content
stringlengths 7
1.05M
| fixed_cases
stringlengths 1
1.28M
|
---|---|
str1= input("enter a string :")
l1 =""
for i in str1 [::-1]:
l1 = i+l1
print(l1)
if str1 == l1:
print("string is a palindrome")
else :
print("string is not a palindrome")
| str1 = input('enter a string :')
l1 = ''
for i in str1[::-1]:
l1 = i + l1
print(l1)
if str1 == l1:
print('string is a palindrome')
else:
print('string is not a palindrome') |
""" Default values : DO NOT CHANGE !!!"""
LOG_FORMAT = "%(asctime)s: %(levelname)s: %(message)s"
DATE_FORMAT = "%Y-%m-%d %H:%M:%S"
MAXITERATIONS = 100
LIFE_PARAMETERS = {"theta_i":30,"theta_fl":36,"theta_gfl":28.6,
"R":4.87,"n":1,"tau":3.5,"m":1,"A":-13.391,
"B":6972.15,"num_of_iteration":4,}
DEFAULT_TEMP = 25
MAX_TRANS_LOADING = 1.5
DEFAULT_CONFIGURATION = {
"dss_filepath": "",
"dss_filename":"",
"extra_data_path": ".",
"export_folder":"",
"start_time":"2018-1-1 0:0:0",
"end_time":"2018-2-1 0:0:0",
"simulation_time_step (minute)": 15,
"frequency": 50,
"upper_voltage": 1.1,
"lower_voltage":0.9,
"record_every": 96,
"export_voltages": False,
"export_lineloadings": False,
"export_transloadings":False,
"export_start_date": "",
"export_end_date": "",
"volt_var": {
"enabled": False,
"yarray": [0.44,0.44,0,0,-0.44,-0.44],
"xarray": [0.7,0.90,0.95,1.05,1.10,1.3]
},
"log_settings": {
"save_in_file": False,
"log_folder": ".",
"log_filename":"logs.log",
"clear_old_log_file": True
}
}
DEFAULT_ADVANCED_CONFIGURATION = {
"project_path": "C:\\Users\\KDUWADI\\Desktop\\NREL_Projects\\CIFF-TANGEDCO\\TANGEDCO\\EMERGE\\Projects",
"active_project":"GR_PALAYAM",
"active_scenario": "FullYear",
"dss_filename":"gr_palayam.dss",
"start_time":"2018-1-1 0:0:0",
"end_time":"2018-1-2 0:0:0",
"simulation_time_step (minute)": 60,
"frequency": 50,
"upper_voltage": 1.1,
"lower_voltage":0.9,
"record_every": 4,
"parallel_simulation":True,
"parallel_process": 1,
"export_voltages": False,
"export_lineloadings": False,
"export_transloadings":False,
"export_start_date": "",
"export_end_date": "",
"volt_var": {
"enabled": True,
"yarray": [0.44,0.44,0,0,-0.44,-0.44],
"xarray": [0.7,0.90,0.95,1.05,1.10,1.3]
},
"log_settings": {
"save_in_file": False,
"log_filename":"",
"clear_old_log_file": True
}
}
VALID_SETTINGS = {
"project_path":{'type':str},
"active_project":{'type':str},
"active_scenario":{'type':str},
"dss_filepath": {'type': str},
"dss_filename":{'type':str},
"export_folder":{'type':str},
"start_time":{'type':str},
"end_time":{'type':str},
"simulation_time_step (minute)":{'type':int},
"frequency": {'type':int,'options':[50,60]},
"upper_voltage": {'type':float,'range':[1,1.5]},
"lower_voltage":{'type':float,'range':[0.8,1]},
"record_every": {'type':int},
"extra_data_path":{'type':str},
"parallel_simulation":{'type':bool},
"parallel_process": {'type':int,'range':[1,4]},
"export_voltages": {'type':bool},
"export_lineloadings": {'type':bool},
"export_transloadings":{'type':bool},
"export_start_date": {'type':str},
"export_end_date": {'type':str},
"volt_var": {
"enabled": {'type':bool},
"yarray": {'type':list},
"xarray": {'type':list}
},
"log_settings": {
"save_in_file": {'type':bool},
"log_folder": {'type':str},
"log_filename":{'type':str},
"clear_old_log_file": {'type':bool}
}
}
| """ Default values : DO NOT CHANGE !!!"""
log_format = '%(asctime)s: %(levelname)s: %(message)s'
date_format = '%Y-%m-%d %H:%M:%S'
maxiterations = 100
life_parameters = {'theta_i': 30, 'theta_fl': 36, 'theta_gfl': 28.6, 'R': 4.87, 'n': 1, 'tau': 3.5, 'm': 1, 'A': -13.391, 'B': 6972.15, 'num_of_iteration': 4}
default_temp = 25
max_trans_loading = 1.5
default_configuration = {'dss_filepath': '', 'dss_filename': '', 'extra_data_path': '.', 'export_folder': '', 'start_time': '2018-1-1 0:0:0', 'end_time': '2018-2-1 0:0:0', 'simulation_time_step (minute)': 15, 'frequency': 50, 'upper_voltage': 1.1, 'lower_voltage': 0.9, 'record_every': 96, 'export_voltages': False, 'export_lineloadings': False, 'export_transloadings': False, 'export_start_date': '', 'export_end_date': '', 'volt_var': {'enabled': False, 'yarray': [0.44, 0.44, 0, 0, -0.44, -0.44], 'xarray': [0.7, 0.9, 0.95, 1.05, 1.1, 1.3]}, 'log_settings': {'save_in_file': False, 'log_folder': '.', 'log_filename': 'logs.log', 'clear_old_log_file': True}}
default_advanced_configuration = {'project_path': 'C:\\Users\\KDUWADI\\Desktop\\NREL_Projects\\CIFF-TANGEDCO\\TANGEDCO\\EMERGE\\Projects', 'active_project': 'GR_PALAYAM', 'active_scenario': 'FullYear', 'dss_filename': 'gr_palayam.dss', 'start_time': '2018-1-1 0:0:0', 'end_time': '2018-1-2 0:0:0', 'simulation_time_step (minute)': 60, 'frequency': 50, 'upper_voltage': 1.1, 'lower_voltage': 0.9, 'record_every': 4, 'parallel_simulation': True, 'parallel_process': 1, 'export_voltages': False, 'export_lineloadings': False, 'export_transloadings': False, 'export_start_date': '', 'export_end_date': '', 'volt_var': {'enabled': True, 'yarray': [0.44, 0.44, 0, 0, -0.44, -0.44], 'xarray': [0.7, 0.9, 0.95, 1.05, 1.1, 1.3]}, 'log_settings': {'save_in_file': False, 'log_filename': '', 'clear_old_log_file': True}}
valid_settings = {'project_path': {'type': str}, 'active_project': {'type': str}, 'active_scenario': {'type': str}, 'dss_filepath': {'type': str}, 'dss_filename': {'type': str}, 'export_folder': {'type': str}, 'start_time': {'type': str}, 'end_time': {'type': str}, 'simulation_time_step (minute)': {'type': int}, 'frequency': {'type': int, 'options': [50, 60]}, 'upper_voltage': {'type': float, 'range': [1, 1.5]}, 'lower_voltage': {'type': float, 'range': [0.8, 1]}, 'record_every': {'type': int}, 'extra_data_path': {'type': str}, 'parallel_simulation': {'type': bool}, 'parallel_process': {'type': int, 'range': [1, 4]}, 'export_voltages': {'type': bool}, 'export_lineloadings': {'type': bool}, 'export_transloadings': {'type': bool}, 'export_start_date': {'type': str}, 'export_end_date': {'type': str}, 'volt_var': {'enabled': {'type': bool}, 'yarray': {'type': list}, 'xarray': {'type': list}}, 'log_settings': {'save_in_file': {'type': bool}, 'log_folder': {'type': str}, 'log_filename': {'type': str}, 'clear_old_log_file': {'type': bool}}} |
def evalRec(env, rec):
"""hl_reportable"""
return (len(set(rec.Genes) &
{
'ABHD12',
'ACTG1',
'ADGRV1',
'AIFM1',
'ATP6V1B1',
'BCS1L',
'BSND',
'CABP2',
'CACNA1D',
'CDC14A',
'CDH23',
'CEACAM16',
'CEP78',
'CHD7',
'CIB2',
'CISD2',
'CLDN14',
'CLIC5',
'CLPP',
'CLRN1',
'COCH',
'COL11A2',
'DIAPH1',
'DIAPH3',
'DMXL2',
'DNMT1',
'DSPP',
'EDN3',
'EDNRB',
'EPS8',
'EPS8L2',
'ESPN',
'ESRRB',
'EYA1',
'EYA4',
'GIPC3',
'GJB2',
'GJB6',
'GPSM2',
'GRHL2',
'GRXCR1',
'GSDME',
'HGF',
'HSD17B4',
'ILDR1',
'KCNE1',
'KCNQ1',
'KCNQ4',
'LARS2',
'LHFPL5',
'LOXHD1',
'LRTOMT',
'MARVELD2',
'MIR96',
'MITF',
'MSRB3',
'MT-RNR1',
'MT-TS1',
'MYH14',
'MYH9',
'MYO15A',
'MYO3A',
'MYO6',
'MYO7A',
'OSBPL2',
'OTOA',
'OTOF',
'OTOG',
'OTOGL',
'P2RX2',
'PAX3',
'PDZD7',
'PJVK',
'POU3F4',
'POU4F3',
'PRPS1',
'PTPRQ',
'RDX',
'RIPOR2',
'S1PR2',
'SERPINB6',
'SIX1',
'SLC17A8',
'SLC26A4',
'SLC52A2',
'SLITRK6',
'SMPX',
'SOX10',
'STRC',
'SYNE4',
'TBC1D24',
'TECTA',
'TIMM8A',
'TMC1',
'TMIE',
'TMPRSS3',
'TPRN',
'TRIOBP',
'TUBB4B',
'USH1C',
'USH1G',
'USH2A',
'WFS1',
'WHRN',
}
) > 0) | def eval_rec(env, rec):
"""hl_reportable"""
return len(set(rec.Genes) & {'ABHD12', 'ACTG1', 'ADGRV1', 'AIFM1', 'ATP6V1B1', 'BCS1L', 'BSND', 'CABP2', 'CACNA1D', 'CDC14A', 'CDH23', 'CEACAM16', 'CEP78', 'CHD7', 'CIB2', 'CISD2', 'CLDN14', 'CLIC5', 'CLPP', 'CLRN1', 'COCH', 'COL11A2', 'DIAPH1', 'DIAPH3', 'DMXL2', 'DNMT1', 'DSPP', 'EDN3', 'EDNRB', 'EPS8', 'EPS8L2', 'ESPN', 'ESRRB', 'EYA1', 'EYA4', 'GIPC3', 'GJB2', 'GJB6', 'GPSM2', 'GRHL2', 'GRXCR1', 'GSDME', 'HGF', 'HSD17B4', 'ILDR1', 'KCNE1', 'KCNQ1', 'KCNQ4', 'LARS2', 'LHFPL5', 'LOXHD1', 'LRTOMT', 'MARVELD2', 'MIR96', 'MITF', 'MSRB3', 'MT-RNR1', 'MT-TS1', 'MYH14', 'MYH9', 'MYO15A', 'MYO3A', 'MYO6', 'MYO7A', 'OSBPL2', 'OTOA', 'OTOF', 'OTOG', 'OTOGL', 'P2RX2', 'PAX3', 'PDZD7', 'PJVK', 'POU3F4', 'POU4F3', 'PRPS1', 'PTPRQ', 'RDX', 'RIPOR2', 'S1PR2', 'SERPINB6', 'SIX1', 'SLC17A8', 'SLC26A4', 'SLC52A2', 'SLITRK6', 'SMPX', 'SOX10', 'STRC', 'SYNE4', 'TBC1D24', 'TECTA', 'TIMM8A', 'TMC1', 'TMIE', 'TMPRSS3', 'TPRN', 'TRIOBP', 'TUBB4B', 'USH1C', 'USH1G', 'USH2A', 'WFS1', 'WHRN'}) > 0 |
# https://github.com/git/git/blob/master/Documentation/technical/index-format.txt
class GitIndexEntry(object):
# The last time a file's metadata changed. This is a tuple (seconds, nanoseconds)
ctime = None
# The last time a file's data changed. This is a tuple (seconds, nanoseconds)
mtime = None
# the ID of device containing this file
dev = None
# The file's inode number
ino = None
# The object type, either b1000 (regular), b1010 (symlink), b1110 (gitlink)
mode_type = None
# The object permissions as an integer
mode_permissions = None
# User ID of owner
uui = None
# Group ID of owner
gid = None
# Size of this object in bytes
size = None
# The object's hash as a hex string
object = None
flag_assume_valid = None
flag_extended = None
flag_stage = None
# Length of the name if < OxFFF, -1 otherwise
flag_name_length = None
name = None
| class Gitindexentry(object):
ctime = None
mtime = None
dev = None
ino = None
mode_type = None
mode_permissions = None
uui = None
gid = None
size = None
object = None
flag_assume_valid = None
flag_extended = None
flag_stage = None
flag_name_length = None
name = None |
__version__ = '7.8.0'
_optional_dependencies = [
{
'name': 'CuPy',
'packages': [
'cupy-cuda120',
'cupy-cuda114',
'cupy-cuda113',
'cupy-cuda112',
'cupy-cuda111',
'cupy-cuda110',
'cupy-cuda102',
'cupy-cuda101',
'cupy-cuda100',
'cupy-cuda92',
'cupy-cuda91',
'cupy-cuda90',
'cupy-cuda80',
'cupy',
],
'specifier': '>=7.7.0,<8.0.0',
'help': 'https://docs.cupy.dev/en/latest/install.html',
},
{
'name': 'iDeep',
'packages': [
'ideep4py',
],
'specifier': '>=2.0.0.post3, <2.1',
'help': 'https://docs.chainer.org/en/latest/tips.html',
},
]
| __version__ = '7.8.0'
_optional_dependencies = [{'name': 'CuPy', 'packages': ['cupy-cuda120', 'cupy-cuda114', 'cupy-cuda113', 'cupy-cuda112', 'cupy-cuda111', 'cupy-cuda110', 'cupy-cuda102', 'cupy-cuda101', 'cupy-cuda100', 'cupy-cuda92', 'cupy-cuda91', 'cupy-cuda90', 'cupy-cuda80', 'cupy'], 'specifier': '>=7.7.0,<8.0.0', 'help': 'https://docs.cupy.dev/en/latest/install.html'}, {'name': 'iDeep', 'packages': ['ideep4py'], 'specifier': '>=2.0.0.post3, <2.1', 'help': 'https://docs.chainer.org/en/latest/tips.html'}] |
side_a=int(input("Enter the first side(a):"))
side_b=int(input("Enter the second side(b):"))
side_c=int(input("Enter the third side(c):"))
if side_a==side_b and side_a==side_c:
print("The triangle is an equilateral triangle.")
elif side_a==side_b or side_a==side_c or side_b==side_c:
print("The triangle is an isosceles triangle.")
else:
print("The triangle is scalene triangle.") | side_a = int(input('Enter the first side(a):'))
side_b = int(input('Enter the second side(b):'))
side_c = int(input('Enter the third side(c):'))
if side_a == side_b and side_a == side_c:
print('The triangle is an equilateral triangle.')
elif side_a == side_b or side_a == side_c or side_b == side_c:
print('The triangle is an isosceles triangle.')
else:
print('The triangle is scalene triangle.') |
# -*- coding: utf-8 -*-
"""
Created on Sat Aug 22 19:07:30 2020
@author: Abhishek Mukherjee
"""
class Solution:
def reorderLogFiles(self, logs: List[str]) -> List[str]:
letLog=[]
digLog=[]
for i in range(len(logs)):
temp=[]
temp=logs[i].split(' ')
if temp[1].isdigit() is True:
digLog.append(logs[i])
else:
letLog.append(logs[i])
tempLetLog=[]
for i in letLog:
tempLetLog.append(' '.join(i.split(' ')[1:]+[i.split(' ')[0]]))
tempLetLog=sorted(tempLetLog)
letLog=[]
for i in tempLetLog:
tempPrime=i.split(' ')[:-1]
temp=i.split(' ')[-1]
letLog.append(' '.join([temp]+tempPrime))
return letLog+digLog | """
Created on Sat Aug 22 19:07:30 2020
@author: Abhishek Mukherjee
"""
class Solution:
def reorder_log_files(self, logs: List[str]) -> List[str]:
let_log = []
dig_log = []
for i in range(len(logs)):
temp = []
temp = logs[i].split(' ')
if temp[1].isdigit() is True:
digLog.append(logs[i])
else:
letLog.append(logs[i])
temp_let_log = []
for i in letLog:
tempLetLog.append(' '.join(i.split(' ')[1:] + [i.split(' ')[0]]))
temp_let_log = sorted(tempLetLog)
let_log = []
for i in tempLetLog:
temp_prime = i.split(' ')[:-1]
temp = i.split(' ')[-1]
letLog.append(' '.join([temp] + tempPrime))
return letLog + digLog |
_base_ = [
'../_base_/models/cascade_rcnn_r50_fpn.py',
'./dataset_base.py',
'./scheduler_base.py',
'../_base_/default_runtime.py'
]
model = dict(
pretrained='open-mmlab://resnext101_32x4d',
backbone=dict(
type='DetectoRS_ResNeXt',
pretrained='open-mmlab://resnext101_32x4d',
depth=101,
groups=32,
base_width=4,
conv_cfg=dict(type='ConvAWS'),
sac=dict(type='SAC', use_deform=True),
stage_with_sac=(False, True, True, True),
output_img=True,
plugins=[
dict(
cfg=dict(
type='GeneralizedAttention',
spatial_range=-1,
num_heads=8,
attention_type='0010',
kv_stride=2),
stages=(False, False, True, True),
in_channels=512,
position='after_conv2')
]
),
neck=dict(
type='RFP',
rfp_steps=2,
aspp_out_channels=64,
aspp_dilations=(1, 3, 6, 1),
rfp_backbone=dict(
rfp_inplanes=256,
type='DetectoRS_ResNeXt',
depth=101,
groups=32,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict(type='BN', requires_grad=True),
norm_eval=True,
conv_cfg=dict(type='ConvAWS'),
sac=dict(type='SAC', use_deform=True),
stage_with_sac=(False, True, True, True),
pretrained='open-mmlab://resnext101_32x4d',
style='pytorch')),
roi_head=dict(
bbox_head=[
dict(
type='Shared2FCBBoxHead',
num_classes=14
),
dict(
type='Shared2FCBBoxHead',
num_classes=14
),
dict(
type='Shared2FCBBoxHead',
num_classes=14
)
]
),
test_cfg=dict(
rpn=dict(
nms_thr=0.7
),
rcnn=dict(
score_thr=0.0,
nms=dict(type='nms', iou_threshold=0.4)
)
)
)
| _base_ = ['../_base_/models/cascade_rcnn_r50_fpn.py', './dataset_base.py', './scheduler_base.py', '../_base_/default_runtime.py']
model = dict(pretrained='open-mmlab://resnext101_32x4d', backbone=dict(type='DetectoRS_ResNeXt', pretrained='open-mmlab://resnext101_32x4d', depth=101, groups=32, base_width=4, conv_cfg=dict(type='ConvAWS'), sac=dict(type='SAC', use_deform=True), stage_with_sac=(False, True, True, True), output_img=True, plugins=[dict(cfg=dict(type='GeneralizedAttention', spatial_range=-1, num_heads=8, attention_type='0010', kv_stride=2), stages=(False, False, True, True), in_channels=512, position='after_conv2')]), neck=dict(type='RFP', rfp_steps=2, aspp_out_channels=64, aspp_dilations=(1, 3, 6, 1), rfp_backbone=dict(rfp_inplanes=256, type='DetectoRS_ResNeXt', depth=101, groups=32, base_width=4, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=True), norm_eval=True, conv_cfg=dict(type='ConvAWS'), sac=dict(type='SAC', use_deform=True), stage_with_sac=(False, True, True, True), pretrained='open-mmlab://resnext101_32x4d', style='pytorch')), roi_head=dict(bbox_head=[dict(type='Shared2FCBBoxHead', num_classes=14), dict(type='Shared2FCBBoxHead', num_classes=14), dict(type='Shared2FCBBoxHead', num_classes=14)]), test_cfg=dict(rpn=dict(nms_thr=0.7), rcnn=dict(score_thr=0.0, nms=dict(type='nms', iou_threshold=0.4)))) |
def decodeLongLong(lst):
high = int(lst[0]) << 32
low = int(lst[1])
if low < 0:
low += 4294967296
if high < 0:
high += 4294967296
return high + low
def encodeLongLong(i):
high = int(i / 4294967296)
low = i - high
return high, low
def parseOk(str):
if str == 'ok':
return True
else:
return False
def printList(lst):
#for i in range(len(lst)):
# print i, '\t', repr(lst[i])
pass
# t is a nine item tuple returned by the time module. This method converts it to
# MythTV's standard representation used on filenames
def encodeTime(t):
ret = ''
for i in t[:-3]:
si = str(i)
if len(si) < 2:
ret += si.zfill(2)
else:
ret += si
return ret
| def decode_long_long(lst):
high = int(lst[0]) << 32
low = int(lst[1])
if low < 0:
low += 4294967296
if high < 0:
high += 4294967296
return high + low
def encode_long_long(i):
high = int(i / 4294967296)
low = i - high
return (high, low)
def parse_ok(str):
if str == 'ok':
return True
else:
return False
def print_list(lst):
pass
def encode_time(t):
ret = ''
for i in t[:-3]:
si = str(i)
if len(si) < 2:
ret += si.zfill(2)
else:
ret += si
return ret |
class AttributeDict(object):
"""
A class to convert a nested Dictionary into an object with key-values
accessibly using attribute notation (AttributeDict.attribute) instead of
key notation (Dict["key"]). This class recursively sets Dicts to objects,
allowing you to recurse down nested dicts (like: AttributeDict.attr.attr)
"""
def __init__(self, **entries):
self.add_entries(**entries)
def add_entries(self, **entries):
for key, value in entries.items():
if type(value) is dict:
self.__dict__[key] = AttributeDict(**value)
else:
self.__dict__[key] = value
def getAttributes(self):
"""
Return all the attributes of the object
"""
return self.__dict__.keys()
| class Attributedict(object):
"""
A class to convert a nested Dictionary into an object with key-values
accessibly using attribute notation (AttributeDict.attribute) instead of
key notation (Dict["key"]). This class recursively sets Dicts to objects,
allowing you to recurse down nested dicts (like: AttributeDict.attr.attr)
"""
def __init__(self, **entries):
self.add_entries(**entries)
def add_entries(self, **entries):
for (key, value) in entries.items():
if type(value) is dict:
self.__dict__[key] = attribute_dict(**value)
else:
self.__dict__[key] = value
def get_attributes(self):
"""
Return all the attributes of the object
"""
return self.__dict__.keys() |
#
# PySNMP MIB module ENTERASYS-NAC-APPLIANCE-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ENTERASYS-NAC-APPLIANCE-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:04:09 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")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint")
etsysModules, = mibBuilder.importSymbols("ENTERASYS-MIB-NAMES", "etsysModules")
ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance")
Bits, ObjectIdentity, MibIdentifier, Counter64, iso, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, ModuleIdentity, IpAddress, Unsigned32, TimeTicks, Gauge32, Integer32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "ObjectIdentity", "MibIdentifier", "Counter64", "iso", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ModuleIdentity", "IpAddress", "Unsigned32", "TimeTicks", "Gauge32", "Integer32", "Counter32")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
etsysNacApplianceMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73))
etsysNacApplianceMIB.setRevisions(('2010-03-09 13:03',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: etsysNacApplianceMIB.setRevisionsDescriptions(('The initial version of this MIB module.',))
if mibBuilder.loadTexts: etsysNacApplianceMIB.setLastUpdated('201003091303Z')
if mibBuilder.loadTexts: etsysNacApplianceMIB.setOrganization('Enterasys Networks, Inc')
if mibBuilder.loadTexts: etsysNacApplianceMIB.setContactInfo('Postal: Enterasys Networks 50 Minuteman Rd. Andover, MA 01810-1008 USA Phone: +1 978 684 1000 E-mail: support@enterasys.com WWW: http://www.enterasys.com')
if mibBuilder.loadTexts: etsysNacApplianceMIB.setDescription("This MIB module defines a portion of the SNMP enterprise MIBs under Enterasys Networks' enterprise OID pertaining to NAC Appliance Status.")
etsysNacApplianceObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1))
etsysNacApplAuthenticationRequests = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 1), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAuthenticationRequests.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAuthenticationRequests.setDescription('Represents the number of authentication requests made since the NAC was started.')
etsysNacApplAuthenticationSuccesses = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAuthenticationSuccesses.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAuthenticationSuccesses.setDescription('Represents the number of successful authentication requests made since the NAC was started.')
etsysNacApplAuthenticationFailures = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAuthenticationFailures.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAuthenticationFailures.setDescription('Represents the number of failed authentication requests made since the NAC was started.')
etsysNacApplRadiusChallenges = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplRadiusChallenges.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplRadiusChallenges.setDescription('Represents the number of Radius challenges made since the NAC was started.')
etsysNacApplAuthenticationInvalidRequests = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAuthenticationInvalidRequests.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAuthenticationInvalidRequests.setDescription('Represents the number of invalid authentication requests made since the NAC was started.')
etsysNacApplAuthenticationDuplicateRequests = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAuthenticationDuplicateRequests.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAuthenticationDuplicateRequests.setDescription('Represents the number of duplicate authentication requests made since the NAC was started.')
etsysNacApplAuthenticationMalformedRequests = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAuthenticationMalformedRequests.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAuthenticationMalformedRequests.setDescription('Represents the number of malformed authentication requests made since the NAC was started.')
etsysNacApplAuthenticationBadRequests = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAuthenticationBadRequests.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAuthenticationBadRequests.setDescription('Represents the number of bad authentication requests made since the NAC was started.')
etsysNacApplAuthenticationDroppedPackets = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAuthenticationDroppedPackets.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAuthenticationDroppedPackets.setDescription('Represents the number of dropped authentication packets since the NAC was started.')
etsysNacApplAuthenticationUnknownTypes = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 10), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAuthenticationUnknownTypes.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAuthenticationUnknownTypes.setDescription('Represents the number of unknown authentication types since the NAC was started.')
etsysNacApplAssessmentRequests = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 11), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplAssessmentRequests.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplAssessmentRequests.setDescription('Represents the number of assessment requests made since the NAC was started.')
etsysNacApplCaptivePortalRequests = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 12), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplCaptivePortalRequests.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplCaptivePortalRequests.setDescription('Represents the number of captive portal requests made since the NAC was started.')
etsysNacApplContactLostSwitches = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 13), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplContactLostSwitches.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplContactLostSwitches.setDescription('Represents the number of configured switches with which the NAC has lost SNMP contact.')
etsysNacApplIPResolutionFailures = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 14), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplIPResolutionFailures.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplIPResolutionFailures.setDescription('Represents the number of failed IP Resolution attempts made since the NAC was started.')
etsysNacApplIPResolutionTimeouts = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 15), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplIPResolutionTimeouts.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplIPResolutionTimeouts.setDescription('Represents the number of IP Resolution attempts that timed out since the NAC was started.')
etsysNacApplConnectedAgents = MibScalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 16), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: etsysNacApplConnectedAgents.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplConnectedAgents.setDescription('Represents the number of End-System Assessment Agents currently connected to the NAC.')
etsysNacApplianceMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2))
etsysNacApplianceMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2, 1))
etsysNacApplianceMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2, 2))
etsysNacApplianceMIBGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2, 1, 1)).setObjects(("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAuthenticationRequests"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAuthenticationSuccesses"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAuthenticationFailures"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplRadiusChallenges"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAuthenticationInvalidRequests"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAuthenticationDuplicateRequests"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAuthenticationMalformedRequests"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAuthenticationBadRequests"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAuthenticationDroppedPackets"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAuthenticationUnknownTypes"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplAssessmentRequests"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplCaptivePortalRequests"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplContactLostSwitches"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplIPResolutionFailures"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplIPResolutionTimeouts"), ("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplConnectedAgents"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
etsysNacApplianceMIBGroup = etsysNacApplianceMIBGroup.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplianceMIBGroup.setDescription('The basic collection of objects providing status information about the NAC Appliance.')
etsysNacApplianceMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2, 2, 1)).setObjects(("ENTERASYS-NAC-APPLIANCE-MIB", "etsysNacApplianceMIBGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
etsysNacApplianceMIBCompliance = etsysNacApplianceMIBCompliance.setStatus('current')
if mibBuilder.loadTexts: etsysNacApplianceMIBCompliance.setDescription('The compliance statement for clients implementing the NAC Appliance Status MIB.')
mibBuilder.exportSymbols("ENTERASYS-NAC-APPLIANCE-MIB", etsysNacApplianceMIBCompliance=etsysNacApplianceMIBCompliance, etsysNacApplAuthenticationDuplicateRequests=etsysNacApplAuthenticationDuplicateRequests, etsysNacApplIPResolutionTimeouts=etsysNacApplIPResolutionTimeouts, etsysNacApplianceObjects=etsysNacApplianceObjects, etsysNacApplAuthenticationInvalidRequests=etsysNacApplAuthenticationInvalidRequests, etsysNacApplAuthenticationUnknownTypes=etsysNacApplAuthenticationUnknownTypes, etsysNacApplianceMIBCompliances=etsysNacApplianceMIBCompliances, etsysNacApplAssessmentRequests=etsysNacApplAssessmentRequests, etsysNacApplAuthenticationBadRequests=etsysNacApplAuthenticationBadRequests, etsysNacApplAuthenticationRequests=etsysNacApplAuthenticationRequests, etsysNacApplRadiusChallenges=etsysNacApplRadiusChallenges, etsysNacApplAuthenticationMalformedRequests=etsysNacApplAuthenticationMalformedRequests, etsysNacApplContactLostSwitches=etsysNacApplContactLostSwitches, etsysNacApplAuthenticationDroppedPackets=etsysNacApplAuthenticationDroppedPackets, etsysNacApplCaptivePortalRequests=etsysNacApplCaptivePortalRequests, etsysNacApplAuthenticationSuccesses=etsysNacApplAuthenticationSuccesses, etsysNacApplIPResolutionFailures=etsysNacApplIPResolutionFailures, etsysNacApplianceMIBConformance=etsysNacApplianceMIBConformance, PYSNMP_MODULE_ID=etsysNacApplianceMIB, etsysNacApplianceMIBGroups=etsysNacApplianceMIBGroups, etsysNacApplianceMIB=etsysNacApplianceMIB, etsysNacApplAuthenticationFailures=etsysNacApplAuthenticationFailures, etsysNacApplianceMIBGroup=etsysNacApplianceMIBGroup, etsysNacApplConnectedAgents=etsysNacApplConnectedAgents)
| (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, value_size_constraint, constraints_union, constraints_intersection, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'SingleValueConstraint')
(etsys_modules,) = mibBuilder.importSymbols('ENTERASYS-MIB-NAMES', 'etsysModules')
(object_group, notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'NotificationGroup', 'ModuleCompliance')
(bits, object_identity, mib_identifier, counter64, iso, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, module_identity, ip_address, unsigned32, time_ticks, gauge32, integer32, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'ObjectIdentity', 'MibIdentifier', 'Counter64', 'iso', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ModuleIdentity', 'IpAddress', 'Unsigned32', 'TimeTicks', 'Gauge32', 'Integer32', 'Counter32')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
etsys_nac_appliance_mib = module_identity((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73))
etsysNacApplianceMIB.setRevisions(('2010-03-09 13:03',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
etsysNacApplianceMIB.setRevisionsDescriptions(('The initial version of this MIB module.',))
if mibBuilder.loadTexts:
etsysNacApplianceMIB.setLastUpdated('201003091303Z')
if mibBuilder.loadTexts:
etsysNacApplianceMIB.setOrganization('Enterasys Networks, Inc')
if mibBuilder.loadTexts:
etsysNacApplianceMIB.setContactInfo('Postal: Enterasys Networks 50 Minuteman Rd. Andover, MA 01810-1008 USA Phone: +1 978 684 1000 E-mail: support@enterasys.com WWW: http://www.enterasys.com')
if mibBuilder.loadTexts:
etsysNacApplianceMIB.setDescription("This MIB module defines a portion of the SNMP enterprise MIBs under Enterasys Networks' enterprise OID pertaining to NAC Appliance Status.")
etsys_nac_appliance_objects = mib_identifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1))
etsys_nac_appl_authentication_requests = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 1), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationRequests.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationRequests.setDescription('Represents the number of authentication requests made since the NAC was started.')
etsys_nac_appl_authentication_successes = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationSuccesses.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationSuccesses.setDescription('Represents the number of successful authentication requests made since the NAC was started.')
etsys_nac_appl_authentication_failures = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationFailures.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationFailures.setDescription('Represents the number of failed authentication requests made since the NAC was started.')
etsys_nac_appl_radius_challenges = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplRadiusChallenges.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplRadiusChallenges.setDescription('Represents the number of Radius challenges made since the NAC was started.')
etsys_nac_appl_authentication_invalid_requests = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationInvalidRequests.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationInvalidRequests.setDescription('Represents the number of invalid authentication requests made since the NAC was started.')
etsys_nac_appl_authentication_duplicate_requests = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationDuplicateRequests.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationDuplicateRequests.setDescription('Represents the number of duplicate authentication requests made since the NAC was started.')
etsys_nac_appl_authentication_malformed_requests = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationMalformedRequests.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationMalformedRequests.setDescription('Represents the number of malformed authentication requests made since the NAC was started.')
etsys_nac_appl_authentication_bad_requests = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 8), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationBadRequests.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationBadRequests.setDescription('Represents the number of bad authentication requests made since the NAC was started.')
etsys_nac_appl_authentication_dropped_packets = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 9), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationDroppedPackets.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationDroppedPackets.setDescription('Represents the number of dropped authentication packets since the NAC was started.')
etsys_nac_appl_authentication_unknown_types = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 10), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationUnknownTypes.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAuthenticationUnknownTypes.setDescription('Represents the number of unknown authentication types since the NAC was started.')
etsys_nac_appl_assessment_requests = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 11), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplAssessmentRequests.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplAssessmentRequests.setDescription('Represents the number of assessment requests made since the NAC was started.')
etsys_nac_appl_captive_portal_requests = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 12), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplCaptivePortalRequests.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplCaptivePortalRequests.setDescription('Represents the number of captive portal requests made since the NAC was started.')
etsys_nac_appl_contact_lost_switches = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 13), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplContactLostSwitches.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplContactLostSwitches.setDescription('Represents the number of configured switches with which the NAC has lost SNMP contact.')
etsys_nac_appl_ip_resolution_failures = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 14), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplIPResolutionFailures.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplIPResolutionFailures.setDescription('Represents the number of failed IP Resolution attempts made since the NAC was started.')
etsys_nac_appl_ip_resolution_timeouts = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 15), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplIPResolutionTimeouts.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplIPResolutionTimeouts.setDescription('Represents the number of IP Resolution attempts that timed out since the NAC was started.')
etsys_nac_appl_connected_agents = mib_scalar((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 1, 16), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
etsysNacApplConnectedAgents.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplConnectedAgents.setDescription('Represents the number of End-System Assessment Agents currently connected to the NAC.')
etsys_nac_appliance_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2))
etsys_nac_appliance_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2, 1))
etsys_nac_appliance_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2, 2))
etsys_nac_appliance_mib_group = object_group((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2, 1, 1)).setObjects(('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAuthenticationRequests'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAuthenticationSuccesses'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAuthenticationFailures'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplRadiusChallenges'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAuthenticationInvalidRequests'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAuthenticationDuplicateRequests'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAuthenticationMalformedRequests'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAuthenticationBadRequests'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAuthenticationDroppedPackets'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAuthenticationUnknownTypes'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplAssessmentRequests'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplCaptivePortalRequests'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplContactLostSwitches'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplIPResolutionFailures'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplIPResolutionTimeouts'), ('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplConnectedAgents'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
etsys_nac_appliance_mib_group = etsysNacApplianceMIBGroup.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplianceMIBGroup.setDescription('The basic collection of objects providing status information about the NAC Appliance.')
etsys_nac_appliance_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 5624, 1, 2, 73, 2, 2, 1)).setObjects(('ENTERASYS-NAC-APPLIANCE-MIB', 'etsysNacApplianceMIBGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
etsys_nac_appliance_mib_compliance = etsysNacApplianceMIBCompliance.setStatus('current')
if mibBuilder.loadTexts:
etsysNacApplianceMIBCompliance.setDescription('The compliance statement for clients implementing the NAC Appliance Status MIB.')
mibBuilder.exportSymbols('ENTERASYS-NAC-APPLIANCE-MIB', etsysNacApplianceMIBCompliance=etsysNacApplianceMIBCompliance, etsysNacApplAuthenticationDuplicateRequests=etsysNacApplAuthenticationDuplicateRequests, etsysNacApplIPResolutionTimeouts=etsysNacApplIPResolutionTimeouts, etsysNacApplianceObjects=etsysNacApplianceObjects, etsysNacApplAuthenticationInvalidRequests=etsysNacApplAuthenticationInvalidRequests, etsysNacApplAuthenticationUnknownTypes=etsysNacApplAuthenticationUnknownTypes, etsysNacApplianceMIBCompliances=etsysNacApplianceMIBCompliances, etsysNacApplAssessmentRequests=etsysNacApplAssessmentRequests, etsysNacApplAuthenticationBadRequests=etsysNacApplAuthenticationBadRequests, etsysNacApplAuthenticationRequests=etsysNacApplAuthenticationRequests, etsysNacApplRadiusChallenges=etsysNacApplRadiusChallenges, etsysNacApplAuthenticationMalformedRequests=etsysNacApplAuthenticationMalformedRequests, etsysNacApplContactLostSwitches=etsysNacApplContactLostSwitches, etsysNacApplAuthenticationDroppedPackets=etsysNacApplAuthenticationDroppedPackets, etsysNacApplCaptivePortalRequests=etsysNacApplCaptivePortalRequests, etsysNacApplAuthenticationSuccesses=etsysNacApplAuthenticationSuccesses, etsysNacApplIPResolutionFailures=etsysNacApplIPResolutionFailures, etsysNacApplianceMIBConformance=etsysNacApplianceMIBConformance, PYSNMP_MODULE_ID=etsysNacApplianceMIB, etsysNacApplianceMIBGroups=etsysNacApplianceMIBGroups, etsysNacApplianceMIB=etsysNacApplianceMIB, etsysNacApplAuthenticationFailures=etsysNacApplAuthenticationFailures, etsysNacApplianceMIBGroup=etsysNacApplianceMIBGroup, etsysNacApplConnectedAgents=etsysNacApplConnectedAgents) |
class Unsubclassable:
def __init_subclass__(cls, **kwargs):
raise TypeError('Unacceptable base type')
def prevent_subclassing():
raise TypeError('Unacceptable base type')
def final_class(cls):
setattr(cls, '__init_subclass__', prevent_subclassing)
return cls
class UnsubclassableType(type):
def __new__(cls, name, bases, dct):
c = super().__new__(cls, name, bases, dct)
setattr(c, '__init_subclass__', prevent_subclassing)
return c
| class Unsubclassable:
def __init_subclass__(cls, **kwargs):
raise type_error('Unacceptable base type')
def prevent_subclassing():
raise type_error('Unacceptable base type')
def final_class(cls):
setattr(cls, '__init_subclass__', prevent_subclassing)
return cls
class Unsubclassabletype(type):
def __new__(cls, name, bases, dct):
c = super().__new__(cls, name, bases, dct)
setattr(c, '__init_subclass__', prevent_subclassing)
return c |
def solve():
# Read input
R, C, H, V = map(int, input().split())
choco = []
for _ in range(R):
choco.append([0] * C)
choco_row, choco_col = [0]*R, [0]*C
num_choco = 0
for i in range(R):
row = input()
for j in range(C):
if row[j] == '@':
choco_col[j] += 1
choco[i][j] = 1
choco_row[i] = row.count('@')
num_choco += choco_row[i]
# Find H and V cuts
if num_choco == 0:
return 'POSSIBLE'
H_idx, V_idx = [], []
flag = True
if num_choco%(H+1)==0 and num_choco%(V+1)==0:
num_choco_h = num_choco/(H+1)
num_choco_v = num_choco/(V+1)
accum = 0
for i, r in enumerate(choco_row):
accum += r
if accum == num_choco_h:
accum = 0
H_idx.append(i)
elif accum > num_choco_h:
flag = False
break
if not flag:
return 'IMPOSSIBLE'
accum = 0
for i, c in enumerate(choco_col):
accum += c
if accum == num_choco_v:
accum = 0
V_idx.append(i)
elif accum > num_choco_v:
flag = False
break
if not flag:
return 'IMPOSSIBLE'
else:
return 'IMPOSSIBLE'
# Check each piece
r_from = 0
num_prev = None
for r in H_idx:
c_from = 0
for c in V_idx:
num = 0
for i in range(r_from, r+1):
for j in range(c_from, c+1):
num += choco[i][j]
if num_prev is None:
num_prev = num
elif num_prev != num:
return 'IMPOSSIBLE'
c_from = c+1
r_from = r+1
return 'POSSIBLE'
if __name__ == '__main__':
T = int(input())
for t in range(T):
print('Case #{}: {}'.format(t+1, solve()))
| def solve():
(r, c, h, v) = map(int, input().split())
choco = []
for _ in range(R):
choco.append([0] * C)
(choco_row, choco_col) = ([0] * R, [0] * C)
num_choco = 0
for i in range(R):
row = input()
for j in range(C):
if row[j] == '@':
choco_col[j] += 1
choco[i][j] = 1
choco_row[i] = row.count('@')
num_choco += choco_row[i]
if num_choco == 0:
return 'POSSIBLE'
(h_idx, v_idx) = ([], [])
flag = True
if num_choco % (H + 1) == 0 and num_choco % (V + 1) == 0:
num_choco_h = num_choco / (H + 1)
num_choco_v = num_choco / (V + 1)
accum = 0
for (i, r) in enumerate(choco_row):
accum += r
if accum == num_choco_h:
accum = 0
H_idx.append(i)
elif accum > num_choco_h:
flag = False
break
if not flag:
return 'IMPOSSIBLE'
accum = 0
for (i, c) in enumerate(choco_col):
accum += c
if accum == num_choco_v:
accum = 0
V_idx.append(i)
elif accum > num_choco_v:
flag = False
break
if not flag:
return 'IMPOSSIBLE'
else:
return 'IMPOSSIBLE'
r_from = 0
num_prev = None
for r in H_idx:
c_from = 0
for c in V_idx:
num = 0
for i in range(r_from, r + 1):
for j in range(c_from, c + 1):
num += choco[i][j]
if num_prev is None:
num_prev = num
elif num_prev != num:
return 'IMPOSSIBLE'
c_from = c + 1
r_from = r + 1
return 'POSSIBLE'
if __name__ == '__main__':
t = int(input())
for t in range(T):
print('Case #{}: {}'.format(t + 1, solve())) |
class Solution(object):
def maximumWealth(self, accounts):
"""
:type accounts: List[List[int]]
:rtype: int
"""
# Runtime: 36 ms
# Memory: 13.5 MB
return max(map(sum, accounts))
| class Solution(object):
def maximum_wealth(self, accounts):
"""
:type accounts: List[List[int]]
:rtype: int
"""
return max(map(sum, accounts)) |
""" Main application entry point.
python -m digibujogens ...
"""
def main():
""" Execute the application.
"""
raise NotImplementedError
# Make the script executable.
if __name__ == "__main__":
raise SystemExit(main())
| """ Main application entry point.
python -m digibujogens ...
"""
def main():
""" Execute the application.
"""
raise NotImplementedError
if __name__ == '__main__':
raise system_exit(main()) |
"""
--- Day 14: Docking Data ---
As your ferry approaches the sea port, the captain asks for your help again. The computer system that runs this port isn't compatible with the docking program on the ferry, so the docking parameters aren't being correctly initialized in the docking program's memory.
After a brief inspection, you discover that the sea port's computer system uses a strange bitmask system in its initialization program. Although you don't have the correct decoder chip handy, you can emulate it in software!
The initialization program (your puzzle input) can either update the bitmask or write a value to memory. Values and memory addresses are both 36-bit unsigned integers. For example, ignoring bitmasks for a moment, a line like mem[8] = 11 would write the value 11 to memory address 8.
The bitmask is always given as a string of 36 bits, written with the most significant bit (representing 2^35) on the left and the least significant bit (2^0, that is, the 1s bit) on the right. The current bitmask is applied to values immediately before they are written to memory: a 0 or 1 overwrites the corresponding bit in the value, while an X leaves the bit in the value unchanged.
For example, consider the following program:
mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
mem[8] = 11
mem[7] = 101
mem[8] = 0
This program starts by specifying a bitmask (mask = ....). The mask it specifies will overwrite two bits in every written value: the 2s bit is overwritten with 0, and the 64s bit is overwritten with 1.
The program then attempts to write the value 11 to memory address 8. By expanding everything out to individual bits, the mask is applied as follows:
value: 000000000000000000000000000000001011 (decimal 11)
mask: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
result: 000000000000000000000000000001001001 (decimal 73)
So, because of the mask, the value 73 is written to memory address 8 instead. Then, the program tries to write 101 to address 7:
value: 000000000000000000000000000001100101 (decimal 101)
mask: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
result: 000000000000000000000000000001100101 (decimal 101)
This time, the mask has no effect, as the bits it overwrote were already the values the mask tried to set. Finally, the program tries to write 0 to address 8:
value: 000000000000000000000000000000000000 (decimal 0)
mask: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
result: 000000000000000000000000000001000000 (decimal 64)
64 is written to address 8 instead, overwriting the value that was there previously.
To initialize your ferry's docking program, you need the sum of all values left in memory after the initialization program completes. (The entire 36-bit address space begins initialized to the value 0 at every address.) In the above example, only two values in memory are not zero - 101 (at address 7) and 64 (at address 8) - producing a sum of 165.
Execute the initialization program. What is the sum of all values left in memory after it completes?
"""
f = open("challenges\data\day14data.txt", "r")
def processData(file):
data = []
for x in f:
x=x.strip().replace('\n', '').split(" = ")
data.append((x[0], x[1]))
return data
# Function to convert Decimal number
# to Binary number
def decimalToBinary(n):
return bin(n).replace("0b", "")
def leadingZeros(length, bin_num):
leadingZeros = length - len(bin_num)
return "0"*leadingZeros + bin_num
def initialize(commands):
memory = {}
mask = "X"*36
for c in commands:
if c[0] == "mask":
mask = c[1]
else:
address = c[0][c[0].index("[")+1:len(c[0])-1]
binaryValue = decimalToBinary(int(c[1]))
binary36 = leadingZeros(36, binaryValue)
memory[address] = ""
for i in range(len(mask)):
if mask[i] == "X":
memory[address] += binary36[i]
else:
memory[address] += mask[i]
sum = 0
for val in memory.values():
sum += int("".join(val), 2)
return sum
"""
--- Part Two ---
For some reason, the sea port's computer system still can't communicate with your ferry's docking program. It must be using version 2 of the decoder chip!
A version 2 decoder chip doesn't modify the values being written at all. Instead, it acts as a memory address decoder. Immediately before a value is written to memory, each bit in the bitmask modifies the corresponding bit of the destination memory address in the following way:
If the bitmask bit is 0, the corresponding memory address bit is unchanged.
If the bitmask bit is 1, the corresponding memory address bit is overwritten with 1.
If the bitmask bit is X, the corresponding memory address bit is floating.
A floating bit is not connected to anything and instead fluctuates unpredictably. In practice, this means the floating bits will take on all possible values, potentially causing many memory addresses to be written all at once!
For example, consider the following program:
mask = 000000000000000000000000000000X1001X
mem[42] = 100
mask = 00000000000000000000000000000000X0XX
mem[26] = 1
When this program goes to write to memory address 42, it first applies the bitmask:
address: 000000000000000000000000000000101010 (decimal 42)
mask: 000000000000000000000000000000X1001X
result: 000000000000000000000000000000X1101X
After applying the mask, four bits are overwritten, three of which are different, and two of which are floating. Floating bits take on every possible combination of values; with two floating bits, four actual memory addresses are written:
000000000000000000000000000000011010 (decimal 26)
000000000000000000000000000000011011 (decimal 27)
000000000000000000000000000000111010 (decimal 58)
000000000000000000000000000000111011 (decimal 59)
Next, the program is about to write to memory address 26 with a different bitmask:
address: 000000000000000000000000000000011010 (decimal 26)
mask: 00000000000000000000000000000000X0XX
result: 00000000000000000000000000000001X0XX
This results in an address with three floating bits, causing writes to eight memory addresses:
000000000000000000000000000000010000 (decimal 16)
000000000000000000000000000000010001 (decimal 17)
000000000000000000000000000000010010 (decimal 18)
000000000000000000000000000000010011 (decimal 19)
000000000000000000000000000000011000 (decimal 24)
000000000000000000000000000000011001 (decimal 25)
000000000000000000000000000000011010 (decimal 26)
000000000000000000000000000000011011 (decimal 27)
The entire 36-bit address space still begins initialized to the value 0 at every address, and you still need the sum of all values left in memory at the end of the program. In this example, the sum is 208.
Execute the initialization program using an emulator for a version 2 decoder chip. What is the sum of all values left in memory after it completes?
"""
def calculateCombinations(bin_address):
combinations = []
# xCount = 0
xPositions = []
for i in range(len(bin_address)):
# find each X and add its idx to a list
if bin_address[i] == "X":
xPositions.append(i)
# xCount += 1
if len(xPositions) > 0:
for i in range(2**(len(xPositions))):
# need to generate all possible combos of 0s & 1s
# w/ leading 0s
possible = decimalToBinary(i)
while len(possible) < len(xPositions):
possible = "0"+possible
combinations.append(possible)
addresses = []
for c in combinations:
# need to insert combination[i] into binary number
# current combo associated idx is in xPositions[i]
newAddress = ""
currPos = 0
for i in range(len(bin_address)):
if currPos < len(xPositions) and i == xPositions[currPos]:
newAddress += c[currPos]
currPos += 1
else:
newAddress += bin_address[i]
addresses.append(newAddress)
return addresses
def initialize_v2(commands):
memory = {}
mask = "X"*36
for c in commands:
if c[0] == "mask":
mask = c[1]
else:
address = c[0][c[0].index("[")+1:len(c[0])-1]
binaryAddress = decimalToBinary(int(address))
binary36 = leadingZeros(36, binaryAddress)
newVal = ""
for i in range(len(mask)):
if mask[i] != "0":
newVal += mask[i]
else:
newVal += binary36[i]
addresses = calculateCombinations(newVal)
for a in addresses:
memory[a] = int(c[1])
sum = 0
for val in memory.values():
sum += val
# print(memory)
return sum
data = processData(f)
# [print(d) for d in data]
sumAllValues = initialize(data)
print("Part 1:", sumAllValues)
sumAllValuesV2 = initialize_v2(data)
print("Part 2:", sumAllValuesV2)
# binary = decimalToBinary(33323)
# binary = leadingZeros(36, binary)
# print(binary)
# combos = initialize_v2([("mask", "100X100X101011111X100000100X11010011"),
# ("mem[33323]", "349380")])
# print(combos) | """
--- Day 14: Docking Data ---
As your ferry approaches the sea port, the captain asks for your help again. The computer system that runs this port isn't compatible with the docking program on the ferry, so the docking parameters aren't being correctly initialized in the docking program's memory.
After a brief inspection, you discover that the sea port's computer system uses a strange bitmask system in its initialization program. Although you don't have the correct decoder chip handy, you can emulate it in software!
The initialization program (your puzzle input) can either update the bitmask or write a value to memory. Values and memory addresses are both 36-bit unsigned integers. For example, ignoring bitmasks for a moment, a line like mem[8] = 11 would write the value 11 to memory address 8.
The bitmask is always given as a string of 36 bits, written with the most significant bit (representing 2^35) on the left and the least significant bit (2^0, that is, the 1s bit) on the right. The current bitmask is applied to values immediately before they are written to memory: a 0 or 1 overwrites the corresponding bit in the value, while an X leaves the bit in the value unchanged.
For example, consider the following program:
mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
mem[8] = 11
mem[7] = 101
mem[8] = 0
This program starts by specifying a bitmask (mask = ....). The mask it specifies will overwrite two bits in every written value: the 2s bit is overwritten with 0, and the 64s bit is overwritten with 1.
The program then attempts to write the value 11 to memory address 8. By expanding everything out to individual bits, the mask is applied as follows:
value: 000000000000000000000000000000001011 (decimal 11)
mask: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
result: 000000000000000000000000000001001001 (decimal 73)
So, because of the mask, the value 73 is written to memory address 8 instead. Then, the program tries to write 101 to address 7:
value: 000000000000000000000000000001100101 (decimal 101)
mask: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
result: 000000000000000000000000000001100101 (decimal 101)
This time, the mask has no effect, as the bits it overwrote were already the values the mask tried to set. Finally, the program tries to write 0 to address 8:
value: 000000000000000000000000000000000000 (decimal 0)
mask: XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X
result: 000000000000000000000000000001000000 (decimal 64)
64 is written to address 8 instead, overwriting the value that was there previously.
To initialize your ferry's docking program, you need the sum of all values left in memory after the initialization program completes. (The entire 36-bit address space begins initialized to the value 0 at every address.) In the above example, only two values in memory are not zero - 101 (at address 7) and 64 (at address 8) - producing a sum of 165.
Execute the initialization program. What is the sum of all values left in memory after it completes?
"""
f = open('challenges\\data\\day14data.txt', 'r')
def process_data(file):
data = []
for x in f:
x = x.strip().replace('\n', '').split(' = ')
data.append((x[0], x[1]))
return data
def decimal_to_binary(n):
return bin(n).replace('0b', '')
def leading_zeros(length, bin_num):
leading_zeros = length - len(bin_num)
return '0' * leadingZeros + bin_num
def initialize(commands):
memory = {}
mask = 'X' * 36
for c in commands:
if c[0] == 'mask':
mask = c[1]
else:
address = c[0][c[0].index('[') + 1:len(c[0]) - 1]
binary_value = decimal_to_binary(int(c[1]))
binary36 = leading_zeros(36, binaryValue)
memory[address] = ''
for i in range(len(mask)):
if mask[i] == 'X':
memory[address] += binary36[i]
else:
memory[address] += mask[i]
sum = 0
for val in memory.values():
sum += int(''.join(val), 2)
return sum
"\n--- Part Two ---\nFor some reason, the sea port's computer system still can't communicate with your ferry's docking program. It must be using version 2 of the decoder chip!\n\nA version 2 decoder chip doesn't modify the values being written at all. Instead, it acts as a memory address decoder. Immediately before a value is written to memory, each bit in the bitmask modifies the corresponding bit of the destination memory address in the following way:\n\nIf the bitmask bit is 0, the corresponding memory address bit is unchanged.\nIf the bitmask bit is 1, the corresponding memory address bit is overwritten with 1.\nIf the bitmask bit is X, the corresponding memory address bit is floating.\nA floating bit is not connected to anything and instead fluctuates unpredictably. In practice, this means the floating bits will take on all possible values, potentially causing many memory addresses to be written all at once!\n\nFor example, consider the following program:\n\nmask = 000000000000000000000000000000X1001X\nmem[42] = 100\nmask = 00000000000000000000000000000000X0XX\nmem[26] = 1\nWhen this program goes to write to memory address 42, it first applies the bitmask:\n\naddress: 000000000000000000000000000000101010 (decimal 42)\nmask: 000000000000000000000000000000X1001X\nresult: 000000000000000000000000000000X1101X\nAfter applying the mask, four bits are overwritten, three of which are different, and two of which are floating. Floating bits take on every possible combination of values; with two floating bits, four actual memory addresses are written:\n\n000000000000000000000000000000011010 (decimal 26)\n000000000000000000000000000000011011 (decimal 27)\n000000000000000000000000000000111010 (decimal 58)\n000000000000000000000000000000111011 (decimal 59)\nNext, the program is about to write to memory address 26 with a different bitmask:\n\naddress: 000000000000000000000000000000011010 (decimal 26)\nmask: 00000000000000000000000000000000X0XX\nresult: 00000000000000000000000000000001X0XX\nThis results in an address with three floating bits, causing writes to eight memory addresses:\n\n000000000000000000000000000000010000 (decimal 16)\n000000000000000000000000000000010001 (decimal 17)\n000000000000000000000000000000010010 (decimal 18)\n000000000000000000000000000000010011 (decimal 19)\n000000000000000000000000000000011000 (decimal 24)\n000000000000000000000000000000011001 (decimal 25)\n000000000000000000000000000000011010 (decimal 26)\n000000000000000000000000000000011011 (decimal 27)\nThe entire 36-bit address space still begins initialized to the value 0 at every address, and you still need the sum of all values left in memory at the end of the program. In this example, the sum is 208.\n\nExecute the initialization program using an emulator for a version 2 decoder chip. What is the sum of all values left in memory after it completes?\n"
def calculate_combinations(bin_address):
combinations = []
x_positions = []
for i in range(len(bin_address)):
if bin_address[i] == 'X':
xPositions.append(i)
if len(xPositions) > 0:
for i in range(2 ** len(xPositions)):
possible = decimal_to_binary(i)
while len(possible) < len(xPositions):
possible = '0' + possible
combinations.append(possible)
addresses = []
for c in combinations:
new_address = ''
curr_pos = 0
for i in range(len(bin_address)):
if currPos < len(xPositions) and i == xPositions[currPos]:
new_address += c[currPos]
curr_pos += 1
else:
new_address += bin_address[i]
addresses.append(newAddress)
return addresses
def initialize_v2(commands):
memory = {}
mask = 'X' * 36
for c in commands:
if c[0] == 'mask':
mask = c[1]
else:
address = c[0][c[0].index('[') + 1:len(c[0]) - 1]
binary_address = decimal_to_binary(int(address))
binary36 = leading_zeros(36, binaryAddress)
new_val = ''
for i in range(len(mask)):
if mask[i] != '0':
new_val += mask[i]
else:
new_val += binary36[i]
addresses = calculate_combinations(newVal)
for a in addresses:
memory[a] = int(c[1])
sum = 0
for val in memory.values():
sum += val
return sum
data = process_data(f)
sum_all_values = initialize(data)
print('Part 1:', sumAllValues)
sum_all_values_v2 = initialize_v2(data)
print('Part 2:', sumAllValuesV2) |
"""
You are given the following information, but you may prefer to do some research for yourself.
1 Jan 1900 was a Monday.
Thirty days has September,
April, June and November.
All the rest have thirty-one,
Saving February alone,
Which has twenty-eight, rain or shine.
And on leap years, twenty-nine.
A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400.
How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?
ans: 171
"""
# set to day of week for 1 Jan 1901 (Tuesday)
dow = 2
def no_days(month, year):
if month in [0,2,4,6,7,9,11]:
return 31
elif month in [3,5,8,10]:
return 30
elif year % 400 == 0:
return 29
elif year % 100 == 0:
return 28
elif year % 4 == 0:
return 29
else:
return 28
sum = 0
for y in range(1901, 2001):
for m in range(0, 12):
if dow == 0:
sum += 1
dow = (dow + no_days(m, y)) % 7
print(sum) | """
You are given the following information, but you may prefer to do some research for yourself.
1 Jan 1900 was a Monday.
Thirty days has September,
April, June and November.
All the rest have thirty-one,
Saving February alone,
Which has twenty-eight, rain or shine.
And on leap years, twenty-nine.
A leap year occurs on any year evenly divisible by 4, but not on a century unless it is divisible by 400.
How many Sundays fell on the first of the month during the twentieth century (1 Jan 1901 to 31 Dec 2000)?
ans: 171
"""
dow = 2
def no_days(month, year):
if month in [0, 2, 4, 6, 7, 9, 11]:
return 31
elif month in [3, 5, 8, 10]:
return 30
elif year % 400 == 0:
return 29
elif year % 100 == 0:
return 28
elif year % 4 == 0:
return 29
else:
return 28
sum = 0
for y in range(1901, 2001):
for m in range(0, 12):
if dow == 0:
sum += 1
dow = (dow + no_days(m, y)) % 7
print(sum) |
#Definicion de la clase
#antes de empezar una clase se declara de la siguiente manera
class Lamp:
_LAMPS = ['''
.
. | ,
\ ' /
` ,-. '
--- ( ) ---
\ /
_|=|_
|_____|
''',
'''
,-.
( )
\ /
_|=|_
|_____|
''']
def __init__(self, is_turned_on): #metodo instancia e init es el constructar osea es el primero que se ejecuta
self._is_turned_on = is_turned_on
def turn_on(self):
self._is_turned_on = True
self._display_image()
def turn_off(self):
self._is_turned_on = False
self._display_image()
def _display_image(self):
if self._is_turned_on:
print(self._LAMPS[0])
else:
print(self._LAMPS[1])
| class Lamp:
_lamps = ["\n .\n . | ,\n \\ ' /\n ` ,-. '\n --- ( ) ---\n \\ /\n _|=|_\n |_____|\n ", '\n ,-.\n ( )\n \\ /\n _|=|_\n |_____|\n ']
def __init__(self, is_turned_on):
self._is_turned_on = is_turned_on
def turn_on(self):
self._is_turned_on = True
self._display_image()
def turn_off(self):
self._is_turned_on = False
self._display_image()
def _display_image(self):
if self._is_turned_on:
print(self._LAMPS[0])
else:
print(self._LAMPS[1]) |
votes_t_shape = [3, 0, 1, 2]
for i in range(6 - 4):
votes_t_shape += [i + 4]
print(votes_t_shape)
| votes_t_shape = [3, 0, 1, 2]
for i in range(6 - 4):
votes_t_shape += [i + 4]
print(votes_t_shape) |
"""Internal API endpoint constant library.
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | |: 1 |
|::.. . | CROWDSTRIKE FALCON |::.. . | FalconPy
`-------' `-------'
OAuth2 API - Customer SDK
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
"""
_filevantage_endpoints = [
[
"getChanges",
"GET",
"/filevantage/entities/changes/v2",
"Retrieve information on changes",
"filevantage",
[
{
"type": "array",
"items": {
"type": "string"
},
"collectionFormat": "multi",
"description": "Comma separated values of change ids",
"name": "ids",
"in": "query",
"required": True
}
]
],
[
"queryChanges",
"GET",
"/filevantage/queries/changes/v2",
"Returns one or more change IDs",
"filevantage",
[
{
"minimum": 0,
"type": "integer",
"description": "The first change index to return in the response. "
"If not provided it will default to '0'. "
"Use with the `limit` parameter to manage pagination of results.",
"name": "offset",
"in": "query"
},
{
"type": "integer",
"description": "The maximum number of changes to return in the response "
"(default: 100; max: 500). "
"Use with the `offset` parameter to manage pagination of results",
"name": "limit",
"in": "query"
},
{
"type": "string",
"description": "Sort changes using options like:\n\n"
"- `action_timestamp` (timestamp of the change occurrence) \n\n "
"Sort either `asc` (ascending) or `desc` (descending). "
"For example: `action_timestamp|asc`.\n"
"The full list of allowed sorting options can be reviewed in our API documentation.",
"name": "sort",
"in": "query"
},
{
"type": "string",
"description": "Filter changes using a query in Falcon Query Language (FQL). \n\n"
"Common filter options include:\n\n - `host.host_name`\n - `action_timestamp`\n\n "
"The full list of allowed filter parameters can be reviewed in our API documentation.",
"name": "filter",
"in": "query"
}
]
]
]
| """Internal API endpoint constant library.
_______ __ _______ __ __ __
| _ .----.-----.--.--.--.--| | _ | |_.----|__| |--.-----.
|. 1___| _| _ | | | | _ | 1___| _| _| | <| -__|
|. |___|__| |_____|________|_____|____ |____|__| |__|__|__|_____|
|: 1 | |: 1 |
|::.. . | CROWDSTRIKE FALCON |::.. . | FalconPy
`-------' `-------'
OAuth2 API - Customer SDK
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to <https://unlicense.org>
"""
_filevantage_endpoints = [['getChanges', 'GET', '/filevantage/entities/changes/v2', 'Retrieve information on changes', 'filevantage', [{'type': 'array', 'items': {'type': 'string'}, 'collectionFormat': 'multi', 'description': 'Comma separated values of change ids', 'name': 'ids', 'in': 'query', 'required': True}]], ['queryChanges', 'GET', '/filevantage/queries/changes/v2', 'Returns one or more change IDs', 'filevantage', [{'minimum': 0, 'type': 'integer', 'description': "The first change index to return in the response. If not provided it will default to '0'. Use with the `limit` parameter to manage pagination of results.", 'name': 'offset', 'in': 'query'}, {'type': 'integer', 'description': 'The maximum number of changes to return in the response (default: 100; max: 500). Use with the `offset` parameter to manage pagination of results', 'name': 'limit', 'in': 'query'}, {'type': 'string', 'description': 'Sort changes using options like:\n\n- `action_timestamp` (timestamp of the change occurrence) \n\n Sort either `asc` (ascending) or `desc` (descending). For example: `action_timestamp|asc`.\nThe full list of allowed sorting options can be reviewed in our API documentation.', 'name': 'sort', 'in': 'query'}, {'type': 'string', 'description': 'Filter changes using a query in Falcon Query Language (FQL). \n\nCommon filter options include:\n\n - `host.host_name`\n - `action_timestamp`\n\n The full list of allowed filter parameters can be reviewed in our API documentation.', 'name': 'filter', 'in': 'query'}]]] |
#/ <reference path="./testBlocks/mb.ts" />
def function_0():
basic.showNumber(7)
basic.forever(function_0) | def function_0():
basic.showNumber(7)
basic.forever(function_0) |
#
# PySNMP MIB module HH3C-PPPOE-SERVER-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HH3C-PPPOE-SERVER-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:16:17 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")
ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion")
hh3cCommon, = mibBuilder.importSymbols("HH3C-OID-MIB", "hh3cCommon")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ObjectIdentity, Integer32, IpAddress, NotificationType, Unsigned32, iso, MibIdentifier, Counter64, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, ModuleIdentity, Bits, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "Integer32", "IpAddress", "NotificationType", "Unsigned32", "iso", "MibIdentifier", "Counter64", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "ModuleIdentity", "Bits", "TimeTicks")
DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention")
hh3cPPPoEServer = ModuleIdentity((1, 3, 6, 1, 4, 1, 25506, 2, 102))
hh3cPPPoEServer.setRevisions(('2009-05-06 00:00',))
if mibBuilder.loadTexts: hh3cPPPoEServer.setLastUpdated('200905060000Z')
if mibBuilder.loadTexts: hh3cPPPoEServer.setOrganization('Hangzhou H3C Technologies Co., Ltd.')
hh3cPPPoEServerObject = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1))
hh3cPPPoEServerMaxSessions = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 1), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cPPPoEServerMaxSessions.setStatus('current')
hh3cPPPoEServerCurrSessions = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 2), Integer32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cPPPoEServerCurrSessions.setStatus('current')
hh3cPPPoEServerAuthRequests = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cPPPoEServerAuthRequests.setStatus('current')
hh3cPPPoEServerAuthSuccesses = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cPPPoEServerAuthSuccesses.setStatus('current')
hh3cPPPoEServerAuthFailures = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: hh3cPPPoEServerAuthFailures.setStatus('current')
hh3cPPPoESAbnormOffsThreshold = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hh3cPPPoESAbnormOffsThreshold.setStatus('current')
hh3cPPPoESAbnormOffPerThreshold = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hh3cPPPoESAbnormOffPerThreshold.setStatus('current')
hh3cPPPoESNormOffPerThreshold = MibScalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: hh3cPPPoESNormOffPerThreshold.setStatus('current')
hh3cPPPoEServerTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2))
hh3cPPPoeServerTrapPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2, 0))
hh3cPPPoESAbnormOffsAlarm = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2, 0, 1))
if mibBuilder.loadTexts: hh3cPPPoESAbnormOffsAlarm.setStatus('current')
hh3cPPPoESAbnormOffPerAlarm = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2, 0, 2))
if mibBuilder.loadTexts: hh3cPPPoESAbnormOffPerAlarm.setStatus('current')
hh3cPPPoESNormOffPerAlarm = NotificationType((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2, 0, 3))
if mibBuilder.loadTexts: hh3cPPPoESNormOffPerAlarm.setStatus('current')
mibBuilder.exportSymbols("HH3C-PPPOE-SERVER-MIB", hh3cPPPoEServerMaxSessions=hh3cPPPoEServerMaxSessions, hh3cPPPoEServerObject=hh3cPPPoEServerObject, hh3cPPPoeServerTrapPrefix=hh3cPPPoeServerTrapPrefix, hh3cPPPoEServerAuthFailures=hh3cPPPoEServerAuthFailures, hh3cPPPoEServer=hh3cPPPoEServer, PYSNMP_MODULE_ID=hh3cPPPoEServer, hh3cPPPoESAbnormOffsAlarm=hh3cPPPoESAbnormOffsAlarm, hh3cPPPoEServerAuthRequests=hh3cPPPoEServerAuthRequests, hh3cPPPoEServerAuthSuccesses=hh3cPPPoEServerAuthSuccesses, hh3cPPPoESNormOffPerThreshold=hh3cPPPoESNormOffPerThreshold, hh3cPPPoEServerCurrSessions=hh3cPPPoEServerCurrSessions, hh3cPPPoEServerTraps=hh3cPPPoEServerTraps, hh3cPPPoESAbnormOffPerThreshold=hh3cPPPoESAbnormOffPerThreshold, hh3cPPPoESAbnormOffPerAlarm=hh3cPPPoESAbnormOffPerAlarm, hh3cPPPoESAbnormOffsThreshold=hh3cPPPoESAbnormOffsThreshold, hh3cPPPoESNormOffPerAlarm=hh3cPPPoESNormOffPerAlarm)
| (integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, single_value_constraint, value_range_constraint, constraints_intersection, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion')
(hh3c_common,) = mibBuilder.importSymbols('HH3C-OID-MIB', 'hh3cCommon')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(object_identity, integer32, ip_address, notification_type, unsigned32, iso, mib_identifier, counter64, counter32, mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32, module_identity, bits, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'Integer32', 'IpAddress', 'NotificationType', 'Unsigned32', 'iso', 'MibIdentifier', 'Counter64', 'Counter32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32', 'ModuleIdentity', 'Bits', 'TimeTicks')
(display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention')
hh3c_pp_po_e_server = module_identity((1, 3, 6, 1, 4, 1, 25506, 2, 102))
hh3cPPPoEServer.setRevisions(('2009-05-06 00:00',))
if mibBuilder.loadTexts:
hh3cPPPoEServer.setLastUpdated('200905060000Z')
if mibBuilder.loadTexts:
hh3cPPPoEServer.setOrganization('Hangzhou H3C Technologies Co., Ltd.')
hh3c_pp_po_e_server_object = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1))
hh3c_pp_po_e_server_max_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 1), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hh3cPPPoEServerMaxSessions.setStatus('current')
hh3c_pp_po_e_server_curr_sessions = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 2), integer32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hh3cPPPoEServerCurrSessions.setStatus('current')
hh3c_pp_po_e_server_auth_requests = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hh3cPPPoEServerAuthRequests.setStatus('current')
hh3c_pp_po_e_server_auth_successes = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hh3cPPPoEServerAuthSuccesses.setStatus('current')
hh3c_pp_po_e_server_auth_failures = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
hh3cPPPoEServerAuthFailures.setStatus('current')
hh3c_pp_po_es_abnorm_offs_threshold = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hh3cPPPoESAbnormOffsThreshold.setStatus('current')
hh3c_pp_po_es_abnorm_off_per_threshold = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hh3cPPPoESAbnormOffPerThreshold.setStatus('current')
hh3c_pp_po_es_norm_off_per_threshold = mib_scalar((1, 3, 6, 1, 4, 1, 25506, 2, 102, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 100))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
hh3cPPPoESNormOffPerThreshold.setStatus('current')
hh3c_pp_po_e_server_traps = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2))
hh3c_pp_poe_server_trap_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2, 0))
hh3c_pp_po_es_abnorm_offs_alarm = notification_type((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2, 0, 1))
if mibBuilder.loadTexts:
hh3cPPPoESAbnormOffsAlarm.setStatus('current')
hh3c_pp_po_es_abnorm_off_per_alarm = notification_type((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2, 0, 2))
if mibBuilder.loadTexts:
hh3cPPPoESAbnormOffPerAlarm.setStatus('current')
hh3c_pp_po_es_norm_off_per_alarm = notification_type((1, 3, 6, 1, 4, 1, 25506, 2, 102, 2, 0, 3))
if mibBuilder.loadTexts:
hh3cPPPoESNormOffPerAlarm.setStatus('current')
mibBuilder.exportSymbols('HH3C-PPPOE-SERVER-MIB', hh3cPPPoEServerMaxSessions=hh3cPPPoEServerMaxSessions, hh3cPPPoEServerObject=hh3cPPPoEServerObject, hh3cPPPoeServerTrapPrefix=hh3cPPPoeServerTrapPrefix, hh3cPPPoEServerAuthFailures=hh3cPPPoEServerAuthFailures, hh3cPPPoEServer=hh3cPPPoEServer, PYSNMP_MODULE_ID=hh3cPPPoEServer, hh3cPPPoESAbnormOffsAlarm=hh3cPPPoESAbnormOffsAlarm, hh3cPPPoEServerAuthRequests=hh3cPPPoEServerAuthRequests, hh3cPPPoEServerAuthSuccesses=hh3cPPPoEServerAuthSuccesses, hh3cPPPoESNormOffPerThreshold=hh3cPPPoESNormOffPerThreshold, hh3cPPPoEServerCurrSessions=hh3cPPPoEServerCurrSessions, hh3cPPPoEServerTraps=hh3cPPPoEServerTraps, hh3cPPPoESAbnormOffPerThreshold=hh3cPPPoESAbnormOffPerThreshold, hh3cPPPoESAbnormOffPerAlarm=hh3cPPPoESAbnormOffPerAlarm, hh3cPPPoESAbnormOffsThreshold=hh3cPPPoESAbnormOffsThreshold, hh3cPPPoESNormOffPerAlarm=hh3cPPPoESNormOffPerAlarm) |
name = input("masukkan nama pembeli = ")
alamat= input("Alamat = ")
NoTelp = input("No Telp = ")
print("\n")
print("=================INFORMASI HARGA MOBIL DEALER JAYA ABADI===============")
print("Pilih Jenis Mobil :")
print("\t 1.Daihatsu ")
print("\t 2.Honda ")
print("\t 3.Toyota ")
print("")
pilihan = int(input("Pilih jenis mobil yang ingin dibeli : "))
print("")
if (pilihan==1):
print("<<<<<<<< Macam macam mobil pada Daihatsu >>>>>>>>>")
print("\ta.Grand New Xenia")
print("\tb.All New Terios")
print("\tc.New Ayla")
Pilih1 = input("Mana yang ingin anda pilih ?? = ")
if(Pilih1 == "a"):
print("Harga mobil Grand New Xenia adalah 183 juta ")
elif(Pilih1== "b"):
print("Harga mobil All New Terios adalah 215 juta")
elif(Pilih1== "c"):
print("Harga mobil New Ayla adalah 110 juta")
else:
print("Tidak terdefinisi")
elif (pilihan==2):
print("<<<<<<<< Macam macam mobil pada Honda >>>>>>>>>")
print("\ta.Honda Brio Satya S")
print("\tb.Honda Jazz ")
print("\tb.Honda Mobilio ")
pilih2 = input("Mana yang ingin anda pilih??")
if(pilih2=="a"):
print("Harga mobil HOnda Brio Satya S adalah 131 juta")
elif(pilih2=="b"):
print("Harga mobil Honda Jazz adalah 232 juta")
elif(pilih2=="c"):
print("Harga mobil Honda mobilio adalah 189 juta")
else:
print("Tidak terdefinisi")
elif (pilihan==3):
print("<<<<<<<< Macam macam mobil pada Toyota>>>>>>>>?")
print("\ta.Alphard")
print("\tb.Camry")
print("\tc.Fortuner")
pilih3 = input("Mana yang ingin anda pilih??")
if (pilih3=="a"):
print("Harga mobil Alphard adalah 870 juta")
elif (pilih3=="b"):
print("Harga mobil Camry adalah 560 Juta")
elif (pilih3=="c"):
print("Harga mobil Fortuner adalah 492 Juta")
| name = input('masukkan nama pembeli = ')
alamat = input('Alamat = ')
no_telp = input('No Telp = ')
print('\n')
print('=================INFORMASI HARGA MOBIL DEALER JAYA ABADI===============')
print('Pilih Jenis Mobil :')
print('\t 1.Daihatsu ')
print('\t 2.Honda ')
print('\t 3.Toyota ')
print('')
pilihan = int(input('Pilih jenis mobil yang ingin dibeli : '))
print('')
if pilihan == 1:
print('<<<<<<<< Macam macam mobil pada Daihatsu >>>>>>>>>')
print('\ta.Grand New Xenia')
print('\tb.All New Terios')
print('\tc.New Ayla')
pilih1 = input('Mana yang ingin anda pilih ?? = ')
if Pilih1 == 'a':
print('Harga mobil Grand New Xenia adalah 183 juta ')
elif Pilih1 == 'b':
print('Harga mobil All New Terios adalah 215 juta')
elif Pilih1 == 'c':
print('Harga mobil New Ayla adalah 110 juta')
else:
print('Tidak terdefinisi')
elif pilihan == 2:
print('<<<<<<<< Macam macam mobil pada Honda >>>>>>>>>')
print('\ta.Honda Brio Satya S')
print('\tb.Honda Jazz ')
print('\tb.Honda Mobilio ')
pilih2 = input('Mana yang ingin anda pilih??')
if pilih2 == 'a':
print('Harga mobil HOnda Brio Satya S adalah 131 juta')
elif pilih2 == 'b':
print('Harga mobil Honda Jazz adalah 232 juta')
elif pilih2 == 'c':
print('Harga mobil Honda mobilio adalah 189 juta')
else:
print('Tidak terdefinisi')
elif pilihan == 3:
print('<<<<<<<< Macam macam mobil pada Toyota>>>>>>>>?')
print('\ta.Alphard')
print('\tb.Camry')
print('\tc.Fortuner')
pilih3 = input('Mana yang ingin anda pilih??')
if pilih3 == 'a':
print('Harga mobil Alphard adalah 870 juta')
elif pilih3 == 'b':
print('Harga mobil Camry adalah 560 Juta')
elif pilih3 == 'c':
print('Harga mobil Fortuner adalah 492 Juta') |
"""
ABP analyzer and graphics tests
"""
cases = [
('Run Pymodel Graphics to generate dot file from FSM model, no need use pma',
'pmg ABP'),
('Generate SVG file from dot',
'dotsvg ABP'),
# Now display ABP.dot in browser
('Run PyModel Analyzer to generate FSM from original FSM, should be the same',
'pma ABP'),
('Run PyModel Graphics to generate a file of graphics commands from new FSM',
'pmg ABPFSM'),
('Generate an svg file from the graphics commands',
'dotsvg ABPFSM'),
# Now display ABPFSM.svg in browser, should look the same as ABP.svg
]
| """
ABP analyzer and graphics tests
"""
cases = [('Run Pymodel Graphics to generate dot file from FSM model, no need use pma', 'pmg ABP'), ('Generate SVG file from dot', 'dotsvg ABP'), ('Run PyModel Analyzer to generate FSM from original FSM, should be the same', 'pma ABP'), ('Run PyModel Graphics to generate a file of graphics commands from new FSM', 'pmg ABPFSM'), ('Generate an svg file from the graphics commands', 'dotsvg ABPFSM')] |
"""
Question:
Nim Game My Submissions Question
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones.
Both of you are very clever and have optimal strategies for the game. Write a function to determine whether you can win the game given the number of stones in the heap.
For example, if there are 4 stones in the heap, then you will never win the game: no matter 1, 2, or 3 stones you remove, the last stone will always be removed by your friend.
Hint:
If there are 5 stones in the heap, could you figure out a way to remove the stones such that you will always be the winner?
Credits:
Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases.
Performance:
1. Total Accepted: 31755 Total Submissions: 63076 Difficulty: Easy
2. Your runtime beats 43.52% of python submissions.
"""
class Solution(object):
def canWinNim(self, n):
"""
:type n: int
:rtype: bool
"""
if n <= 3:
return True
if n % 4 == 0:
return False
else:
return True
assert Solution().canWinNim(0) is True
assert Solution().canWinNim(1) is True
assert Solution().canWinNim(2) is True
assert Solution().canWinNim(3) is True
assert Solution().canWinNim(4) is False
assert Solution().canWinNim(5) is True
assert Solution().canWinNim(6) is True
assert Solution().canWinNim(7) is True
assert Solution().canWinNim(8) is False
| """
Question:
Nim Game My Submissions Question
You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 stones. The one who removes the last stone will be the winner. You will take the first turn to remove the stones.
Both of you are very clever and have optimal strategies for the game. Write a function to determine whether you can win the game given the number of stones in the heap.
For example, if there are 4 stones in the heap, then you will never win the game: no matter 1, 2, or 3 stones you remove, the last stone will always be removed by your friend.
Hint:
If there are 5 stones in the heap, could you figure out a way to remove the stones such that you will always be the winner?
Credits:
Special thanks to @jianchao.li.fighter for adding this problem and creating all test cases.
Performance:
1. Total Accepted: 31755 Total Submissions: 63076 Difficulty: Easy
2. Your runtime beats 43.52% of python submissions.
"""
class Solution(object):
def can_win_nim(self, n):
"""
:type n: int
:rtype: bool
"""
if n <= 3:
return True
if n % 4 == 0:
return False
else:
return True
assert solution().canWinNim(0) is True
assert solution().canWinNim(1) is True
assert solution().canWinNim(2) is True
assert solution().canWinNim(3) is True
assert solution().canWinNim(4) is False
assert solution().canWinNim(5) is True
assert solution().canWinNim(6) is True
assert solution().canWinNim(7) is True
assert solution().canWinNim(8) is False |
#!/bin/python3
with open('../camera/QCamera2/stack/common/cam_intf.h', 'r') as f:
data = f.read()
f.closed
start = data.find(' INCLUDE(CAM_INTF_META_HISTOGRAM')
end = data.find('} metadata_data_t;')
data = data[start:end]
metadata = data.split("\n")
metalist = list()
for line in metadata:
if (line.startswith(' INCLUDE')):
foo = line.split(',')
foo[0] = foo[0].replace('INCLUDE', 'PRINT')
metalist.append(foo[0] + ", pMetadata);")
with open('list.txt', 'w') as f:
for item in metalist:
f.write("%s\n" % item)
f.closed
| with open('../camera/QCamera2/stack/common/cam_intf.h', 'r') as f:
data = f.read()
f.closed
start = data.find(' INCLUDE(CAM_INTF_META_HISTOGRAM')
end = data.find('} metadata_data_t;')
data = data[start:end]
metadata = data.split('\n')
metalist = list()
for line in metadata:
if line.startswith(' INCLUDE'):
foo = line.split(',')
foo[0] = foo[0].replace('INCLUDE', 'PRINT')
metalist.append(foo[0] + ', pMetadata);')
with open('list.txt', 'w') as f:
for item in metalist:
f.write('%s\n' % item)
f.closed |
def g(A, n):
if A == -1:
return 0
return A // (2 * n) * n + max(A % (2 * n) - (n - 1), 0)
def f(A, B):
result = 0
for i in range(48):
t = 1 << i
if (g(B, t) - g(A - 1, t)) % 2 == 1:
result += t
return result
A, B = map(int, input().split())
print(f(A, B))
| def g(A, n):
if A == -1:
return 0
return A // (2 * n) * n + max(A % (2 * n) - (n - 1), 0)
def f(A, B):
result = 0
for i in range(48):
t = 1 << i
if (g(B, t) - g(A - 1, t)) % 2 == 1:
result += t
return result
(a, b) = map(int, input().split())
print(f(A, B)) |
# Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.
def move_zeros(array):
#your code here
new_array = []
new_index = 0
while len(array) > 0:
item = array.pop(0)
if item == 0 and not type(item) == bool :
new_array.append(item)
else:
new_array.insert(new_index, item)
new_index = new_index + 1
return new_array | def move_zeros(array):
new_array = []
new_index = 0
while len(array) > 0:
item = array.pop(0)
if item == 0 and (not type(item) == bool):
new_array.append(item)
else:
new_array.insert(new_index, item)
new_index = new_index + 1
return new_array |
def construct_tag_data(tag_name, attrs=None, value=None, sorting=None):
data = {
'_name': tag_name,
'_attrs': attrs or [],
'_value': value,
}
if sorting:
data['_sorting'] = sorting
return data
def add_simple_child(data, child_friendly_name, child_tag_name, child_attrs=None, child_value=None):
data[child_friendly_name] = construct_tag_data(child_tag_name, child_attrs, child_value)
return data
def construct_header(ctransfer):
header = construct_tag_data('GrpHdr')
header['_sorting'] = ['MsgId', 'CreDtTm', 'NbOfTxs', 'CtrlSum', 'InitgPty']
header['message_id'] = construct_tag_data('MsgId', value=ctransfer.uuid)
header['creation_date_time'] = construct_tag_data('CreDtTm', value=ctransfer.timestamp)
header['num_transactions'] = construct_tag_data('NbOfTxs', value=ctransfer.get_num_of_transactions())
header['control_sum'] = construct_tag_data('CtrlSum', value=ctransfer.get_control_sum())
header['initiating_party'] = add_simple_child(construct_tag_data('InitgPty'), 'name', 'Nm', [],
ctransfer.debtor.name)
return header
def construct_iban(account, tag_name):
iban_data = construct_tag_data(tag_name)
iban_data['id'] = add_simple_child(construct_tag_data('Id'), 'iban', 'IBAN', [], account.iban)
return iban_data
def construct_bic(account, tag_name):
bic_data = construct_tag_data(tag_name)
bic_data['financial_instrument_id'] = add_simple_child(construct_tag_data('FinInstnId'), 'bic', 'BIC', [],
account.bic)
return bic_data
def construct_address_data(account, tag_name):
addr_data = construct_tag_data(tag_name)
addr_data['name'] = construct_tag_data('Nm', value=account.name)
if account.has_address():
address = construct_tag_data('PstlAdr')
if account.country:
address['country'] = construct_tag_data('Ctry', value=account.country)
if account.street:
address['addr_line_1'] = construct_tag_data('AdrLine', value=account.street)
if account.postcode and account.city:
address['addr_line_2'] = construct_tag_data('AdrLine', value="%s %s" % (account.postcode, account.city))
addr_data['address'] = address
return addr_data
def construct_transaction_data(ctransfer, transaction):
transaction_information = construct_tag_data('CdtTrfTxInf')
transaction_information['_sorting'] = ['PmtId', 'Amt', 'ChrgBr', 'UltmtDbtr', 'CdtrAgt', 'Cdtr', 'CdtrAcct',
'UltmtCdtr', 'Purp', 'RmtInf']
transaction_information['payment_id'] = add_simple_child(
data=add_simple_child(data=construct_tag_data('PmtId', sorting=['InstrId', 'EndToEndId']),
child_friendly_name='instruction',
child_tag_name='InstrId',
child_value=transaction.uuid),
child_friendly_name='eref',
child_tag_name='EndToEndId',
child_value=transaction.eref)
transaction_information['amount'] = add_simple_child(data=construct_tag_data('Amt'),
child_friendly_name='amount',
child_tag_name='InstdAmt',
child_attrs=[('Ccy', ctransfer.currency)],
child_value=transaction.get_amount())
transaction_information['charge_bearer'] = construct_tag_data('ChrgBr', value='SLEV')
if ctransfer.debtor.use_ultimate:
transaction_information['ultimate_debtor'] = add_simple_child(data=construct_tag_data('UltmtDbtr'),
child_friendly_name='name',
child_tag_name='Nm',
child_value=ctransfer.debtor.name)
transaction_information['creditor_agent'] = construct_bic(transaction.creditor, 'CdtrAgt')
transaction_information['creditor_data'] = construct_address_data(transaction.creditor, 'Cdtr')
transaction_information['creditor_account'] = construct_iban(transaction.creditor, 'CdtrAcct')
if transaction.creditor.use_ultimate:
transaction_information['ultimate_creditor'] = add_simple_child(data=construct_tag_data('UltmtCdtr'),
child_friendly_name='name',
child_tag_name='Nm',
child_value=transaction.creditor.name)
transaction_information['purpose'] = add_simple_child(data=construct_tag_data('Purp'),
child_friendly_name='code',
child_tag_name='Cd',
child_value=transaction.ext_purpose)
if not transaction.use_structured:
transaction_information['remote_inf'] = add_simple_child(data=construct_tag_data('RmtInf'),
child_friendly_name='unstructured',
child_tag_name='Ustrd',
child_value=transaction.purpose)
else:
rmt_inf = construct_tag_data('RmtInf')
rmt_inf_strd = add_simple_child(data=construct_tag_data('Strd'),
child_friendly_name='additional_info',
child_tag_name='AddtlRmtInf',
child_value=transaction.purpose)
rmt_tp = construct_tag_data('Tp')
rmt_tp['code_or_property'] = add_simple_child(data=construct_tag_data('CdOrPrtry'),
child_friendly_name='code',
child_tag_name='Cd',
child_value='SCOR')
rmt_creditor_ref_inf = add_simple_child(data=construct_tag_data('CdtrRefInf'),
child_friendly_name='reference',
child_tag_name='Ref',
child_value=transaction.cref)
rmt_creditor_ref_inf['tp'] = rmt_tp
rmt_inf_strd['creditor_ref_information'] = rmt_creditor_ref_inf
rmt_inf['structured'] = rmt_inf_strd
transaction_information['remote_inf'] = rmt_inf
return transaction_information
def construct_payment_information(ctransfer):
payment_inf = construct_tag_data('PmtInf')
payment_inf['_sorting'] = ['PmtInfId', 'PmtMtd', 'BtchBookg', 'NbOfTxs', 'CtrlSum', 'PmtTpInf', 'ReqdExctnDt',
'Dbtr', 'DbtrAcct', 'DbtrAgt', 'ChrgBr', 'CdtTrfTxInf']
payment_inf['payment_id'] = construct_tag_data('PmtInfId', value=ctransfer.payment_id)
payment_inf['payment_method'] = construct_tag_data('PmtMtd', value='TRF')
payment_inf['batch'] = construct_tag_data('BtchBookg', value=str(ctransfer.batch).lower())
payment_inf['num_transactions'] = construct_tag_data('NbOfTxs', value=ctransfer.get_num_of_transactions())
payment_inf['control_sum'] = construct_tag_data('CtrlSum', value=ctransfer.get_control_sum())
payment_instruction = construct_tag_data('PmtTpInf')
payment_instruction['_sorting'] = ['InstrPrty', 'SvcLvl']
payment_instruction['priority'] = construct_tag_data('InstrPrty', value='NORM')
payment_instruction['service_level'] = add_simple_child(construct_tag_data('SvcLvl'), 'code', 'Cd', [], 'SEPA')
payment_inf['instruction'] = payment_instruction
payment_inf['requested_execution_time'] = construct_tag_data('ReqdExctnDt', value=ctransfer.execution_time)
payment_inf['debtor'] = construct_address_data(ctransfer.debtor, 'Dbtr')
payment_inf['debtor_account'] = construct_iban(ctransfer.debtor, 'DbtrAcct')
payment_inf['debtor_agent'] = construct_bic(ctransfer.debtor, 'DbtrAgt')
payment_inf['charge_bearer'] = construct_tag_data('ChrgBr', value='SLEV')
for i, payment in enumerate(ctransfer.transactions):
transfer_information = construct_transaction_data(ctransfer, payment)
payment_inf['transfer_no_%s' % i] = transfer_information
return payment_inf
def construct_document(ctransfer):
root = construct_tag_data('Document', [('xmlns', 'urn:iso:std:iso:20022:tech:xsd:pain.001.001.03')])
message = construct_tag_data('CstmrCdtTrfInitn')
message['_sorting'] = ['GrpHdr', 'PmtInf']
message['header'] = construct_header(ctransfer)
message['payment_information'] = construct_payment_information(ctransfer)
root['message'] = message
return root
| def construct_tag_data(tag_name, attrs=None, value=None, sorting=None):
data = {'_name': tag_name, '_attrs': attrs or [], '_value': value}
if sorting:
data['_sorting'] = sorting
return data
def add_simple_child(data, child_friendly_name, child_tag_name, child_attrs=None, child_value=None):
data[child_friendly_name] = construct_tag_data(child_tag_name, child_attrs, child_value)
return data
def construct_header(ctransfer):
header = construct_tag_data('GrpHdr')
header['_sorting'] = ['MsgId', 'CreDtTm', 'NbOfTxs', 'CtrlSum', 'InitgPty']
header['message_id'] = construct_tag_data('MsgId', value=ctransfer.uuid)
header['creation_date_time'] = construct_tag_data('CreDtTm', value=ctransfer.timestamp)
header['num_transactions'] = construct_tag_data('NbOfTxs', value=ctransfer.get_num_of_transactions())
header['control_sum'] = construct_tag_data('CtrlSum', value=ctransfer.get_control_sum())
header['initiating_party'] = add_simple_child(construct_tag_data('InitgPty'), 'name', 'Nm', [], ctransfer.debtor.name)
return header
def construct_iban(account, tag_name):
iban_data = construct_tag_data(tag_name)
iban_data['id'] = add_simple_child(construct_tag_data('Id'), 'iban', 'IBAN', [], account.iban)
return iban_data
def construct_bic(account, tag_name):
bic_data = construct_tag_data(tag_name)
bic_data['financial_instrument_id'] = add_simple_child(construct_tag_data('FinInstnId'), 'bic', 'BIC', [], account.bic)
return bic_data
def construct_address_data(account, tag_name):
addr_data = construct_tag_data(tag_name)
addr_data['name'] = construct_tag_data('Nm', value=account.name)
if account.has_address():
address = construct_tag_data('PstlAdr')
if account.country:
address['country'] = construct_tag_data('Ctry', value=account.country)
if account.street:
address['addr_line_1'] = construct_tag_data('AdrLine', value=account.street)
if account.postcode and account.city:
address['addr_line_2'] = construct_tag_data('AdrLine', value='%s %s' % (account.postcode, account.city))
addr_data['address'] = address
return addr_data
def construct_transaction_data(ctransfer, transaction):
transaction_information = construct_tag_data('CdtTrfTxInf')
transaction_information['_sorting'] = ['PmtId', 'Amt', 'ChrgBr', 'UltmtDbtr', 'CdtrAgt', 'Cdtr', 'CdtrAcct', 'UltmtCdtr', 'Purp', 'RmtInf']
transaction_information['payment_id'] = add_simple_child(data=add_simple_child(data=construct_tag_data('PmtId', sorting=['InstrId', 'EndToEndId']), child_friendly_name='instruction', child_tag_name='InstrId', child_value=transaction.uuid), child_friendly_name='eref', child_tag_name='EndToEndId', child_value=transaction.eref)
transaction_information['amount'] = add_simple_child(data=construct_tag_data('Amt'), child_friendly_name='amount', child_tag_name='InstdAmt', child_attrs=[('Ccy', ctransfer.currency)], child_value=transaction.get_amount())
transaction_information['charge_bearer'] = construct_tag_data('ChrgBr', value='SLEV')
if ctransfer.debtor.use_ultimate:
transaction_information['ultimate_debtor'] = add_simple_child(data=construct_tag_data('UltmtDbtr'), child_friendly_name='name', child_tag_name='Nm', child_value=ctransfer.debtor.name)
transaction_information['creditor_agent'] = construct_bic(transaction.creditor, 'CdtrAgt')
transaction_information['creditor_data'] = construct_address_data(transaction.creditor, 'Cdtr')
transaction_information['creditor_account'] = construct_iban(transaction.creditor, 'CdtrAcct')
if transaction.creditor.use_ultimate:
transaction_information['ultimate_creditor'] = add_simple_child(data=construct_tag_data('UltmtCdtr'), child_friendly_name='name', child_tag_name='Nm', child_value=transaction.creditor.name)
transaction_information['purpose'] = add_simple_child(data=construct_tag_data('Purp'), child_friendly_name='code', child_tag_name='Cd', child_value=transaction.ext_purpose)
if not transaction.use_structured:
transaction_information['remote_inf'] = add_simple_child(data=construct_tag_data('RmtInf'), child_friendly_name='unstructured', child_tag_name='Ustrd', child_value=transaction.purpose)
else:
rmt_inf = construct_tag_data('RmtInf')
rmt_inf_strd = add_simple_child(data=construct_tag_data('Strd'), child_friendly_name='additional_info', child_tag_name='AddtlRmtInf', child_value=transaction.purpose)
rmt_tp = construct_tag_data('Tp')
rmt_tp['code_or_property'] = add_simple_child(data=construct_tag_data('CdOrPrtry'), child_friendly_name='code', child_tag_name='Cd', child_value='SCOR')
rmt_creditor_ref_inf = add_simple_child(data=construct_tag_data('CdtrRefInf'), child_friendly_name='reference', child_tag_name='Ref', child_value=transaction.cref)
rmt_creditor_ref_inf['tp'] = rmt_tp
rmt_inf_strd['creditor_ref_information'] = rmt_creditor_ref_inf
rmt_inf['structured'] = rmt_inf_strd
transaction_information['remote_inf'] = rmt_inf
return transaction_information
def construct_payment_information(ctransfer):
payment_inf = construct_tag_data('PmtInf')
payment_inf['_sorting'] = ['PmtInfId', 'PmtMtd', 'BtchBookg', 'NbOfTxs', 'CtrlSum', 'PmtTpInf', 'ReqdExctnDt', 'Dbtr', 'DbtrAcct', 'DbtrAgt', 'ChrgBr', 'CdtTrfTxInf']
payment_inf['payment_id'] = construct_tag_data('PmtInfId', value=ctransfer.payment_id)
payment_inf['payment_method'] = construct_tag_data('PmtMtd', value='TRF')
payment_inf['batch'] = construct_tag_data('BtchBookg', value=str(ctransfer.batch).lower())
payment_inf['num_transactions'] = construct_tag_data('NbOfTxs', value=ctransfer.get_num_of_transactions())
payment_inf['control_sum'] = construct_tag_data('CtrlSum', value=ctransfer.get_control_sum())
payment_instruction = construct_tag_data('PmtTpInf')
payment_instruction['_sorting'] = ['InstrPrty', 'SvcLvl']
payment_instruction['priority'] = construct_tag_data('InstrPrty', value='NORM')
payment_instruction['service_level'] = add_simple_child(construct_tag_data('SvcLvl'), 'code', 'Cd', [], 'SEPA')
payment_inf['instruction'] = payment_instruction
payment_inf['requested_execution_time'] = construct_tag_data('ReqdExctnDt', value=ctransfer.execution_time)
payment_inf['debtor'] = construct_address_data(ctransfer.debtor, 'Dbtr')
payment_inf['debtor_account'] = construct_iban(ctransfer.debtor, 'DbtrAcct')
payment_inf['debtor_agent'] = construct_bic(ctransfer.debtor, 'DbtrAgt')
payment_inf['charge_bearer'] = construct_tag_data('ChrgBr', value='SLEV')
for (i, payment) in enumerate(ctransfer.transactions):
transfer_information = construct_transaction_data(ctransfer, payment)
payment_inf['transfer_no_%s' % i] = transfer_information
return payment_inf
def construct_document(ctransfer):
root = construct_tag_data('Document', [('xmlns', 'urn:iso:std:iso:20022:tech:xsd:pain.001.001.03')])
message = construct_tag_data('CstmrCdtTrfInitn')
message['_sorting'] = ['GrpHdr', 'PmtInf']
message['header'] = construct_header(ctransfer)
message['payment_information'] = construct_payment_information(ctransfer)
root['message'] = message
return root |
#
# PySNMP MIB module CISCO-DOT11-QOS-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-DOT11-QOS-MIB
# Produced by pysmi-0.3.4 at Wed May 1 11:55:50 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, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint")
CDot11IfVlanIdOrZero, = mibBuilder.importSymbols("CISCO-DOT11-IF-MIB", "CDot11IfVlanIdOrZero")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup")
Bits, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Counter64, Counter32, ModuleIdentity, NotificationType, Unsigned32, IpAddress, MibIdentifier, iso, TimeTicks, Integer32 = mibBuilder.importSymbols("SNMPv2-SMI", "Bits", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Counter64", "Counter32", "ModuleIdentity", "NotificationType", "Unsigned32", "IpAddress", "MibIdentifier", "iso", "TimeTicks", "Integer32")
TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue")
ciscoDot11QosMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 416))
ciscoDot11QosMIB.setRevisions(('2006-05-09 00:00', '2003-11-24 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoDot11QosMIB.setRevisionsDescriptions(('The DEFVAL clauses have been removed from the definition of the objects cdot11QosCWmin, cdot11QosCWmax, cdot11QosMaxRetry and cdot11QosBackoffOffset, as the default values for these objects depend on the different traffic classes and that there are no common default values across the different traffic classes. ', 'Initial version of this MIB module.',))
if mibBuilder.loadTexts: ciscoDot11QosMIB.setLastUpdated('200605090000Z')
if mibBuilder.loadTexts: ciscoDot11QosMIB.setOrganization('Cisco Systems Inc.')
if mibBuilder.loadTexts: ciscoDot11QosMIB.setContactInfo(' Cisco Systems Customer Service Postal: 170 West Tasman Drive, San Jose CA 95134-1706. USA Tel: +1 800 553-NETS E-mail: cs-dot11@cisco.com')
if mibBuilder.loadTexts: ciscoDot11QosMIB.setDescription('This MIB module provides network management support for QoS on wireless LAN devices. The objects defined in this MIB provide equivalent support as the objects in the IEEE 802.11E Standard draft. The original names of the objects in the standard are included in the REFERENCE clauses. GLOSSARY and ACRONYMS Access point (AP) Transmitter/receiver (transceiver) device that commonly connects and transports data between a wireless network and a wired network. AIFS Arbitration Interframe Space. It is one of the five different IFSs defined to provide priority levels for access to the wireless media. It shall be used by QSTAs to transmit data type frames (MPDUs) and management type frames (MMPDUs). BSS IEEE 802.11 Basic Service Set (Radio Cell). The BSS of an AP comprises of the stations directly associating with the AP. CW Contention Window. It is the time period between radio signal collisions caused by simultaneous broadcast from multiple wireless stations. The contention window is used to compute the random backoff of the radio broadcast. The IEEE 802.11b does not specify the unit for the time period. CWP Factor Contention Window Persistence Factor. It indicates the factor used in computing new CW values on every 15 unsuccessful attempt to transmit an MPDU or an MMPDU of a traffic class. It is a scaling factor in units of 1/16ths. IFS Inter-Frame Space is the time interval between frames. A STA shall determine that the medium is idle through the use of the carrier sense function for the interval specified. In other words, the size of the IFS determines the length of the backoff time interval of a device to the medium. In this case, the medium is the radio wave spectrum. The IEEE 802.11b standard does not specify any unit for the time interval. BSS IEEE 802.11 Basic Service Set (Radio Cell). The MAC Medium Access Control. Layer 2 in the network model. MPDU MAC protocol data unit. The unit of data exchanged between two peer MAC entities using the services of the physical layer (PHY). MMPDU Management type MAC protocol data unit. MSDU MAC service data unit. Information that is delivered as a unit between MAC service access points. QBSS Quality of service basic service set. QSTA QoS station. STA (WSTA) A non-AP IEEE 802.11 wireless station.')
ciscoDot11QosMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 0))
ciscoDot11QosMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1))
ciscoDot11QosMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 2))
ciscoDot11QosConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1))
ciscoDot11QosQueue = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2))
ciscoDot11QosStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3))
ciscoDot11QosNotifControl = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 4))
class Cdot11QosTrafficClass(TextualConvention, Integer32):
reference = 'IEEE 802.1D-1998, Annex H.2.10 and IEEE 802.11E-2001, section 7.5.1.'
description = 'This textual convention defines the 802.11E traffic classes: background(0) - background traffic, lowest priority bestEffort(1) - best effort delivery, default priority class for all traffic video(2) - video traffic, 2nd highest priority voice(3) - voice traffic, highest priority.'
status = 'current'
subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))
namedValues = NamedValues(("background", 0), ("bestEffort", 1), ("video", 2), ("voice", 3))
cdot11QosConfigTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1), )
if mibBuilder.loadTexts: cdot11QosConfigTable.setStatus('current')
if mibBuilder.loadTexts: cdot11QosConfigTable.setDescription('This table contains the basic set of attributes to configure QoS queues for radio interfaces of a wireless LAN device. This table has an expansion dependent relationship with the ifTable. Each IEEE 802.11 wireless interface has different outbound queues for different network traffic class. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11QosConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-DOT11-QOS-MIB", "cdot11TrafficQueue"))
if mibBuilder.loadTexts: cdot11QosConfigEntry.setStatus('current')
if mibBuilder.loadTexts: cdot11QosConfigEntry.setDescription('Each entry contains parameters to configure traffic contention window, AIFS, priority and MSDU lifetime for each traffic queue on an IEEE 802.11 interface.')
cdot11TrafficQueue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 1), Unsigned32())
if mibBuilder.loadTexts: cdot11TrafficQueue.setStatus('current')
if mibBuilder.loadTexts: cdot11TrafficQueue.setDescription('This is the index to the outbound traffic queue on the radio interface.')
cdot11TrafficClass = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 2), Cdot11QosTrafficClass()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11TrafficClass.setStatus('current')
if mibBuilder.loadTexts: cdot11TrafficClass.setDescription('This object specifies the traffic class and priority for the traffic on this queue.')
cdot11QosCWmin = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 10))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cdot11QosCWmin.setReference('dot11CWmin, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosCWmin.setStatus('current')
if mibBuilder.loadTexts: cdot11QosCWmin.setDescription('This object defines the minimum contention window value for a traffic class. The minimum contention window is 2 to the power of cdot11QosCWmin minus 1, and that is from 0 to 1023. The cdot11QosCWmin value must be less than or equal to cdot11QosCWmax.')
cdot11QosCWmax = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 10))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cdot11QosCWmax.setReference('dot11CWmax, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosCWmax.setStatus('current')
if mibBuilder.loadTexts: cdot11QosCWmax.setDescription('This object defines the maximum contention window value for a traffic class. The maximum contention window is 2 to the power of cdot11QosCWmax minus 1, and that is from 0 to 1023. The cdot11QosCWmax value must be greater than or equal to cdot11QosCWmin.')
cdot11QosBackoffOffset = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 20))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cdot11QosBackoffOffset.setStatus('current')
if mibBuilder.loadTexts: cdot11QosBackoffOffset.setDescription('This specifies the offset of the radio backoff from the transmission media for this traffic class. The backoff interval of a radio is calculated from a pseudo random integer drawn from a uniform distribution over the interval determined by the maximum and minimum of the contention window.')
cdot11QosMaxRetry = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cdot11QosMaxRetry.setStatus('current')
if mibBuilder.loadTexts: cdot11QosMaxRetry.setDescription('This specifies the number of times the radio retries for a particular transmission if there is a collision for the media.')
cdot11QosSupportTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2), )
if mibBuilder.loadTexts: cdot11QosSupportTable.setStatus('current')
if mibBuilder.loadTexts: cdot11QosSupportTable.setDescription('This table contains the attributes indicating QoS support information on the IEEE 802.11 interfaces of this device. This table has a sparse dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11QosSupportEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: cdot11QosSupportEntry.setStatus('current')
if mibBuilder.loadTexts: cdot11QosSupportEntry.setDescription('Each entry contains attributes to indicate if QoS and priority queue are supported for an IEEE 802.11 interface.')
cdot11QosOptionImplemented = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2, 1, 1), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosOptionImplemented.setReference('dot11QosOptionImplemented, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosOptionImplemented.setStatus('current')
if mibBuilder.loadTexts: cdot11QosOptionImplemented.setDescription('This object indicates if QoS is implemented on this IEEE 802.11 network interface.')
cdot11QosOptionEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2, 1, 2), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosOptionEnabled.setStatus('current')
if mibBuilder.loadTexts: cdot11QosOptionEnabled.setDescription("This object indicates if QoS is enabled on this IEEE 802.11 network interface. If it is 'true', QoS queuing is ON and traffic are prioritized according to their traffic class. If it is 'false', there is no QoS queuing and traffic are not prioritized.")
cdot11QosQueuesAvailable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(4, 64))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosQueuesAvailable.setReference('dot11QueuesAvailable, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosQueuesAvailable.setStatus('current')
if mibBuilder.loadTexts: cdot11QosQueuesAvailable.setDescription('This object shows the number of QoS priority queues are available on this IEEE 802.11 network interface. That is the number of queue per interface in the cdot11QosConfigTable.')
cdot11QosQueueTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1), )
if mibBuilder.loadTexts: cdot11QosQueueTable.setStatus('current')
if mibBuilder.loadTexts: cdot11QosQueueTable.setDescription('This table contains the queue weight and size information and statistics for each traffic queue on each the IEEE 802.11 interface. This table has a sparse dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11QosQueueEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-DOT11-QOS-MIB", "cdot11TrafficQueue"))
if mibBuilder.loadTexts: cdot11QosQueueEntry.setStatus('current')
if mibBuilder.loadTexts: cdot11QosQueueEntry.setDescription('Each entry contains the current queue weight, size, and peak size information for each traffic queue on an IEEE 802.11 interface.')
cdot11QosQueueQuota = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosQueueQuota.setStatus('current')
if mibBuilder.loadTexts: cdot11QosQueueQuota.setDescription('This is the current QoS priority queue packet quota for this queue on the overall bandwidth. The total available quota is platform dependent and is shared among all the transmitting queues. The queue with the largest quota value has the largest share of the overall bandwidth of the radio. The quota is allocated by the radio driver dynamically.')
cdot11QosQueueSize = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1, 1, 2), Gauge32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosQueueSize.setReference('dot11QueueSizeTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosQueueSize.setStatus('current')
if mibBuilder.loadTexts: cdot11QosQueueSize.setDescription('This is the current QoS priority queue size for this queue.')
cdot11QosQueuePeakSize = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosQueuePeakSize.setReference('dot11QueuePeakSizeTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosQueuePeakSize.setStatus('current')
if mibBuilder.loadTexts: cdot11QosQueuePeakSize.setDescription('This is the peak QoS priority queue size for this queue.')
cdot11QosStatisticsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1), )
if mibBuilder.loadTexts: cdot11QosStatisticsTable.setStatus('current')
if mibBuilder.loadTexts: cdot11QosStatisticsTable.setDescription('This table contains the QoS statistics by traffic queue on each the IEEE 802.11 network interface. This table has a expansion dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11QosStatisticsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-DOT11-QOS-MIB", "cdot11TrafficQueue"))
if mibBuilder.loadTexts: cdot11QosStatisticsEntry.setStatus('current')
if mibBuilder.loadTexts: cdot11QosStatisticsEntry.setDescription('Each entry contain QoS statistics for data transmission and receive for each traffic queue on an IEEE 802.11 interface.')
cdot11QosDiscardedFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosDiscardedFrames.setReference('dot11QosDiscardedFrameCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosDiscardedFrames.setStatus('current')
if mibBuilder.loadTexts: cdot11QosDiscardedFrames.setDescription('This is the counter for QoS discarded frames transmitting from this IEEE 802.11 interface for the traffic queue.')
cdot11QosFails = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosFails.setReference('dot11QosFailedCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosFails.setStatus('current')
if mibBuilder.loadTexts: cdot11QosFails.setDescription('This is the counter for QoS failures on this IEEE 802.11 interface for the traffic queue.')
cdot11QosRetries = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 3), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosRetries.setReference('dot11QosRetryCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosRetries.setStatus('current')
if mibBuilder.loadTexts: cdot11QosRetries.setDescription('This is the counter for QoS retries performed on this IEEE 802.11 interface for the traffic queue.')
cdot11QosMutipleRetries = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosMutipleRetries.setReference('dot11QosMutipleRetryCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosMutipleRetries.setStatus('current')
if mibBuilder.loadTexts: cdot11QosMutipleRetries.setDescription('This is the counter for QoS multiple retries performed on this IEEE 802.11 interface for the traffic queue.')
cdot11QosTransmittedFrames = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 5), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosTransmittedFrames.setReference('dot11QosTransmittedFrameCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosTransmittedFrames.setStatus('current')
if mibBuilder.loadTexts: cdot11QosTransmittedFrames.setDescription('This is the counter for QoS frames transmitted from this IEEE 802.11 interface for the traffic queue.')
cdot11QosIfStatisticsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 2), )
if mibBuilder.loadTexts: cdot11QosIfStatisticsTable.setStatus('current')
if mibBuilder.loadTexts: cdot11QosIfStatisticsTable.setDescription('This table contains the attributes indicating QoS statistics on the IEEE 802.11 interfaces of the device. This table has a sparse dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11QosIfStatisticsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: cdot11QosIfStatisticsEntry.setStatus('current')
if mibBuilder.loadTexts: cdot11QosIfStatisticsEntry.setDescription('Each entry contains attributes to support QoS statistics on an IEEE 802.11 interface.')
cdot11QosIfDiscardedFragments = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 2, 1, 1), Counter32()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosIfDiscardedFragments.setReference('dot11QosDiscardedFragments, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts: cdot11QosIfDiscardedFragments.setStatus('current')
if mibBuilder.loadTexts: cdot11QosIfDiscardedFragments.setDescription('This object counts the number of QoS discarded transmitting fragments on this radio interface.')
cdot11QosIfVlanTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 3), )
if mibBuilder.loadTexts: cdot11QosIfVlanTable.setStatus('current')
if mibBuilder.loadTexts: cdot11QosIfVlanTable.setDescription('This table maps VLANs to different traffic classes and defines their QoS properties. This table has an expansion dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11QosIfVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-DOT11-QOS-MIB", "cdot11QosIfVlanId"))
if mibBuilder.loadTexts: cdot11QosIfVlanEntry.setStatus('current')
if mibBuilder.loadTexts: cdot11QosIfVlanEntry.setDescription('Each entry defines parameters determining the traffic class and QoS configuration of a VLAN.')
cdot11QosIfVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 3, 1, 1), CDot11IfVlanIdOrZero().subtype(subtypeSpec=ValueRangeConstraint(1, 4095)))
if mibBuilder.loadTexts: cdot11QosIfVlanId.setStatus('current')
if mibBuilder.loadTexts: cdot11QosIfVlanId.setDescription('This object identifies the VLAN (1 to 4095) on this radio interface.')
cdot11QosIfVlanTrafficClass = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 3, 1, 2), Cdot11QosTrafficClass()).setMaxAccess("readonly")
if mibBuilder.loadTexts: cdot11QosIfVlanTrafficClass.setStatus('current')
if mibBuilder.loadTexts: cdot11QosIfVlanTrafficClass.setDescription('This is the QoS traffic class for the traffic transmitting on this VLAN. The traffic class determines the priority for the VLAN.')
cdot11QosNotifEnabled = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 4, 1), TruthValue().clone('false')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: cdot11QosNotifEnabled.setStatus('current')
if mibBuilder.loadTexts: cdot11QosNotifEnabled.setDescription('Indicates whether cdot11QosChangeNotif notification will or will not be sent by the agent when the QoS configuration in the cdot11QosConfigTable is changed.')
cdot11QosChangeNotif = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 416, 0, 1)).setObjects(("CISCO-DOT11-QOS-MIB", "cdot11TrafficClass"))
if mibBuilder.loadTexts: cdot11QosChangeNotif.setStatus('current')
if mibBuilder.loadTexts: cdot11QosChangeNotif.setDescription('This notification will be sent when the QoS configuration in the cdot11QosConfigTable is changed. The object cdot11TrafficClass specifies the traffic class of which a queue is configured. The sending of these notifications can be enabled or disabled via cdot11QosNotifEnabled.')
ciscoDot11QosMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 1))
ciscoDot11QosMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2))
ciscoDot11QosMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 1, 1)).setObjects(("CISCO-DOT11-QOS-MIB", "ciscoDot11QosConfigGroup"), ("CISCO-DOT11-QOS-MIB", "ciscoDot11QosStatsGroup"), ("CISCO-DOT11-QOS-MIB", "ciscoDot11QosNotifControlGroup"), ("CISCO-DOT11-QOS-MIB", "ciscoDot11QosNotificationGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoDot11QosMIBCompliance = ciscoDot11QosMIBCompliance.setStatus('current')
if mibBuilder.loadTexts: ciscoDot11QosMIBCompliance.setDescription('The compliance statement for the configuration and status groups.')
ciscoDot11QosConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2, 1)).setObjects(("CISCO-DOT11-QOS-MIB", "cdot11TrafficClass"), ("CISCO-DOT11-QOS-MIB", "cdot11QosCWmin"), ("CISCO-DOT11-QOS-MIB", "cdot11QosCWmax"), ("CISCO-DOT11-QOS-MIB", "cdot11QosBackoffOffset"), ("CISCO-DOT11-QOS-MIB", "cdot11QosMaxRetry"), ("CISCO-DOT11-QOS-MIB", "cdot11QosOptionImplemented"), ("CISCO-DOT11-QOS-MIB", "cdot11QosOptionEnabled"), ("CISCO-DOT11-QOS-MIB", "cdot11QosQueuesAvailable"), ("CISCO-DOT11-QOS-MIB", "cdot11QosQueueQuota"), ("CISCO-DOT11-QOS-MIB", "cdot11QosQueueSize"), ("CISCO-DOT11-QOS-MIB", "cdot11QosQueuePeakSize"), ("CISCO-DOT11-QOS-MIB", "cdot11QosIfVlanTrafficClass"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoDot11QosConfigGroup = ciscoDot11QosConfigGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoDot11QosConfigGroup.setDescription('Configurations for IEEE 802.11 QoS.')
ciscoDot11QosStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2, 2)).setObjects(("CISCO-DOT11-QOS-MIB", "cdot11QosIfDiscardedFragments"), ("CISCO-DOT11-QOS-MIB", "cdot11QosDiscardedFrames"), ("CISCO-DOT11-QOS-MIB", "cdot11QosFails"), ("CISCO-DOT11-QOS-MIB", "cdot11QosRetries"), ("CISCO-DOT11-QOS-MIB", "cdot11QosMutipleRetries"), ("CISCO-DOT11-QOS-MIB", "cdot11QosTransmittedFrames"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoDot11QosStatsGroup = ciscoDot11QosStatsGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoDot11QosStatsGroup.setDescription('Status and statistics for IEEE 802.11 QoS.')
ciscoDot11QosNotifControlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2, 3)).setObjects(("CISCO-DOT11-QOS-MIB", "cdot11QosNotifEnabled"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoDot11QosNotifControlGroup = ciscoDot11QosNotifControlGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoDot11QosNotifControlGroup.setDescription('Notification control configuration for QoS.')
ciscoDot11QosNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2, 4)).setObjects(("CISCO-DOT11-QOS-MIB", "cdot11QosChangeNotif"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoDot11QosNotificationGroup = ciscoDot11QosNotificationGroup.setStatus('current')
if mibBuilder.loadTexts: ciscoDot11QosNotificationGroup.setDescription('Notifications for QoS configuration.')
mibBuilder.exportSymbols("CISCO-DOT11-QOS-MIB", PYSNMP_MODULE_ID=ciscoDot11QosMIB, cdot11QosQueueTable=cdot11QosQueueTable, cdot11QosCWmin=cdot11QosCWmin, ciscoDot11QosMIBObjects=ciscoDot11QosMIBObjects, cdot11QosIfVlanTable=cdot11QosIfVlanTable, cdot11QosIfVlanId=cdot11QosIfVlanId, cdot11QosStatisticsTable=cdot11QosStatisticsTable, ciscoDot11QosQueue=ciscoDot11QosQueue, ciscoDot11QosStatistics=ciscoDot11QosStatistics, cdot11QosRetries=cdot11QosRetries, cdot11QosQueuesAvailable=cdot11QosQueuesAvailable, cdot11QosFails=cdot11QosFails, cdot11QosOptionEnabled=cdot11QosOptionEnabled, cdot11QosStatisticsEntry=cdot11QosStatisticsEntry, cdot11TrafficQueue=cdot11TrafficQueue, ciscoDot11QosMIBCompliance=ciscoDot11QosMIBCompliance, ciscoDot11QosMIBCompliances=ciscoDot11QosMIBCompliances, cdot11QosIfStatisticsTable=cdot11QosIfStatisticsTable, cdot11QosIfDiscardedFragments=cdot11QosIfDiscardedFragments, cdot11QosMaxRetry=cdot11QosMaxRetry, cdot11QosMutipleRetries=cdot11QosMutipleRetries, ciscoDot11QosMIB=ciscoDot11QosMIB, cdot11QosQueueQuota=cdot11QosQueueQuota, ciscoDot11QosMIBConformance=ciscoDot11QosMIBConformance, cdot11QosConfigTable=cdot11QosConfigTable, cdot11QosCWmax=cdot11QosCWmax, cdot11QosConfigEntry=cdot11QosConfigEntry, cdot11QosQueueSize=cdot11QosQueueSize, cdot11QosIfVlanEntry=cdot11QosIfVlanEntry, cdot11TrafficClass=cdot11TrafficClass, ciscoDot11QosStatsGroup=ciscoDot11QosStatsGroup, ciscoDot11QosConfig=ciscoDot11QosConfig, ciscoDot11QosNotifControl=ciscoDot11QosNotifControl, cdot11QosSupportEntry=cdot11QosSupportEntry, cdot11QosSupportTable=cdot11QosSupportTable, ciscoDot11QosMIBGroups=ciscoDot11QosMIBGroups, cdot11QosBackoffOffset=cdot11QosBackoffOffset, ciscoDot11QosConfigGroup=ciscoDot11QosConfigGroup, cdot11QosTransmittedFrames=cdot11QosTransmittedFrames, cdot11QosQueueEntry=cdot11QosQueueEntry, ciscoDot11QosNotifControlGroup=ciscoDot11QosNotifControlGroup, ciscoDot11QosNotificationGroup=ciscoDot11QosNotificationGroup, ciscoDot11QosMIBNotifs=ciscoDot11QosMIBNotifs, cdot11QosIfStatisticsEntry=cdot11QosIfStatisticsEntry, cdot11QosNotifEnabled=cdot11QosNotifEnabled, cdot11QosChangeNotif=cdot11QosChangeNotif, cdot11QosOptionImplemented=cdot11QosOptionImplemented, cdot11QosIfVlanTrafficClass=cdot11QosIfVlanTrafficClass, Cdot11QosTrafficClass=Cdot11QosTrafficClass, cdot11QosQueuePeakSize=cdot11QosQueuePeakSize, cdot11QosDiscardedFrames=cdot11QosDiscardedFrames)
| (integer, object_identifier, octet_string) = mibBuilder.importSymbols('ASN1', 'Integer', 'ObjectIdentifier', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_size_constraint, constraints_intersection, constraints_union, value_range_constraint, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint')
(c_dot11_if_vlan_id_or_zero,) = mibBuilder.importSymbols('CISCO-DOT11-IF-MIB', 'CDot11IfVlanIdOrZero')
(cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt')
(if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex')
(object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup')
(bits, gauge32, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, counter64, counter32, module_identity, notification_type, unsigned32, ip_address, mib_identifier, iso, time_ticks, integer32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Bits', 'Gauge32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'Counter64', 'Counter32', 'ModuleIdentity', 'NotificationType', 'Unsigned32', 'IpAddress', 'MibIdentifier', 'iso', 'TimeTicks', 'Integer32')
(textual_convention, display_string, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'TruthValue')
cisco_dot11_qos_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 416))
ciscoDot11QosMIB.setRevisions(('2006-05-09 00:00', '2003-11-24 00:00'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
ciscoDot11QosMIB.setRevisionsDescriptions(('The DEFVAL clauses have been removed from the definition of the objects cdot11QosCWmin, cdot11QosCWmax, cdot11QosMaxRetry and cdot11QosBackoffOffset, as the default values for these objects depend on the different traffic classes and that there are no common default values across the different traffic classes. ', 'Initial version of this MIB module.'))
if mibBuilder.loadTexts:
ciscoDot11QosMIB.setLastUpdated('200605090000Z')
if mibBuilder.loadTexts:
ciscoDot11QosMIB.setOrganization('Cisco Systems Inc.')
if mibBuilder.loadTexts:
ciscoDot11QosMIB.setContactInfo(' Cisco Systems Customer Service Postal: 170 West Tasman Drive, San Jose CA 95134-1706. USA Tel: +1 800 553-NETS E-mail: cs-dot11@cisco.com')
if mibBuilder.loadTexts:
ciscoDot11QosMIB.setDescription('This MIB module provides network management support for QoS on wireless LAN devices. The objects defined in this MIB provide equivalent support as the objects in the IEEE 802.11E Standard draft. The original names of the objects in the standard are included in the REFERENCE clauses. GLOSSARY and ACRONYMS Access point (AP) Transmitter/receiver (transceiver) device that commonly connects and transports data between a wireless network and a wired network. AIFS Arbitration Interframe Space. It is one of the five different IFSs defined to provide priority levels for access to the wireless media. It shall be used by QSTAs to transmit data type frames (MPDUs) and management type frames (MMPDUs). BSS IEEE 802.11 Basic Service Set (Radio Cell). The BSS of an AP comprises of the stations directly associating with the AP. CW Contention Window. It is the time period between radio signal collisions caused by simultaneous broadcast from multiple wireless stations. The contention window is used to compute the random backoff of the radio broadcast. The IEEE 802.11b does not specify the unit for the time period. CWP Factor Contention Window Persistence Factor. It indicates the factor used in computing new CW values on every 15 unsuccessful attempt to transmit an MPDU or an MMPDU of a traffic class. It is a scaling factor in units of 1/16ths. IFS Inter-Frame Space is the time interval between frames. A STA shall determine that the medium is idle through the use of the carrier sense function for the interval specified. In other words, the size of the IFS determines the length of the backoff time interval of a device to the medium. In this case, the medium is the radio wave spectrum. The IEEE 802.11b standard does not specify any unit for the time interval. BSS IEEE 802.11 Basic Service Set (Radio Cell). The MAC Medium Access Control. Layer 2 in the network model. MPDU MAC protocol data unit. The unit of data exchanged between two peer MAC entities using the services of the physical layer (PHY). MMPDU Management type MAC protocol data unit. MSDU MAC service data unit. Information that is delivered as a unit between MAC service access points. QBSS Quality of service basic service set. QSTA QoS station. STA (WSTA) A non-AP IEEE 802.11 wireless station.')
cisco_dot11_qos_mib_notifs = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 0))
cisco_dot11_qos_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1))
cisco_dot11_qos_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 2))
cisco_dot11_qos_config = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1))
cisco_dot11_qos_queue = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2))
cisco_dot11_qos_statistics = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3))
cisco_dot11_qos_notif_control = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 4))
class Cdot11Qostrafficclass(TextualConvention, Integer32):
reference = 'IEEE 802.1D-1998, Annex H.2.10 and IEEE 802.11E-2001, section 7.5.1.'
description = 'This textual convention defines the 802.11E traffic classes: background(0) - background traffic, lowest priority bestEffort(1) - best effort delivery, default priority class for all traffic video(2) - video traffic, 2nd highest priority voice(3) - voice traffic, highest priority.'
status = 'current'
subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2, 3))
named_values = named_values(('background', 0), ('bestEffort', 1), ('video', 2), ('voice', 3))
cdot11_qos_config_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1))
if mibBuilder.loadTexts:
cdot11QosConfigTable.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosConfigTable.setDescription('This table contains the basic set of attributes to configure QoS queues for radio interfaces of a wireless LAN device. This table has an expansion dependent relationship with the ifTable. Each IEEE 802.11 wireless interface has different outbound queues for different network traffic class. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11_qos_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'CISCO-DOT11-QOS-MIB', 'cdot11TrafficQueue'))
if mibBuilder.loadTexts:
cdot11QosConfigEntry.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosConfigEntry.setDescription('Each entry contains parameters to configure traffic contention window, AIFS, priority and MSDU lifetime for each traffic queue on an IEEE 802.11 interface.')
cdot11_traffic_queue = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 1), unsigned32())
if mibBuilder.loadTexts:
cdot11TrafficQueue.setStatus('current')
if mibBuilder.loadTexts:
cdot11TrafficQueue.setDescription('This is the index to the outbound traffic queue on the radio interface.')
cdot11_traffic_class = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 2), cdot11_qos_traffic_class()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11TrafficClass.setStatus('current')
if mibBuilder.loadTexts:
cdot11TrafficClass.setDescription('This object specifies the traffic class and priority for the traffic on this queue.')
cdot11_qos_c_wmin = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 10))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cdot11QosCWmin.setReference('dot11CWmin, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosCWmin.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosCWmin.setDescription('This object defines the minimum contention window value for a traffic class. The minimum contention window is 2 to the power of cdot11QosCWmin minus 1, and that is from 0 to 1023. The cdot11QosCWmin value must be less than or equal to cdot11QosCWmax.')
cdot11_qos_c_wmax = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 10))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cdot11QosCWmax.setReference('dot11CWmax, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosCWmax.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosCWmax.setDescription('This object defines the maximum contention window value for a traffic class. The maximum contention window is 2 to the power of cdot11QosCWmax minus 1, and that is from 0 to 1023. The cdot11QosCWmax value must be greater than or equal to cdot11QosCWmin.')
cdot11_qos_backoff_offset = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 5), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 20))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cdot11QosBackoffOffset.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosBackoffOffset.setDescription('This specifies the offset of the radio backoff from the transmission media for this traffic class. The backoff interval of a radio is calculated from a pseudo random integer drawn from a uniform distribution over the interval determined by the maximum and minimum of the contention window.')
cdot11_qos_max_retry = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 1, 1, 6), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cdot11QosMaxRetry.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosMaxRetry.setDescription('This specifies the number of times the radio retries for a particular transmission if there is a collision for the media.')
cdot11_qos_support_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2))
if mibBuilder.loadTexts:
cdot11QosSupportTable.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosSupportTable.setDescription('This table contains the attributes indicating QoS support information on the IEEE 802.11 interfaces of this device. This table has a sparse dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11_qos_support_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'))
if mibBuilder.loadTexts:
cdot11QosSupportEntry.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosSupportEntry.setDescription('Each entry contains attributes to indicate if QoS and priority queue are supported for an IEEE 802.11 interface.')
cdot11_qos_option_implemented = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2, 1, 1), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosOptionImplemented.setReference('dot11QosOptionImplemented, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosOptionImplemented.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosOptionImplemented.setDescription('This object indicates if QoS is implemented on this IEEE 802.11 network interface.')
cdot11_qos_option_enabled = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2, 1, 2), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosOptionEnabled.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosOptionEnabled.setDescription("This object indicates if QoS is enabled on this IEEE 802.11 network interface. If it is 'true', QoS queuing is ON and traffic are prioritized according to their traffic class. If it is 'false', there is no QoS queuing and traffic are not prioritized.")
cdot11_qos_queues_available = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 2, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(4, 64))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosQueuesAvailable.setReference('dot11QueuesAvailable, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosQueuesAvailable.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosQueuesAvailable.setDescription('This object shows the number of QoS priority queues are available on this IEEE 802.11 network interface. That is the number of queue per interface in the cdot11QosConfigTable.')
cdot11_qos_queue_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1))
if mibBuilder.loadTexts:
cdot11QosQueueTable.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosQueueTable.setDescription('This table contains the queue weight and size information and statistics for each traffic queue on each the IEEE 802.11 interface. This table has a sparse dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11_qos_queue_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'CISCO-DOT11-QOS-MIB', 'cdot11TrafficQueue'))
if mibBuilder.loadTexts:
cdot11QosQueueEntry.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosQueueEntry.setDescription('Each entry contains the current queue weight, size, and peak size information for each traffic queue on an IEEE 802.11 interface.')
cdot11_qos_queue_quota = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosQueueQuota.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosQueueQuota.setDescription('This is the current QoS priority queue packet quota for this queue on the overall bandwidth. The total available quota is platform dependent and is shared among all the transmitting queues. The queue with the largest quota value has the largest share of the overall bandwidth of the radio. The quota is allocated by the radio driver dynamically.')
cdot11_qos_queue_size = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1, 1, 2), gauge32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosQueueSize.setReference('dot11QueueSizeTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosQueueSize.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosQueueSize.setDescription('This is the current QoS priority queue size for this queue.')
cdot11_qos_queue_peak_size = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 2, 1, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosQueuePeakSize.setReference('dot11QueuePeakSizeTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosQueuePeakSize.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosQueuePeakSize.setDescription('This is the peak QoS priority queue size for this queue.')
cdot11_qos_statistics_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1))
if mibBuilder.loadTexts:
cdot11QosStatisticsTable.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosStatisticsTable.setDescription('This table contains the QoS statistics by traffic queue on each the IEEE 802.11 network interface. This table has a expansion dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11_qos_statistics_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'CISCO-DOT11-QOS-MIB', 'cdot11TrafficQueue'))
if mibBuilder.loadTexts:
cdot11QosStatisticsEntry.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosStatisticsEntry.setDescription('Each entry contain QoS statistics for data transmission and receive for each traffic queue on an IEEE 802.11 interface.')
cdot11_qos_discarded_frames = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 1), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosDiscardedFrames.setReference('dot11QosDiscardedFrameCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosDiscardedFrames.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosDiscardedFrames.setDescription('This is the counter for QoS discarded frames transmitting from this IEEE 802.11 interface for the traffic queue.')
cdot11_qos_fails = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 2), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosFails.setReference('dot11QosFailedCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosFails.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosFails.setDescription('This is the counter for QoS failures on this IEEE 802.11 interface for the traffic queue.')
cdot11_qos_retries = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 3), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosRetries.setReference('dot11QosRetryCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosRetries.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosRetries.setDescription('This is the counter for QoS retries performed on this IEEE 802.11 interface for the traffic queue.')
cdot11_qos_mutiple_retries = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 4), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosMutipleRetries.setReference('dot11QosMutipleRetryCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosMutipleRetries.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosMutipleRetries.setDescription('This is the counter for QoS multiple retries performed on this IEEE 802.11 interface for the traffic queue.')
cdot11_qos_transmitted_frames = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 1, 1, 5), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosTransmittedFrames.setReference('dot11QosTransmittedFrameCountTC, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosTransmittedFrames.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosTransmittedFrames.setDescription('This is the counter for QoS frames transmitted from this IEEE 802.11 interface for the traffic queue.')
cdot11_qos_if_statistics_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 2))
if mibBuilder.loadTexts:
cdot11QosIfStatisticsTable.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosIfStatisticsTable.setDescription('This table contains the attributes indicating QoS statistics on the IEEE 802.11 interfaces of the device. This table has a sparse dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11_qos_if_statistics_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 2, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'))
if mibBuilder.loadTexts:
cdot11QosIfStatisticsEntry.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosIfStatisticsEntry.setDescription('Each entry contains attributes to support QoS statistics on an IEEE 802.11 interface.')
cdot11_qos_if_discarded_fragments = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 3, 2, 1, 1), counter32()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosIfDiscardedFragments.setReference('dot11QosDiscardedFragments, IEEE 802.11E-2001/D1.')
if mibBuilder.loadTexts:
cdot11QosIfDiscardedFragments.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosIfDiscardedFragments.setDescription('This object counts the number of QoS discarded transmitting fragments on this radio interface.')
cdot11_qos_if_vlan_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 3))
if mibBuilder.loadTexts:
cdot11QosIfVlanTable.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosIfVlanTable.setDescription('This table maps VLANs to different traffic classes and defines their QoS properties. This table has an expansion dependent relationship with the ifTable. For each entry in this table, there exists an entry in the ifTable of ifType ieee80211(71).')
cdot11_qos_if_vlan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 3, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'CISCO-DOT11-QOS-MIB', 'cdot11QosIfVlanId'))
if mibBuilder.loadTexts:
cdot11QosIfVlanEntry.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosIfVlanEntry.setDescription('Each entry defines parameters determining the traffic class and QoS configuration of a VLAN.')
cdot11_qos_if_vlan_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 3, 1, 1), c_dot11_if_vlan_id_or_zero().subtype(subtypeSpec=value_range_constraint(1, 4095)))
if mibBuilder.loadTexts:
cdot11QosIfVlanId.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosIfVlanId.setDescription('This object identifies the VLAN (1 to 4095) on this radio interface.')
cdot11_qos_if_vlan_traffic_class = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 1, 3, 1, 2), cdot11_qos_traffic_class()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
cdot11QosIfVlanTrafficClass.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosIfVlanTrafficClass.setDescription('This is the QoS traffic class for the traffic transmitting on this VLAN. The traffic class determines the priority for the VLAN.')
cdot11_qos_notif_enabled = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 416, 1, 4, 1), truth_value().clone('false')).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
cdot11QosNotifEnabled.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosNotifEnabled.setDescription('Indicates whether cdot11QosChangeNotif notification will or will not be sent by the agent when the QoS configuration in the cdot11QosConfigTable is changed.')
cdot11_qos_change_notif = notification_type((1, 3, 6, 1, 4, 1, 9, 9, 416, 0, 1)).setObjects(('CISCO-DOT11-QOS-MIB', 'cdot11TrafficClass'))
if mibBuilder.loadTexts:
cdot11QosChangeNotif.setStatus('current')
if mibBuilder.loadTexts:
cdot11QosChangeNotif.setDescription('This notification will be sent when the QoS configuration in the cdot11QosConfigTable is changed. The object cdot11TrafficClass specifies the traffic class of which a queue is configured. The sending of these notifications can be enabled or disabled via cdot11QosNotifEnabled.')
cisco_dot11_qos_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 1))
cisco_dot11_qos_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2))
cisco_dot11_qos_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 1, 1)).setObjects(('CISCO-DOT11-QOS-MIB', 'ciscoDot11QosConfigGroup'), ('CISCO-DOT11-QOS-MIB', 'ciscoDot11QosStatsGroup'), ('CISCO-DOT11-QOS-MIB', 'ciscoDot11QosNotifControlGroup'), ('CISCO-DOT11-QOS-MIB', 'ciscoDot11QosNotificationGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_dot11_qos_mib_compliance = ciscoDot11QosMIBCompliance.setStatus('current')
if mibBuilder.loadTexts:
ciscoDot11QosMIBCompliance.setDescription('The compliance statement for the configuration and status groups.')
cisco_dot11_qos_config_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2, 1)).setObjects(('CISCO-DOT11-QOS-MIB', 'cdot11TrafficClass'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosCWmin'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosCWmax'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosBackoffOffset'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosMaxRetry'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosOptionImplemented'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosOptionEnabled'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosQueuesAvailable'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosQueueQuota'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosQueueSize'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosQueuePeakSize'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosIfVlanTrafficClass'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_dot11_qos_config_group = ciscoDot11QosConfigGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoDot11QosConfigGroup.setDescription('Configurations for IEEE 802.11 QoS.')
cisco_dot11_qos_stats_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2, 2)).setObjects(('CISCO-DOT11-QOS-MIB', 'cdot11QosIfDiscardedFragments'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosDiscardedFrames'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosFails'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosRetries'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosMutipleRetries'), ('CISCO-DOT11-QOS-MIB', 'cdot11QosTransmittedFrames'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_dot11_qos_stats_group = ciscoDot11QosStatsGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoDot11QosStatsGroup.setDescription('Status and statistics for IEEE 802.11 QoS.')
cisco_dot11_qos_notif_control_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2, 3)).setObjects(('CISCO-DOT11-QOS-MIB', 'cdot11QosNotifEnabled'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_dot11_qos_notif_control_group = ciscoDot11QosNotifControlGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoDot11QosNotifControlGroup.setDescription('Notification control configuration for QoS.')
cisco_dot11_qos_notification_group = notification_group((1, 3, 6, 1, 4, 1, 9, 9, 416, 2, 2, 4)).setObjects(('CISCO-DOT11-QOS-MIB', 'cdot11QosChangeNotif'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_dot11_qos_notification_group = ciscoDot11QosNotificationGroup.setStatus('current')
if mibBuilder.loadTexts:
ciscoDot11QosNotificationGroup.setDescription('Notifications for QoS configuration.')
mibBuilder.exportSymbols('CISCO-DOT11-QOS-MIB', PYSNMP_MODULE_ID=ciscoDot11QosMIB, cdot11QosQueueTable=cdot11QosQueueTable, cdot11QosCWmin=cdot11QosCWmin, ciscoDot11QosMIBObjects=ciscoDot11QosMIBObjects, cdot11QosIfVlanTable=cdot11QosIfVlanTable, cdot11QosIfVlanId=cdot11QosIfVlanId, cdot11QosStatisticsTable=cdot11QosStatisticsTable, ciscoDot11QosQueue=ciscoDot11QosQueue, ciscoDot11QosStatistics=ciscoDot11QosStatistics, cdot11QosRetries=cdot11QosRetries, cdot11QosQueuesAvailable=cdot11QosQueuesAvailable, cdot11QosFails=cdot11QosFails, cdot11QosOptionEnabled=cdot11QosOptionEnabled, cdot11QosStatisticsEntry=cdot11QosStatisticsEntry, cdot11TrafficQueue=cdot11TrafficQueue, ciscoDot11QosMIBCompliance=ciscoDot11QosMIBCompliance, ciscoDot11QosMIBCompliances=ciscoDot11QosMIBCompliances, cdot11QosIfStatisticsTable=cdot11QosIfStatisticsTable, cdot11QosIfDiscardedFragments=cdot11QosIfDiscardedFragments, cdot11QosMaxRetry=cdot11QosMaxRetry, cdot11QosMutipleRetries=cdot11QosMutipleRetries, ciscoDot11QosMIB=ciscoDot11QosMIB, cdot11QosQueueQuota=cdot11QosQueueQuota, ciscoDot11QosMIBConformance=ciscoDot11QosMIBConformance, cdot11QosConfigTable=cdot11QosConfigTable, cdot11QosCWmax=cdot11QosCWmax, cdot11QosConfigEntry=cdot11QosConfigEntry, cdot11QosQueueSize=cdot11QosQueueSize, cdot11QosIfVlanEntry=cdot11QosIfVlanEntry, cdot11TrafficClass=cdot11TrafficClass, ciscoDot11QosStatsGroup=ciscoDot11QosStatsGroup, ciscoDot11QosConfig=ciscoDot11QosConfig, ciscoDot11QosNotifControl=ciscoDot11QosNotifControl, cdot11QosSupportEntry=cdot11QosSupportEntry, cdot11QosSupportTable=cdot11QosSupportTable, ciscoDot11QosMIBGroups=ciscoDot11QosMIBGroups, cdot11QosBackoffOffset=cdot11QosBackoffOffset, ciscoDot11QosConfigGroup=ciscoDot11QosConfigGroup, cdot11QosTransmittedFrames=cdot11QosTransmittedFrames, cdot11QosQueueEntry=cdot11QosQueueEntry, ciscoDot11QosNotifControlGroup=ciscoDot11QosNotifControlGroup, ciscoDot11QosNotificationGroup=ciscoDot11QosNotificationGroup, ciscoDot11QosMIBNotifs=ciscoDot11QosMIBNotifs, cdot11QosIfStatisticsEntry=cdot11QosIfStatisticsEntry, cdot11QosNotifEnabled=cdot11QosNotifEnabled, cdot11QosChangeNotif=cdot11QosChangeNotif, cdot11QosOptionImplemented=cdot11QosOptionImplemented, cdot11QosIfVlanTrafficClass=cdot11QosIfVlanTrafficClass, Cdot11QosTrafficClass=Cdot11QosTrafficClass, cdot11QosQueuePeakSize=cdot11QosQueuePeakSize, cdot11QosDiscardedFrames=cdot11QosDiscardedFrames) |
"""
Next lexicographical permutation algorithm
https://www.nayuki.io/page/next-lexicographical-permutation-algorithm
"""
def next_lexo(S):
b = S[-1]
for i, a in enumerate(reversed(S[:-1]), 2):
if a < b:
# we have the pivot a
for j, b in enumerate(reversed(S), 1):
if b > a:
F = list(S)
F[-i], F[-j] = F[-j], F[-i]
F = F[: -i + 1] + sorted(F[-i + 1 :])
return "".join(F)
else:
b = a
return "no answer"
| """
Next lexicographical permutation algorithm
https://www.nayuki.io/page/next-lexicographical-permutation-algorithm
"""
def next_lexo(S):
b = S[-1]
for (i, a) in enumerate(reversed(S[:-1]), 2):
if a < b:
for (j, b) in enumerate(reversed(S), 1):
if b > a:
f = list(S)
(F[-i], F[-j]) = (F[-j], F[-i])
f = F[:-i + 1] + sorted(F[-i + 1:])
return ''.join(F)
else:
b = a
return 'no answer' |
def hamming(n):
"""Returns the nth hamming number"""
hamming = {1}
x = 1
while len(hamming) <= n * 3.5:
new_hamming = {1}
for i in hamming:
new_hamming.add(i * 2)
new_hamming.add(i * 3)
new_hamming.add(i * 5)
# merge new number into hamming set
hamming = hamming.union(new_hamming)
hamming = sorted(list(hamming))
return hamming[n - 1]
print(hamming(970))
# hamming(968) should be 41943040
# hamming(969) should be 41990400
# hamming(970) should be 42187500
| def hamming(n):
"""Returns the nth hamming number"""
hamming = {1}
x = 1
while len(hamming) <= n * 3.5:
new_hamming = {1}
for i in hamming:
new_hamming.add(i * 2)
new_hamming.add(i * 3)
new_hamming.add(i * 5)
hamming = hamming.union(new_hamming)
hamming = sorted(list(hamming))
return hamming[n - 1]
print(hamming(970)) |
'''
Created on Jan 18, 2018
@author: riteshagarwal
'''
java = False
rest = False
cli = False | """
Created on Jan 18, 2018
@author: riteshagarwal
"""
java = False
rest = False
cli = False |
async def handler(context):
return await context.data
| async def handler(context):
return await context.data |
def default_evaluator(model, X_test, y_test):
"""A simple evaluator that takes in a model,
and a test set, and returns the loss.
Args:
model: The model to evaluate.
X_test: The features matrix of the test set.
y_test: The one-hot labels matrix of the test set.
Returns:
The loss on the test set.
"""
return model.evaluate(X_test, y_test, verbose=0)[0]
| def default_evaluator(model, X_test, y_test):
"""A simple evaluator that takes in a model,
and a test set, and returns the loss.
Args:
model: The model to evaluate.
X_test: The features matrix of the test set.
y_test: The one-hot labels matrix of the test set.
Returns:
The loss on the test set.
"""
return model.evaluate(X_test, y_test, verbose=0)[0] |
class APIError(Exception):
"""
Base exception for the API app
"""
pass
class APIResourcePatternError(APIError):
"""
Raised when an app tries to override an existing URL regular expression
pattern
"""
pass
| class Apierror(Exception):
"""
Base exception for the API app
"""
pass
class Apiresourcepatternerror(APIError):
"""
Raised when an app tries to override an existing URL regular expression
pattern
"""
pass |
dataset_type = 'UNITER_VqaDataset'
data_root = '/home/datasets/mix_data/UNITER/VQA/'
train_datasets = ['train']
test_datasets = ['minival'] # name not in use, but have defined one to run
vqa_cfg = dict(
train_txt_dbs=[
data_root + 'vqa_train.db',
data_root + 'vqa_trainval.db',
data_root + 'vqa_vg.db',
],
train_img_dbs=[
data_root + 'coco_train2014/',
data_root + 'coco_val2014',
data_root + 'vg/',
],
val_txt_db=data_root + 'vqa_devval.db',
val_img_db=data_root + 'coco_val2014/',
ans2label_file=data_root + 'ans2label.json',
max_txt_len=60,
conf_th=0.2,
max_bb=100,
min_bb=10,
num_bb=36,
train_batch_size=20480, # 5120,
val_batch_size=40960, # 10240,
)
BUCKET_SIZE = 8192
train_data = dict(
samples_per_gpu=vqa_cfg['train_batch_size'],
workers_per_gpu=4,
pin_memory=True,
batch_sampler=dict(
type='TokenBucketSampler',
bucket_size=BUCKET_SIZE,
batch_size=vqa_cfg['train_batch_size'],
drop_last=True,
size_multiple=8,
),
data=dict(
type=dataset_type,
datacfg=vqa_cfg,
train_or_val=True,
),
)
test_data = dict(
samples_per_gpu=vqa_cfg['val_batch_size'],
workers_per_gpu=4,
batch_sampler=dict(
type='TokenBucketSampler',
bucket_size=BUCKET_SIZE,
batch_size=vqa_cfg['val_batch_size'],
drop_last=False,
size_multiple=8,
),
pin_memory=True,
data=dict(
type=dataset_type,
datacfg=vqa_cfg,
train_or_val=False,
),
)
post_processor = dict(
type='Evaluator',
metrics=[dict(type='UNITER_AccuracyMetric')],
dataset_converters=[dict(type='UNITER_DatasetConverter')],
)
| dataset_type = 'UNITER_VqaDataset'
data_root = '/home/datasets/mix_data/UNITER/VQA/'
train_datasets = ['train']
test_datasets = ['minival']
vqa_cfg = dict(train_txt_dbs=[data_root + 'vqa_train.db', data_root + 'vqa_trainval.db', data_root + 'vqa_vg.db'], train_img_dbs=[data_root + 'coco_train2014/', data_root + 'coco_val2014', data_root + 'vg/'], val_txt_db=data_root + 'vqa_devval.db', val_img_db=data_root + 'coco_val2014/', ans2label_file=data_root + 'ans2label.json', max_txt_len=60, conf_th=0.2, max_bb=100, min_bb=10, num_bb=36, train_batch_size=20480, val_batch_size=40960)
bucket_size = 8192
train_data = dict(samples_per_gpu=vqa_cfg['train_batch_size'], workers_per_gpu=4, pin_memory=True, batch_sampler=dict(type='TokenBucketSampler', bucket_size=BUCKET_SIZE, batch_size=vqa_cfg['train_batch_size'], drop_last=True, size_multiple=8), data=dict(type=dataset_type, datacfg=vqa_cfg, train_or_val=True))
test_data = dict(samples_per_gpu=vqa_cfg['val_batch_size'], workers_per_gpu=4, batch_sampler=dict(type='TokenBucketSampler', bucket_size=BUCKET_SIZE, batch_size=vqa_cfg['val_batch_size'], drop_last=False, size_multiple=8), pin_memory=True, data=dict(type=dataset_type, datacfg=vqa_cfg, train_or_val=False))
post_processor = dict(type='Evaluator', metrics=[dict(type='UNITER_AccuracyMetric')], dataset_converters=[dict(type='UNITER_DatasetConverter')]) |
# Debug print levels for fine-grained debug trace output control
DNFQUEUE = (1 << 0) # netfilterqueue
DGENPKT = (1 << 1) # Generic packet handling
DGENPKTV = (1 << 2) # Generic packet handling with TCP analysis
DCB = (1 << 3) # Packet handlign callbacks
DPROCFS = (1 << 4) # procfs
DIPTBLS = (1 << 5) # iptables
DNONLOC = (1 << 6) # Nonlocal-destined datagrams
DDPF = (1 << 7) # DPF (Dynamic Port Forwarding)
DDPFV = (1 << 8) # DPF (Dynamic Port Forwarding) Verbose
DIPNAT = (1 << 9) # IP redirection for nonlocal-destined datagrams
DMANGLE = (1 << 10) # Packet mangling
DPCAP = (1 << 11) # Pcap write logic
DIGN = (1 << 12) # Packet redirect ignore conditions
DFTP = (1 << 13) # FTP checks
DMISC = (1 << 27) # Miscellaneous
DCOMP = 0x0fffffff # Component mask
DFLAG = 0xf0000000 # Flag mask
DEVERY = 0x0fffffff # Log everything, low verbosity
DEVERY2 = 0x8fffffff # Log everything, complete verbosity
DLABELS = {
DNFQUEUE: 'NFQUEUE',
DGENPKT: 'GENPKT',
DGENPKTV: 'GENPKTV',
DCB: 'CB',
DPROCFS: 'PROCFS',
DIPTBLS: 'IPTABLES',
DNONLOC: 'NONLOC',
DDPF: 'DPF',
DDPFV: 'DPFV',
DIPNAT: 'IPNAT',
DMANGLE: 'MANGLE',
DPCAP: 'PCAP',
DIGN: 'IGN',
DFTP: 'FTP',
DIGN | DFTP: 'IGN-FTP',
DMISC: 'MISC',
}
DLABELS_INV = {v.upper(): k for k, v in DLABELS.items()}
| dnfqueue = 1 << 0
dgenpkt = 1 << 1
dgenpktv = 1 << 2
dcb = 1 << 3
dprocfs = 1 << 4
diptbls = 1 << 5
dnonloc = 1 << 6
ddpf = 1 << 7
ddpfv = 1 << 8
dipnat = 1 << 9
dmangle = 1 << 10
dpcap = 1 << 11
dign = 1 << 12
dftp = 1 << 13
dmisc = 1 << 27
dcomp = 268435455
dflag = 4026531840
devery = 268435455
devery2 = 2415919103
dlabels = {DNFQUEUE: 'NFQUEUE', DGENPKT: 'GENPKT', DGENPKTV: 'GENPKTV', DCB: 'CB', DPROCFS: 'PROCFS', DIPTBLS: 'IPTABLES', DNONLOC: 'NONLOC', DDPF: 'DPF', DDPFV: 'DPFV', DIPNAT: 'IPNAT', DMANGLE: 'MANGLE', DPCAP: 'PCAP', DIGN: 'IGN', DFTP: 'FTP', DIGN | DFTP: 'IGN-FTP', DMISC: 'MISC'}
dlabels_inv = {v.upper(): k for (k, v) in DLABELS.items()} |
"""
Module: 'display' on M5 FlowUI v1.4.0-beta
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-284-g5d8e1c867 on 2019-08-30', machine='ESP32 module with ESP32')
# Stubber: 1.3.1
class TFT:
''
BLACK = 0
BLUE = 255
BMP = 2
BOTTOM = -9004
CENTER = -9003
COLOR_BITS16 = 16
COLOR_BITS24 = 24
CYAN = 65535
DARKCYAN = 32896
DARKGREEN = 32768
DARKGREY = 8421504
FONT_7seg = 9
FONT_Comic = 4
FONT_Default = 0
FONT_DefaultSmall = 8
FONT_DejaVu18 = 1
FONT_DejaVu24 = 2
FONT_DejaVu40 = 11
FONT_DejaVu56 = 12
FONT_DejaVu72 = 13
FONT_Minya = 5
FONT_Small = 7
FONT_Tooney = 6
FONT_Ubuntu = 3
GREEN = 65280
GREENYELLOW = 11336748
HSPI = 1
JPG = 1
LANDSCAPE = 1
LANDSCAPE_FLIP = 3
LASTX = 7000
LASTY = 8000
LIGHTGREY = 12632256
M5STACK = 6
MAGENTA = 16515327
MAROON = 8388608
NAVY = 128
OLIVE = 8421376
ORANGE = 16557056
PINK = 16564426
PORTRAIT = 0
PORTRAIT_FLIP = 2
PURPLE = 8388736
RED = 16515072
RIGHT = -9004
VSPI = 2
WHITE = 16579836
YELLOW = 16579584
def arc():
pass
def attrib7seg():
pass
def backlight():
pass
def circle():
pass
def clear():
pass
def clearwin():
pass
def compileFont():
pass
def deinit():
pass
def drawCircle():
pass
def drawLine():
pass
def drawPixel():
pass
def drawRect():
pass
def drawRoundRect():
pass
def drawTriangle():
pass
def ellipse():
pass
def fill():
pass
def fillCircle():
pass
def fillRect():
pass
def fillRoundRect():
pass
def fillScreen():
pass
def fillTriangle():
pass
def font():
pass
def fontSize():
pass
def getCursor():
pass
def get_bg():
pass
def get_fg():
pass
def hsb2rgb():
pass
def image():
pass
def init():
pass
def line():
pass
def lineByAngle():
pass
def orient():
pass
def pixel():
pass
def polygon():
pass
def print():
pass
def println():
pass
def qrcode():
pass
def rect():
pass
def resetwin():
pass
def restorewin():
pass
def roundrect():
pass
def savewin():
pass
def screensize():
pass
def setBrightness():
pass
def setColor():
pass
def setCursor():
pass
def setRotation():
pass
def setTextColor():
pass
def set_bg():
pass
def set_fg():
pass
def setwin():
pass
def text():
pass
def textClear():
pass
def textWidth():
pass
def text_x():
pass
def text_y():
pass
def tft_deselect():
pass
def tft_readcmd():
pass
def tft_select():
pass
def tft_setspeed():
pass
def tft_writecmd():
pass
def tft_writecmddata():
pass
def triangle():
pass
def winsize():
pass
| """
Module: 'display' on M5 FlowUI v1.4.0-beta
"""
class Tft:
""""""
black = 0
blue = 255
bmp = 2
bottom = -9004
center = -9003
color_bits16 = 16
color_bits24 = 24
cyan = 65535
darkcyan = 32896
darkgreen = 32768
darkgrey = 8421504
font_7seg = 9
font__comic = 4
font__default = 0
font__default_small = 8
font__deja_vu18 = 1
font__deja_vu24 = 2
font__deja_vu40 = 11
font__deja_vu56 = 12
font__deja_vu72 = 13
font__minya = 5
font__small = 7
font__tooney = 6
font__ubuntu = 3
green = 65280
greenyellow = 11336748
hspi = 1
jpg = 1
landscape = 1
landscape_flip = 3
lastx = 7000
lasty = 8000
lightgrey = 12632256
m5_stack = 6
magenta = 16515327
maroon = 8388608
navy = 128
olive = 8421376
orange = 16557056
pink = 16564426
portrait = 0
portrait_flip = 2
purple = 8388736
red = 16515072
right = -9004
vspi = 2
white = 16579836
yellow = 16579584
def arc():
pass
def attrib7seg():
pass
def backlight():
pass
def circle():
pass
def clear():
pass
def clearwin():
pass
def compile_font():
pass
def deinit():
pass
def draw_circle():
pass
def draw_line():
pass
def draw_pixel():
pass
def draw_rect():
pass
def draw_round_rect():
pass
def draw_triangle():
pass
def ellipse():
pass
def fill():
pass
def fill_circle():
pass
def fill_rect():
pass
def fill_round_rect():
pass
def fill_screen():
pass
def fill_triangle():
pass
def font():
pass
def font_size():
pass
def get_cursor():
pass
def get_bg():
pass
def get_fg():
pass
def hsb2rgb():
pass
def image():
pass
def init():
pass
def line():
pass
def line_by_angle():
pass
def orient():
pass
def pixel():
pass
def polygon():
pass
def print():
pass
def println():
pass
def qrcode():
pass
def rect():
pass
def resetwin():
pass
def restorewin():
pass
def roundrect():
pass
def savewin():
pass
def screensize():
pass
def set_brightness():
pass
def set_color():
pass
def set_cursor():
pass
def set_rotation():
pass
def set_text_color():
pass
def set_bg():
pass
def set_fg():
pass
def setwin():
pass
def text():
pass
def text_clear():
pass
def text_width():
pass
def text_x():
pass
def text_y():
pass
def tft_deselect():
pass
def tft_readcmd():
pass
def tft_select():
pass
def tft_setspeed():
pass
def tft_writecmd():
pass
def tft_writecmddata():
pass
def triangle():
pass
def winsize():
pass |
types_of_people = 10
x = f"There are {types_of_people} types of people."
binary = "binary"
do_not = "don't"
y = f"Those who know {binary} and those who {do_not}."
print(x)
print(y)
print(f"I said: {x}")
print(f"I also said: '{y}'")
hilarious = False
joke_evaluation = "Isn't that joke so funny?! {}"
print(joke_evaluation.format(hilarious))
w="This is the left side of..."
e="a string with a right side."
print(w + e)
| types_of_people = 10
x = f'There are {types_of_people} types of people.'
binary = 'binary'
do_not = "don't"
y = f'Those who know {binary} and those who {do_not}.'
print(x)
print(y)
print(f'I said: {x}')
print(f"I also said: '{y}'")
hilarious = False
joke_evaluation = "Isn't that joke so funny?! {}"
print(joke_evaluation.format(hilarious))
w = 'This is the left side of...'
e = 'a string with a right side.'
print(w + e) |
class LineSegment3D(object):
"""A class to represent a 3D line segment."""
def __init__(self, p1, p2):
"""Initialize with two endpoints."""
if p1 > p2:
p1, p2 = (p2, p1)
self.p1 = p1
self.p2 = p2
self.count = 1
def __len__(self):
"""Line segment always has two endpoints."""
return 2
def __iter__(self):
"""Iterator generator for endpoints."""
yield self.p1
yield self.p2
def __getitem__(self, idx):
"""Given a vertex number, returns a vertex coordinate vector."""
if idx == 0:
return self.p1
if idx == 1:
return self.p2
raise LookupError()
def __hash__(self):
"""Returns hash value for endpoints"""
return hash((self.p1, self.p2))
def __lt__(self, p):
return self < p
def __cmp__(self, p):
"""Compare points for sort ordering in an arbitrary heirarchy."""
val = self[0].__cmp__(p[0])
if val != 0:
return val
return self[1].__cmp__(p[1])
def __format__(self, fmt):
"""Provides .format() support."""
pfx = ""
sep = " - "
sfx = ""
if "a" in fmt:
pfx = "["
sep = ", "
sfx = "]"
elif "s" in fmt:
pfx = ""
sep = " "
sfx = ""
p1 = self.p1.__format__(fmt)
p2 = self.p2.__format__(fmt)
return pfx + p1 + sep + p2 + sfx
def __repr__(self):
"""Standard string representation."""
return "<LineSegment3D: {0}>".format(self)
def __str__(self):
"""Returns a human readable coordinate string."""
return "{0:a}".format(self)
def translate(self,offset):
"""Translate the endpoint's vertices"""
self.p1 = (self.p1[a] + offset[a] for a in range(3))
self.p2 = (self.p2[a] + offset[a] for a in range(3))
def scale(self,scale):
"""Translate the endpoint's vertices"""
self.p1 = (self.p1[a] * scale[a] for a in range(3))
self.p2 = (self.p2[a] * scale[a] for a in range(3))
def length(self):
"""Returns the length of the line."""
return self.p1.distFromPoint(self.p2)
class LineSegment3DCache(object):
"""Cache class for 3D Line Segments."""
def __init__(self):
"""Initialize as an empty cache."""
self.endhash = {}
self.seghash = {}
def _add_endpoint(self, p, seg):
"""Remember that this segment has a given endpoint"""
if p not in self.endhash:
self.endhash[p] = []
self.endhash[p].append(seg)
def rehash(self):
"""Reset the hashes for changed edge vertices"""
oldseghash = self.seghash
self.seghash = {
(v[0], v[1]): v
for v in oldseghash.values()
}
oldendhash = self.endhash
self.endhash = {
k: v
for v in oldendhash.values()
for k in v
}
def translate(self,offset):
"""Translate vertices of all edges."""
for v in self.seghash.values():
v.translate(offset)
self.rehash()
def scale(self,scale):
"""Scale vertices of all edges."""
for v in self.seghash.values():
v.scale(scale)
self.rehash()
def endpoint_segments(self, p):
"""get list of edges that end at point p"""
if p not in self.endhash:
return []
return self.endhash[p]
def get(self, p1, p2):
"""Given 2 endpoints, return the cached LineSegment3D inst, if any."""
key = (p1, p2) if p1 < p2 else (p2, p1)
if key not in self.seghash:
return None
return self.seghash[key]
def add(self, p1, p2):
"""Given 2 endpoints, return the (new or cached) LineSegment3D inst."""
key = (p1, p2) if p1 < p2 else (p2, p1)
if key in self.seghash:
seg = self.seghash[key]
seg.count += 1
return seg
seg = LineSegment3D(p1, p2)
self.seghash[key] = seg
self._add_endpoint(p1, seg)
self._add_endpoint(p2, seg)
return seg
def __iter__(self):
"""Creates an iterator for the line segments in the cache."""
for pt in self.seghash.values():
yield pt
def __len__(self):
"""Length of sequence."""
return len(self.seghash)
# vim: expandtab tabstop=4 shiftwidth=4 softtabstop=4 nowrap
| class Linesegment3D(object):
"""A class to represent a 3D line segment."""
def __init__(self, p1, p2):
"""Initialize with two endpoints."""
if p1 > p2:
(p1, p2) = (p2, p1)
self.p1 = p1
self.p2 = p2
self.count = 1
def __len__(self):
"""Line segment always has two endpoints."""
return 2
def __iter__(self):
"""Iterator generator for endpoints."""
yield self.p1
yield self.p2
def __getitem__(self, idx):
"""Given a vertex number, returns a vertex coordinate vector."""
if idx == 0:
return self.p1
if idx == 1:
return self.p2
raise lookup_error()
def __hash__(self):
"""Returns hash value for endpoints"""
return hash((self.p1, self.p2))
def __lt__(self, p):
return self < p
def __cmp__(self, p):
"""Compare points for sort ordering in an arbitrary heirarchy."""
val = self[0].__cmp__(p[0])
if val != 0:
return val
return self[1].__cmp__(p[1])
def __format__(self, fmt):
"""Provides .format() support."""
pfx = ''
sep = ' - '
sfx = ''
if 'a' in fmt:
pfx = '['
sep = ', '
sfx = ']'
elif 's' in fmt:
pfx = ''
sep = ' '
sfx = ''
p1 = self.p1.__format__(fmt)
p2 = self.p2.__format__(fmt)
return pfx + p1 + sep + p2 + sfx
def __repr__(self):
"""Standard string representation."""
return '<LineSegment3D: {0}>'.format(self)
def __str__(self):
"""Returns a human readable coordinate string."""
return '{0:a}'.format(self)
def translate(self, offset):
"""Translate the endpoint's vertices"""
self.p1 = (self.p1[a] + offset[a] for a in range(3))
self.p2 = (self.p2[a] + offset[a] for a in range(3))
def scale(self, scale):
"""Translate the endpoint's vertices"""
self.p1 = (self.p1[a] * scale[a] for a in range(3))
self.p2 = (self.p2[a] * scale[a] for a in range(3))
def length(self):
"""Returns the length of the line."""
return self.p1.distFromPoint(self.p2)
class Linesegment3Dcache(object):
"""Cache class for 3D Line Segments."""
def __init__(self):
"""Initialize as an empty cache."""
self.endhash = {}
self.seghash = {}
def _add_endpoint(self, p, seg):
"""Remember that this segment has a given endpoint"""
if p not in self.endhash:
self.endhash[p] = []
self.endhash[p].append(seg)
def rehash(self):
"""Reset the hashes for changed edge vertices"""
oldseghash = self.seghash
self.seghash = {(v[0], v[1]): v for v in oldseghash.values()}
oldendhash = self.endhash
self.endhash = {k: v for v in oldendhash.values() for k in v}
def translate(self, offset):
"""Translate vertices of all edges."""
for v in self.seghash.values():
v.translate(offset)
self.rehash()
def scale(self, scale):
"""Scale vertices of all edges."""
for v in self.seghash.values():
v.scale(scale)
self.rehash()
def endpoint_segments(self, p):
"""get list of edges that end at point p"""
if p not in self.endhash:
return []
return self.endhash[p]
def get(self, p1, p2):
"""Given 2 endpoints, return the cached LineSegment3D inst, if any."""
key = (p1, p2) if p1 < p2 else (p2, p1)
if key not in self.seghash:
return None
return self.seghash[key]
def add(self, p1, p2):
"""Given 2 endpoints, return the (new or cached) LineSegment3D inst."""
key = (p1, p2) if p1 < p2 else (p2, p1)
if key in self.seghash:
seg = self.seghash[key]
seg.count += 1
return seg
seg = line_segment3_d(p1, p2)
self.seghash[key] = seg
self._add_endpoint(p1, seg)
self._add_endpoint(p2, seg)
return seg
def __iter__(self):
"""Creates an iterator for the line segments in the cache."""
for pt in self.seghash.values():
yield pt
def __len__(self):
"""Length of sequence."""
return len(self.seghash) |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 3 19:26:47 2019
@author: sercangul
"""
n = 5
xy = [map(int, input().split()) for _ in range(n)]
sx, sy, sx2, sxy = map(sum, zip(*[(x, y, x**2, x * y) for x, y in xy]))
b = (n * sxy - sx * sy) / (n * sx2 - sx**2)
a = (sy / n) - b * (sx / n)
print('{:.3f}'.format(a + b * 80)) | """
Created on Mon Jun 3 19:26:47 2019
@author: sercangul
"""
n = 5
xy = [map(int, input().split()) for _ in range(n)]
(sx, sy, sx2, sxy) = map(sum, zip(*[(x, y, x ** 2, x * y) for (x, y) in xy]))
b = (n * sxy - sx * sy) / (n * sx2 - sx ** 2)
a = sy / n - b * (sx / n)
print('{:.3f}'.format(a + b * 80)) |
def create_array(n):
res=[]
i=1
while i<=n:
res.append(i)
i += 1
return res
| def create_array(n):
res = []
i = 1
while i <= n:
res.append(i)
i += 1
return res |
class Popularity:
'''
Popularity( length=20 )
Used to iteratively calculate the average overall popularity of an algorithm's recommendations.
Parameters
-----------
length : int
Coverage@length
training_df : dataframe
determines how many distinct item_ids there are in the training data
'''
def __init__(self, length=20, training_df=None):
self.length = length;
self.sum = 0
self.tests = 0
self.train_actions = len(training_df.index)
#group the data by the itemIds
grp = training_df.groupby('ItemId')
#count the occurence of every itemid in the trainingdataset
self.pop_scores = grp.size()
#sort it according to the score
self.pop_scores.sort_values(ascending=False, inplace=True)
#normalize
self.pop_scores = self.pop_scores / self.pop_scores[:1].values[0]
def add(self, result, next_items, for_item=0, session=0, pop_bin=None, position=None):
'''
Update the metric with a result set and the correct next item.
Result must be sorted correctly.
Parameters
--------
result: pandas.Series
Series of scores with the item id as the index
'''
#only keep the k- first predictions
recs = result[:self.length]
#take the unique values out of those top scorers
items = recs.index.unique()
self.sum += ( self.pop_scores[ items ].sum() / len( items ) )
self.tests += 1
def result(self):
'''
Return a tuple of a description string and the current averaged value
'''
return ("Popularity@" + str( self.length ) + ": "), ( self.sum / self.tests )
| class Popularity:
"""
Popularity( length=20 )
Used to iteratively calculate the average overall popularity of an algorithm's recommendations.
Parameters
-----------
length : int
Coverage@length
training_df : dataframe
determines how many distinct item_ids there are in the training data
"""
def __init__(self, length=20, training_df=None):
self.length = length
self.sum = 0
self.tests = 0
self.train_actions = len(training_df.index)
grp = training_df.groupby('ItemId')
self.pop_scores = grp.size()
self.pop_scores.sort_values(ascending=False, inplace=True)
self.pop_scores = self.pop_scores / self.pop_scores[:1].values[0]
def add(self, result, next_items, for_item=0, session=0, pop_bin=None, position=None):
"""
Update the metric with a result set and the correct next item.
Result must be sorted correctly.
Parameters
--------
result: pandas.Series
Series of scores with the item id as the index
"""
recs = result[:self.length]
items = recs.index.unique()
self.sum += self.pop_scores[items].sum() / len(items)
self.tests += 1
def result(self):
"""
Return a tuple of a description string and the current averaged value
"""
return ('Popularity@' + str(self.length) + ': ', self.sum / self.tests) |
def create_auction(self):
expected_http_status = '201 Created'
request_data = {"data": self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data)
self.assertEqual(response.status, expected_http_status)
def create_auction_check_minNumberOfQualifiedBids(self):
expected_minNumberOfQualifiedBids = 2
request_data = {"data": self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data)
self.assertEqual(response.json['data']['minNumberOfQualifiedBids'],
expected_minNumberOfQualifiedBids)
def create_auction_check_auctionParameters(self):
expected_auctionParameters = {'type': 'texas'}
request_data = {"data": self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data)
self.assertEqual(response.json['data']['auctionParameters'],
expected_auctionParameters)
def create_auction_invalid_auctionPeriod(self):
expected_http_status = '422 Unprocessable Entity'
auction = self.auction
auction.pop('auctionPeriod')
request_data = {"data": self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data, status=422)
self.assertEqual(response.status, expected_http_status)
entrypoint = '/auctions'
auction['auctionPeriod'] = {'startDate': None}
response = self.app.post_json(entrypoint, request_data, status=422)
self.assertEqual(response.status, expected_http_status)
def create_auction_dump(self):
request_data = {"data": self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data)
filename = 'docs/source/tutorial/create_auction.http'
self.dump(response.request, response, filename)
| def create_auction(self):
expected_http_status = '201 Created'
request_data = {'data': self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data)
self.assertEqual(response.status, expected_http_status)
def create_auction_check_min_number_of_qualified_bids(self):
expected_min_number_of_qualified_bids = 2
request_data = {'data': self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data)
self.assertEqual(response.json['data']['minNumberOfQualifiedBids'], expected_minNumberOfQualifiedBids)
def create_auction_check_auction_parameters(self):
expected_auction_parameters = {'type': 'texas'}
request_data = {'data': self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data)
self.assertEqual(response.json['data']['auctionParameters'], expected_auctionParameters)
def create_auction_invalid_auction_period(self):
expected_http_status = '422 Unprocessable Entity'
auction = self.auction
auction.pop('auctionPeriod')
request_data = {'data': self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data, status=422)
self.assertEqual(response.status, expected_http_status)
entrypoint = '/auctions'
auction['auctionPeriod'] = {'startDate': None}
response = self.app.post_json(entrypoint, request_data, status=422)
self.assertEqual(response.status, expected_http_status)
def create_auction_dump(self):
request_data = {'data': self.auction}
entrypoint = '/auctions'
response = self.app.post_json(entrypoint, request_data)
filename = 'docs/source/tutorial/create_auction.http'
self.dump(response.request, response, filename) |
#===========================================================================
#
# Crystalfontz Raspberry-Pi Python example library for FTDI / BridgeTek
# EVE graphic accelerators.
#
#---------------------------------------------------------------------------
#
# This file is part of the port/adaptation of existing C based EVE libraries
# to Python for Crystalfontz EVE based displays.
#
# 2021-10-20 Mark Williams / Crystalfontz America Inc.
# https:#www.crystalfontz.com/products/eve-accelerated-tft-displays.php
#---------------------------------------------------------------------------
#
# This is free and unencumbered software released into the public domain.
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
# For more information, please refer to <http:#unlicense.org/>
#
#============================================================================
#EVE Device Type
EVE_DEVICE = 811
# EVE Clock Speed
EVE_CLOCK_SPEED = 60000000
# Touch
TOUCH_RESISTIVE = False
TOUCH_CAPACITIVE = False
TOUCH_GOODIX_CAPACITIVE = False
# Define RGB output pins order, determined by PCB layout
LCD_SWIZZLE = 2
# Define active edge of PCLK. Observed by scope:
# 0: Data is put out coincident with falling edge of the clock.
# Rising edge of the clock is in the middle of the data.
# 1: Data is put out coincident with rising edge of the clock.
# Falling edge of the clock is in the middle of the data.
LCD_PCLKPOL = 0
# LCD drive strength: 0=5mA, 1=10mA
LCD_DRIVE_10MA = 0
# Spread Spectrum on RGB signals. Probably not a good idea at higher
# PCLK frequencies.
LCD_PCLK_CSPREAD = 0
#This is not a 24-bit display, so dither
LCD_DITHER = 0
# Pixel clock divisor
LCD_PCLK = 5
#----------------------------------------------------------------------------
# Frame_Rate = 60Hz / 16.7mS
#----------------------------------------------------------------------------
# Horizontal timing
# Target 60Hz frame rate, using the largest possible line time in order to
# maximize the time that the EVE has to process each line.
HPX = 240 # Horizontal Pixel Width
HSW = 10 # Horizontal Sync Width
HBP = 20 # Horizontal Back Porch
HFP = 10 # Horizontal Front Porch
HPP = 209 # Horizontal Pixel Padding
# FTDI needs at least 1 here
# Define the constants needed by the EVE based on the timing
# Active width of LCD display
LCD_WIDTH = HPX
# Start of horizontal sync pulse
LCD_HSYNC0 = HFP
# End of horizontal sync pulse
LCD_HSYNC1 = HFP+HSW
# Start of active line
LCD_HOFFSET = HFP+HSW+HBP
# Total number of clocks per line
LCD_HCYCLE = HPX+HFP+HSW+HBP+HPP
#----------------------------------------------------------------------------
# Vertical timing
VLH = 400 # Vertical Line Height
VS = 2 # Vertical Sync (in lines)
VBP = 2 # Vertical Back Porch
VFP = 4 # Vertical Front Porch
VLP = 1 # Vertical Line Padding
# FTDI needs at least 1 here
# Define the constants needed by the EVE based on the timing
# Active height of LCD display
LCD_HEIGHT = VLH
# Start of vertical sync pulse
LCD_VSYNC0 = VFP
# End of vertical sync pulse
LCD_VSYNC1 = VFP+VS
# Start of active screen
LCD_VOFFSET = VFP+VS+VBP
# Total number of lines per screen
LCD_VCYCLE = VLH+VFP+VS+VBP+VLP | eve_device = 811
eve_clock_speed = 60000000
touch_resistive = False
touch_capacitive = False
touch_goodix_capacitive = False
lcd_swizzle = 2
lcd_pclkpol = 0
lcd_drive_10_ma = 0
lcd_pclk_cspread = 0
lcd_dither = 0
lcd_pclk = 5
hpx = 240
hsw = 10
hbp = 20
hfp = 10
hpp = 209
lcd_width = HPX
lcd_hsync0 = HFP
lcd_hsync1 = HFP + HSW
lcd_hoffset = HFP + HSW + HBP
lcd_hcycle = HPX + HFP + HSW + HBP + HPP
vlh = 400
vs = 2
vbp = 2
vfp = 4
vlp = 1
lcd_height = VLH
lcd_vsync0 = VFP
lcd_vsync1 = VFP + VS
lcd_voffset = VFP + VS + VBP
lcd_vcycle = VLH + VFP + VS + VBP + VLP |
INPUT_FILE = "../../input/09.txt"
Point = tuple[int, int]
Heightmap = dict[Point, int]
Basin = set[Point]
def parse_input() -> Heightmap:
"""
Parses the input and returns a Heightmap
"""
with open(INPUT_FILE) as f:
heights = [[int(x) for x in line.strip()] for line in f]
heightmap: Heightmap = dict()
for (y, row) in enumerate(heights):
for (x, height) in enumerate(row):
heightmap[(x, y)] = height
return heightmap
def get_surrounding_points(heightmap: Heightmap, point: Point) -> set[Point]:
"""
Returns a set of surrounding points within the heightmap
"""
x, y = point
return {
(x - 1, y),
(x, y - 1),
(x, y + 1),
(x + 1, y),
} & heightmap.keys()
def get_surrounding_heights(heightmap: Heightmap, point: Point) -> set[int]:
"""
Returns the heights of points surrounding the given point
"""
surrounding_points = get_surrounding_points(heightmap, point)
return {heightmap[point] for point in surrounding_points}
def get_low_points(heightmap: Heightmap) -> set[Point]:
"""
Finds the low points on the heightmap
"""
low_points: set[Point] = set()
for point in heightmap:
surrounding_heights = get_surrounding_heights(heightmap, point)
if all(heightmap[point] < height for height in surrounding_heights):
low_points.add(point)
return low_points
def solve_part1(heightmap: Heightmap, low_points: set[Point]) -> int:
"""
Calculates the sum of the risk levels of all low points
"""
return sum(1 + heightmap[point] for point in low_points)
def get_basins(heightmap: Heightmap, low_points: set[Point]) -> list[Basin]:
"""
Finds all basins on the heightmap
"""
basins: list[Basin] = []
for low_point in low_points:
basin: Basin = set()
points_to_consider = {low_point}
while points_to_consider:
point = points_to_consider.pop()
if heightmap[point] == 9:
continue
surrounding_points = get_surrounding_points(heightmap, point)
points_to_consider.update(surrounding_points - basin)
basin.add(point)
basins.append(basin)
return basins
def solve_part2(heightmap: Heightmap, low_points: set[Point]) -> int:
"""
Calculates the product of the sizes of the three largest basins
"""
basins = get_basins(heightmap, low_points)
basin_sizes = sorted((len(basin) for basin in basins), reverse=True)
return basin_sizes[0] * basin_sizes[1] * basin_sizes[2]
if __name__ == "__main__":
heightmap = parse_input()
low_points = get_low_points(heightmap)
part1 = solve_part1(heightmap, low_points)
part2 = solve_part2(heightmap, low_points)
print(part1)
print(part2)
| input_file = '../../input/09.txt'
point = tuple[int, int]
heightmap = dict[Point, int]
basin = set[Point]
def parse_input() -> Heightmap:
"""
Parses the input and returns a Heightmap
"""
with open(INPUT_FILE) as f:
heights = [[int(x) for x in line.strip()] for line in f]
heightmap: Heightmap = dict()
for (y, row) in enumerate(heights):
for (x, height) in enumerate(row):
heightmap[x, y] = height
return heightmap
def get_surrounding_points(heightmap: Heightmap, point: Point) -> set[Point]:
"""
Returns a set of surrounding points within the heightmap
"""
(x, y) = point
return {(x - 1, y), (x, y - 1), (x, y + 1), (x + 1, y)} & heightmap.keys()
def get_surrounding_heights(heightmap: Heightmap, point: Point) -> set[int]:
"""
Returns the heights of points surrounding the given point
"""
surrounding_points = get_surrounding_points(heightmap, point)
return {heightmap[point] for point in surrounding_points}
def get_low_points(heightmap: Heightmap) -> set[Point]:
"""
Finds the low points on the heightmap
"""
low_points: set[Point] = set()
for point in heightmap:
surrounding_heights = get_surrounding_heights(heightmap, point)
if all((heightmap[point] < height for height in surrounding_heights)):
low_points.add(point)
return low_points
def solve_part1(heightmap: Heightmap, low_points: set[Point]) -> int:
"""
Calculates the sum of the risk levels of all low points
"""
return sum((1 + heightmap[point] for point in low_points))
def get_basins(heightmap: Heightmap, low_points: set[Point]) -> list[Basin]:
"""
Finds all basins on the heightmap
"""
basins: list[Basin] = []
for low_point in low_points:
basin: Basin = set()
points_to_consider = {low_point}
while points_to_consider:
point = points_to_consider.pop()
if heightmap[point] == 9:
continue
surrounding_points = get_surrounding_points(heightmap, point)
points_to_consider.update(surrounding_points - basin)
basin.add(point)
basins.append(basin)
return basins
def solve_part2(heightmap: Heightmap, low_points: set[Point]) -> int:
"""
Calculates the product of the sizes of the three largest basins
"""
basins = get_basins(heightmap, low_points)
basin_sizes = sorted((len(basin) for basin in basins), reverse=True)
return basin_sizes[0] * basin_sizes[1] * basin_sizes[2]
if __name__ == '__main__':
heightmap = parse_input()
low_points = get_low_points(heightmap)
part1 = solve_part1(heightmap, low_points)
part2 = solve_part2(heightmap, low_points)
print(part1)
print(part2) |
class Car(object):
"""
Car class that can be used to instantiate various vehicles.
It takes in arguments that depict the type, model, and name
of the vehicle
"""
def __init__(self, name="General", model="GM", car_type="saloon"):
num_of_wheels = 4
num_of_doors = 4
if car_type == "trailer":
num_of_wheels = 8
if name == "Porshe" or name == "Koenigsegg":
num_of_doors = 2
self.name = name
self.model = model
self.type = car_type
self.num_of_doors = num_of_doors
self.num_of_wheels = num_of_wheels
self.speed = 0
def drive(self, gear):
if self.type == "trailer":
self.speed = gear * 77 / 7
elif self.type == "saloon":
self.speed = gear * 1000 / 3
return self
def is_saloon(self):
return self.type == 'saloon'
| class Car(object):
"""
Car class that can be used to instantiate various vehicles.
It takes in arguments that depict the type, model, and name
of the vehicle
"""
def __init__(self, name='General', model='GM', car_type='saloon'):
num_of_wheels = 4
num_of_doors = 4
if car_type == 'trailer':
num_of_wheels = 8
if name == 'Porshe' or name == 'Koenigsegg':
num_of_doors = 2
self.name = name
self.model = model
self.type = car_type
self.num_of_doors = num_of_doors
self.num_of_wheels = num_of_wheels
self.speed = 0
def drive(self, gear):
if self.type == 'trailer':
self.speed = gear * 77 / 7
elif self.type == 'saloon':
self.speed = gear * 1000 / 3
return self
def is_saloon(self):
return self.type == 'saloon' |
"""Test discovery of entities for device-specific schemas for the Z-Wave JS integration."""
async def test_iblinds_v2(hass, client, iblinds_v2, integration):
"""Test that an iBlinds v2.0 multilevel switch value is discovered as a cover."""
node = iblinds_v2
assert node.device_class.specific.label == "Unused"
state = hass.states.get("light.window_blind_controller")
assert not state
state = hass.states.get("cover.window_blind_controller")
assert state
async def test_ge_12730(hass, client, ge_12730, integration):
"""Test GE 12730 Fan Controller v2.0 multilevel switch is discovered as a fan."""
node = ge_12730
assert node.device_class.specific.label == "Multilevel Power Switch"
state = hass.states.get("light.in_wall_smart_fan_control")
assert not state
state = hass.states.get("fan.in_wall_smart_fan_control")
assert state
async def test_inovelli_lzw36(hass, client, inovelli_lzw36, integration):
"""Test LZW36 Fan Controller multilevel switch endpoint 2 is discovered as a fan."""
node = inovelli_lzw36
assert node.device_class.specific.label == "Unused"
state = hass.states.get("light.family_room_combo")
assert state.state == "off"
state = hass.states.get("fan.family_room_combo_2")
assert state
| """Test discovery of entities for device-specific schemas for the Z-Wave JS integration."""
async def test_iblinds_v2(hass, client, iblinds_v2, integration):
"""Test that an iBlinds v2.0 multilevel switch value is discovered as a cover."""
node = iblinds_v2
assert node.device_class.specific.label == 'Unused'
state = hass.states.get('light.window_blind_controller')
assert not state
state = hass.states.get('cover.window_blind_controller')
assert state
async def test_ge_12730(hass, client, ge_12730, integration):
"""Test GE 12730 Fan Controller v2.0 multilevel switch is discovered as a fan."""
node = ge_12730
assert node.device_class.specific.label == 'Multilevel Power Switch'
state = hass.states.get('light.in_wall_smart_fan_control')
assert not state
state = hass.states.get('fan.in_wall_smart_fan_control')
assert state
async def test_inovelli_lzw36(hass, client, inovelli_lzw36, integration):
"""Test LZW36 Fan Controller multilevel switch endpoint 2 is discovered as a fan."""
node = inovelli_lzw36
assert node.device_class.specific.label == 'Unused'
state = hass.states.get('light.family_room_combo')
assert state.state == 'off'
state = hass.states.get('fan.family_room_combo_2')
assert state |
# Copyright 2018 Google LLC
#
# 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.
#
# DO NOT EDIT -- GENERATED BY CMake -- Change the CMakeLists.txt file if needed
"""Automatically generated unit tests list - DO NOT EDIT."""
google_cloud_cpp_common_unit_tests = [
"common_options_test.cc",
"future_generic_test.cc",
"future_generic_then_test.cc",
"future_void_test.cc",
"future_void_then_test.cc",
"iam_bindings_test.cc",
"internal/algorithm_test.cc",
"internal/api_client_header_test.cc",
"internal/backoff_policy_test.cc",
"internal/base64_transforms_test.cc",
"internal/big_endian_test.cc",
"internal/compiler_info_test.cc",
"internal/credentials_impl_test.cc",
"internal/env_test.cc",
"internal/filesystem_test.cc",
"internal/format_time_point_test.cc",
"internal/future_impl_test.cc",
"internal/invoke_result_test.cc",
"internal/log_impl_test.cc",
"internal/pagination_range_test.cc",
"internal/parse_rfc3339_test.cc",
"internal/random_test.cc",
"internal/retry_policy_test.cc",
"internal/status_payload_keys_test.cc",
"internal/strerror_test.cc",
"internal/throw_delegate_test.cc",
"internal/tuple_test.cc",
"internal/type_list_test.cc",
"internal/user_agent_prefix_test.cc",
"internal/utility_test.cc",
"kms_key_name_test.cc",
"log_test.cc",
"options_test.cc",
"polling_policy_test.cc",
"project_test.cc",
"status_or_test.cc",
"status_test.cc",
"stream_range_test.cc",
"terminate_handler_test.cc",
"tracing_options_test.cc",
]
| """Automatically generated unit tests list - DO NOT EDIT."""
google_cloud_cpp_common_unit_tests = ['common_options_test.cc', 'future_generic_test.cc', 'future_generic_then_test.cc', 'future_void_test.cc', 'future_void_then_test.cc', 'iam_bindings_test.cc', 'internal/algorithm_test.cc', 'internal/api_client_header_test.cc', 'internal/backoff_policy_test.cc', 'internal/base64_transforms_test.cc', 'internal/big_endian_test.cc', 'internal/compiler_info_test.cc', 'internal/credentials_impl_test.cc', 'internal/env_test.cc', 'internal/filesystem_test.cc', 'internal/format_time_point_test.cc', 'internal/future_impl_test.cc', 'internal/invoke_result_test.cc', 'internal/log_impl_test.cc', 'internal/pagination_range_test.cc', 'internal/parse_rfc3339_test.cc', 'internal/random_test.cc', 'internal/retry_policy_test.cc', 'internal/status_payload_keys_test.cc', 'internal/strerror_test.cc', 'internal/throw_delegate_test.cc', 'internal/tuple_test.cc', 'internal/type_list_test.cc', 'internal/user_agent_prefix_test.cc', 'internal/utility_test.cc', 'kms_key_name_test.cc', 'log_test.cc', 'options_test.cc', 'polling_policy_test.cc', 'project_test.cc', 'status_or_test.cc', 'status_test.cc', 'stream_range_test.cc', 'terminate_handler_test.cc', 'tracing_options_test.cc'] |
class Any2Int:
def __init__(self, min_count: int, include_UNK: bool, include_PAD: bool):
self.min_count = min_count
self.include_UNK = include_UNK
self.include_PAD = include_PAD
self.frozen = False
self.UNK_i = -1
self.UNK_s = "<UNK>"
self.PAD_i = -2
self.PAD_s = "<PAD>"
self.voc_size = 0
self._s2i = dict()
self._i2s = []
self.frequency = dict()
def iter_item(self):
return enumerate(self._i2s)
def get_s2i(self, s, default: int):
assert self.frozen
i = self._s2i.get(s, -1)
if i >= 0:
return i
elif self.include_UNK:
return self.UNK_i
else:
return default
def __getitem__(self, s):
return self.s2i(s)
def s2i(self, s):
i = self.get_s2i(s, -1)
if i >= 0:
return i
else:
raise Exception(f"out of vocabulary entry {s}")
def contains(self, s):
return self.get_s2i(s, -1) != -1
def i2s(self, i):
assert self.frozen
if 0 <= i < self.voc_size:
return self._i2s[i]
else:
raise Exception(f"not entry at position {i} for a vocabulary of size {self.voc_size}")
def add_to_counts(self, s):
assert not self.frozen
self.frequency[s] = self.frequency.get(s, 0)+1
def freeze(self):
assert not self.frozen
if self.include_UNK:
self.UNK_i = len(self._i2s)
self._i2s.append(self.UNK_s)
if self.include_PAD:
self.PAD_i = len(self._i2s)
self._i2s.append(self.PAD_s)
for s, count in sorted(self.frequency.items(), key=lambda x: -x[1]):
if count >= self.min_count:
self._i2s.append(s)
for i, s in enumerate(self._i2s):
self._s2i[s] = i
self.voc_size = len(self._i2s)
self.frozen = True
def __reduce__(self):
return Any2Int, (2, self.include_UNK, self.include_PAD), (self.min_count, self.include_UNK, self.frozen,
self.UNK_i, self.UNK_s, self.PAD_i, self.PAD_s,
self.voc_size, self._s2i, self._i2s, self.frequency)
def __setstate__(self, state):
self.min_count = state[0]
self.include_UNK = state[1]
self.frozen = state[2]
self.UNK_i = state[3]
self.UNK_s = state[4]
self.PAD_i = state[5]
self.PAD_s = state[6]
self.voc_size = state[7]
self._s2i = state[8]
self._i2s = state[9]
self.frequency = state[10]
| class Any2Int:
def __init__(self, min_count: int, include_UNK: bool, include_PAD: bool):
self.min_count = min_count
self.include_UNK = include_UNK
self.include_PAD = include_PAD
self.frozen = False
self.UNK_i = -1
self.UNK_s = '<UNK>'
self.PAD_i = -2
self.PAD_s = '<PAD>'
self.voc_size = 0
self._s2i = dict()
self._i2s = []
self.frequency = dict()
def iter_item(self):
return enumerate(self._i2s)
def get_s2i(self, s, default: int):
assert self.frozen
i = self._s2i.get(s, -1)
if i >= 0:
return i
elif self.include_UNK:
return self.UNK_i
else:
return default
def __getitem__(self, s):
return self.s2i(s)
def s2i(self, s):
i = self.get_s2i(s, -1)
if i >= 0:
return i
else:
raise exception(f'out of vocabulary entry {s}')
def contains(self, s):
return self.get_s2i(s, -1) != -1
def i2s(self, i):
assert self.frozen
if 0 <= i < self.voc_size:
return self._i2s[i]
else:
raise exception(f'not entry at position {i} for a vocabulary of size {self.voc_size}')
def add_to_counts(self, s):
assert not self.frozen
self.frequency[s] = self.frequency.get(s, 0) + 1
def freeze(self):
assert not self.frozen
if self.include_UNK:
self.UNK_i = len(self._i2s)
self._i2s.append(self.UNK_s)
if self.include_PAD:
self.PAD_i = len(self._i2s)
self._i2s.append(self.PAD_s)
for (s, count) in sorted(self.frequency.items(), key=lambda x: -x[1]):
if count >= self.min_count:
self._i2s.append(s)
for (i, s) in enumerate(self._i2s):
self._s2i[s] = i
self.voc_size = len(self._i2s)
self.frozen = True
def __reduce__(self):
return (Any2Int, (2, self.include_UNK, self.include_PAD), (self.min_count, self.include_UNK, self.frozen, self.UNK_i, self.UNK_s, self.PAD_i, self.PAD_s, self.voc_size, self._s2i, self._i2s, self.frequency))
def __setstate__(self, state):
self.min_count = state[0]
self.include_UNK = state[1]
self.frozen = state[2]
self.UNK_i = state[3]
self.UNK_s = state[4]
self.PAD_i = state[5]
self.PAD_s = state[6]
self.voc_size = state[7]
self._s2i = state[8]
self._i2s = state[9]
self.frequency = state[10] |
# Test definitions for Lit, the LLVM test runner.
#
# This is reusing the LLVM Lit test runner in the interim until the new build
# rules are upstreamed.
# TODO(b/136126535): remove this custom rule.
"""Lit runner globbing test
"""
load("//tensorflow:tensorflow.bzl", "filegroup")
load("@bazel_skylib//lib:paths.bzl", "paths")
load("//tensorflow:tensorflow.bzl", "tf_cc_test", "tf_native_cc_binary", "tf_copts")
# Default values used by the test runner.
_default_test_file_exts = ["mlir", ".pbtxt", ".td"]
_default_driver = "@llvm-project//mlir:run_lit.sh"
_default_size = "small"
_default_tags = []
# These are patterns which we should never match, for tests, subdirectories, or
# test input data files.
_ALWAYS_EXCLUDE = [
"**/LICENSE.txt",
"**/README.txt",
"**/lit.local.cfg",
# Exclude input files that have spaces in their names, since bazel
# cannot cope with such "targets" in the srcs list.
"**/* *",
"**/* */**",
]
def _run_lit_test(name, test_file, data, size, tags, driver, features, exec_properties):
"""Runs lit on all tests it can find in `data` under tensorflow/compiler/mlir.
Note that, due to Bazel's hermetic builds, lit only sees the tests that
are included in the `data` parameter, regardless of what other tests might
exist in the directory searched.
Args:
name: str, the name of the test, including extension.
data: [str], the data input to the test.
size: str, the size of the test.
tags: [str], tags to attach to the test.
driver: str, label of the driver shell script.
Note: use of a custom driver is not currently supported
and specifying a default driver will abort the tests.
features: [str], list of extra features to enable.
"""
name_without_suffix = test_file[0].split('.')[0]
local_test_files = name + ".test_files"
filegroup(
name = local_test_files,
srcs = native.glob([
"data/" + name_without_suffix + "*.mlir",
]),
)
tf_cc_test(
name = name,
srcs = test_file,
size = size,
deps = [
"//tensorflow/compiler/mlir/disc/tests:mlir_feature_test",
"//tensorflow/core:test",
"//tensorflow/core:test_main",
"//tensorflow/core:testlib",
],
data = [":" + local_test_files] + data + [
"//tensorflow/compiler/mlir/disc:disc_compiler_main",
"//tensorflow/compiler/mlir:tf-mlir-translate",
"//tensorflow/compiler/mlir:tf-opt",
],
)
def glob_op_tests(
exclude = [],
test_file_exts = _default_test_file_exts,
default_size = _default_size,
size_override = {},
data = [],
per_test_extra_data = {},
default_tags = _default_tags,
tags_override = {},
driver = _default_driver,
features = [],
exec_properties = {}):
"""Creates all plausible Lit tests (and their inputs) under this directory.
Args:
exclude: [str], paths to exclude (for tests and inputs).
test_file_exts: [str], extensions for files that are tests.
default_size: str, the test size for targets not in "size_override".
size_override: {str: str}, sizes to use for specific tests.
data: [str], additional input data to the test.
per_test_extra_data: {str: [str]}, extra data to attach to a given file.
default_tags: [str], additional tags to attach to the test.
tags_override: {str: str}, tags to add to specific tests.
driver: str, label of the driver shell script.
Note: use of a custom driver is not currently supported
and specifying a default driver will abort the tests.
features: [str], list of extra features to enable.
exec_properties: a dictionary of properties to pass on.
"""
# Ignore some patterns by default for tests and input data.
exclude = _ALWAYS_EXCLUDE + exclude
tests = native.glob(
["*." + ext for ext in test_file_exts],
exclude = exclude,
)
# Run tests individually such that errors can be attributed to a specific
# failure.
for i in range(len(tests)):
curr_test = tests[i]
# Instantiate this test with updated parameters.
lit_test(
name = curr_test,
data = data + per_test_extra_data.get(curr_test, []),
size = size_override.get(curr_test, default_size),
tags = default_tags + tags_override.get(curr_test, []),
driver = driver,
features = features,
exec_properties = exec_properties,
)
def lit_test(
name,
data = [],
size = _default_size,
tags = _default_tags,
driver = _default_driver,
features = [],
exec_properties = {}):
"""Runs test files under lit.
Args:
name: str, the name of the test.
data: [str], labels that should be provided as data inputs.
size: str, the size of the test.
tags: [str], tags to attach to the test.
driver: str, label of the driver shell script.
Note: use of a custom driver is not currently supported
and specifying a default driver will abort the tests.
features: [str], list of extra features to enable.
"""
_run_lit_test(name + ".test", [name], data, size, tags, driver, features, exec_properties)
| """Lit runner globbing test
"""
load('//tensorflow:tensorflow.bzl', 'filegroup')
load('@bazel_skylib//lib:paths.bzl', 'paths')
load('//tensorflow:tensorflow.bzl', 'tf_cc_test', 'tf_native_cc_binary', 'tf_copts')
_default_test_file_exts = ['mlir', '.pbtxt', '.td']
_default_driver = '@llvm-project//mlir:run_lit.sh'
_default_size = 'small'
_default_tags = []
_always_exclude = ['**/LICENSE.txt', '**/README.txt', '**/lit.local.cfg', '**/* *', '**/* */**']
def _run_lit_test(name, test_file, data, size, tags, driver, features, exec_properties):
"""Runs lit on all tests it can find in `data` under tensorflow/compiler/mlir.
Note that, due to Bazel's hermetic builds, lit only sees the tests that
are included in the `data` parameter, regardless of what other tests might
exist in the directory searched.
Args:
name: str, the name of the test, including extension.
data: [str], the data input to the test.
size: str, the size of the test.
tags: [str], tags to attach to the test.
driver: str, label of the driver shell script.
Note: use of a custom driver is not currently supported
and specifying a default driver will abort the tests.
features: [str], list of extra features to enable.
"""
name_without_suffix = test_file[0].split('.')[0]
local_test_files = name + '.test_files'
filegroup(name=local_test_files, srcs=native.glob(['data/' + name_without_suffix + '*.mlir']))
tf_cc_test(name=name, srcs=test_file, size=size, deps=['//tensorflow/compiler/mlir/disc/tests:mlir_feature_test', '//tensorflow/core:test', '//tensorflow/core:test_main', '//tensorflow/core:testlib'], data=[':' + local_test_files] + data + ['//tensorflow/compiler/mlir/disc:disc_compiler_main', '//tensorflow/compiler/mlir:tf-mlir-translate', '//tensorflow/compiler/mlir:tf-opt'])
def glob_op_tests(exclude=[], test_file_exts=_default_test_file_exts, default_size=_default_size, size_override={}, data=[], per_test_extra_data={}, default_tags=_default_tags, tags_override={}, driver=_default_driver, features=[], exec_properties={}):
"""Creates all plausible Lit tests (and their inputs) under this directory.
Args:
exclude: [str], paths to exclude (for tests and inputs).
test_file_exts: [str], extensions for files that are tests.
default_size: str, the test size for targets not in "size_override".
size_override: {str: str}, sizes to use for specific tests.
data: [str], additional input data to the test.
per_test_extra_data: {str: [str]}, extra data to attach to a given file.
default_tags: [str], additional tags to attach to the test.
tags_override: {str: str}, tags to add to specific tests.
driver: str, label of the driver shell script.
Note: use of a custom driver is not currently supported
and specifying a default driver will abort the tests.
features: [str], list of extra features to enable.
exec_properties: a dictionary of properties to pass on.
"""
exclude = _ALWAYS_EXCLUDE + exclude
tests = native.glob(['*.' + ext for ext in test_file_exts], exclude=exclude)
for i in range(len(tests)):
curr_test = tests[i]
lit_test(name=curr_test, data=data + per_test_extra_data.get(curr_test, []), size=size_override.get(curr_test, default_size), tags=default_tags + tags_override.get(curr_test, []), driver=driver, features=features, exec_properties=exec_properties)
def lit_test(name, data=[], size=_default_size, tags=_default_tags, driver=_default_driver, features=[], exec_properties={}):
"""Runs test files under lit.
Args:
name: str, the name of the test.
data: [str], labels that should be provided as data inputs.
size: str, the size of the test.
tags: [str], tags to attach to the test.
driver: str, label of the driver shell script.
Note: use of a custom driver is not currently supported
and specifying a default driver will abort the tests.
features: [str], list of extra features to enable.
"""
_run_lit_test(name + '.test', [name], data, size, tags, driver, features, exec_properties) |
"""
These are functions to add to the configure context.
"""
def __checkCanLink(context, source, source_type, message_libname, real_libs=[]):
"""
Check that source can be successfully compiled and linked against real_libs.
Keyword arguments:
source -- source to try to compile
source_type -- type of source file, (probably should be ".c")
message_libname -- library name to show in the message output from scons
real_libs -- list of actual libraries to link against (defaults to a list
with one element, the value of messager_libname)
"""
if not real_libs:
real_libs = [message_libname]
context.Message("Checking for %s..." % message_libname)
libsave = context.env.get('LIBS')
context.env.AppendUnique(LIBS=real_libs)
ret = context.TryLink(source, source_type)
context.Result( ret )
if libsave is None:
del(context.env['LIBS'])
else:
context.env['LIBS'] = libsave
return ret
libuuid_source = '''
#include <uuid/uuid.h>
int main() {
uuid_t uu;
char uuid_str[37];
uuid_generate(uu);
uuid_unparse(uu, uuid_str);
return 0;
}
'''
def CheckLibUUID(context):
return __checkCanLink(context, libuuid_source, ".c", "libuuid", ["uuid"])
selinux_source = '''
#include <selinux/selinux.h>
int main() {
security_context_t ctx;
getpeercon(0, &ctx);
return 0;
}
'''
def CheckSeLinux(context):
return __checkCanLink(context, selinux_source, '.cpp', 'selinux', ['selinux'])
byteswap_source = '''
#include <byteswap.h>
#include <stdint.h>
int main() {
uint16_t b16 = 0x00FF;
uint32_t b32 = 0x0011EEFF;
uint64_t b64 = 0x00112233CCDDEEFF;
bswap_16(b16);
bswap_32(b32);
bswap_64(b64);
return 0;
}
'''
def CheckByteswap(context):
context.Message("Checking for byteswap.h...")
ret = context.TryCompile(byteswap_source, '.c')
context.Result( ret )
return ret
bdb_source = '''
#include <db.h>
#if defined(DB_VERSION_MAJOR) && DB_VERSION_MAJOR >= 4
#if DB_VERSION_MAJOR == 4
#if defined(DB_VERSION_MINOR) && DB_VERSION_MINOR >= 3
#else
#error ""
#endif
#endif
#else
#error ""
#endif
'''
def CheckBDB(context):
context.Message("Checking for BDB >= 4.3...")
ret = context.TryCompile(bdb_source, '.c')
context.Result(ret)
return ret
| """
These are functions to add to the configure context.
"""
def __check_can_link(context, source, source_type, message_libname, real_libs=[]):
"""
Check that source can be successfully compiled and linked against real_libs.
Keyword arguments:
source -- source to try to compile
source_type -- type of source file, (probably should be ".c")
message_libname -- library name to show in the message output from scons
real_libs -- list of actual libraries to link against (defaults to a list
with one element, the value of messager_libname)
"""
if not real_libs:
real_libs = [message_libname]
context.Message('Checking for %s...' % message_libname)
libsave = context.env.get('LIBS')
context.env.AppendUnique(LIBS=real_libs)
ret = context.TryLink(source, source_type)
context.Result(ret)
if libsave is None:
del context.env['LIBS']
else:
context.env['LIBS'] = libsave
return ret
libuuid_source = '\n#include <uuid/uuid.h>\nint main() {\n\tuuid_t uu;\n\tchar uuid_str[37];\n\tuuid_generate(uu);\n\tuuid_unparse(uu, uuid_str);\n\treturn 0;\n}\n'
def check_lib_uuid(context):
return __check_can_link(context, libuuid_source, '.c', 'libuuid', ['uuid'])
selinux_source = '\n#include <selinux/selinux.h>\nint main() {\n\tsecurity_context_t ctx;\n\tgetpeercon(0, &ctx);\n\treturn 0;\n}\n'
def check_se_linux(context):
return __check_can_link(context, selinux_source, '.cpp', 'selinux', ['selinux'])
byteswap_source = '\n#include <byteswap.h>\n#include <stdint.h>\nint main() {\n\tuint16_t b16 = 0x00FF;\n\tuint32_t b32 = 0x0011EEFF;\n\tuint64_t b64 = 0x00112233CCDDEEFF;\n\n\tbswap_16(b16);\n\tbswap_32(b32);\n\tbswap_64(b64);\n\treturn 0;\n}\n'
def check_byteswap(context):
context.Message('Checking for byteswap.h...')
ret = context.TryCompile(byteswap_source, '.c')
context.Result(ret)
return ret
bdb_source = '\n#include <db.h>\n\n#if defined(DB_VERSION_MAJOR) && DB_VERSION_MAJOR >= 4\n\t#if DB_VERSION_MAJOR == 4\n\t\t#if defined(DB_VERSION_MINOR) && DB_VERSION_MINOR >= 3\n\t\t#else\n\t\t\t#error ""\n\t\t#endif\n\t#endif\n#else\n\t#error ""\n#endif\n'
def check_bdb(context):
context.Message('Checking for BDB >= 4.3...')
ret = context.TryCompile(bdb_source, '.c')
context.Result(ret)
return ret |
class CharEnumerator(object):
""" Supports iterating over a System.String object and reading its individual characters. This class cannot be inherited. """
def ZZZ(self):
"""hardcoded/mock instance of the class"""
return CharEnumerator()
instance=ZZZ()
"""hardcoded/returns an instance of the class"""
def Clone(self):
"""
Clone(self: CharEnumerator) -> object
Creates a copy of the current System.CharEnumerator object.
Returns: An System.Object that is a copy of the current System.CharEnumerator object.
"""
pass
def Dispose(self):
"""
Dispose(self: CharEnumerator)
Releases all resources used by the current instance of the System.CharEnumerator class.
"""
pass
def MoveNext(self):
"""
MoveNext(self: CharEnumerator) -> bool
Increments the internal index of the current System.CharEnumerator object to the next character of the enumerated string.
Returns: true if the index is successfully incremented and within the enumerated string; otherwise,false.
"""
pass
def next(self,*args):
""" next(self: object) -> object """
pass
def Reset(self):
"""
Reset(self: CharEnumerator)
Initializes the index to a position logically before the first character of the enumerated string.
"""
pass
def __contains__(self,*args):
""" __contains__[Char](enumerator: IEnumerator[Char],value: Char) -> bool """
pass
def __enter__(self,*args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self,*args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self,*args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self,*args):
""" __iter__(self: IEnumerator) -> object """
pass
def __reduce_ex__(self,*args):
pass
def __repr__(self,*args):
""" __repr__(self: object) -> str """
pass
Current=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets the currently referenced character in the string enumerated by this System.CharEnumerator object.
Get: Current(self: CharEnumerator) -> Char
"""
| class Charenumerator(object):
""" Supports iterating over a System.String object and reading its individual characters. This class cannot be inherited. """
def zzz(self):
"""hardcoded/mock instance of the class"""
return char_enumerator()
instance = zzz()
'hardcoded/returns an instance of the class'
def clone(self):
"""
Clone(self: CharEnumerator) -> object
Creates a copy of the current System.CharEnumerator object.
Returns: An System.Object that is a copy of the current System.CharEnumerator object.
"""
pass
def dispose(self):
"""
Dispose(self: CharEnumerator)
Releases all resources used by the current instance of the System.CharEnumerator class.
"""
pass
def move_next(self):
"""
MoveNext(self: CharEnumerator) -> bool
Increments the internal index of the current System.CharEnumerator object to the next character of the enumerated string.
Returns: true if the index is successfully incremented and within the enumerated string; otherwise,false.
"""
pass
def next(self, *args):
""" next(self: object) -> object """
pass
def reset(self):
"""
Reset(self: CharEnumerator)
Initializes the index to a position logically before the first character of the enumerated string.
"""
pass
def __contains__(self, *args):
""" __contains__[Char](enumerator: IEnumerator[Char],value: Char) -> bool """
pass
def __enter__(self, *args):
""" __enter__(self: IDisposable) -> object """
pass
def __exit__(self, *args):
""" __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """
pass
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
def __iter__(self, *args):
""" __iter__(self: IEnumerator) -> object """
pass
def __reduce_ex__(self, *args):
pass
def __repr__(self, *args):
""" __repr__(self: object) -> str """
pass
current = property(lambda self: object(), lambda self, v: None, lambda self: None)
'Gets the currently referenced character in the string enumerated by this System.CharEnumerator object.\n\n\n\nGet: Current(self: CharEnumerator) -> Char\n\n\n\n' |
# model settings
model = dict(
type='Semi_AppSup_TempSup_SimCLR_Crossclip_PTV_Recognizer3D',
backbone=dict(
type='ResNet3d',
depth=18,
pretrained=None,
pretrained2d=False,
norm_eval=False,
conv_cfg=dict(type='Conv3d'),
norm_cfg=dict(type='SyncBN', requires_grad=True, eps=1e-3),
act_cfg=dict(type='ReLU'),
conv1_kernel=(3, 7, 7),
conv1_stride_t=1,
pool1_stride_t=1,
inflate=(1, 1, 1, 1),
spatial_strides=(1, 2, 2, 2),
temporal_strides=(1, 2, 2, 2),
zero_init_residual=False),
cls_head=dict(
type='I3DHead',
num_classes=400,
in_channels=512,
spatial_type='avg',
dropout_ratio=0.5,
init_std=0.01),
cls_head_temp=None,
temp_backbone='same',
temp_sup_head='same',
train_cfg=dict(
warmup_epoch=10,
fixmatch_threshold=0.3,
temp_align_indices=(0, 1, 2, 3),
align_loss_func='Cosine',
pseudo_label_metric='avg',
crossclip_contrast_loss=[],
crossclip_contrast_range=[],
),
test_cfg=dict(average_clips='score'))
# dataset settings
dataset_type = 'VideoDataset'
dataset_type_labeled = 'VideoDataset_Contrastive'
dataset_type_unlabeled = 'UnlabeledVideoDataset_MultiView_Contrastive'
# dataset_type_appearance = 'RawframeDataset_withAPP'
data_root = 'data/kinetics400/videos_train'
data_root_val = 'data/kinetics400/videos_val'
labeled_percentage = 1
ann_file_train_labeled = f'data/kinetics400/videossl_splits/kinetics400_train_{labeled_percentage}_percent_labeled_videos.txt'
ann_file_train_unlabeled = 'data/kinetics400/kinetics400_train_list_videos.txt'
ann_file_val = 'data/kinetics400/kinetics400_val_list_videos.txt'
ann_file_test = 'data/kinetics400/kinetics400_val_list_videos.txt'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_bgr=False)
train_pipeline = [
dict(type='DecordInit'),
dict(type='SampleFrames_Custom', clip_len=8, frame_interval=8, num_clips=1,
total_frames_offset=-1),
dict(type='DecordDecode_Custom',
extra_modalities=['tempgrad']),
dict(type='Resize', scale=(-1, 256), lazy=True),
dict(type='RandomResizedCrop', lazy=True),
dict(type='Resize', scale=(224, 224), keep_ratio=False, lazy=True),
dict(type='Flip', flip_ratio=0.5, lazy=True),
dict(type='Fuse_WithDiff'),
dict(type='Normalize', **img_norm_cfg),
dict(type='Normalize_Diff', **img_norm_cfg, raw_to_diff=False, redist_to_rgb=False),
dict(type='FormatShape', input_format='NCTHW'),
dict(type='FormatShape_Diff', input_format='NCTHW'),
dict(type='Collect', keys=['imgs', 'label', 'imgs_diff'], meta_keys=[]),
dict(type='ToTensor', keys=['imgs', 'label', 'imgs_diff'])
]
# Get the frame and resize, shared by both weak and strong
train_pipeline_weak = [
dict(type='DecordInit'),
dict(type='SampleFrames_Custom', clip_len=8, frame_interval=8, num_clips=1,
total_frames_offset=-1),
dict(type='DecordDecode_Custom',
extra_modalities=['tempgrad']),
dict(type='Resize', scale=(-1, 256), lazy=True),
dict(type='RandomResizedCrop', lazy=True),
dict(type='Resize', scale=(224, 224), keep_ratio=False, lazy=True),
dict(type='Flip', flip_ratio=0.5, lazy=True),
dict(type='Fuse_WithDiff'),
]
# Only used for strong augmentation
train_pipeline_strong = [
dict(type='Imgaug', transforms='default'),
dict(type='Imgaug_Custom', transforms='default', modality='imgs_diff')
]
# Formating the input tensors, shared by both weak and strong
train_pipeline_format = [
dict(type='Normalize', **img_norm_cfg),
dict(type='Normalize_Diff', **img_norm_cfg, raw_to_diff=False, redist_to_rgb=False),
dict(type='FormatShape', input_format='NCTHW'),
dict(type='FormatShape_Diff', input_format='NCTHW'),
dict(type='Collect', keys=['imgs', 'label', 'imgs_diff'], meta_keys=[]),
dict(type='ToTensor', keys=['imgs', 'label', 'imgs_diff'])
]
val_pipeline = [
dict(type='DecordInit'),
dict(
type='SampleFrames',
clip_len=8,
frame_interval=8,
num_clips=1,
test_mode=True),
dict(type='DecordDecode'),
dict(type='Resize', scale=(-1, 256), lazy=True),
dict(type='CenterCrop', crop_size=224, lazy=True),
dict(type='Flip', flip_ratio=0, lazy=True),
dict(type='Fuse'),
dict(type='Normalize', **img_norm_cfg),
dict(type='FormatShape', input_format='NCTHW'),
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]),
dict(type='ToTensor', keys=['imgs'])
]
test_pipeline = [
dict(type='DecordInit'),
dict(
type='SampleFrames',
clip_len=8,
frame_interval=8,
num_clips=10,
test_mode=True),
dict(type='DecordDecode'),
dict(type='Resize', scale=(-1, 256)),
dict(type='ThreeCrop', crop_size=256),
dict(type='Flip', flip_ratio=0),
dict(type='Normalize', **img_norm_cfg),
dict(type='FormatShape', input_format='NCTHW'),
dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]),
dict(type='ToTensor', keys=['imgs'])
]
data = dict(
videos_per_gpu=8, # NOTE: Need to reduce batch size. 16 -> 5
workers_per_gpu=4, # Default: 4
train_dataloader=dict(drop_last=True, pin_memory=True),
train_labeled=dict(
type=dataset_type_labeled,
ann_file=ann_file_train_labeled,
data_prefix=data_root,
pipeline=train_pipeline,
contrast_clip_num=1
),
train_unlabeled=dict(
type=dataset_type_unlabeled,
ann_file=ann_file_train_unlabeled,
data_prefix=data_root,
pipeline_weak=train_pipeline_weak,
pipeline_strong=train_pipeline_strong,
pipeline_format=train_pipeline_format,
contrast_clip_num=1
),
val=dict(
type=dataset_type,
ann_file=ann_file_val,
data_prefix=data_root_val,
pipeline=val_pipeline,
test_mode=True),
test=dict(
type=dataset_type,
ann_file=ann_file_val,
data_prefix=data_root_val,
pipeline=test_pipeline,
test_mode=True),
precise_bn=dict(
type=dataset_type,
ann_file=ann_file_train_unlabeled,
data_prefix=data_root,
pipeline=val_pipeline),
videos_per_gpu_precise_bn=5
)
# optimizer
optimizer = dict(
type='SGD', lr=0.2, momentum=0.9,
weight_decay=0.0001) # this lr 0.2 is used for 8 gpus
optimizer_config = dict(grad_clip=dict(max_norm=40, norm_type=2))
# learning policy
lr_config = dict(policy='CosineAnnealing',
min_lr=0,
warmup='linear',
warmup_ratio=0.1,
warmup_by_epoch=True,
warmup_iters=10)
total_epochs = 45 # Might need to increase this number for different splits. Default: 180
checkpoint_config = dict(interval=5, max_keep_ckpts=3)
evaluation = dict(
interval=5, metrics=['top_k_accuracy', 'mean_class_accuracy'], topk=(1, 5)) # Default: 5
log_config = dict(
interval=20, # Default: 20
hooks=[
dict(type='TextLoggerHook'),
dict(type='TensorboardLoggerHook'),
])
precise_bn = dict(num_iters=200, interval=5,
bn_range=['backbone', 'cls_head'])
dist_params = dict(backend='nccl')
log_level = 'INFO'
work_dir = None
load_from = None
resume_from = None
workflow = [('train', 1)]
find_unused_parameters = False
| model = dict(type='Semi_AppSup_TempSup_SimCLR_Crossclip_PTV_Recognizer3D', backbone=dict(type='ResNet3d', depth=18, pretrained=None, pretrained2d=False, norm_eval=False, conv_cfg=dict(type='Conv3d'), norm_cfg=dict(type='SyncBN', requires_grad=True, eps=0.001), act_cfg=dict(type='ReLU'), conv1_kernel=(3, 7, 7), conv1_stride_t=1, pool1_stride_t=1, inflate=(1, 1, 1, 1), spatial_strides=(1, 2, 2, 2), temporal_strides=(1, 2, 2, 2), zero_init_residual=False), cls_head=dict(type='I3DHead', num_classes=400, in_channels=512, spatial_type='avg', dropout_ratio=0.5, init_std=0.01), cls_head_temp=None, temp_backbone='same', temp_sup_head='same', train_cfg=dict(warmup_epoch=10, fixmatch_threshold=0.3, temp_align_indices=(0, 1, 2, 3), align_loss_func='Cosine', pseudo_label_metric='avg', crossclip_contrast_loss=[], crossclip_contrast_range=[]), test_cfg=dict(average_clips='score'))
dataset_type = 'VideoDataset'
dataset_type_labeled = 'VideoDataset_Contrastive'
dataset_type_unlabeled = 'UnlabeledVideoDataset_MultiView_Contrastive'
data_root = 'data/kinetics400/videos_train'
data_root_val = 'data/kinetics400/videos_val'
labeled_percentage = 1
ann_file_train_labeled = f'data/kinetics400/videossl_splits/kinetics400_train_{labeled_percentage}_percent_labeled_videos.txt'
ann_file_train_unlabeled = 'data/kinetics400/kinetics400_train_list_videos.txt'
ann_file_val = 'data/kinetics400/kinetics400_val_list_videos.txt'
ann_file_test = 'data/kinetics400/kinetics400_val_list_videos.txt'
img_norm_cfg = dict(mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_bgr=False)
train_pipeline = [dict(type='DecordInit'), dict(type='SampleFrames_Custom', clip_len=8, frame_interval=8, num_clips=1, total_frames_offset=-1), dict(type='DecordDecode_Custom', extra_modalities=['tempgrad']), dict(type='Resize', scale=(-1, 256), lazy=True), dict(type='RandomResizedCrop', lazy=True), dict(type='Resize', scale=(224, 224), keep_ratio=False, lazy=True), dict(type='Flip', flip_ratio=0.5, lazy=True), dict(type='Fuse_WithDiff'), dict(type='Normalize', **img_norm_cfg), dict(type='Normalize_Diff', **img_norm_cfg, raw_to_diff=False, redist_to_rgb=False), dict(type='FormatShape', input_format='NCTHW'), dict(type='FormatShape_Diff', input_format='NCTHW'), dict(type='Collect', keys=['imgs', 'label', 'imgs_diff'], meta_keys=[]), dict(type='ToTensor', keys=['imgs', 'label', 'imgs_diff'])]
train_pipeline_weak = [dict(type='DecordInit'), dict(type='SampleFrames_Custom', clip_len=8, frame_interval=8, num_clips=1, total_frames_offset=-1), dict(type='DecordDecode_Custom', extra_modalities=['tempgrad']), dict(type='Resize', scale=(-1, 256), lazy=True), dict(type='RandomResizedCrop', lazy=True), dict(type='Resize', scale=(224, 224), keep_ratio=False, lazy=True), dict(type='Flip', flip_ratio=0.5, lazy=True), dict(type='Fuse_WithDiff')]
train_pipeline_strong = [dict(type='Imgaug', transforms='default'), dict(type='Imgaug_Custom', transforms='default', modality='imgs_diff')]
train_pipeline_format = [dict(type='Normalize', **img_norm_cfg), dict(type='Normalize_Diff', **img_norm_cfg, raw_to_diff=False, redist_to_rgb=False), dict(type='FormatShape', input_format='NCTHW'), dict(type='FormatShape_Diff', input_format='NCTHW'), dict(type='Collect', keys=['imgs', 'label', 'imgs_diff'], meta_keys=[]), dict(type='ToTensor', keys=['imgs', 'label', 'imgs_diff'])]
val_pipeline = [dict(type='DecordInit'), dict(type='SampleFrames', clip_len=8, frame_interval=8, num_clips=1, test_mode=True), dict(type='DecordDecode'), dict(type='Resize', scale=(-1, 256), lazy=True), dict(type='CenterCrop', crop_size=224, lazy=True), dict(type='Flip', flip_ratio=0, lazy=True), dict(type='Fuse'), dict(type='Normalize', **img_norm_cfg), dict(type='FormatShape', input_format='NCTHW'), dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), dict(type='ToTensor', keys=['imgs'])]
test_pipeline = [dict(type='DecordInit'), dict(type='SampleFrames', clip_len=8, frame_interval=8, num_clips=10, test_mode=True), dict(type='DecordDecode'), dict(type='Resize', scale=(-1, 256)), dict(type='ThreeCrop', crop_size=256), dict(type='Flip', flip_ratio=0), dict(type='Normalize', **img_norm_cfg), dict(type='FormatShape', input_format='NCTHW'), dict(type='Collect', keys=['imgs', 'label'], meta_keys=[]), dict(type='ToTensor', keys=['imgs'])]
data = dict(videos_per_gpu=8, workers_per_gpu=4, train_dataloader=dict(drop_last=True, pin_memory=True), train_labeled=dict(type=dataset_type_labeled, ann_file=ann_file_train_labeled, data_prefix=data_root, pipeline=train_pipeline, contrast_clip_num=1), train_unlabeled=dict(type=dataset_type_unlabeled, ann_file=ann_file_train_unlabeled, data_prefix=data_root, pipeline_weak=train_pipeline_weak, pipeline_strong=train_pipeline_strong, pipeline_format=train_pipeline_format, contrast_clip_num=1), val=dict(type=dataset_type, ann_file=ann_file_val, data_prefix=data_root_val, pipeline=val_pipeline, test_mode=True), test=dict(type=dataset_type, ann_file=ann_file_val, data_prefix=data_root_val, pipeline=test_pipeline, test_mode=True), precise_bn=dict(type=dataset_type, ann_file=ann_file_train_unlabeled, data_prefix=data_root, pipeline=val_pipeline), videos_per_gpu_precise_bn=5)
optimizer = dict(type='SGD', lr=0.2, momentum=0.9, weight_decay=0.0001)
optimizer_config = dict(grad_clip=dict(max_norm=40, norm_type=2))
lr_config = dict(policy='CosineAnnealing', min_lr=0, warmup='linear', warmup_ratio=0.1, warmup_by_epoch=True, warmup_iters=10)
total_epochs = 45
checkpoint_config = dict(interval=5, max_keep_ckpts=3)
evaluation = dict(interval=5, metrics=['top_k_accuracy', 'mean_class_accuracy'], topk=(1, 5))
log_config = dict(interval=20, hooks=[dict(type='TextLoggerHook'), dict(type='TensorboardLoggerHook')])
precise_bn = dict(num_iters=200, interval=5, bn_range=['backbone', 'cls_head'])
dist_params = dict(backend='nccl')
log_level = 'INFO'
work_dir = None
load_from = None
resume_from = None
workflow = [('train', 1)]
find_unused_parameters = False |
"""
Disjoint set.
Reference: https://en.wikipedia.org/wiki/Disjoint-set_data_structure
"""
class Node:
def __init__(self, data: int) -> None:
self.data = data
self.rank: int
self.parent: Node
def make_set(x: Node) -> None:
"""
Make x as a set.
"""
# rank is the distance from x to its' parent
# root's rank is 0
x.rank = 0
x.parent = x
def union_set(x: Node, y: Node) -> None:
"""
Union of two sets.
set with bigger rank should be parent, so that the
disjoint set tree will be more flat.
"""
x, y = find_set(x), find_set(y)
if x == y:
return
elif x.rank > y.rank:
y.parent = x
else:
x.parent = y
if x.rank == y.rank:
y.rank += 1
def find_set(x: Node) -> Node:
"""
Return the parent of x
"""
if x != x.parent:
x.parent = find_set(x.parent)
return x.parent
def find_python_set(node: Node) -> set:
"""
Return a Python Standard Library set that contains i.
"""
sets = ({0, 1, 2}, {3, 4, 5})
for s in sets:
if node.data in s:
return s
raise ValueError(f"{node.data} is not in {sets}")
def test_disjoint_set() -> None:
"""
>>> test_disjoint_set()
"""
vertex = [Node(i) for i in range(6)]
for v in vertex:
make_set(v)
union_set(vertex[0], vertex[1])
union_set(vertex[1], vertex[2])
union_set(vertex[3], vertex[4])
union_set(vertex[3], vertex[5])
for node0 in vertex:
for node1 in vertex:
if find_python_set(node0).isdisjoint(find_python_set(node1)):
assert find_set(node0) != find_set(node1)
else:
assert find_set(node0) == find_set(node1)
if __name__ == "__main__":
test_disjoint_set()
| """
Disjoint set.
Reference: https://en.wikipedia.org/wiki/Disjoint-set_data_structure
"""
class Node:
def __init__(self, data: int) -> None:
self.data = data
self.rank: int
self.parent: Node
def make_set(x: Node) -> None:
"""
Make x as a set.
"""
x.rank = 0
x.parent = x
def union_set(x: Node, y: Node) -> None:
"""
Union of two sets.
set with bigger rank should be parent, so that the
disjoint set tree will be more flat.
"""
(x, y) = (find_set(x), find_set(y))
if x == y:
return
elif x.rank > y.rank:
y.parent = x
else:
x.parent = y
if x.rank == y.rank:
y.rank += 1
def find_set(x: Node) -> Node:
"""
Return the parent of x
"""
if x != x.parent:
x.parent = find_set(x.parent)
return x.parent
def find_python_set(node: Node) -> set:
"""
Return a Python Standard Library set that contains i.
"""
sets = ({0, 1, 2}, {3, 4, 5})
for s in sets:
if node.data in s:
return s
raise value_error(f'{node.data} is not in {sets}')
def test_disjoint_set() -> None:
"""
>>> test_disjoint_set()
"""
vertex = [node(i) for i in range(6)]
for v in vertex:
make_set(v)
union_set(vertex[0], vertex[1])
union_set(vertex[1], vertex[2])
union_set(vertex[3], vertex[4])
union_set(vertex[3], vertex[5])
for node0 in vertex:
for node1 in vertex:
if find_python_set(node0).isdisjoint(find_python_set(node1)):
assert find_set(node0) != find_set(node1)
else:
assert find_set(node0) == find_set(node1)
if __name__ == '__main__':
test_disjoint_set() |
class SeqIter:
def __init__(self,l):
self.l = l
self.i = 0
self.stop = False
def __len__(self):
return len(self.l)
def __list__(self):
l = []
while True:
try:
l.append(self.__next__())
except StopIteration:
break
return l
def __iter__(self):
return self
def __next__(self):
has_length = True
found = False
try:
self.l.__len__()
except AttributeError:
has_length = False
try:
if self.stop:
raise StopIteration()
if has_length and self.i >= self.l.__len__():
self.stop = True
raise StopIteration()
ret = self.l[self.i]
found = True
except IndexError:
raise StopIteration()
except StopIteration:
raise StopIteration()
self.i += 1
if found:
return ret
else:
return None
___assign("%SeqIter", SeqIter)
def iter(l, *args):
callable = ___id("%callable")
if args.__len__() == 1:
if callable(l):
stopwhen = args[0]
return FuncIter(l, stopwhen)
else:
TypeError("iter(v, w): v must be callable")
elif args.__len__() == 0:
try:
return l.__iter__()
except:
try:
if callable(l.__getitem__):
return SeqIter(l)
except:
raise TypeError("object is not iterable")
else:
raise TypeError("iter expect at most 2 arguments")
___assign("%iter", iter)
def next(it, *arg):
if len(arg) == 0:
return it.__next__()
else:
return it.__next__(arg[0])
___assign("%next", next)
class FuncIter:
def __init__(self, func, stopwhen):
self.func = func
self.stopwhen = stopwhen
self.stopped = False
def __list__(self):
l = []
while not self.stopped:
try:
l.append(self.__next__())
except StopIteration:
break
return l
def __next__(self):
f = self.func
v = f()
if v == self.stopwhen:
self.stopped = True
raise StopIteration()
else:
return v
___assign("%FuncIter", FuncIter)
| class Seqiter:
def __init__(self, l):
self.l = l
self.i = 0
self.stop = False
def __len__(self):
return len(self.l)
def __list__(self):
l = []
while True:
try:
l.append(self.__next__())
except StopIteration:
break
return l
def __iter__(self):
return self
def __next__(self):
has_length = True
found = False
try:
self.l.__len__()
except AttributeError:
has_length = False
try:
if self.stop:
raise stop_iteration()
if has_length and self.i >= self.l.__len__():
self.stop = True
raise stop_iteration()
ret = self.l[self.i]
found = True
except IndexError:
raise stop_iteration()
except StopIteration:
raise stop_iteration()
self.i += 1
if found:
return ret
else:
return None
___assign('%SeqIter', SeqIter)
def iter(l, *args):
callable = ___id('%callable')
if args.__len__() == 1:
if callable(l):
stopwhen = args[0]
return func_iter(l, stopwhen)
else:
type_error('iter(v, w): v must be callable')
elif args.__len__() == 0:
try:
return l.__iter__()
except:
try:
if callable(l.__getitem__):
return seq_iter(l)
except:
raise type_error('object is not iterable')
else:
raise type_error('iter expect at most 2 arguments')
___assign('%iter', iter)
def next(it, *arg):
if len(arg) == 0:
return it.__next__()
else:
return it.__next__(arg[0])
___assign('%next', next)
class Funciter:
def __init__(self, func, stopwhen):
self.func = func
self.stopwhen = stopwhen
self.stopped = False
def __list__(self):
l = []
while not self.stopped:
try:
l.append(self.__next__())
except StopIteration:
break
return l
def __next__(self):
f = self.func
v = f()
if v == self.stopwhen:
self.stopped = True
raise stop_iteration()
else:
return v
___assign('%FuncIter', FuncIter) |
def quicksort(xs):
if len(xs) == 0:
return []
pivot = xs[0]
xs = xs[1:]
left = [x for x in xs if x <= pivot]
right = [x for x in xs if x > pivot]
res = quicksort(left)
res.append(pivot)
res += quicksort(right)
return res
xs = [1, 3, 2, 4, 5, 2]
sorted_xs = quicksort(xs)
| def quicksort(xs):
if len(xs) == 0:
return []
pivot = xs[0]
xs = xs[1:]
left = [x for x in xs if x <= pivot]
right = [x for x in xs if x > pivot]
res = quicksort(left)
res.append(pivot)
res += quicksort(right)
return res
xs = [1, 3, 2, 4, 5, 2]
sorted_xs = quicksort(xs) |
#
# PySNMP MIB module CISCO-TRUSTSEC-POLICY-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-TRUSTSEC-POLICY-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:14:36 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, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion")
ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt")
Cisco2KVlanList, CiscoVrfName = mibBuilder.importSymbols("CISCO-TC", "Cisco2KVlanList", "CiscoVrfName")
CtsAclNameOrEmpty, CtsAclList, CtsGenerationId, CtsAclName, CtsAclListOrEmpty, CtsSgaclMonitorMode, CtsSecurityGroupTag = mibBuilder.importSymbols("CISCO-TRUSTSEC-TC-MIB", "CtsAclNameOrEmpty", "CtsAclList", "CtsGenerationId", "CtsAclName", "CtsAclListOrEmpty", "CtsSgaclMonitorMode", "CtsSecurityGroupTag")
ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex")
InetAddressType, InetAddress, InetAddressPrefixLength = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressType", "InetAddress", "InetAddressPrefixLength")
VlanIndex, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanIndex")
SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString")
NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance")
Counter32, Unsigned32, Bits, ObjectIdentity, iso, Counter64, Gauge32, Integer32, TimeTicks, MibIdentifier, ModuleIdentity, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Unsigned32", "Bits", "ObjectIdentity", "iso", "Counter64", "Gauge32", "Integer32", "TimeTicks", "MibIdentifier", "ModuleIdentity", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress")
DisplayString, StorageType, TruthValue, RowStatus, DateAndTime, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "StorageType", "TruthValue", "RowStatus", "DateAndTime", "TextualConvention")
ciscoTrustSecPolicyMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 713))
ciscoTrustSecPolicyMIB.setRevisions(('2012-12-19 00:00', '2009-11-06 00:00',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: ciscoTrustSecPolicyMIB.setRevisionsDescriptions(('Added following OBJECT-GROUP: - ctspNotifCtrlGroup - ctspNotifGroup - ctspNotifInfoGroup - ctspIfSgtMappingGroup - ctspVlanSgtMappingGroup - ctspSgtCachingGroup - ctspSgaclMonitorGroup - ctspSgaclMonitorStatisticGroup Added new compliance - ciscoTrustSecPolicyMIBCompliances Modified ctspIpSgtSource to add l3if(6), vlan(7), caching(8).', 'Initial version of this MIB module.',))
if mibBuilder.loadTexts: ciscoTrustSecPolicyMIB.setLastUpdated('201212190000Z')
if mibBuilder.loadTexts: ciscoTrustSecPolicyMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts: ciscoTrustSecPolicyMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-lan-switch-snmp@cisco.com')
if mibBuilder.loadTexts: ciscoTrustSecPolicyMIB.setDescription('This MIB module defines managed objects that facilitate the management of various policies within the Cisco Trusted Security (TrustSec) infrastructure. The information available through this MIB includes: o Device and interface level configuration for enabling SGACL (Security Group Access Control List) enforcement on Layer2/3 traffic. o Administrative and operational SGACL mapping to Security Group Tag (SGT). o Various statistics counters for traffic subject to SGACL enforcement. o TrustSec policies with respect to peer device. o Interface level configuration for enabling the propagation of SGT along with the Layer 3 traffic in portions of network which does not have the capability to support TrustSec feature. o TrustSec policies with respect to SGT propagation with Layer 3 traffic. The following terms are used throughout this MIB: VRF: Virtual Routing and Forwarding. SGACL: Security Group Access Control List. ACE: Access Control Entries. SXP: SGT Propagation Protocol. SVI: Switch Virtual Interface. IPM: Identity Port Mapping. SGT (Security Group Tag) is a unique 16 bits value assigned to every security group and used by network devices to enforce SGACL. Peer is another device connected to the local device on the other side of a TrustSec link. Default Policy: Policy applied to traffic when there is no explicit policy between the SGT associated with the originator of the traffic and the SGT associated with the destination of the traffic.')
ciscoTrustSecPolicyMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 0))
ciscoTrustSecPolicyMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1))
ciscoTrustSecPolicyMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 2))
ctspSgacl = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1))
ctspPeerPolicy = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2))
ctspLayer3Transport = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3))
ctspIpSgtMappings = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4))
ctspSgtPolicy = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5))
ctspIfSgtMappings = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6))
ctspVlanSgtMappings = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7))
ctspSgtCaching = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 8))
ctspNotifsControl = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 9))
ctspNotifsOnlyInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 10))
ctspSgaclGlobals = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1))
ctspSgaclMappings = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2))
ctspSgaclStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3))
ctspSgaclEnforcementEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("l3Only", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspSgaclEnforcementEnable.setStatus('current')
if mibBuilder.loadTexts: ctspSgaclEnforcementEnable.setDescription("This object specifies whether SGACL enforcement for all Layer 3 interfaces (excluding SVIs) is enabled at the managed system. 'none' indicates that SGACL enforcement for all Layer 3 interfaces (excluding SVIs) is disabled. 'l3Only' indicates that SGACL enforcement is enabled on every TrustSec capable Layer3 interface (excluding SVIs) in the device.")
ctspSgaclIpv4DropNetflowMonitor = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 2), SnmpAdminString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspSgaclIpv4DropNetflowMonitor.setStatus('current')
if mibBuilder.loadTexts: ctspSgaclIpv4DropNetflowMonitor.setDescription('This object specifies an existing flexible netflow monitor name used to collect and export the IPv4 traffic dropped packets statistics due to SGACL enforcement. The zero-length string indicates that no such netflow monitor is configured in the device.')
ctspSgaclIpv6DropNetflowMonitor = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 3), SnmpAdminString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspSgaclIpv6DropNetflowMonitor.setStatus('current')
if mibBuilder.loadTexts: ctspSgaclIpv6DropNetflowMonitor.setDescription('This object specifies an existing flexible netflow monitor name used to collect and export the IPv6 traffic dropped packets statistics due to SGACL enforcement. The zero-length string indicates that no such netflow monitor is configured in the device.')
ctspVlanConfigTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4), )
if mibBuilder.loadTexts: ctspVlanConfigTable.setStatus('current')
if mibBuilder.loadTexts: ctspVlanConfigTable.setDescription('This table lists the SGACL enforcement for Layer 2 and Layer 3 switched packet in a VLAN as well as VRF information for VLANs in the device.')
ctspVlanConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanConfigIndex"))
if mibBuilder.loadTexts: ctspVlanConfigEntry.setStatus('current')
if mibBuilder.loadTexts: ctspVlanConfigEntry.setDescription('Each row contains the SGACL enforcement information for Layer 2 and Layer 3 switched packets in a VLAN identified by its VlanIndex value. Entry in this table is populated for VLANs which contains SGACL enforcement or VRF configuration.')
ctspVlanConfigIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 1), VlanIndex())
if mibBuilder.loadTexts: ctspVlanConfigIndex.setStatus('current')
if mibBuilder.loadTexts: ctspVlanConfigIndex.setDescription('This object indicates the VLAN-ID of this VLAN.')
ctspVlanConfigSgaclEnforcement = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 2), TruthValue()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspVlanConfigSgaclEnforcement.setStatus('current')
if mibBuilder.loadTexts: ctspVlanConfigSgaclEnforcement.setDescription("This object specifies the configured SGACL enforcement status for this VLAN i.e., 'true' = enabled and 'false' = disabled.")
ctspVlanSviActive = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 3), TruthValue()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspVlanSviActive.setStatus('current')
if mibBuilder.loadTexts: ctspVlanSviActive.setDescription("This object indicates if there is an active SVI associated with this VLAN. 'true' indicates that there is an active SVI associated with this VLAN. and SGACL is enforced for both Layer 2 and Layer 3 switched packets within that VLAN. 'false' indicates that there is no active SVI associated with this VLAN, and SGACL is only enforced for Layer 2 switched packets within that VLAN.")
ctspVlanConfigVrfName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 4), CiscoVrfName()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspVlanConfigVrfName.setStatus('current')
if mibBuilder.loadTexts: ctspVlanConfigVrfName.setDescription('This object specifies an existing VRF where this VLAN belongs to. The zero length value indicates this VLAN belongs to the default VRF.')
ctspVlanConfigStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 5), StorageType().clone('volatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspVlanConfigStorageType.setStatus('current')
if mibBuilder.loadTexts: ctspVlanConfigStorageType.setDescription('The objects specifies the storage type for this conceptual row.')
ctspVlanConfigRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspVlanConfigRowStatus.setStatus('current')
if mibBuilder.loadTexts: ctspVlanConfigRowStatus.setDescription("The status of this conceptual row entry. This object is used to manage creation and deletion of rows in this table. When this object value is 'active', other writable objects in the same row cannot be modified.")
ctspConfigSgaclMappingTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1), )
if mibBuilder.loadTexts: ctspConfigSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMappingTable.setDescription('This table contains the SGACLs information which is applied to unicast IP traffic which carries a source SGT and travels to a destination SGT.')
ctspConfigSgaclMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspConfigSgaclMappingIpTrafficType"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspConfigSgaclMappingDestSgt"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspConfigSgaclMappingSourceSgt"))
if mibBuilder.loadTexts: ctspConfigSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMappingEntry.setDescription('Each row contains the SGACL mapping to source and destination SGT for a certain traffic type as well as status of this instance. A row instance can be created or removed by setting the appropriate value of its RowStatus object.')
ctspConfigSgaclMappingIpTrafficType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2))))
if mibBuilder.loadTexts: ctspConfigSgaclMappingIpTrafficType.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMappingIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic carrying the source SGT and travelling to destination SGT and subjected to SGACL enforcement.')
ctspConfigSgaclMappingDestSgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 2), CtsSecurityGroupTag())
if mibBuilder.loadTexts: ctspConfigSgaclMappingDestSgt.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMappingDestSgt.setDescription('This object indicates the destination SGT value. Value of zero indicates that the destination SGT is unknown.')
ctspConfigSgaclMappingSourceSgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 3), CtsSecurityGroupTag())
if mibBuilder.loadTexts: ctspConfigSgaclMappingSourceSgt.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMappingSourceSgt.setDescription('This object indicates the source SGT value. Value of zero indicates that the source SGT is unknown.')
ctspConfigSgaclMappingSgaclName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 4), CtsAclList()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspConfigSgaclMappingSgaclName.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMappingSgaclName.setDescription('This object specifies the list of existing SGACLs which is administratively configured to apply to unicast IP traffic carrying the source SGT to the destination SGT.')
ctspConfigSgaclMappingStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 5), StorageType().clone('volatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspConfigSgaclMappingStorageType.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMappingStorageType.setDescription('The storage type for this conceptual row.')
ctspConfigSgaclMappingRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 6), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspConfigSgaclMappingRowStatus.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMappingRowStatus.setDescription('This object is used to manage the creation and deletion of rows in this table. ctspConfigSgaclName may be modified at any time.')
ctspConfigSgaclMonitor = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 7), CtsSgaclMonitorMode().clone('off')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspConfigSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMonitor.setDescription('This object specifies whether SGACL monitor mode is turned on for the configured SGACL enforced traffic.')
ctspDefConfigIpv4Sgacls = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 2), CtsAclListOrEmpty()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspDefConfigIpv4Sgacls.setStatus('current')
if mibBuilder.loadTexts: ctspDefConfigIpv4Sgacls.setDescription('This object specifies the SGACLs of the unicast default policy for IPv4 traffic. If there is no SGACL configured for unicast default policy for IPv4 traffic, the value of this object is the zero-length string.')
ctspDefConfigIpv6Sgacls = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 3), CtsAclListOrEmpty()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspDefConfigIpv6Sgacls.setStatus('current')
if mibBuilder.loadTexts: ctspDefConfigIpv6Sgacls.setDescription('This object specifies the SGACLs of the unicast default policy for IPv6 traffic. If there is no SGACL configured for unicast default policy for IPv6 traffic, the value of this object is the zero-length string.')
ctspDownloadedSgaclMappingTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4), )
if mibBuilder.loadTexts: ctspDownloadedSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgaclMappingTable.setDescription('This table contains the downloaded SGACLs information applied to unicast IP traffic which carries a source SGT and travels to a destination SGT.')
ctspDownloadedSgaclMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgaclDestSgt"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgaclSourceSgt"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgaclIndex"))
if mibBuilder.loadTexts: ctspDownloadedSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgaclMappingEntry.setDescription('Each row contains the downloaded SGACLs mapping. A row instance is added for each pair of <source SGT, destination SGT> which contains SGACL that is dynamically downloaded from ACS server.')
ctspDownloadedSgaclDestSgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 1), CtsSecurityGroupTag())
if mibBuilder.loadTexts: ctspDownloadedSgaclDestSgt.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgaclDestSgt.setDescription('This object indicates the destination SGT value. Value of zero indicates that the destination SGT is unknown.')
ctspDownloadedSgaclSourceSgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 2), CtsSecurityGroupTag())
if mibBuilder.loadTexts: ctspDownloadedSgaclSourceSgt.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgaclSourceSgt.setDescription('This object indicates the source SGT value. Value of zero indicates that the source SGT is unknown.')
ctspDownloadedSgaclIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: ctspDownloadedSgaclIndex.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgaclIndex.setDescription('This object identifies the downloaded SGACL which is applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctspDownloadedSgaclName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 4), CtsAclName()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedSgaclName.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgaclName.setDescription('This object indicates the name of downloaded SGACL which is applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctspDownloadedSgaclGenId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 5), CtsGenerationId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedSgaclGenId.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgaclGenId.setDescription('This object indicates the generation identification of downloaded SGACL which is applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctspDownloadedIpTrafficType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 6), Bits().clone(namedValues=NamedValues(("ipv4", 0), ("ipv6", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedIpTrafficType.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic carrying the source SGT and travelling to destination SGT and subjected to SGACL enforcement by this downloaded default policy.')
ctspDownloadedSgaclMonitor = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 7), CtsSgaclMonitorMode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgaclMonitor.setDescription('This object indicates whether SGACL monitor mode is turned on for the downloaded SGACL enforced traffic.')
ctspDefDownloadedSgaclMappingTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5), )
if mibBuilder.loadTexts: ctspDefDownloadedSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts: ctspDefDownloadedSgaclMappingTable.setDescription('This table contains the downloaded SGACLs information of the default policy applied to unicast IP traffic.')
ctspDefDownloadedSgaclMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspDefDownloadedSgaclIndex"))
if mibBuilder.loadTexts: ctspDefDownloadedSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts: ctspDefDownloadedSgaclMappingEntry.setDescription('Each row contains the downloaded SGACLs mapping. A row instance contains the SGACL information of the default policy dynamically downloaded from ACS server for unicast IP traffic.')
ctspDefDownloadedSgaclIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: ctspDefDownloadedSgaclIndex.setStatus('current')
if mibBuilder.loadTexts: ctspDefDownloadedSgaclIndex.setDescription('This object identifies the SGACL of downloaded default policy applied to unicast IP traffic.')
ctspDefDownloadedSgaclName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 2), CtsAclName()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefDownloadedSgaclName.setStatus('current')
if mibBuilder.loadTexts: ctspDefDownloadedSgaclName.setDescription('This object indicates the name of the SGACL of downloaded default policy applied to unicast IP traffic.')
ctspDefDownloadedSgaclGenId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 3), CtsGenerationId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefDownloadedSgaclGenId.setStatus('current')
if mibBuilder.loadTexts: ctspDefDownloadedSgaclGenId.setDescription('This object indicates the generation identification of the SGACL of downloaded default policy applied to unicast IP traffic.')
ctspDefDownloadedIpTrafficType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 4), Bits().clone(namedValues=NamedValues(("ipv4", 0), ("ipv6", 1)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefDownloadedIpTrafficType.setStatus('current')
if mibBuilder.loadTexts: ctspDefDownloadedIpTrafficType.setDescription('This object indicates the type of the IP traffic subjected to SGACL enforcement by this downloaded default policy.')
ctspDefDownloadedSgaclMonitor = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 5), CtsSgaclMonitorMode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefDownloadedSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts: ctspDefDownloadedSgaclMonitor.setDescription('This object indicates whether SGACL monitor mode is turned on for the default downloaded SGACL enforced traffic.')
ctspOperSgaclMappingTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6), )
if mibBuilder.loadTexts: ctspOperSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts: ctspOperSgaclMappingTable.setDescription('This table contains the operational SGACLs information applied to unicast IP traffic which carries a source SGT and travels to a destination SGT.')
ctspOperSgaclMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspOperIpTrafficType"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspOperSgaclDestSgt"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspOperSgaclSourceSgt"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspOperSgaclIndex"))
if mibBuilder.loadTexts: ctspOperSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts: ctspOperSgaclMappingEntry.setDescription('Each row contains the operational SGACLs mapping. A row instance is added for each pair of <source SGT, destination SGT> which contains the SGACL that either statically configured at the device or dynamically downloaded from ACS server.')
ctspOperIpTrafficType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2))))
if mibBuilder.loadTexts: ctspOperIpTrafficType.setStatus('current')
if mibBuilder.loadTexts: ctspOperIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic carrying the source SGT and travelling to destination SGT and subjected to SGACL enforcement.')
ctspOperSgaclDestSgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 2), CtsSecurityGroupTag())
if mibBuilder.loadTexts: ctspOperSgaclDestSgt.setStatus('current')
if mibBuilder.loadTexts: ctspOperSgaclDestSgt.setDescription('This object indicates the destination SGT value. Value of zero indicates that the destination SGT is unknown.')
ctspOperSgaclSourceSgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 3), CtsSecurityGroupTag())
if mibBuilder.loadTexts: ctspOperSgaclSourceSgt.setStatus('current')
if mibBuilder.loadTexts: ctspOperSgaclSourceSgt.setDescription('This object indicates the source SGT value. Value of zero indicates that the source SGT is unknown.')
ctspOperSgaclIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: ctspOperSgaclIndex.setStatus('current')
if mibBuilder.loadTexts: ctspOperSgaclIndex.setDescription('This object identifies the SGACL operationally applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctspOperationalSgaclName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 5), CtsAclName()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspOperationalSgaclName.setStatus('current')
if mibBuilder.loadTexts: ctspOperationalSgaclName.setDescription('This object indicates the name of the SGACL operationally applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctspOperationalSgaclGenId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 6), CtsGenerationId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspOperationalSgaclGenId.setStatus('current')
if mibBuilder.loadTexts: ctspOperationalSgaclGenId.setDescription('This object indicates the generation identification of the SGACL operationally applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctspOperSgaclMappingSource = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configured", 1), ("downloaded", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspOperSgaclMappingSource.setStatus('current')
if mibBuilder.loadTexts: ctspOperSgaclMappingSource.setDescription("This object indicates the source of SGACL mapping for the SGACL operationally applied to unicast IP traffic carrying the source SGT to the destination SGT. 'downloaded' indicates that the mapping is downloaded from ACS server. 'configured' indicates that the mapping is locally configured in the device.")
ctspOperSgaclConfigSource = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configured", 1), ("downloaded", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspOperSgaclConfigSource.setStatus('current')
if mibBuilder.loadTexts: ctspOperSgaclConfigSource.setDescription("This object indicates the source of SGACL creation for this SGACL. 'configured' indicates that the SGACL is locally configured in the local device. 'downloaded' indicates that the SGACL is created at ACS server and downloaded to the local device.")
ctspOperSgaclMonitor = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 9), CtsSgaclMonitorMode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspOperSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts: ctspOperSgaclMonitor.setDescription('This object indicates whether SGACL monitor mode is turned on for the SGACL enforced traffic.')
ctspDefOperSgaclMappingTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7), )
if mibBuilder.loadTexts: ctspDefOperSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts: ctspDefOperSgaclMappingTable.setDescription('This table contains the operational SGACLs information of the default policy applied to unicast IP traffic.')
ctspDefOperSgaclMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspDefOperIpTrafficType"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspDefOperSgaclIndex"))
if mibBuilder.loadTexts: ctspDefOperSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts: ctspDefOperSgaclMappingEntry.setDescription('A row instance contains the SGACL information of the default policy which is either statically configured at the device or dynamically downloaded from ACS server for unicast IP traffic.')
ctspDefOperIpTrafficType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2))))
if mibBuilder.loadTexts: ctspDefOperIpTrafficType.setStatus('current')
if mibBuilder.loadTexts: ctspDefOperIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic subjected to default policy enforcement.')
ctspDefOperSgaclIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)))
if mibBuilder.loadTexts: ctspDefOperSgaclIndex.setStatus('current')
if mibBuilder.loadTexts: ctspDefOperSgaclIndex.setDescription('This object identifies the SGACL of default policy operationally applied to unicast IP traffic.')
ctspDefOperationalSgaclName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 3), CtsAclName()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefOperationalSgaclName.setStatus('current')
if mibBuilder.loadTexts: ctspDefOperationalSgaclName.setDescription('This object indicates the name of the SGACL of default policy operationally applied to unicast IP traffic.')
ctspDefOperationalSgaclGenId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 4), CtsGenerationId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefOperationalSgaclGenId.setStatus('current')
if mibBuilder.loadTexts: ctspDefOperationalSgaclGenId.setDescription('This object indicates the generation identification of the SGACL of default policy operationally applied to unicast IP traffic.')
ctspDefOperSgaclMappingSource = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configured", 1), ("downloaded", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefOperSgaclMappingSource.setStatus('current')
if mibBuilder.loadTexts: ctspDefOperSgaclMappingSource.setDescription("This object indicates the source of SGACL mapping for the SGACL of default policy operationally applied to unicast IP traffic. 'downloaded' indicates that the mapping is downloaded from ACS server. 'configured' indicates that the mapping is locally configured in the device.")
ctspDefOperSgaclConfigSource = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("configured", 1), ("downloaded", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefOperSgaclConfigSource.setStatus('current')
if mibBuilder.loadTexts: ctspDefOperSgaclConfigSource.setDescription("This object indicates the source of SGACL creation for the SGACL of default policy operationally applied to unicast IP traffic. 'downloaded' indicates that the SGACL is created at ACS server and downloaded to the local device. 'configured' indicates that the SGACL is locally configured in the local device.")
ctspDefOperSgaclMonitor = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 7), CtsSgaclMonitorMode()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefOperSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts: ctspDefOperSgaclMonitor.setDescription('This object indicates whether SGACL monitor mode is turned on for the SGACL of default policy enforced traffic.')
ctspDefConfigIpv4SgaclsMonitor = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 8), CtsSgaclMonitorMode()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspDefConfigIpv4SgaclsMonitor.setStatus('current')
if mibBuilder.loadTexts: ctspDefConfigIpv4SgaclsMonitor.setDescription('This object specifies whether SGACL monitor mode is turned on for the default configured SGACL enforced Ipv4 traffic.')
ctspDefConfigIpv6SgaclsMonitor = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 9), CtsSgaclMonitorMode()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspDefConfigIpv6SgaclsMonitor.setStatus('current')
if mibBuilder.loadTexts: ctspDefConfigIpv6SgaclsMonitor.setDescription('This object specifies whether SGACL monitor mode is turned on for the default configured SGACL enforced Ipv6 traffic.')
ctspSgaclMonitorEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 10), CtsSgaclMonitorMode()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspSgaclMonitorEnable.setStatus('current')
if mibBuilder.loadTexts: ctspSgaclMonitorEnable.setDescription('This object specifies whether SGACL monitor mode is turned on for the entire system. It has precedence than the per SGACL ctspConfigSgaclMonitor control. It could act as safety mechanism to turn off monitor in case the monitor feature impact system performance.')
ctspSgtStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1), )
if mibBuilder.loadTexts: ctspSgtStatsTable.setStatus('current')
if mibBuilder.loadTexts: ctspSgtStatsTable.setDescription('This table describes SGACL statistics counters per a pair of <source SGT, destination SGT> that is capable of providing this information.')
ctspSgtStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspStatsIpTrafficType"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspStatsDestSgt"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspStatsSourceSgt"))
if mibBuilder.loadTexts: ctspSgtStatsEntry.setStatus('current')
if mibBuilder.loadTexts: ctspSgtStatsEntry.setDescription('Each row contains the SGACL statistics related to IPv4 or IPv6 packets carrying the source SGT travelling to the destination SGT and subjected to SGACL enforcement.')
ctspStatsIpTrafficType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2))))
if mibBuilder.loadTexts: ctspStatsIpTrafficType.setStatus('current')
if mibBuilder.loadTexts: ctspStatsIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic carrying the source SGT and travelling to destination SGT and subjected to SGACL enforcement.')
ctspStatsDestSgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 2), CtsSecurityGroupTag())
if mibBuilder.loadTexts: ctspStatsDestSgt.setStatus('current')
if mibBuilder.loadTexts: ctspStatsDestSgt.setDescription('This object indicates the destination SGT value. Value of zero indicates that the destination SGT is unknown.')
ctspStatsSourceSgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 3), CtsSecurityGroupTag())
if mibBuilder.loadTexts: ctspStatsSourceSgt.setStatus('current')
if mibBuilder.loadTexts: ctspStatsSourceSgt.setDescription('This object indicates the source SGT value. Value of zero indicates that the source SGT is unknown.')
ctspStatsIpSwDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspStatsIpSwDropPkts.setStatus('current')
if mibBuilder.loadTexts: ctspStatsIpSwDropPkts.setDescription('This object indicates the number of software-forwarded IP packets which are dropped by SGACL.')
ctspStatsIpHwDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspStatsIpHwDropPkts.setStatus('current')
if mibBuilder.loadTexts: ctspStatsIpHwDropPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are dropped by SGACL.')
ctspStatsIpSwPermitPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspStatsIpSwPermitPkts.setStatus('current')
if mibBuilder.loadTexts: ctspStatsIpSwPermitPkts.setDescription('This object indicates the number of software-forwarded IP packets which are permitted by SGACL.')
ctspStatsIpHwPermitPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspStatsIpHwPermitPkts.setStatus('current')
if mibBuilder.loadTexts: ctspStatsIpHwPermitPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are permitted by SGACL.')
ctspStatsIpSwMonitorPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 8), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspStatsIpSwMonitorPkts.setStatus('current')
if mibBuilder.loadTexts: ctspStatsIpSwMonitorPkts.setDescription('This object indicates the number of software-forwarded IP packets which are SGACL enforced & monitored.')
ctspStatsIpHwMonitorPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 9), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspStatsIpHwMonitorPkts.setStatus('current')
if mibBuilder.loadTexts: ctspStatsIpHwMonitorPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are SGACL enforced & monitored.')
ctspDefStatsTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2), )
if mibBuilder.loadTexts: ctspDefStatsTable.setStatus('current')
if mibBuilder.loadTexts: ctspDefStatsTable.setDescription('This table describes statistics counters for unicast IP traffic subjected to default unicast policy.')
ctspDefStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspDefIpTrafficType"))
if mibBuilder.loadTexts: ctspDefStatsEntry.setStatus('current')
if mibBuilder.loadTexts: ctspDefStatsEntry.setDescription('Each row contains the statistics counter for each IP traffic type.')
ctspDefIpTrafficType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2))))
if mibBuilder.loadTexts: ctspDefIpTrafficType.setStatus('current')
if mibBuilder.loadTexts: ctspDefIpTrafficType.setDescription('This object indicates the type of the IP traffic subjected to default unicast policy enforcement.')
ctspDefIpSwDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 2), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefIpSwDropPkts.setStatus('current')
if mibBuilder.loadTexts: ctspDefIpSwDropPkts.setDescription('This object indicates the number of software-forwarded IP packets which are dropped by default unicast policy.')
ctspDefIpHwDropPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 3), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefIpHwDropPkts.setStatus('current')
if mibBuilder.loadTexts: ctspDefIpHwDropPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are dropped by default unicast policy.')
ctspDefIpSwPermitPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 4), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefIpSwPermitPkts.setStatus('current')
if mibBuilder.loadTexts: ctspDefIpSwPermitPkts.setDescription('This object indicates the number of software-forwarded IP packets which are permitted by default unicast policy.')
ctspDefIpHwPermitPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 5), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefIpHwPermitPkts.setStatus('current')
if mibBuilder.loadTexts: ctspDefIpHwPermitPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are permitted by default unicast policy.')
ctspDefIpSwMonitorPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 6), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefIpSwMonitorPkts.setStatus('current')
if mibBuilder.loadTexts: ctspDefIpSwMonitorPkts.setDescription('This object indicates the number of software-forwarded IP packets which are monitored by default unicast policy.')
ctspDefIpHwMonitorPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 7), Counter64()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDefIpHwMonitorPkts.setStatus('current')
if mibBuilder.loadTexts: ctspDefIpHwMonitorPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are monitored by default unicast policy.')
ctspAllPeerPolicyAction = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("refresh", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspAllPeerPolicyAction.setStatus('current')
if mibBuilder.loadTexts: ctspAllPeerPolicyAction.setDescription("This object allows user to specify the action to be taken with respect to all peer policies in the device. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh all peer policies in the device.")
ctspPeerPolicyTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2), )
if mibBuilder.loadTexts: ctspPeerPolicyTable.setStatus('current')
if mibBuilder.loadTexts: ctspPeerPolicyTable.setDescription('This table lists the peer policy information for each peer device.')
ctspPeerPolicyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1), ).setIndexNames((1, "CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerName"))
if mibBuilder.loadTexts: ctspPeerPolicyEntry.setStatus('current')
if mibBuilder.loadTexts: ctspPeerPolicyEntry.setDescription('Each row contains the managed objects for peer policies for each peer device based on its name.')
ctspPeerName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 128)))
if mibBuilder.loadTexts: ctspPeerName.setStatus('current')
if mibBuilder.loadTexts: ctspPeerName.setDescription('This object uniquely identifies a peer device.')
ctspPeerSgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 2), CtsSecurityGroupTag()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspPeerSgt.setStatus('current')
if mibBuilder.loadTexts: ctspPeerSgt.setDescription('This object indicates the SGT value of this peer device.')
ctspPeerSgtGenId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 3), CtsGenerationId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspPeerSgtGenId.setStatus('current')
if mibBuilder.loadTexts: ctspPeerSgtGenId.setDescription('This object indicates the generation identification of the SGT value assigned to this peer device.')
ctspPeerTrustState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("trusted", 1), ("noTrust", 2)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspPeerTrustState.setStatus('current')
if mibBuilder.loadTexts: ctspPeerTrustState.setDescription("This object indicates the TrustSec trust state of this peer device. 'trusted' indicates that this is a trusted peer device. 'noTrust' indicates that this peer device is not trusted.")
ctspPeerPolicyLifeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 5), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspPeerPolicyLifeTime.setStatus('current')
if mibBuilder.loadTexts: ctspPeerPolicyLifeTime.setDescription('This object indicates the policy life time which provides the time interval during which the peer policy is valid.')
ctspPeerPolicyLastUpdate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 6), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspPeerPolicyLastUpdate.setStatus('current')
if mibBuilder.loadTexts: ctspPeerPolicyLastUpdate.setDescription('This object indicates the time when this peer policy is last updated.')
ctspPeerPolicyAction = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("refresh", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspPeerPolicyAction.setStatus('current')
if mibBuilder.loadTexts: ctspPeerPolicyAction.setDescription("This object allows user to specify the action to be taken with this peer policy. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh this peer policy.")
ctspLayer3PolicyTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1), )
if mibBuilder.loadTexts: ctspLayer3PolicyTable.setStatus('current')
if mibBuilder.loadTexts: ctspLayer3PolicyTable.setDescription('This table describes Layer 3 transport policy for IP traffic regarding SGT propagation.')
ctspLayer3PolicyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspLayer3PolicyIpTrafficType"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspLayer3PolicyType"))
if mibBuilder.loadTexts: ctspLayer3PolicyEntry.setStatus('current')
if mibBuilder.loadTexts: ctspLayer3PolicyEntry.setDescription('Each row contains the Layer 3 transport policies per IP traffic type per policy type.')
ctspLayer3PolicyIpTrafficType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("ipv4", 1), ("ipv6", 2))))
if mibBuilder.loadTexts: ctspLayer3PolicyIpTrafficType.setStatus('current')
if mibBuilder.loadTexts: ctspLayer3PolicyIpTrafficType.setDescription("This object indicates the type of the IP traffic affected by Layer-3 transport policy. 'ipv4' indicates that the affected traffic is IPv4 traffic. 'ipv6' indicates that the affected traffic is IPv6 traffic.")
ctspLayer3PolicyType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("permit", 1), ("exception", 2))))
if mibBuilder.loadTexts: ctspLayer3PolicyType.setStatus('current')
if mibBuilder.loadTexts: ctspLayer3PolicyType.setDescription("This object indicates the type of the Layer-3 transport policy affecting IP traffic regarding SGT propagation. 'permit' indicates that the transport policy is used to classify Layer-3 traffic which is subject to SGT propagation. 'exception' indicates that the transport policy is used to classify Layer-3 traffic which is NOT subject to SGT propagation.")
ctspLayer3PolicyLocalConfig = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 3), CtsAclNameOrEmpty()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspLayer3PolicyLocalConfig.setStatus('current')
if mibBuilder.loadTexts: ctspLayer3PolicyLocalConfig.setDescription('This object specifies the name of an ACL that is administratively configured to classify Layer3 traffic. Zero-length string indicates there is no such configured policy.')
ctspLayer3PolicyDownloaded = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 4), CtsAclNameOrEmpty()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspLayer3PolicyDownloaded.setStatus('current')
if mibBuilder.loadTexts: ctspLayer3PolicyDownloaded.setDescription('This object specifies the name of an ACL that is downloaded from policy server to classify Layer3 traffic. Zero-length string indicates there is no such downloaded policy.')
ctspLayer3PolicyOperational = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 5), CtsAclNameOrEmpty()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspLayer3PolicyOperational.setStatus('current')
if mibBuilder.loadTexts: ctspLayer3PolicyOperational.setDescription('This object specifies the name of an operational ACL currently used to classify Layer3 traffic. Zero-length string indicates there is no such policy in effect.')
ctspIfL3PolicyConfigTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 2), )
if mibBuilder.loadTexts: ctspIfL3PolicyConfigTable.setStatus('current')
if mibBuilder.loadTexts: ctspIfL3PolicyConfigTable.setDescription('This table lists the interfaces which support Layer3 Transport policy.')
ctspIfL3PolicyConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: ctspIfL3PolicyConfigEntry.setStatus('current')
if mibBuilder.loadTexts: ctspIfL3PolicyConfigEntry.setDescription('Each row contains managed objects for Layer3 Transport on interface capable of providing this information.')
ctspIfL3Ipv4PolicyEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 2, 1, 1), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspIfL3Ipv4PolicyEnabled.setStatus('current')
if mibBuilder.loadTexts: ctspIfL3Ipv4PolicyEnabled.setDescription("This object specifies whether the Layer3 Transport policies will be applied on this interface for egress IPv4 traffic. 'true' indicates that Layer3 permit and exception policy will be applied at this interface for egress IPv4 traffic. 'false' indicates that Layer3 permit and exception policy will not be applied at this interface for egress IPv4 traffic.")
ctspIfL3Ipv6PolicyEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 2, 1, 2), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspIfL3Ipv6PolicyEnabled.setStatus('current')
if mibBuilder.loadTexts: ctspIfL3Ipv6PolicyEnabled.setDescription("This object specifies whether the Layer3 Transport policies will be applied on this interface for egress IPv6 traffic. 'true' indicates that Layer3 permit and exception policy will be applied at this interface for egress IPv6 traffic. 'false' indicates that Layer3 permit and exception policy will not be applied at this interface for egress IPv6 traffic.")
ctspIpSgtMappingTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1), )
if mibBuilder.loadTexts: ctspIpSgtMappingTable.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtMappingTable.setDescription('This table contains the IP-to-SGT mapping information in the device.')
ctspIpSgtMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtVrfName"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtAddressType"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtIpAddress"), (0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtAddressLength"))
if mibBuilder.loadTexts: ctspIpSgtMappingEntry.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtMappingEntry.setDescription('Each row contains the IP-to-SGT mapping and status of this instance. Entry in this table is either populated automatically by the device or manually configured by a user. A manually configured row instance can be created or removed by setting the appropriate value of its RowStatus object.')
ctspIpSgtVrfName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 1), CiscoVrfName())
if mibBuilder.loadTexts: ctspIpSgtVrfName.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtVrfName.setDescription('This object indicates the VRF where IP-SGT mapping belongs to. The zero length value indicates the default VRF.')
ctspIpSgtAddressType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 2), InetAddressType())
if mibBuilder.loadTexts: ctspIpSgtAddressType.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtAddressType.setDescription('This object indicates the type of Internet address.')
ctspIpSgtIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 3), InetAddress())
if mibBuilder.loadTexts: ctspIpSgtIpAddress.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtIpAddress.setDescription('This object indicates an Internet address. The type of this address is determined by the value of ctspIpSgtAddressType object.')
ctspIpSgtAddressLength = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 4), InetAddressPrefixLength())
if mibBuilder.loadTexts: ctspIpSgtAddressLength.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtAddressLength.setDescription('This object indicates the length of an Internet address prefix.')
ctspIpSgtValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 5), CtsSecurityGroupTag()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspIpSgtValue.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtValue.setDescription('This object specifies the SGT value assigned to an Internet address.')
ctspIpSgtSource = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("configured", 1), ("arp", 2), ("localAuthenticated", 3), ("sxp", 4), ("internal", 5), ("l3if", 6), ("vlan", 7), ("caching", 8)))).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspIpSgtSource.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtSource.setDescription("This object indicates the source of the mapping. 'configured' indicates that the mapping is manually configured by user. 'arp' indicates that the mapping is dynamically learnt from tagged ARP replies. 'localAuthenticated' indicates that the mapping is dynamically learnt from the device authentication of a host. 'sxp' indicates that the mapping is dynamically learnt from SXP (SGT Propagation Protocol). 'internal' indicates that the mapping is automatically created by the device between the device IP addresses and the device own SGT. 'l3if' indicates that Interface-SGT mapping is configured by user. 'vlan' indicates that Vlan-SGT mapping is configured by user. 'cached' indicates that sgt mapping is cached. Only 'configured' value is accepted when setting this object.")
ctspIpSgtStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 7), StorageType().clone('volatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspIpSgtStorageType.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtStorageType.setDescription('The storage type for this conceptual row.')
ctspIpSgtRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 8), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspIpSgtRowStatus.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtRowStatus.setDescription("This object is used to manage the creation and deletion of rows in this table. If this object value is 'active', user cannot modify any writable object in this row. If value of ctspIpSgtSource object in an entry is not 'configured', user cannot change the value of this object.")
ctspAllSgtPolicyAction = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("refresh", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspAllSgtPolicyAction.setStatus('current')
if mibBuilder.loadTexts: ctspAllSgtPolicyAction.setDescription("This object allows user to specify the action to be taken with respect to all SGT policies in the device. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh all SGT policies in the device.")
ctspDownloadedSgtPolicyTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2), )
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyTable.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyTable.setDescription('This table lists the SGT policy information downloaded by the device.')
ctspDownloadedSgtPolicyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgtPolicySgt"))
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyEntry.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyEntry.setDescription('Each row contains the managed objects for SGT policies downloaded by the device.')
ctspDownloadedSgtPolicySgt = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 1), CtsSecurityGroupTag())
if mibBuilder.loadTexts: ctspDownloadedSgtPolicySgt.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgtPolicySgt.setDescription('This object indicates the SGT value for which the downloaded policy is applied to. Value of zero indicates that the SGT is unknown.')
ctspDownloadedSgtPolicySgtGenId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 2), CtsGenerationId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedSgtPolicySgtGenId.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgtPolicySgtGenId.setDescription('This object indicates the generation identification of the SGT value denoted by ctspDownloadedSgtPolicySgt object.')
ctspDownloadedSgtPolicyLifeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 3), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyLifeTime.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyLifeTime.setDescription('This object indicates the policy life time which provides the time interval during which this downloaded policy is valid.')
ctspDownloadedSgtPolicyLastUpdate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 4), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyLastUpdate.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyLastUpdate.setDescription('This object indicates the time when this downloaded SGT policy is last updated.')
ctspDownloadedSgtPolicyAction = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("refresh", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyAction.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgtPolicyAction.setDescription("This object allows user to specify the action to be taken with this downloaded SGT policy. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh this SGT policy.")
ctspDownloadedDefSgtPolicyTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3), )
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyTable.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyTable.setDescription('This table lists the default SGT policy information downloaded by the device.')
ctspDownloadedDefSgtPolicyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedDefSgtPolicyType"))
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyEntry.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyEntry.setDescription('Each row contains the managed objects for default SGT policies downloaded by the device.')
ctspDownloadedDefSgtPolicyType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("unicastDefault", 1))))
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyType.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyType.setDescription("This object indicates the downloaded default SGT policy type. 'unicastDefault' indicates the SGT policy applied to traffic which carries the default unicast SGT.")
ctspDownloadedDefSgtPolicySgtGenId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 2), CtsGenerationId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicySgtGenId.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicySgtGenId.setDescription('This object indicates the generation identification of the downloaded default SGT policy.')
ctspDownloadedDefSgtPolicyLifeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 3), Unsigned32()).setUnits('seconds').setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyLifeTime.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyLifeTime.setDescription('This object indicates the policy life time which provides the time interval during which this download default policy is valid.')
ctspDownloadedDefSgtPolicyLastUpdate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 4), DateAndTime()).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyLastUpdate.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyLastUpdate.setDescription('This object indicates the time when this downloaded SGT policy is last updated.')
ctspDownloadedDefSgtPolicyAction = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("none", 1), ("refresh", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyAction.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedDefSgtPolicyAction.setDescription("This object allows user to specify the action to be taken with this default downloaded SGT policy. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh this default SGT policy.")
ctspIfSgtMappingTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1), )
if mibBuilder.loadTexts: ctspIfSgtMappingTable.setStatus('current')
if mibBuilder.loadTexts: ctspIfSgtMappingTable.setDescription('This table contains the Interface-to-SGT mapping configuration information in the device.')
ctspIfSgtMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: ctspIfSgtMappingEntry.setStatus('current')
if mibBuilder.loadTexts: ctspIfSgtMappingEntry.setDescription('Each row contains the SGT mapping configuration of a particular interface. A row instance can be created or removed by setting ctspIfSgtRowStatus.')
ctspIfSgtValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1, 1), CtsSecurityGroupTag()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspIfSgtValue.setStatus('current')
if mibBuilder.loadTexts: ctspIfSgtValue.setDescription('This object specifies the SGT value assigned to the interface.')
ctspIfSgName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1, 2), SnmpAdminString()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspIfSgName.setStatus('current')
if mibBuilder.loadTexts: ctspIfSgName.setDescription('This object specifies the Security Group Name assigned to the interface.')
ctspIfSgtStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1, 3), StorageType().clone('volatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspIfSgtStorageType.setStatus('current')
if mibBuilder.loadTexts: ctspIfSgtStorageType.setDescription('The storage type for this conceptual row.')
ctspIfSgtRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspIfSgtRowStatus.setStatus('current')
if mibBuilder.loadTexts: ctspIfSgtRowStatus.setDescription('This object is used to manage the creation and deletion of rows in this table.')
ctspIfSgtMappingInfoTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 2), )
if mibBuilder.loadTexts: ctspIfSgtMappingInfoTable.setStatus('current')
if mibBuilder.loadTexts: ctspIfSgtMappingInfoTable.setDescription('This table contains the Interface-to-SGT mapping status information in the device.')
ctspIfSgtMappingInfoEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"))
if mibBuilder.loadTexts: ctspIfSgtMappingInfoEntry.setStatus('current')
if mibBuilder.loadTexts: ctspIfSgtMappingInfoEntry.setDescription('Containing the Interface-to-SGT mapping status of the specified interface.')
ctspL3IPMStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("disabled", 1), ("active", 2), ("inactive", 3)))).setMaxAccess("readonly")
if mibBuilder.loadTexts: ctspL3IPMStatus.setStatus('current')
if mibBuilder.loadTexts: ctspL3IPMStatus.setDescription('This object indicates the Layer 3 Identity Port Mapping(IPM) operational mode. disabled - The L3 IPM is not configured. active - The L3 IPM is configured for this interface, and SGT is available. inactive - The L3 IPM is configured for this interface, and SGT is unavailable.')
ctspVlanSgtMappingTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1), )
if mibBuilder.loadTexts: ctspVlanSgtMappingTable.setStatus('current')
if mibBuilder.loadTexts: ctspVlanSgtMappingTable.setDescription('This table contains the Vlan-SGT mapping information in the device.')
ctspVlanSgtMappingEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1), ).setIndexNames((0, "CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanSgtMappingIndex"))
if mibBuilder.loadTexts: ctspVlanSgtMappingEntry.setStatus('current')
if mibBuilder.loadTexts: ctspVlanSgtMappingEntry.setDescription('Each row contains the SGT mapping configuration of a particular VLAN. A row instance can be created or removed by setting ctspVlanSgtRowStatus.')
ctspVlanSgtMappingIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1, 1), VlanIndex())
if mibBuilder.loadTexts: ctspVlanSgtMappingIndex.setStatus('current')
if mibBuilder.loadTexts: ctspVlanSgtMappingIndex.setDescription('This object specifies the VLAN-ID which is used as index.')
ctspVlanSgtMapValue = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1, 2), CtsSecurityGroupTag()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspVlanSgtMapValue.setStatus('current')
if mibBuilder.loadTexts: ctspVlanSgtMapValue.setDescription('This object specifies the SGT value assigned to the vlan.')
ctspVlanSgtStorageType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1, 3), StorageType().clone('volatile')).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspVlanSgtStorageType.setStatus('current')
if mibBuilder.loadTexts: ctspVlanSgtStorageType.setDescription('The storage type for this conceptual row.')
ctspVlanSgtRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1, 4), RowStatus()).setMaxAccess("readcreate")
if mibBuilder.loadTexts: ctspVlanSgtRowStatus.setStatus('current')
if mibBuilder.loadTexts: ctspVlanSgtRowStatus.setDescription('This object is used to manage the creation and deletion of rows in this table.')
ctspSgtCachingMode = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 8, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("standAlone", 2), ("withEnforcement", 3), ("vlan", 4)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspSgtCachingMode.setStatus('current')
if mibBuilder.loadTexts: ctspSgtCachingMode.setDescription("This object specifies which SGT-caching mode is configured for SGT caching capable interfaces at the managed system. 'none' indicates that sgt-caching for all Layer 3 interfaces (excluding SVIs) is disabled. 'standAlone' indicates that SGT-caching is enabled on every TrustSec capable Layer3 interface (excluding SVIs) in the device. 'withEnforcement' indicates that SGT-caching is enabled on interfaces that have RBAC enforcement enabled. 'vlan' indicates that SGT-caching is enabled on the VLANs specified by ctspSgtCachingVlansfFirst2K & ctspSgtCachingVlansSecond2K")
ctspSgtCachingVlansFirst2K = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 8, 2), Cisco2KVlanList()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspSgtCachingVlansFirst2K.setStatus('current')
if mibBuilder.loadTexts: ctspSgtCachingVlansFirst2K.setDescription('A string of octets containing one bit per VLAN for VLANs 0 to 2047. If the bit corresponding to a VLAN is set to 1, it indicates SGT-caching is enabled on the VLAN. If the bit corresponding to a VLAN is set to 0, it indicates SGT-caching is disabled on the VLAN.')
ctspSgtCachingVlansSecond2K = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 8, 3), Cisco2KVlanList()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspSgtCachingVlansSecond2K.setStatus('current')
if mibBuilder.loadTexts: ctspSgtCachingVlansSecond2K.setDescription('A string of octets containing one bit per VLAN for VLANs 2048 to 4095. If the bit corresponding to a VLAN is set to 1, it indicates SGT-caching is enabled on the VLAN. If the bit corresponding to a VLAN is set to 0, it indicates SGT-caching is disabled on the VLAN.')
ctspPeerPolicyUpdatedNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 9, 1), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspPeerPolicyUpdatedNotifEnable.setStatus('current')
if mibBuilder.loadTexts: ctspPeerPolicyUpdatedNotifEnable.setDescription("This object specifies whether the system generates ctspPeerPolicyUpdatedNotif. A value of 'false' will prevent ctspPeerPolicyUpdatedNotif notifications from being generated by this system.")
ctspAuthorizationSgaclFailNotifEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 9, 2), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ctspAuthorizationSgaclFailNotifEnable.setStatus('current')
if mibBuilder.loadTexts: ctspAuthorizationSgaclFailNotifEnable.setDescription("This object specifies whether this system generates the ctspAuthorizationSgaclFailNotif. A value of 'false' will prevent ctspAuthorizationSgaclFailNotif notifications from being generated by this system.")
ctspOldPeerSgt = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 10, 1), CtsSecurityGroupTag()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: ctspOldPeerSgt.setStatus('current')
if mibBuilder.loadTexts: ctspOldPeerSgt.setDescription('This object provides the old sgt value for ctspPeerPolicyUpdatedNotif, i.e., the sgt value before the policy is updated.')
ctspAuthorizationSgaclFailReason = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 10, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("downloadACE", 1), ("downloadSrc", 2), ("downloadDst", 3), ("installPolicy", 4), ("installPolicyStandby", 5), ("installForIP", 6), ("uninstall", 7)))).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: ctspAuthorizationSgaclFailReason.setStatus('current')
if mibBuilder.loadTexts: ctspAuthorizationSgaclFailReason.setDescription("This object indicates the reason of failure during SGACL acquisitions, installations and uninstallations, which is associated with ctspAuthorizationSgaclFailNotif; 'downloadACE' - Failure during downloading ACE in SGACL acquisition. 'downloadSrc' - Failure during downloading source list in SGACL acquisition. 'downloadDst' - Failure during downloading destination list in SGACL acquisition. 'installPolicy' - Failure during SGACL policy installation 'installPolicyStandby' - Failure during SGACL policy installation on standby 'installForIP' - Failure during SGACL installation for specific IP type. 'uninstall' - Failure during SGACL uninstallation.")
ctspAuthorizationSgaclFailInfo = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 10, 3), SnmpAdminString()).setMaxAccess("accessiblefornotify")
if mibBuilder.loadTexts: ctspAuthorizationSgaclFailInfo.setStatus('current')
if mibBuilder.loadTexts: ctspAuthorizationSgaclFailInfo.setDescription('This object provides additional information about authorization SGACL failure, which is associated with ctspAuthorizationSgaclFailNotif.')
ctspPeerPolicyUpdatedNotif = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 713, 0, 1)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspOldPeerSgt"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerSgt"))
if mibBuilder.loadTexts: ctspPeerPolicyUpdatedNotif.setStatus('current')
if mibBuilder.loadTexts: ctspPeerPolicyUpdatedNotif.setDescription('A ctspPeerPolicyUpdatedNotif is generated when the SGT value of a peer device has been updated.')
ctspAuthorizationSgaclFailNotif = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 713, 0, 2)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspAuthorizationSgaclFailReason"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspAuthorizationSgaclFailInfo"))
if mibBuilder.loadTexts: ctspAuthorizationSgaclFailNotif.setStatus('current')
if mibBuilder.loadTexts: ctspAuthorizationSgaclFailNotif.setDescription('A ctspAuthorizationSgaclFailNotif is generated when the authorization of SGACL fails.')
ciscoTrustSecPolicyMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 1))
ciscoTrustSecPolicyMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2))
ciscoTrustSecPolicyMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 1, 1)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspGlobalSgaclEnforcementGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspOperSgaclMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgaclMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSwStatisticsGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefSwStatisticsGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanConfigGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspConfigSgaclMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpHwStatisticsGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefHwStatisticsGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclIpv4DropNetflowMonitorGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclIpv6DropNetflowMonitorGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerPolicyGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerPolicyActionGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspLayer3TransportGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIfL3PolicyConfigGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgtPolicyGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTrustSecPolicyMIBCompliance = ciscoTrustSecPolicyMIBCompliance.setStatus('deprecated')
if mibBuilder.loadTexts: ciscoTrustSecPolicyMIBCompliance.setDescription('The compliance statement for the CISCO-TRUSTSEC-POLICY-MIB')
ciscoTrustSecPolicyMIBComplianceRev2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 1, 2)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspGlobalSgaclEnforcementGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspOperSgaclMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgaclMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSwStatisticsGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefSwStatisticsGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanConfigGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspConfigSgaclMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpHwStatisticsGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefHwStatisticsGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclIpv4DropNetflowMonitorGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclIpv6DropNetflowMonitorGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerPolicyGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerPolicyActionGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspLayer3TransportGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIfL3PolicyConfigGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgtPolicyGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIfSgtMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanSgtMappingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgtCachingGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclMonitorGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclMonitorStatisticGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspNotifCtrlGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspNotifGroup"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspNotifInfoGroup"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ciscoTrustSecPolicyMIBComplianceRev2 = ciscoTrustSecPolicyMIBComplianceRev2.setStatus('current')
if mibBuilder.loadTexts: ciscoTrustSecPolicyMIBComplianceRev2.setDescription('The compliance statement for the CISCO-TRUSTSEC-POLICY-MIB')
ctspGlobalSgaclEnforcementGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 1)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclEnforcementEnable"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspGlobalSgaclEnforcementGroup = ctspGlobalSgaclEnforcementGroup.setStatus('current')
if mibBuilder.loadTexts: ctspGlobalSgaclEnforcementGroup.setDescription('A collection of object which provides the SGACL enforcement information for all TrustSec capable Layer 3 interfaces (excluding SVIs) at the device level.')
ctspSgaclIpv4DropNetflowMonitorGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 2)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclIpv4DropNetflowMonitor"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspSgaclIpv4DropNetflowMonitorGroup = ctspSgaclIpv4DropNetflowMonitorGroup.setStatus('current')
if mibBuilder.loadTexts: ctspSgaclIpv4DropNetflowMonitorGroup.setDescription('A collection of object which provides netflow monitor information for IPv4 traffic drop packet due to SGACL enforcement in the device.')
ctspSgaclIpv6DropNetflowMonitorGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 3)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclIpv6DropNetflowMonitor"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspSgaclIpv6DropNetflowMonitorGroup = ctspSgaclIpv6DropNetflowMonitorGroup.setStatus('current')
if mibBuilder.loadTexts: ctspSgaclIpv6DropNetflowMonitorGroup.setDescription('A collection of object which provides netflow monitor information for IPv6 traffic drop packet due to SGACL enforcement in the device.')
ctspVlanConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 4)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanConfigSgaclEnforcement"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanSviActive"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanConfigVrfName"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanConfigStorageType"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanConfigRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspVlanConfigGroup = ctspVlanConfigGroup.setStatus('current')
if mibBuilder.loadTexts: ctspVlanConfigGroup.setDescription('A collection of object which provides the SGACL enforcement and VRF information for each VLAN.')
ctspConfigSgaclMappingGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 5)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspConfigSgaclMappingSgaclName"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspConfigSgaclMappingStorageType"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspConfigSgaclMappingRowStatus"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefConfigIpv4Sgacls"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefConfigIpv6Sgacls"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspConfigSgaclMappingGroup = ctspConfigSgaclMappingGroup.setStatus('current')
if mibBuilder.loadTexts: ctspConfigSgaclMappingGroup.setDescription('A collection of objects which provides the administratively configured SGACL mapping information in the device.')
ctspDownloadedSgaclMappingGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 6)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgaclName"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgaclGenId"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedIpTrafficType"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefDownloadedSgaclName"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefDownloadedSgaclGenId"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefDownloadedIpTrafficType"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspDownloadedSgaclMappingGroup = ctspDownloadedSgaclMappingGroup.setStatus('current')
if mibBuilder.loadTexts: ctspDownloadedSgaclMappingGroup.setDescription('A collection of objects which provides the downloaded SGACL mapping information in the device.')
ctspOperSgaclMappingGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 7)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspOperationalSgaclName"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspOperationalSgaclGenId"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspOperSgaclMappingSource"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspOperSgaclConfigSource"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefOperationalSgaclName"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefOperationalSgaclGenId"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefOperSgaclMappingSource"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefOperSgaclConfigSource"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspOperSgaclMappingGroup = ctspOperSgaclMappingGroup.setStatus('current')
if mibBuilder.loadTexts: ctspOperSgaclMappingGroup.setDescription('A collection of objects which provides the operational SGACL mapping information in the device.')
ctspIpSwStatisticsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 8)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspStatsIpSwDropPkts"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspStatsIpSwPermitPkts"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspIpSwStatisticsGroup = ctspIpSwStatisticsGroup.setStatus('current')
if mibBuilder.loadTexts: ctspIpSwStatisticsGroup.setDescription('A collection of objects which provides software statistics counters for unicast IP traffic subjected to SGACL enforcement.')
ctspIpHwStatisticsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 9)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspStatsIpHwDropPkts"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspStatsIpHwPermitPkts"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspIpHwStatisticsGroup = ctspIpHwStatisticsGroup.setStatus('current')
if mibBuilder.loadTexts: ctspIpHwStatisticsGroup.setDescription('A collection of objects which provides hardware statistics counters for unicast IP traffic subjected to SGACL enforcement.')
ctspDefSwStatisticsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 10)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefIpSwDropPkts"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefIpSwPermitPkts"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspDefSwStatisticsGroup = ctspDefSwStatisticsGroup.setStatus('current')
if mibBuilder.loadTexts: ctspDefSwStatisticsGroup.setDescription('A collection of objects which provides software statistics counters for unicast IP traffic subjected to unicast default policy enforcement.')
ctspDefHwStatisticsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 11)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefIpHwDropPkts"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefIpHwPermitPkts"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspDefHwStatisticsGroup = ctspDefHwStatisticsGroup.setStatus('current')
if mibBuilder.loadTexts: ctspDefHwStatisticsGroup.setDescription('A collection of objects which provides hardware statistics counters for unicast IP traffic subjected to unicast default policy enforcement.')
ctspPeerPolicyActionGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 12)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspAllPeerPolicyAction"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspPeerPolicyActionGroup = ctspPeerPolicyActionGroup.setStatus('current')
if mibBuilder.loadTexts: ctspPeerPolicyActionGroup.setDescription('A collection of object which provides refreshing of all peer policies in the device.')
ctspPeerPolicyGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 13)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerSgt"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerSgtGenId"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerTrustState"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerPolicyLifeTime"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerPolicyLastUpdate"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerPolicyAction"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspPeerPolicyGroup = ctspPeerPolicyGroup.setStatus('current')
if mibBuilder.loadTexts: ctspPeerPolicyGroup.setDescription('A collection of object which provides peer policy information in the device.')
ctspLayer3TransportGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 14)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspLayer3PolicyLocalConfig"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspLayer3PolicyDownloaded"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspLayer3PolicyOperational"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspLayer3TransportGroup = ctspLayer3TransportGroup.setStatus('current')
if mibBuilder.loadTexts: ctspLayer3TransportGroup.setDescription('A collection of objects which provides managed information regarding the SGT propagation along with Layer 3 traffic in the device.')
ctspIfL3PolicyConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 15)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspIfL3Ipv4PolicyEnabled"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIfL3Ipv6PolicyEnabled"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspIfL3PolicyConfigGroup = ctspIfL3PolicyConfigGroup.setStatus('current')
if mibBuilder.loadTexts: ctspIfL3PolicyConfigGroup.setDescription('A collection of objects which provides managed information for Layer3 Tranport policy enforcement on capable interface in the device.')
ctspIpSgtMappingGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 16)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtValue"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtSource"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtStorageType"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIpSgtRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspIpSgtMappingGroup = ctspIpSgtMappingGroup.setStatus('current')
if mibBuilder.loadTexts: ctspIpSgtMappingGroup.setDescription('A collection of objects which provides managed information regarding IP-to-Sgt mapping in the device.')
ctspSgtPolicyGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 17)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspAllSgtPolicyAction"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgtPolicySgtGenId"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgtPolicyLifeTime"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgtPolicyLastUpdate"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgtPolicyAction"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedDefSgtPolicySgtGenId"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedDefSgtPolicyLifeTime"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedDefSgtPolicyLastUpdate"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedDefSgtPolicyAction"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspSgtPolicyGroup = ctspSgtPolicyGroup.setStatus('current')
if mibBuilder.loadTexts: ctspSgtPolicyGroup.setDescription('A collection of object which provides SGT policy information in the device.')
ctspIfSgtMappingGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 18)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspIfSgtValue"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIfSgName"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspL3IPMStatus"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIfSgtStorageType"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspIfSgtRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspIfSgtMappingGroup = ctspIfSgtMappingGroup.setStatus('current')
if mibBuilder.loadTexts: ctspIfSgtMappingGroup.setDescription('A collection of objects which provides managed information regarding Interface-to-Sgt mapping in the device.')
ctspVlanSgtMappingGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 19)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanSgtMapValue"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanSgtStorageType"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspVlanSgtRowStatus"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspVlanSgtMappingGroup = ctspVlanSgtMappingGroup.setStatus('current')
if mibBuilder.loadTexts: ctspVlanSgtMappingGroup.setDescription('A collection of objects which provides sgt mapping information for the IP traffic in the specified Vlan.')
ctspSgtCachingGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 20)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgtCachingMode"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgtCachingVlansFirst2K"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgtCachingVlansSecond2K"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspSgtCachingGroup = ctspSgtCachingGroup.setStatus('current')
if mibBuilder.loadTexts: ctspSgtCachingGroup.setDescription('A collection of objects which provides sgt Caching information.')
ctspSgaclMonitorGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 21)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspSgaclMonitorEnable"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspConfigSgaclMonitor"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefConfigIpv4SgaclsMonitor"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefConfigIpv6SgaclsMonitor"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDownloadedSgaclMonitor"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefDownloadedSgaclMonitor"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspOperSgaclMonitor"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefOperSgaclMonitor"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspSgaclMonitorGroup = ctspSgaclMonitorGroup.setStatus('current')
if mibBuilder.loadTexts: ctspSgaclMonitorGroup.setDescription('A collection of objects which provides SGACL monitor information.')
ctspSgaclMonitorStatisticGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 22)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspStatsIpSwMonitorPkts"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspStatsIpHwMonitorPkts"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefIpSwMonitorPkts"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspDefIpHwMonitorPkts"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspSgaclMonitorStatisticGroup = ctspSgaclMonitorStatisticGroup.setStatus('current')
if mibBuilder.loadTexts: ctspSgaclMonitorStatisticGroup.setDescription('A collection of objects which provides monitor statistics counters for unicast IP traffic subjected to SGACL enforcement.')
ctspNotifCtrlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 23)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerPolicyUpdatedNotifEnable"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspAuthorizationSgaclFailNotifEnable"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspNotifCtrlGroup = ctspNotifCtrlGroup.setStatus('current')
if mibBuilder.loadTexts: ctspNotifCtrlGroup.setDescription('A collection of objects providing notification control for TrustSec policy notifications.')
ctspNotifGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 24)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspPeerPolicyUpdatedNotif"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspAuthorizationSgaclFailNotif"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspNotifGroup = ctspNotifGroup.setStatus('current')
if mibBuilder.loadTexts: ctspNotifGroup.setDescription('A collection of notifications for TrustSec policy.')
ctspNotifInfoGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 25)).setObjects(("CISCO-TRUSTSEC-POLICY-MIB", "ctspOldPeerSgt"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspAuthorizationSgaclFailReason"), ("CISCO-TRUSTSEC-POLICY-MIB", "ctspAuthorizationSgaclFailInfo"))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctspNotifInfoGroup = ctspNotifInfoGroup.setStatus('current')
if mibBuilder.loadTexts: ctspNotifInfoGroup.setDescription('A collection of objects providing the variable binding for TrustSec policy notifications.')
mibBuilder.exportSymbols("CISCO-TRUSTSEC-POLICY-MIB", ctspDefDownloadedIpTrafficType=ctspDefDownloadedIpTrafficType, ctspLayer3PolicyType=ctspLayer3PolicyType, ctspPeerTrustState=ctspPeerTrustState, ctspIfSgtValue=ctspIfSgtValue, ctspDownloadedSgaclName=ctspDownloadedSgaclName, ctspSgtCachingVlansSecond2K=ctspSgtCachingVlansSecond2K, ctspDownloadedSgtPolicyLifeTime=ctspDownloadedSgtPolicyLifeTime, ctspSgacl=ctspSgacl, ctspDownloadedDefSgtPolicyLastUpdate=ctspDownloadedDefSgtPolicyLastUpdate, ctspLayer3PolicyLocalConfig=ctspLayer3PolicyLocalConfig, ctspSgaclMappings=ctspSgaclMappings, ctspAllPeerPolicyAction=ctspAllPeerPolicyAction, ctspDefOperationalSgaclGenId=ctspDefOperationalSgaclGenId, ctspSgaclStatistics=ctspSgaclStatistics, ctspDefStatsEntry=ctspDefStatsEntry, ctspOperSgaclMappingSource=ctspOperSgaclMappingSource, ctspDefIpSwPermitPkts=ctspDefIpSwPermitPkts, ciscoTrustSecPolicyMIBObjects=ciscoTrustSecPolicyMIBObjects, ctspIfSgtMappingGroup=ctspIfSgtMappingGroup, ctspVlanConfigStorageType=ctspVlanConfigStorageType, ctspOperSgaclSourceSgt=ctspOperSgaclSourceSgt, ctspDownloadedSgtPolicyLastUpdate=ctspDownloadedSgtPolicyLastUpdate, ctspPeerPolicyUpdatedNotifEnable=ctspPeerPolicyUpdatedNotifEnable, ctspIpSgtVrfName=ctspIpSgtVrfName, ctspConfigSgaclMappingEntry=ctspConfigSgaclMappingEntry, ctspDefIpHwDropPkts=ctspDefIpHwDropPkts, ctspDefOperSgaclMappingEntry=ctspDefOperSgaclMappingEntry, ctspOperIpTrafficType=ctspOperIpTrafficType, ctspStatsIpHwMonitorPkts=ctspStatsIpHwMonitorPkts, ctspDefDownloadedSgaclMappingTable=ctspDefDownloadedSgaclMappingTable, ctspOperSgaclDestSgt=ctspOperSgaclDestSgt, ctspIpSgtMappingGroup=ctspIpSgtMappingGroup, ctspIfSgtRowStatus=ctspIfSgtRowStatus, ctspDownloadedDefSgtPolicyType=ctspDownloadedDefSgtPolicyType, ctspLayer3PolicyDownloaded=ctspLayer3PolicyDownloaded, ctspStatsDestSgt=ctspStatsDestSgt, ctspPeerSgt=ctspPeerSgt, ctspVlanConfigIndex=ctspVlanConfigIndex, ctspDefDownloadedSgaclIndex=ctspDefDownloadedSgaclIndex, ctspConfigSgaclMappingStorageType=ctspConfigSgaclMappingStorageType, ctspPeerName=ctspPeerName, ctspDefIpTrafficType=ctspDefIpTrafficType, ctspOperSgaclMappingGroup=ctspOperSgaclMappingGroup, ctspPeerPolicyUpdatedNotif=ctspPeerPolicyUpdatedNotif, ctspSgtCaching=ctspSgtCaching, ciscoTrustSecPolicyMIBComplianceRev2=ciscoTrustSecPolicyMIBComplianceRev2, ciscoTrustSecPolicyMIBConformance=ciscoTrustSecPolicyMIBConformance, ctspDefOperSgaclIndex=ctspDefOperSgaclIndex, ctspOperSgaclMappingTable=ctspOperSgaclMappingTable, ctspDownloadedSgaclGenId=ctspDownloadedSgaclGenId, ctspIfSgtMappings=ctspIfSgtMappings, ctspSgaclIpv6DropNetflowMonitor=ctspSgaclIpv6DropNetflowMonitor, ciscoTrustSecPolicyMIBGroups=ciscoTrustSecPolicyMIBGroups, ctspNotifsOnlyInfo=ctspNotifsOnlyInfo, ctspVlanConfigEntry=ctspVlanConfigEntry, ctspPeerPolicy=ctspPeerPolicy, ctspDownloadedSgaclDestSgt=ctspDownloadedSgaclDestSgt, ctspDefIpHwMonitorPkts=ctspDefIpHwMonitorPkts, ctspLayer3TransportGroup=ctspLayer3TransportGroup, ctspGlobalSgaclEnforcementGroup=ctspGlobalSgaclEnforcementGroup, ctspDownloadedSgaclMappingEntry=ctspDownloadedSgaclMappingEntry, ctspPeerPolicyActionGroup=ctspPeerPolicyActionGroup, ctspSgaclGlobals=ctspSgaclGlobals, ctspNotifInfoGroup=ctspNotifInfoGroup, ctspSgaclMonitorEnable=ctspSgaclMonitorEnable, ctspStatsIpTrafficType=ctspStatsIpTrafficType, ctspConfigSgaclMonitor=ctspConfigSgaclMonitor, ctspDefConfigIpv4Sgacls=ctspDefConfigIpv4Sgacls, ctspVlanSgtMappingGroup=ctspVlanSgtMappingGroup, ctspSgtCachingGroup=ctspSgtCachingGroup, ctspIfL3PolicyConfigEntry=ctspIfL3PolicyConfigEntry, ctspConfigSgaclMappingRowStatus=ctspConfigSgaclMappingRowStatus, ctspIpSwStatisticsGroup=ctspIpSwStatisticsGroup, ctspDownloadedSgtPolicySgt=ctspDownloadedSgtPolicySgt, ctspDefConfigIpv6SgaclsMonitor=ctspDefConfigIpv6SgaclsMonitor, ctspOperSgaclIndex=ctspOperSgaclIndex, ctspVlanSgtMappingTable=ctspVlanSgtMappingTable, ctspIfSgtMappingEntry=ctspIfSgtMappingEntry, ctspAuthorizationSgaclFailNotif=ctspAuthorizationSgaclFailNotif, ctspConfigSgaclMappingGroup=ctspConfigSgaclMappingGroup, ctspIfSgtMappingTable=ctspIfSgtMappingTable, ctspStatsIpSwDropPkts=ctspStatsIpSwDropPkts, ctspIpSgtSource=ctspIpSgtSource, ctspConfigSgaclMappingSgaclName=ctspConfigSgaclMappingSgaclName, ctspLayer3PolicyEntry=ctspLayer3PolicyEntry, ctspDownloadedSgaclSourceSgt=ctspDownloadedSgaclSourceSgt, ctspVlanConfigSgaclEnforcement=ctspVlanConfigSgaclEnforcement, ctspDefDownloadedSgaclMappingEntry=ctspDefDownloadedSgaclMappingEntry, ctspIpSgtIpAddress=ctspIpSgtIpAddress, ctspDownloadedSgaclMappingTable=ctspDownloadedSgaclMappingTable, ctspDefOperSgaclMappingTable=ctspDefOperSgaclMappingTable, ctspL3IPMStatus=ctspL3IPMStatus, ctspIfL3Ipv6PolicyEnabled=ctspIfL3Ipv6PolicyEnabled, ctspOperSgaclMonitor=ctspOperSgaclMonitor, ctspIpSgtMappings=ctspIpSgtMappings, ctspPeerPolicyAction=ctspPeerPolicyAction, ctspDownloadedDefSgtPolicyTable=ctspDownloadedDefSgtPolicyTable, ctspPeerPolicyTable=ctspPeerPolicyTable, ctspIfSgtStorageType=ctspIfSgtStorageType, ctspConfigSgaclMappingTable=ctspConfigSgaclMappingTable, PYSNMP_MODULE_ID=ciscoTrustSecPolicyMIB, ctspVlanSgtMappings=ctspVlanSgtMappings, ctspSgtCachingVlansFirst2K=ctspSgtCachingVlansFirst2K, ctspDefOperIpTrafficType=ctspDefOperIpTrafficType, ctspVlanSgtMapValue=ctspVlanSgtMapValue, ctspAuthorizationSgaclFailInfo=ctspAuthorizationSgaclFailInfo, ctspVlanSviActive=ctspVlanSviActive, ctspDownloadedSgtPolicyTable=ctspDownloadedSgtPolicyTable, ctspLayer3PolicyTable=ctspLayer3PolicyTable, ctspDownloadedIpTrafficType=ctspDownloadedIpTrafficType, ctspDownloadedSgtPolicyEntry=ctspDownloadedSgtPolicyEntry, ctspDefOperSgaclMappingSource=ctspDefOperSgaclMappingSource, ctspPeerPolicyEntry=ctspPeerPolicyEntry, ctspSgtStatsTable=ctspSgtStatsTable, ctspIfL3Ipv4PolicyEnabled=ctspIfL3Ipv4PolicyEnabled, ctspSgaclMonitorStatisticGroup=ctspSgaclMonitorStatisticGroup, ctspOperationalSgaclName=ctspOperationalSgaclName, ctspIpSgtStorageType=ctspIpSgtStorageType, ctspStatsIpSwPermitPkts=ctspStatsIpSwPermitPkts, ctspVlanSgtMappingIndex=ctspVlanSgtMappingIndex, ctspNotifsControl=ctspNotifsControl, ctspVlanSgtRowStatus=ctspVlanSgtRowStatus, ctspStatsIpSwMonitorPkts=ctspStatsIpSwMonitorPkts, ctspDefHwStatisticsGroup=ctspDefHwStatisticsGroup, ctspDownloadedDefSgtPolicyEntry=ctspDownloadedDefSgtPolicyEntry, ctspIpSgtValue=ctspIpSgtValue, ctspLayer3PolicyOperational=ctspLayer3PolicyOperational, ctspDefIpSwMonitorPkts=ctspDefIpSwMonitorPkts, ctspSgaclIpv4DropNetflowMonitor=ctspSgaclIpv4DropNetflowMonitor, ciscoTrustSecPolicyMIBNotifs=ciscoTrustSecPolicyMIBNotifs, ctspAuthorizationSgaclFailReason=ctspAuthorizationSgaclFailReason, ciscoTrustSecPolicyMIBCompliance=ciscoTrustSecPolicyMIBCompliance, ctspIpSgtMappingEntry=ctspIpSgtMappingEntry, ctspSgtStatsEntry=ctspSgtStatsEntry, ctspIfL3PolicyConfigGroup=ctspIfL3PolicyConfigGroup, ctspSgtPolicyGroup=ctspSgtPolicyGroup, ctspSgtPolicy=ctspSgtPolicy, ctspVlanConfigTable=ctspVlanConfigTable, ctspStatsSourceSgt=ctspStatsSourceSgt, ctspLayer3PolicyIpTrafficType=ctspLayer3PolicyIpTrafficType, ctspPeerPolicyLifeTime=ctspPeerPolicyLifeTime, ctspDefDownloadedSgaclGenId=ctspDefDownloadedSgaclGenId, ctspStatsIpHwPermitPkts=ctspStatsIpHwPermitPkts, ctspIpHwStatisticsGroup=ctspIpHwStatisticsGroup, ctspIpSgtAddressLength=ctspIpSgtAddressLength, ctspDownloadedSgtPolicyAction=ctspDownloadedSgtPolicyAction, ctspAllSgtPolicyAction=ctspAllSgtPolicyAction, ctspDownloadedDefSgtPolicyLifeTime=ctspDownloadedDefSgtPolicyLifeTime, ctspVlanConfigVrfName=ctspVlanConfigVrfName, ctspDownloadedDefSgtPolicySgtGenId=ctspDownloadedDefSgtPolicySgtGenId, ctspPeerSgtGenId=ctspPeerSgtGenId, ctspIfSgName=ctspIfSgName, ctspSgaclMonitorGroup=ctspSgaclMonitorGroup, ctspVlanSgtStorageType=ctspVlanSgtStorageType, ctspSgaclEnforcementEnable=ctspSgaclEnforcementEnable, ctspDefOperSgaclMonitor=ctspDefOperSgaclMonitor, ctspDownloadedSgaclMappingGroup=ctspDownloadedSgaclMappingGroup, ctspPeerPolicyGroup=ctspPeerPolicyGroup, ctspDefDownloadedSgaclMonitor=ctspDefDownloadedSgaclMonitor, ctspIfL3PolicyConfigTable=ctspIfL3PolicyConfigTable, ctspDefDownloadedSgaclName=ctspDefDownloadedSgaclName, ctspDownloadedSgtPolicySgtGenId=ctspDownloadedSgtPolicySgtGenId, ciscoTrustSecPolicyMIB=ciscoTrustSecPolicyMIB, ctspVlanConfigRowStatus=ctspVlanConfigRowStatus, ctspIpSgtRowStatus=ctspIpSgtRowStatus, ctspAuthorizationSgaclFailNotifEnable=ctspAuthorizationSgaclFailNotifEnable, ctspConfigSgaclMappingSourceSgt=ctspConfigSgaclMappingSourceSgt, ctspVlanConfigGroup=ctspVlanConfigGroup, ctspDefConfigIpv4SgaclsMonitor=ctspDefConfigIpv4SgaclsMonitor, ctspDefIpSwDropPkts=ctspDefIpSwDropPkts, ctspDefConfigIpv6Sgacls=ctspDefConfigIpv6Sgacls, ctspConfigSgaclMappingIpTrafficType=ctspConfigSgaclMappingIpTrafficType, ciscoTrustSecPolicyMIBCompliances=ciscoTrustSecPolicyMIBCompliances, ctspStatsIpHwDropPkts=ctspStatsIpHwDropPkts, ctspVlanSgtMappingEntry=ctspVlanSgtMappingEntry, ctspDefIpHwPermitPkts=ctspDefIpHwPermitPkts, ctspOperationalSgaclGenId=ctspOperationalSgaclGenId, ctspDefOperationalSgaclName=ctspDefOperationalSgaclName, ctspOperSgaclMappingEntry=ctspOperSgaclMappingEntry, ctspIpSgtMappingTable=ctspIpSgtMappingTable, ctspIfSgtMappingInfoEntry=ctspIfSgtMappingInfoEntry, ctspLayer3Transport=ctspLayer3Transport, ctspSgaclIpv4DropNetflowMonitorGroup=ctspSgaclIpv4DropNetflowMonitorGroup, ctspSgtCachingMode=ctspSgtCachingMode, ctspOperSgaclConfigSource=ctspOperSgaclConfigSource, ctspDownloadedSgaclMonitor=ctspDownloadedSgaclMonitor, ctspDefSwStatisticsGroup=ctspDefSwStatisticsGroup, ctspIpSgtAddressType=ctspIpSgtAddressType, ctspPeerPolicyLastUpdate=ctspPeerPolicyLastUpdate, ctspDownloadedDefSgtPolicyAction=ctspDownloadedDefSgtPolicyAction, ctspOldPeerSgt=ctspOldPeerSgt, ctspNotifGroup=ctspNotifGroup, ctspDefOperSgaclConfigSource=ctspDefOperSgaclConfigSource, ctspDefStatsTable=ctspDefStatsTable, ctspSgaclIpv6DropNetflowMonitorGroup=ctspSgaclIpv6DropNetflowMonitorGroup, ctspConfigSgaclMappingDestSgt=ctspConfigSgaclMappingDestSgt, ctspIfSgtMappingInfoTable=ctspIfSgtMappingInfoTable, ctspNotifCtrlGroup=ctspNotifCtrlGroup, ctspDownloadedSgaclIndex=ctspDownloadedSgaclIndex)
| (object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, constraints_intersection, single_value_constraint, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsUnion')
(cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt')
(cisco2_k_vlan_list, cisco_vrf_name) = mibBuilder.importSymbols('CISCO-TC', 'Cisco2KVlanList', 'CiscoVrfName')
(cts_acl_name_or_empty, cts_acl_list, cts_generation_id, cts_acl_name, cts_acl_list_or_empty, cts_sgacl_monitor_mode, cts_security_group_tag) = mibBuilder.importSymbols('CISCO-TRUSTSEC-TC-MIB', 'CtsAclNameOrEmpty', 'CtsAclList', 'CtsGenerationId', 'CtsAclName', 'CtsAclListOrEmpty', 'CtsSgaclMonitorMode', 'CtsSecurityGroupTag')
(if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex')
(inet_address_type, inet_address, inet_address_prefix_length) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddressType', 'InetAddress', 'InetAddressPrefixLength')
(vlan_index,) = mibBuilder.importSymbols('Q-BRIDGE-MIB', 'VlanIndex')
(snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString')
(notification_group, object_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ObjectGroup', 'ModuleCompliance')
(counter32, unsigned32, bits, object_identity, iso, counter64, gauge32, integer32, time_ticks, mib_identifier, module_identity, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, ip_address) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'Unsigned32', 'Bits', 'ObjectIdentity', 'iso', 'Counter64', 'Gauge32', 'Integer32', 'TimeTicks', 'MibIdentifier', 'ModuleIdentity', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'IpAddress')
(display_string, storage_type, truth_value, row_status, date_and_time, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'StorageType', 'TruthValue', 'RowStatus', 'DateAndTime', 'TextualConvention')
cisco_trust_sec_policy_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 713))
ciscoTrustSecPolicyMIB.setRevisions(('2012-12-19 00:00', '2009-11-06 00:00'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
ciscoTrustSecPolicyMIB.setRevisionsDescriptions(('Added following OBJECT-GROUP: - ctspNotifCtrlGroup - ctspNotifGroup - ctspNotifInfoGroup - ctspIfSgtMappingGroup - ctspVlanSgtMappingGroup - ctspSgtCachingGroup - ctspSgaclMonitorGroup - ctspSgaclMonitorStatisticGroup Added new compliance - ciscoTrustSecPolicyMIBCompliances Modified ctspIpSgtSource to add l3if(6), vlan(7), caching(8).', 'Initial version of this MIB module.'))
if mibBuilder.loadTexts:
ciscoTrustSecPolicyMIB.setLastUpdated('201212190000Z')
if mibBuilder.loadTexts:
ciscoTrustSecPolicyMIB.setOrganization('Cisco Systems, Inc.')
if mibBuilder.loadTexts:
ciscoTrustSecPolicyMIB.setContactInfo('Cisco Systems Customer Service Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-lan-switch-snmp@cisco.com')
if mibBuilder.loadTexts:
ciscoTrustSecPolicyMIB.setDescription('This MIB module defines managed objects that facilitate the management of various policies within the Cisco Trusted Security (TrustSec) infrastructure. The information available through this MIB includes: o Device and interface level configuration for enabling SGACL (Security Group Access Control List) enforcement on Layer2/3 traffic. o Administrative and operational SGACL mapping to Security Group Tag (SGT). o Various statistics counters for traffic subject to SGACL enforcement. o TrustSec policies with respect to peer device. o Interface level configuration for enabling the propagation of SGT along with the Layer 3 traffic in portions of network which does not have the capability to support TrustSec feature. o TrustSec policies with respect to SGT propagation with Layer 3 traffic. The following terms are used throughout this MIB: VRF: Virtual Routing and Forwarding. SGACL: Security Group Access Control List. ACE: Access Control Entries. SXP: SGT Propagation Protocol. SVI: Switch Virtual Interface. IPM: Identity Port Mapping. SGT (Security Group Tag) is a unique 16 bits value assigned to every security group and used by network devices to enforce SGACL. Peer is another device connected to the local device on the other side of a TrustSec link. Default Policy: Policy applied to traffic when there is no explicit policy between the SGT associated with the originator of the traffic and the SGT associated with the destination of the traffic.')
cisco_trust_sec_policy_mib_notifs = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 0))
cisco_trust_sec_policy_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1))
cisco_trust_sec_policy_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 2))
ctsp_sgacl = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1))
ctsp_peer_policy = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2))
ctsp_layer3_transport = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3))
ctsp_ip_sgt_mappings = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4))
ctsp_sgt_policy = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5))
ctsp_if_sgt_mappings = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6))
ctsp_vlan_sgt_mappings = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7))
ctsp_sgt_caching = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 8))
ctsp_notifs_control = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 9))
ctsp_notifs_only_info = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 10))
ctsp_sgacl_globals = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1))
ctsp_sgacl_mappings = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2))
ctsp_sgacl_statistics = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3))
ctsp_sgacl_enforcement_enable = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('none', 1), ('l3Only', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspSgaclEnforcementEnable.setStatus('current')
if mibBuilder.loadTexts:
ctspSgaclEnforcementEnable.setDescription("This object specifies whether SGACL enforcement for all Layer 3 interfaces (excluding SVIs) is enabled at the managed system. 'none' indicates that SGACL enforcement for all Layer 3 interfaces (excluding SVIs) is disabled. 'l3Only' indicates that SGACL enforcement is enabled on every TrustSec capable Layer3 interface (excluding SVIs) in the device.")
ctsp_sgacl_ipv4_drop_netflow_monitor = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 2), snmp_admin_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspSgaclIpv4DropNetflowMonitor.setStatus('current')
if mibBuilder.loadTexts:
ctspSgaclIpv4DropNetflowMonitor.setDescription('This object specifies an existing flexible netflow monitor name used to collect and export the IPv4 traffic dropped packets statistics due to SGACL enforcement. The zero-length string indicates that no such netflow monitor is configured in the device.')
ctsp_sgacl_ipv6_drop_netflow_monitor = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 3), snmp_admin_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspSgaclIpv6DropNetflowMonitor.setStatus('current')
if mibBuilder.loadTexts:
ctspSgaclIpv6DropNetflowMonitor.setDescription('This object specifies an existing flexible netflow monitor name used to collect and export the IPv6 traffic dropped packets statistics due to SGACL enforcement. The zero-length string indicates that no such netflow monitor is configured in the device.')
ctsp_vlan_config_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4))
if mibBuilder.loadTexts:
ctspVlanConfigTable.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanConfigTable.setDescription('This table lists the SGACL enforcement for Layer 2 and Layer 3 switched packet in a VLAN as well as VRF information for VLANs in the device.')
ctsp_vlan_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanConfigIndex'))
if mibBuilder.loadTexts:
ctspVlanConfigEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanConfigEntry.setDescription('Each row contains the SGACL enforcement information for Layer 2 and Layer 3 switched packets in a VLAN identified by its VlanIndex value. Entry in this table is populated for VLANs which contains SGACL enforcement or VRF configuration.')
ctsp_vlan_config_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 1), vlan_index())
if mibBuilder.loadTexts:
ctspVlanConfigIndex.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanConfigIndex.setDescription('This object indicates the VLAN-ID of this VLAN.')
ctsp_vlan_config_sgacl_enforcement = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 2), truth_value()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspVlanConfigSgaclEnforcement.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanConfigSgaclEnforcement.setDescription("This object specifies the configured SGACL enforcement status for this VLAN i.e., 'true' = enabled and 'false' = disabled.")
ctsp_vlan_svi_active = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 3), truth_value()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspVlanSviActive.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanSviActive.setDescription("This object indicates if there is an active SVI associated with this VLAN. 'true' indicates that there is an active SVI associated with this VLAN. and SGACL is enforced for both Layer 2 and Layer 3 switched packets within that VLAN. 'false' indicates that there is no active SVI associated with this VLAN, and SGACL is only enforced for Layer 2 switched packets within that VLAN.")
ctsp_vlan_config_vrf_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 4), cisco_vrf_name()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspVlanConfigVrfName.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanConfigVrfName.setDescription('This object specifies an existing VRF where this VLAN belongs to. The zero length value indicates this VLAN belongs to the default VRF.')
ctsp_vlan_config_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 5), storage_type().clone('volatile')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspVlanConfigStorageType.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanConfigStorageType.setDescription('The objects specifies the storage type for this conceptual row.')
ctsp_vlan_config_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 1, 4, 1, 6), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspVlanConfigRowStatus.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanConfigRowStatus.setDescription("The status of this conceptual row entry. This object is used to manage creation and deletion of rows in this table. When this object value is 'active', other writable objects in the same row cannot be modified.")
ctsp_config_sgacl_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1))
if mibBuilder.loadTexts:
ctspConfigSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingTable.setDescription('This table contains the SGACLs information which is applied to unicast IP traffic which carries a source SGT and travels to a destination SGT.')
ctsp_config_sgacl_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspConfigSgaclMappingIpTrafficType'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspConfigSgaclMappingDestSgt'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspConfigSgaclMappingSourceSgt'))
if mibBuilder.loadTexts:
ctspConfigSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingEntry.setDescription('Each row contains the SGACL mapping to source and destination SGT for a certain traffic type as well as status of this instance. A row instance can be created or removed by setting the appropriate value of its RowStatus object.')
ctsp_config_sgacl_mapping_ip_traffic_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ipv4', 1), ('ipv6', 2))))
if mibBuilder.loadTexts:
ctspConfigSgaclMappingIpTrafficType.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic carrying the source SGT and travelling to destination SGT and subjected to SGACL enforcement.')
ctsp_config_sgacl_mapping_dest_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 2), cts_security_group_tag())
if mibBuilder.loadTexts:
ctspConfigSgaclMappingDestSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingDestSgt.setDescription('This object indicates the destination SGT value. Value of zero indicates that the destination SGT is unknown.')
ctsp_config_sgacl_mapping_source_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 3), cts_security_group_tag())
if mibBuilder.loadTexts:
ctspConfigSgaclMappingSourceSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingSourceSgt.setDescription('This object indicates the source SGT value. Value of zero indicates that the source SGT is unknown.')
ctsp_config_sgacl_mapping_sgacl_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 4), cts_acl_list()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingSgaclName.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingSgaclName.setDescription('This object specifies the list of existing SGACLs which is administratively configured to apply to unicast IP traffic carrying the source SGT to the destination SGT.')
ctsp_config_sgacl_mapping_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 5), storage_type().clone('volatile')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingStorageType.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingStorageType.setDescription('The storage type for this conceptual row.')
ctsp_config_sgacl_mapping_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 6), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingRowStatus.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingRowStatus.setDescription('This object is used to manage the creation and deletion of rows in this table. ctspConfigSgaclName may be modified at any time.')
ctsp_config_sgacl_monitor = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 1, 1, 7), cts_sgacl_monitor_mode().clone('off')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspConfigSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMonitor.setDescription('This object specifies whether SGACL monitor mode is turned on for the configured SGACL enforced traffic.')
ctsp_def_config_ipv4_sgacls = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 2), cts_acl_list_or_empty()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspDefConfigIpv4Sgacls.setStatus('current')
if mibBuilder.loadTexts:
ctspDefConfigIpv4Sgacls.setDescription('This object specifies the SGACLs of the unicast default policy for IPv4 traffic. If there is no SGACL configured for unicast default policy for IPv4 traffic, the value of this object is the zero-length string.')
ctsp_def_config_ipv6_sgacls = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 3), cts_acl_list_or_empty()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspDefConfigIpv6Sgacls.setStatus('current')
if mibBuilder.loadTexts:
ctspDefConfigIpv6Sgacls.setDescription('This object specifies the SGACLs of the unicast default policy for IPv6 traffic. If there is no SGACL configured for unicast default policy for IPv6 traffic, the value of this object is the zero-length string.')
ctsp_downloaded_sgacl_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4))
if mibBuilder.loadTexts:
ctspDownloadedSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgaclMappingTable.setDescription('This table contains the downloaded SGACLs information applied to unicast IP traffic which carries a source SGT and travels to a destination SGT.')
ctsp_downloaded_sgacl_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgaclDestSgt'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgaclSourceSgt'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgaclIndex'))
if mibBuilder.loadTexts:
ctspDownloadedSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgaclMappingEntry.setDescription('Each row contains the downloaded SGACLs mapping. A row instance is added for each pair of <source SGT, destination SGT> which contains SGACL that is dynamically downloaded from ACS server.')
ctsp_downloaded_sgacl_dest_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 1), cts_security_group_tag())
if mibBuilder.loadTexts:
ctspDownloadedSgaclDestSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgaclDestSgt.setDescription('This object indicates the destination SGT value. Value of zero indicates that the destination SGT is unknown.')
ctsp_downloaded_sgacl_source_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 2), cts_security_group_tag())
if mibBuilder.loadTexts:
ctspDownloadedSgaclSourceSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgaclSourceSgt.setDescription('This object indicates the source SGT value. Value of zero indicates that the source SGT is unknown.')
ctsp_downloaded_sgacl_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 3), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
ctspDownloadedSgaclIndex.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgaclIndex.setDescription('This object identifies the downloaded SGACL which is applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctsp_downloaded_sgacl_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 4), cts_acl_name()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedSgaclName.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgaclName.setDescription('This object indicates the name of downloaded SGACL which is applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctsp_downloaded_sgacl_gen_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 5), cts_generation_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedSgaclGenId.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgaclGenId.setDescription('This object indicates the generation identification of downloaded SGACL which is applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctsp_downloaded_ip_traffic_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 6), bits().clone(namedValues=named_values(('ipv4', 0), ('ipv6', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedIpTrafficType.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic carrying the source SGT and travelling to destination SGT and subjected to SGACL enforcement by this downloaded default policy.')
ctsp_downloaded_sgacl_monitor = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 4, 1, 7), cts_sgacl_monitor_mode()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgaclMonitor.setDescription('This object indicates whether SGACL monitor mode is turned on for the downloaded SGACL enforced traffic.')
ctsp_def_downloaded_sgacl_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5))
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclMappingTable.setDescription('This table contains the downloaded SGACLs information of the default policy applied to unicast IP traffic.')
ctsp_def_downloaded_sgacl_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefDownloadedSgaclIndex'))
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclMappingEntry.setDescription('Each row contains the downloaded SGACLs mapping. A row instance contains the SGACL information of the default policy dynamically downloaded from ACS server for unicast IP traffic.')
ctsp_def_downloaded_sgacl_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclIndex.setStatus('current')
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclIndex.setDescription('This object identifies the SGACL of downloaded default policy applied to unicast IP traffic.')
ctsp_def_downloaded_sgacl_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 2), cts_acl_name()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclName.setStatus('current')
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclName.setDescription('This object indicates the name of the SGACL of downloaded default policy applied to unicast IP traffic.')
ctsp_def_downloaded_sgacl_gen_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 3), cts_generation_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclGenId.setStatus('current')
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclGenId.setDescription('This object indicates the generation identification of the SGACL of downloaded default policy applied to unicast IP traffic.')
ctsp_def_downloaded_ip_traffic_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 4), bits().clone(namedValues=named_values(('ipv4', 0), ('ipv6', 1)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefDownloadedIpTrafficType.setStatus('current')
if mibBuilder.loadTexts:
ctspDefDownloadedIpTrafficType.setDescription('This object indicates the type of the IP traffic subjected to SGACL enforcement by this downloaded default policy.')
ctsp_def_downloaded_sgacl_monitor = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 5, 1, 5), cts_sgacl_monitor_mode()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts:
ctspDefDownloadedSgaclMonitor.setDescription('This object indicates whether SGACL monitor mode is turned on for the default downloaded SGACL enforced traffic.')
ctsp_oper_sgacl_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6))
if mibBuilder.loadTexts:
ctspOperSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts:
ctspOperSgaclMappingTable.setDescription('This table contains the operational SGACLs information applied to unicast IP traffic which carries a source SGT and travels to a destination SGT.')
ctsp_oper_sgacl_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperIpTrafficType'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperSgaclDestSgt'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperSgaclSourceSgt'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperSgaclIndex'))
if mibBuilder.loadTexts:
ctspOperSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspOperSgaclMappingEntry.setDescription('Each row contains the operational SGACLs mapping. A row instance is added for each pair of <source SGT, destination SGT> which contains the SGACL that either statically configured at the device or dynamically downloaded from ACS server.')
ctsp_oper_ip_traffic_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ipv4', 1), ('ipv6', 2))))
if mibBuilder.loadTexts:
ctspOperIpTrafficType.setStatus('current')
if mibBuilder.loadTexts:
ctspOperIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic carrying the source SGT and travelling to destination SGT and subjected to SGACL enforcement.')
ctsp_oper_sgacl_dest_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 2), cts_security_group_tag())
if mibBuilder.loadTexts:
ctspOperSgaclDestSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspOperSgaclDestSgt.setDescription('This object indicates the destination SGT value. Value of zero indicates that the destination SGT is unknown.')
ctsp_oper_sgacl_source_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 3), cts_security_group_tag())
if mibBuilder.loadTexts:
ctspOperSgaclSourceSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspOperSgaclSourceSgt.setDescription('This object indicates the source SGT value. Value of zero indicates that the source SGT is unknown.')
ctsp_oper_sgacl_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
ctspOperSgaclIndex.setStatus('current')
if mibBuilder.loadTexts:
ctspOperSgaclIndex.setDescription('This object identifies the SGACL operationally applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctsp_operational_sgacl_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 5), cts_acl_name()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspOperationalSgaclName.setStatus('current')
if mibBuilder.loadTexts:
ctspOperationalSgaclName.setDescription('This object indicates the name of the SGACL operationally applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctsp_operational_sgacl_gen_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 6), cts_generation_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspOperationalSgaclGenId.setStatus('current')
if mibBuilder.loadTexts:
ctspOperationalSgaclGenId.setDescription('This object indicates the generation identification of the SGACL operationally applied to unicast IP traffic carrying the source SGT to the destination SGT.')
ctsp_oper_sgacl_mapping_source = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('configured', 1), ('downloaded', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspOperSgaclMappingSource.setStatus('current')
if mibBuilder.loadTexts:
ctspOperSgaclMappingSource.setDescription("This object indicates the source of SGACL mapping for the SGACL operationally applied to unicast IP traffic carrying the source SGT to the destination SGT. 'downloaded' indicates that the mapping is downloaded from ACS server. 'configured' indicates that the mapping is locally configured in the device.")
ctsp_oper_sgacl_config_source = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('configured', 1), ('downloaded', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspOperSgaclConfigSource.setStatus('current')
if mibBuilder.loadTexts:
ctspOperSgaclConfigSource.setDescription("This object indicates the source of SGACL creation for this SGACL. 'configured' indicates that the SGACL is locally configured in the local device. 'downloaded' indicates that the SGACL is created at ACS server and downloaded to the local device.")
ctsp_oper_sgacl_monitor = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 6, 1, 9), cts_sgacl_monitor_mode()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspOperSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts:
ctspOperSgaclMonitor.setDescription('This object indicates whether SGACL monitor mode is turned on for the SGACL enforced traffic.')
ctsp_def_oper_sgacl_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7))
if mibBuilder.loadTexts:
ctspDefOperSgaclMappingTable.setStatus('current')
if mibBuilder.loadTexts:
ctspDefOperSgaclMappingTable.setDescription('This table contains the operational SGACLs information of the default policy applied to unicast IP traffic.')
ctsp_def_oper_sgacl_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefOperIpTrafficType'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefOperSgaclIndex'))
if mibBuilder.loadTexts:
ctspDefOperSgaclMappingEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspDefOperSgaclMappingEntry.setDescription('A row instance contains the SGACL information of the default policy which is either statically configured at the device or dynamically downloaded from ACS server for unicast IP traffic.')
ctsp_def_oper_ip_traffic_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ipv4', 1), ('ipv6', 2))))
if mibBuilder.loadTexts:
ctspDefOperIpTrafficType.setStatus('current')
if mibBuilder.loadTexts:
ctspDefOperIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic subjected to default policy enforcement.')
ctsp_def_oper_sgacl_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 65535)))
if mibBuilder.loadTexts:
ctspDefOperSgaclIndex.setStatus('current')
if mibBuilder.loadTexts:
ctspDefOperSgaclIndex.setDescription('This object identifies the SGACL of default policy operationally applied to unicast IP traffic.')
ctsp_def_operational_sgacl_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 3), cts_acl_name()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefOperationalSgaclName.setStatus('current')
if mibBuilder.loadTexts:
ctspDefOperationalSgaclName.setDescription('This object indicates the name of the SGACL of default policy operationally applied to unicast IP traffic.')
ctsp_def_operational_sgacl_gen_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 4), cts_generation_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefOperationalSgaclGenId.setStatus('current')
if mibBuilder.loadTexts:
ctspDefOperationalSgaclGenId.setDescription('This object indicates the generation identification of the SGACL of default policy operationally applied to unicast IP traffic.')
ctsp_def_oper_sgacl_mapping_source = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('configured', 1), ('downloaded', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefOperSgaclMappingSource.setStatus('current')
if mibBuilder.loadTexts:
ctspDefOperSgaclMappingSource.setDescription("This object indicates the source of SGACL mapping for the SGACL of default policy operationally applied to unicast IP traffic. 'downloaded' indicates that the mapping is downloaded from ACS server. 'configured' indicates that the mapping is locally configured in the device.")
ctsp_def_oper_sgacl_config_source = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('configured', 1), ('downloaded', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefOperSgaclConfigSource.setStatus('current')
if mibBuilder.loadTexts:
ctspDefOperSgaclConfigSource.setDescription("This object indicates the source of SGACL creation for the SGACL of default policy operationally applied to unicast IP traffic. 'downloaded' indicates that the SGACL is created at ACS server and downloaded to the local device. 'configured' indicates that the SGACL is locally configured in the local device.")
ctsp_def_oper_sgacl_monitor = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 7, 1, 7), cts_sgacl_monitor_mode()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefOperSgaclMonitor.setStatus('current')
if mibBuilder.loadTexts:
ctspDefOperSgaclMonitor.setDescription('This object indicates whether SGACL monitor mode is turned on for the SGACL of default policy enforced traffic.')
ctsp_def_config_ipv4_sgacls_monitor = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 8), cts_sgacl_monitor_mode()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspDefConfigIpv4SgaclsMonitor.setStatus('current')
if mibBuilder.loadTexts:
ctspDefConfigIpv4SgaclsMonitor.setDescription('This object specifies whether SGACL monitor mode is turned on for the default configured SGACL enforced Ipv4 traffic.')
ctsp_def_config_ipv6_sgacls_monitor = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 9), cts_sgacl_monitor_mode()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspDefConfigIpv6SgaclsMonitor.setStatus('current')
if mibBuilder.loadTexts:
ctspDefConfigIpv6SgaclsMonitor.setDescription('This object specifies whether SGACL monitor mode is turned on for the default configured SGACL enforced Ipv6 traffic.')
ctsp_sgacl_monitor_enable = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 2, 10), cts_sgacl_monitor_mode()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspSgaclMonitorEnable.setStatus('current')
if mibBuilder.loadTexts:
ctspSgaclMonitorEnable.setDescription('This object specifies whether SGACL monitor mode is turned on for the entire system. It has precedence than the per SGACL ctspConfigSgaclMonitor control. It could act as safety mechanism to turn off monitor in case the monitor feature impact system performance.')
ctsp_sgt_stats_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1))
if mibBuilder.loadTexts:
ctspSgtStatsTable.setStatus('current')
if mibBuilder.loadTexts:
ctspSgtStatsTable.setDescription('This table describes SGACL statistics counters per a pair of <source SGT, destination SGT> that is capable of providing this information.')
ctsp_sgt_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspStatsIpTrafficType'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspStatsDestSgt'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspStatsSourceSgt'))
if mibBuilder.loadTexts:
ctspSgtStatsEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspSgtStatsEntry.setDescription('Each row contains the SGACL statistics related to IPv4 or IPv6 packets carrying the source SGT travelling to the destination SGT and subjected to SGACL enforcement.')
ctsp_stats_ip_traffic_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ipv4', 1), ('ipv6', 2))))
if mibBuilder.loadTexts:
ctspStatsIpTrafficType.setStatus('current')
if mibBuilder.loadTexts:
ctspStatsIpTrafficType.setDescription('This object indicates the type of the unicast IP traffic carrying the source SGT and travelling to destination SGT and subjected to SGACL enforcement.')
ctsp_stats_dest_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 2), cts_security_group_tag())
if mibBuilder.loadTexts:
ctspStatsDestSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspStatsDestSgt.setDescription('This object indicates the destination SGT value. Value of zero indicates that the destination SGT is unknown.')
ctsp_stats_source_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 3), cts_security_group_tag())
if mibBuilder.loadTexts:
ctspStatsSourceSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspStatsSourceSgt.setDescription('This object indicates the source SGT value. Value of zero indicates that the source SGT is unknown.')
ctsp_stats_ip_sw_drop_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspStatsIpSwDropPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspStatsIpSwDropPkts.setDescription('This object indicates the number of software-forwarded IP packets which are dropped by SGACL.')
ctsp_stats_ip_hw_drop_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspStatsIpHwDropPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspStatsIpHwDropPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are dropped by SGACL.')
ctsp_stats_ip_sw_permit_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspStatsIpSwPermitPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspStatsIpSwPermitPkts.setDescription('This object indicates the number of software-forwarded IP packets which are permitted by SGACL.')
ctsp_stats_ip_hw_permit_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspStatsIpHwPermitPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspStatsIpHwPermitPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are permitted by SGACL.')
ctsp_stats_ip_sw_monitor_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 8), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspStatsIpSwMonitorPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspStatsIpSwMonitorPkts.setDescription('This object indicates the number of software-forwarded IP packets which are SGACL enforced & monitored.')
ctsp_stats_ip_hw_monitor_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 1, 1, 9), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspStatsIpHwMonitorPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspStatsIpHwMonitorPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are SGACL enforced & monitored.')
ctsp_def_stats_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2))
if mibBuilder.loadTexts:
ctspDefStatsTable.setStatus('current')
if mibBuilder.loadTexts:
ctspDefStatsTable.setDescription('This table describes statistics counters for unicast IP traffic subjected to default unicast policy.')
ctsp_def_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefIpTrafficType'))
if mibBuilder.loadTexts:
ctspDefStatsEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspDefStatsEntry.setDescription('Each row contains the statistics counter for each IP traffic type.')
ctsp_def_ip_traffic_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ipv4', 1), ('ipv6', 2))))
if mibBuilder.loadTexts:
ctspDefIpTrafficType.setStatus('current')
if mibBuilder.loadTexts:
ctspDefIpTrafficType.setDescription('This object indicates the type of the IP traffic subjected to default unicast policy enforcement.')
ctsp_def_ip_sw_drop_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 2), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefIpSwDropPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspDefIpSwDropPkts.setDescription('This object indicates the number of software-forwarded IP packets which are dropped by default unicast policy.')
ctsp_def_ip_hw_drop_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 3), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefIpHwDropPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspDefIpHwDropPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are dropped by default unicast policy.')
ctsp_def_ip_sw_permit_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 4), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefIpSwPermitPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspDefIpSwPermitPkts.setDescription('This object indicates the number of software-forwarded IP packets which are permitted by default unicast policy.')
ctsp_def_ip_hw_permit_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 5), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefIpHwPermitPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspDefIpHwPermitPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are permitted by default unicast policy.')
ctsp_def_ip_sw_monitor_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 6), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefIpSwMonitorPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspDefIpSwMonitorPkts.setDescription('This object indicates the number of software-forwarded IP packets which are monitored by default unicast policy.')
ctsp_def_ip_hw_monitor_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 1, 3, 2, 1, 7), counter64()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDefIpHwMonitorPkts.setStatus('current')
if mibBuilder.loadTexts:
ctspDefIpHwMonitorPkts.setDescription('This object indicates the number of hardware-forwarded IP packets which are monitored by default unicast policy.')
ctsp_all_peer_policy_action = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('none', 1), ('refresh', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspAllPeerPolicyAction.setStatus('current')
if mibBuilder.loadTexts:
ctspAllPeerPolicyAction.setDescription("This object allows user to specify the action to be taken with respect to all peer policies in the device. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh all peer policies in the device.")
ctsp_peer_policy_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2))
if mibBuilder.loadTexts:
ctspPeerPolicyTable.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerPolicyTable.setDescription('This table lists the peer policy information for each peer device.')
ctsp_peer_policy_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1)).setIndexNames((1, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerName'))
if mibBuilder.loadTexts:
ctspPeerPolicyEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerPolicyEntry.setDescription('Each row contains the managed objects for peer policies for each peer device based on its name.')
ctsp_peer_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 1), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 128)))
if mibBuilder.loadTexts:
ctspPeerName.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerName.setDescription('This object uniquely identifies a peer device.')
ctsp_peer_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 2), cts_security_group_tag()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspPeerSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerSgt.setDescription('This object indicates the SGT value of this peer device.')
ctsp_peer_sgt_gen_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 3), cts_generation_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspPeerSgtGenId.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerSgtGenId.setDescription('This object indicates the generation identification of the SGT value assigned to this peer device.')
ctsp_peer_trust_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('trusted', 1), ('noTrust', 2)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspPeerTrustState.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerTrustState.setDescription("This object indicates the TrustSec trust state of this peer device. 'trusted' indicates that this is a trusted peer device. 'noTrust' indicates that this peer device is not trusted.")
ctsp_peer_policy_life_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 5), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspPeerPolicyLifeTime.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerPolicyLifeTime.setDescription('This object indicates the policy life time which provides the time interval during which the peer policy is valid.')
ctsp_peer_policy_last_update = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 6), date_and_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspPeerPolicyLastUpdate.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerPolicyLastUpdate.setDescription('This object indicates the time when this peer policy is last updated.')
ctsp_peer_policy_action = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 2, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('none', 1), ('refresh', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspPeerPolicyAction.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerPolicyAction.setDescription("This object allows user to specify the action to be taken with this peer policy. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh this peer policy.")
ctsp_layer3_policy_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1))
if mibBuilder.loadTexts:
ctspLayer3PolicyTable.setStatus('current')
if mibBuilder.loadTexts:
ctspLayer3PolicyTable.setDescription('This table describes Layer 3 transport policy for IP traffic regarding SGT propagation.')
ctsp_layer3_policy_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspLayer3PolicyIpTrafficType'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspLayer3PolicyType'))
if mibBuilder.loadTexts:
ctspLayer3PolicyEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspLayer3PolicyEntry.setDescription('Each row contains the Layer 3 transport policies per IP traffic type per policy type.')
ctsp_layer3_policy_ip_traffic_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('ipv4', 1), ('ipv6', 2))))
if mibBuilder.loadTexts:
ctspLayer3PolicyIpTrafficType.setStatus('current')
if mibBuilder.loadTexts:
ctspLayer3PolicyIpTrafficType.setDescription("This object indicates the type of the IP traffic affected by Layer-3 transport policy. 'ipv4' indicates that the affected traffic is IPv4 traffic. 'ipv6' indicates that the affected traffic is IPv6 traffic.")
ctsp_layer3_policy_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('permit', 1), ('exception', 2))))
if mibBuilder.loadTexts:
ctspLayer3PolicyType.setStatus('current')
if mibBuilder.loadTexts:
ctspLayer3PolicyType.setDescription("This object indicates the type of the Layer-3 transport policy affecting IP traffic regarding SGT propagation. 'permit' indicates that the transport policy is used to classify Layer-3 traffic which is subject to SGT propagation. 'exception' indicates that the transport policy is used to classify Layer-3 traffic which is NOT subject to SGT propagation.")
ctsp_layer3_policy_local_config = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 3), cts_acl_name_or_empty()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspLayer3PolicyLocalConfig.setStatus('current')
if mibBuilder.loadTexts:
ctspLayer3PolicyLocalConfig.setDescription('This object specifies the name of an ACL that is administratively configured to classify Layer3 traffic. Zero-length string indicates there is no such configured policy.')
ctsp_layer3_policy_downloaded = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 4), cts_acl_name_or_empty()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspLayer3PolicyDownloaded.setStatus('current')
if mibBuilder.loadTexts:
ctspLayer3PolicyDownloaded.setDescription('This object specifies the name of an ACL that is downloaded from policy server to classify Layer3 traffic. Zero-length string indicates there is no such downloaded policy.')
ctsp_layer3_policy_operational = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 1, 1, 5), cts_acl_name_or_empty()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspLayer3PolicyOperational.setStatus('current')
if mibBuilder.loadTexts:
ctspLayer3PolicyOperational.setDescription('This object specifies the name of an operational ACL currently used to classify Layer3 traffic. Zero-length string indicates there is no such policy in effect.')
ctsp_if_l3_policy_config_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 2))
if mibBuilder.loadTexts:
ctspIfL3PolicyConfigTable.setStatus('current')
if mibBuilder.loadTexts:
ctspIfL3PolicyConfigTable.setDescription('This table lists the interfaces which support Layer3 Transport policy.')
ctsp_if_l3_policy_config_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 2, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'))
if mibBuilder.loadTexts:
ctspIfL3PolicyConfigEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspIfL3PolicyConfigEntry.setDescription('Each row contains managed objects for Layer3 Transport on interface capable of providing this information.')
ctsp_if_l3_ipv4_policy_enabled = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 2, 1, 1), truth_value()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspIfL3Ipv4PolicyEnabled.setStatus('current')
if mibBuilder.loadTexts:
ctspIfL3Ipv4PolicyEnabled.setDescription("This object specifies whether the Layer3 Transport policies will be applied on this interface for egress IPv4 traffic. 'true' indicates that Layer3 permit and exception policy will be applied at this interface for egress IPv4 traffic. 'false' indicates that Layer3 permit and exception policy will not be applied at this interface for egress IPv4 traffic.")
ctsp_if_l3_ipv6_policy_enabled = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 3, 2, 1, 2), truth_value()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspIfL3Ipv6PolicyEnabled.setStatus('current')
if mibBuilder.loadTexts:
ctspIfL3Ipv6PolicyEnabled.setDescription("This object specifies whether the Layer3 Transport policies will be applied on this interface for egress IPv6 traffic. 'true' indicates that Layer3 permit and exception policy will be applied at this interface for egress IPv6 traffic. 'false' indicates that Layer3 permit and exception policy will not be applied at this interface for egress IPv6 traffic.")
ctsp_ip_sgt_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1))
if mibBuilder.loadTexts:
ctspIpSgtMappingTable.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtMappingTable.setDescription('This table contains the IP-to-SGT mapping information in the device.')
ctsp_ip_sgt_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtVrfName'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtAddressType'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtIpAddress'), (0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtAddressLength'))
if mibBuilder.loadTexts:
ctspIpSgtMappingEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtMappingEntry.setDescription('Each row contains the IP-to-SGT mapping and status of this instance. Entry in this table is either populated automatically by the device or manually configured by a user. A manually configured row instance can be created or removed by setting the appropriate value of its RowStatus object.')
ctsp_ip_sgt_vrf_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 1), cisco_vrf_name())
if mibBuilder.loadTexts:
ctspIpSgtVrfName.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtVrfName.setDescription('This object indicates the VRF where IP-SGT mapping belongs to. The zero length value indicates the default VRF.')
ctsp_ip_sgt_address_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 2), inet_address_type())
if mibBuilder.loadTexts:
ctspIpSgtAddressType.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtAddressType.setDescription('This object indicates the type of Internet address.')
ctsp_ip_sgt_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 3), inet_address())
if mibBuilder.loadTexts:
ctspIpSgtIpAddress.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtIpAddress.setDescription('This object indicates an Internet address. The type of this address is determined by the value of ctspIpSgtAddressType object.')
ctsp_ip_sgt_address_length = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 4), inet_address_prefix_length())
if mibBuilder.loadTexts:
ctspIpSgtAddressLength.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtAddressLength.setDescription('This object indicates the length of an Internet address prefix.')
ctsp_ip_sgt_value = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 5), cts_security_group_tag()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspIpSgtValue.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtValue.setDescription('This object specifies the SGT value assigned to an Internet address.')
ctsp_ip_sgt_source = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('configured', 1), ('arp', 2), ('localAuthenticated', 3), ('sxp', 4), ('internal', 5), ('l3if', 6), ('vlan', 7), ('caching', 8)))).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspIpSgtSource.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtSource.setDescription("This object indicates the source of the mapping. 'configured' indicates that the mapping is manually configured by user. 'arp' indicates that the mapping is dynamically learnt from tagged ARP replies. 'localAuthenticated' indicates that the mapping is dynamically learnt from the device authentication of a host. 'sxp' indicates that the mapping is dynamically learnt from SXP (SGT Propagation Protocol). 'internal' indicates that the mapping is automatically created by the device between the device IP addresses and the device own SGT. 'l3if' indicates that Interface-SGT mapping is configured by user. 'vlan' indicates that Vlan-SGT mapping is configured by user. 'cached' indicates that sgt mapping is cached. Only 'configured' value is accepted when setting this object.")
ctsp_ip_sgt_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 7), storage_type().clone('volatile')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspIpSgtStorageType.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtStorageType.setDescription('The storage type for this conceptual row.')
ctsp_ip_sgt_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 4, 1, 1, 8), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspIpSgtRowStatus.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtRowStatus.setDescription("This object is used to manage the creation and deletion of rows in this table. If this object value is 'active', user cannot modify any writable object in this row. If value of ctspIpSgtSource object in an entry is not 'configured', user cannot change the value of this object.")
ctsp_all_sgt_policy_action = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('none', 1), ('refresh', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspAllSgtPolicyAction.setStatus('current')
if mibBuilder.loadTexts:
ctspAllSgtPolicyAction.setDescription("This object allows user to specify the action to be taken with respect to all SGT policies in the device. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh all SGT policies in the device.")
ctsp_downloaded_sgt_policy_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2))
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyTable.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyTable.setDescription('This table lists the SGT policy information downloaded by the device.')
ctsp_downloaded_sgt_policy_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgtPolicySgt'))
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyEntry.setDescription('Each row contains the managed objects for SGT policies downloaded by the device.')
ctsp_downloaded_sgt_policy_sgt = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 1), cts_security_group_tag())
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicySgt.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicySgt.setDescription('This object indicates the SGT value for which the downloaded policy is applied to. Value of zero indicates that the SGT is unknown.')
ctsp_downloaded_sgt_policy_sgt_gen_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 2), cts_generation_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicySgtGenId.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicySgtGenId.setDescription('This object indicates the generation identification of the SGT value denoted by ctspDownloadedSgtPolicySgt object.')
ctsp_downloaded_sgt_policy_life_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 3), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyLifeTime.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyLifeTime.setDescription('This object indicates the policy life time which provides the time interval during which this downloaded policy is valid.')
ctsp_downloaded_sgt_policy_last_update = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 4), date_and_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyLastUpdate.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyLastUpdate.setDescription('This object indicates the time when this downloaded SGT policy is last updated.')
ctsp_downloaded_sgt_policy_action = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 2, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('none', 1), ('refresh', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyAction.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgtPolicyAction.setDescription("This object allows user to specify the action to be taken with this downloaded SGT policy. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh this SGT policy.")
ctsp_downloaded_def_sgt_policy_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3))
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyTable.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyTable.setDescription('This table lists the default SGT policy information downloaded by the device.')
ctsp_downloaded_def_sgt_policy_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedDefSgtPolicyType'))
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyEntry.setDescription('Each row contains the managed objects for default SGT policies downloaded by the device.')
ctsp_downloaded_def_sgt_policy_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1))).clone(namedValues=named_values(('unicastDefault', 1))))
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyType.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyType.setDescription("This object indicates the downloaded default SGT policy type. 'unicastDefault' indicates the SGT policy applied to traffic which carries the default unicast SGT.")
ctsp_downloaded_def_sgt_policy_sgt_gen_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 2), cts_generation_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicySgtGenId.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicySgtGenId.setDescription('This object indicates the generation identification of the downloaded default SGT policy.')
ctsp_downloaded_def_sgt_policy_life_time = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 3), unsigned32()).setUnits('seconds').setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyLifeTime.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyLifeTime.setDescription('This object indicates the policy life time which provides the time interval during which this download default policy is valid.')
ctsp_downloaded_def_sgt_policy_last_update = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 4), date_and_time()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyLastUpdate.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyLastUpdate.setDescription('This object indicates the time when this downloaded SGT policy is last updated.')
ctsp_downloaded_def_sgt_policy_action = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 5, 3, 1, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('none', 1), ('refresh', 2)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyAction.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedDefSgtPolicyAction.setDescription("This object allows user to specify the action to be taken with this default downloaded SGT policy. When read, this object always returns the value 'none'. 'none' - No operation. 'refresh' - Refresh this default SGT policy.")
ctsp_if_sgt_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1))
if mibBuilder.loadTexts:
ctspIfSgtMappingTable.setStatus('current')
if mibBuilder.loadTexts:
ctspIfSgtMappingTable.setDescription('This table contains the Interface-to-SGT mapping configuration information in the device.')
ctsp_if_sgt_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'))
if mibBuilder.loadTexts:
ctspIfSgtMappingEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspIfSgtMappingEntry.setDescription('Each row contains the SGT mapping configuration of a particular interface. A row instance can be created or removed by setting ctspIfSgtRowStatus.')
ctsp_if_sgt_value = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1, 1), cts_security_group_tag()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspIfSgtValue.setStatus('current')
if mibBuilder.loadTexts:
ctspIfSgtValue.setDescription('This object specifies the SGT value assigned to the interface.')
ctsp_if_sg_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1, 2), snmp_admin_string()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspIfSgName.setStatus('current')
if mibBuilder.loadTexts:
ctspIfSgName.setDescription('This object specifies the Security Group Name assigned to the interface.')
ctsp_if_sgt_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1, 3), storage_type().clone('volatile')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspIfSgtStorageType.setStatus('current')
if mibBuilder.loadTexts:
ctspIfSgtStorageType.setDescription('The storage type for this conceptual row.')
ctsp_if_sgt_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 1, 1, 4), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspIfSgtRowStatus.setStatus('current')
if mibBuilder.loadTexts:
ctspIfSgtRowStatus.setDescription('This object is used to manage the creation and deletion of rows in this table.')
ctsp_if_sgt_mapping_info_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 2))
if mibBuilder.loadTexts:
ctspIfSgtMappingInfoTable.setStatus('current')
if mibBuilder.loadTexts:
ctspIfSgtMappingInfoTable.setDescription('This table contains the Interface-to-SGT mapping status information in the device.')
ctsp_if_sgt_mapping_info_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 2, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'))
if mibBuilder.loadTexts:
ctspIfSgtMappingInfoEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspIfSgtMappingInfoEntry.setDescription('Containing the Interface-to-SGT mapping status of the specified interface.')
ctsp_l3_ipm_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 6, 2, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('disabled', 1), ('active', 2), ('inactive', 3)))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
ctspL3IPMStatus.setStatus('current')
if mibBuilder.loadTexts:
ctspL3IPMStatus.setDescription('This object indicates the Layer 3 Identity Port Mapping(IPM) operational mode. disabled - The L3 IPM is not configured. active - The L3 IPM is configured for this interface, and SGT is available. inactive - The L3 IPM is configured for this interface, and SGT is unavailable.')
ctsp_vlan_sgt_mapping_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1))
if mibBuilder.loadTexts:
ctspVlanSgtMappingTable.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanSgtMappingTable.setDescription('This table contains the Vlan-SGT mapping information in the device.')
ctsp_vlan_sgt_mapping_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1)).setIndexNames((0, 'CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanSgtMappingIndex'))
if mibBuilder.loadTexts:
ctspVlanSgtMappingEntry.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanSgtMappingEntry.setDescription('Each row contains the SGT mapping configuration of a particular VLAN. A row instance can be created or removed by setting ctspVlanSgtRowStatus.')
ctsp_vlan_sgt_mapping_index = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1, 1), vlan_index())
if mibBuilder.loadTexts:
ctspVlanSgtMappingIndex.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanSgtMappingIndex.setDescription('This object specifies the VLAN-ID which is used as index.')
ctsp_vlan_sgt_map_value = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1, 2), cts_security_group_tag()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspVlanSgtMapValue.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanSgtMapValue.setDescription('This object specifies the SGT value assigned to the vlan.')
ctsp_vlan_sgt_storage_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1, 3), storage_type().clone('volatile')).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspVlanSgtStorageType.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanSgtStorageType.setDescription('The storage type for this conceptual row.')
ctsp_vlan_sgt_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 7, 1, 1, 4), row_status()).setMaxAccess('readcreate')
if mibBuilder.loadTexts:
ctspVlanSgtRowStatus.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanSgtRowStatus.setDescription('This object is used to manage the creation and deletion of rows in this table.')
ctsp_sgt_caching_mode = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 8, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('none', 1), ('standAlone', 2), ('withEnforcement', 3), ('vlan', 4)))).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspSgtCachingMode.setStatus('current')
if mibBuilder.loadTexts:
ctspSgtCachingMode.setDescription("This object specifies which SGT-caching mode is configured for SGT caching capable interfaces at the managed system. 'none' indicates that sgt-caching for all Layer 3 interfaces (excluding SVIs) is disabled. 'standAlone' indicates that SGT-caching is enabled on every TrustSec capable Layer3 interface (excluding SVIs) in the device. 'withEnforcement' indicates that SGT-caching is enabled on interfaces that have RBAC enforcement enabled. 'vlan' indicates that SGT-caching is enabled on the VLANs specified by ctspSgtCachingVlansfFirst2K & ctspSgtCachingVlansSecond2K")
ctsp_sgt_caching_vlans_first2_k = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 8, 2), cisco2_k_vlan_list()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspSgtCachingVlansFirst2K.setStatus('current')
if mibBuilder.loadTexts:
ctspSgtCachingVlansFirst2K.setDescription('A string of octets containing one bit per VLAN for VLANs 0 to 2047. If the bit corresponding to a VLAN is set to 1, it indicates SGT-caching is enabled on the VLAN. If the bit corresponding to a VLAN is set to 0, it indicates SGT-caching is disabled on the VLAN.')
ctsp_sgt_caching_vlans_second2_k = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 8, 3), cisco2_k_vlan_list()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspSgtCachingVlansSecond2K.setStatus('current')
if mibBuilder.loadTexts:
ctspSgtCachingVlansSecond2K.setDescription('A string of octets containing one bit per VLAN for VLANs 2048 to 4095. If the bit corresponding to a VLAN is set to 1, it indicates SGT-caching is enabled on the VLAN. If the bit corresponding to a VLAN is set to 0, it indicates SGT-caching is disabled on the VLAN.')
ctsp_peer_policy_updated_notif_enable = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 9, 1), truth_value()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspPeerPolicyUpdatedNotifEnable.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerPolicyUpdatedNotifEnable.setDescription("This object specifies whether the system generates ctspPeerPolicyUpdatedNotif. A value of 'false' will prevent ctspPeerPolicyUpdatedNotif notifications from being generated by this system.")
ctsp_authorization_sgacl_fail_notif_enable = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 9, 2), truth_value()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ctspAuthorizationSgaclFailNotifEnable.setStatus('current')
if mibBuilder.loadTexts:
ctspAuthorizationSgaclFailNotifEnable.setDescription("This object specifies whether this system generates the ctspAuthorizationSgaclFailNotif. A value of 'false' will prevent ctspAuthorizationSgaclFailNotif notifications from being generated by this system.")
ctsp_old_peer_sgt = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 10, 1), cts_security_group_tag()).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
ctspOldPeerSgt.setStatus('current')
if mibBuilder.loadTexts:
ctspOldPeerSgt.setDescription('This object provides the old sgt value for ctspPeerPolicyUpdatedNotif, i.e., the sgt value before the policy is updated.')
ctsp_authorization_sgacl_fail_reason = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 10, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=named_values(('downloadACE', 1), ('downloadSrc', 2), ('downloadDst', 3), ('installPolicy', 4), ('installPolicyStandby', 5), ('installForIP', 6), ('uninstall', 7)))).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
ctspAuthorizationSgaclFailReason.setStatus('current')
if mibBuilder.loadTexts:
ctspAuthorizationSgaclFailReason.setDescription("This object indicates the reason of failure during SGACL acquisitions, installations and uninstallations, which is associated with ctspAuthorizationSgaclFailNotif; 'downloadACE' - Failure during downloading ACE in SGACL acquisition. 'downloadSrc' - Failure during downloading source list in SGACL acquisition. 'downloadDst' - Failure during downloading destination list in SGACL acquisition. 'installPolicy' - Failure during SGACL policy installation 'installPolicyStandby' - Failure during SGACL policy installation on standby 'installForIP' - Failure during SGACL installation for specific IP type. 'uninstall' - Failure during SGACL uninstallation.")
ctsp_authorization_sgacl_fail_info = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 713, 1, 10, 3), snmp_admin_string()).setMaxAccess('accessiblefornotify')
if mibBuilder.loadTexts:
ctspAuthorizationSgaclFailInfo.setStatus('current')
if mibBuilder.loadTexts:
ctspAuthorizationSgaclFailInfo.setDescription('This object provides additional information about authorization SGACL failure, which is associated with ctspAuthorizationSgaclFailNotif.')
ctsp_peer_policy_updated_notif = notification_type((1, 3, 6, 1, 4, 1, 9, 9, 713, 0, 1)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspOldPeerSgt'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerSgt'))
if mibBuilder.loadTexts:
ctspPeerPolicyUpdatedNotif.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerPolicyUpdatedNotif.setDescription('A ctspPeerPolicyUpdatedNotif is generated when the SGT value of a peer device has been updated.')
ctsp_authorization_sgacl_fail_notif = notification_type((1, 3, 6, 1, 4, 1, 9, 9, 713, 0, 2)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspAuthorizationSgaclFailReason'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspAuthorizationSgaclFailInfo'))
if mibBuilder.loadTexts:
ctspAuthorizationSgaclFailNotif.setStatus('current')
if mibBuilder.loadTexts:
ctspAuthorizationSgaclFailNotif.setDescription('A ctspAuthorizationSgaclFailNotif is generated when the authorization of SGACL fails.')
cisco_trust_sec_policy_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 1))
cisco_trust_sec_policy_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2))
cisco_trust_sec_policy_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 1, 1)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspGlobalSgaclEnforcementGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperSgaclMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgaclMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSwStatisticsGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefSwStatisticsGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanConfigGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspConfigSgaclMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpHwStatisticsGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefHwStatisticsGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclIpv4DropNetflowMonitorGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclIpv6DropNetflowMonitorGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerPolicyGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerPolicyActionGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspLayer3TransportGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIfL3PolicyConfigGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgtPolicyGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_trust_sec_policy_mib_compliance = ciscoTrustSecPolicyMIBCompliance.setStatus('deprecated')
if mibBuilder.loadTexts:
ciscoTrustSecPolicyMIBCompliance.setDescription('The compliance statement for the CISCO-TRUSTSEC-POLICY-MIB')
cisco_trust_sec_policy_mib_compliance_rev2 = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 1, 2)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspGlobalSgaclEnforcementGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperSgaclMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgaclMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSwStatisticsGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefSwStatisticsGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanConfigGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspConfigSgaclMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpHwStatisticsGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefHwStatisticsGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclIpv4DropNetflowMonitorGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclIpv6DropNetflowMonitorGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerPolicyGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerPolicyActionGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspLayer3TransportGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIfL3PolicyConfigGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgtPolicyGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIfSgtMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanSgtMappingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgtCachingGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclMonitorGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclMonitorStatisticGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspNotifCtrlGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspNotifGroup'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspNotifInfoGroup'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
cisco_trust_sec_policy_mib_compliance_rev2 = ciscoTrustSecPolicyMIBComplianceRev2.setStatus('current')
if mibBuilder.loadTexts:
ciscoTrustSecPolicyMIBComplianceRev2.setDescription('The compliance statement for the CISCO-TRUSTSEC-POLICY-MIB')
ctsp_global_sgacl_enforcement_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 1)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclEnforcementEnable'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_global_sgacl_enforcement_group = ctspGlobalSgaclEnforcementGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspGlobalSgaclEnforcementGroup.setDescription('A collection of object which provides the SGACL enforcement information for all TrustSec capable Layer 3 interfaces (excluding SVIs) at the device level.')
ctsp_sgacl_ipv4_drop_netflow_monitor_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 2)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclIpv4DropNetflowMonitor'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_sgacl_ipv4_drop_netflow_monitor_group = ctspSgaclIpv4DropNetflowMonitorGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspSgaclIpv4DropNetflowMonitorGroup.setDescription('A collection of object which provides netflow monitor information for IPv4 traffic drop packet due to SGACL enforcement in the device.')
ctsp_sgacl_ipv6_drop_netflow_monitor_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 3)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclIpv6DropNetflowMonitor'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_sgacl_ipv6_drop_netflow_monitor_group = ctspSgaclIpv6DropNetflowMonitorGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspSgaclIpv6DropNetflowMonitorGroup.setDescription('A collection of object which provides netflow monitor information for IPv6 traffic drop packet due to SGACL enforcement in the device.')
ctsp_vlan_config_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 4)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanConfigSgaclEnforcement'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanSviActive'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanConfigVrfName'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanConfigStorageType'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanConfigRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_vlan_config_group = ctspVlanConfigGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanConfigGroup.setDescription('A collection of object which provides the SGACL enforcement and VRF information for each VLAN.')
ctsp_config_sgacl_mapping_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 5)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspConfigSgaclMappingSgaclName'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspConfigSgaclMappingStorageType'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspConfigSgaclMappingRowStatus'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefConfigIpv4Sgacls'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefConfigIpv6Sgacls'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_config_sgacl_mapping_group = ctspConfigSgaclMappingGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspConfigSgaclMappingGroup.setDescription('A collection of objects which provides the administratively configured SGACL mapping information in the device.')
ctsp_downloaded_sgacl_mapping_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 6)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgaclName'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgaclGenId'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedIpTrafficType'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefDownloadedSgaclName'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefDownloadedSgaclGenId'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefDownloadedIpTrafficType'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_downloaded_sgacl_mapping_group = ctspDownloadedSgaclMappingGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspDownloadedSgaclMappingGroup.setDescription('A collection of objects which provides the downloaded SGACL mapping information in the device.')
ctsp_oper_sgacl_mapping_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 7)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperationalSgaclName'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperationalSgaclGenId'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperSgaclMappingSource'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperSgaclConfigSource'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefOperationalSgaclName'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefOperationalSgaclGenId'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefOperSgaclMappingSource'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefOperSgaclConfigSource'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_oper_sgacl_mapping_group = ctspOperSgaclMappingGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspOperSgaclMappingGroup.setDescription('A collection of objects which provides the operational SGACL mapping information in the device.')
ctsp_ip_sw_statistics_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 8)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspStatsIpSwDropPkts'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspStatsIpSwPermitPkts'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_ip_sw_statistics_group = ctspIpSwStatisticsGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSwStatisticsGroup.setDescription('A collection of objects which provides software statistics counters for unicast IP traffic subjected to SGACL enforcement.')
ctsp_ip_hw_statistics_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 9)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspStatsIpHwDropPkts'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspStatsIpHwPermitPkts'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_ip_hw_statistics_group = ctspIpHwStatisticsGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspIpHwStatisticsGroup.setDescription('A collection of objects which provides hardware statistics counters for unicast IP traffic subjected to SGACL enforcement.')
ctsp_def_sw_statistics_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 10)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefIpSwDropPkts'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefIpSwPermitPkts'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_def_sw_statistics_group = ctspDefSwStatisticsGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspDefSwStatisticsGroup.setDescription('A collection of objects which provides software statistics counters for unicast IP traffic subjected to unicast default policy enforcement.')
ctsp_def_hw_statistics_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 11)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefIpHwDropPkts'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefIpHwPermitPkts'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_def_hw_statistics_group = ctspDefHwStatisticsGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspDefHwStatisticsGroup.setDescription('A collection of objects which provides hardware statistics counters for unicast IP traffic subjected to unicast default policy enforcement.')
ctsp_peer_policy_action_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 12)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspAllPeerPolicyAction'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_peer_policy_action_group = ctspPeerPolicyActionGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerPolicyActionGroup.setDescription('A collection of object which provides refreshing of all peer policies in the device.')
ctsp_peer_policy_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 13)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerSgt'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerSgtGenId'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerTrustState'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerPolicyLifeTime'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerPolicyLastUpdate'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerPolicyAction'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_peer_policy_group = ctspPeerPolicyGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspPeerPolicyGroup.setDescription('A collection of object which provides peer policy information in the device.')
ctsp_layer3_transport_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 14)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspLayer3PolicyLocalConfig'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspLayer3PolicyDownloaded'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspLayer3PolicyOperational'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_layer3_transport_group = ctspLayer3TransportGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspLayer3TransportGroup.setDescription('A collection of objects which provides managed information regarding the SGT propagation along with Layer 3 traffic in the device.')
ctsp_if_l3_policy_config_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 15)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIfL3Ipv4PolicyEnabled'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIfL3Ipv6PolicyEnabled'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_if_l3_policy_config_group = ctspIfL3PolicyConfigGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspIfL3PolicyConfigGroup.setDescription('A collection of objects which provides managed information for Layer3 Tranport policy enforcement on capable interface in the device.')
ctsp_ip_sgt_mapping_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 16)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtValue'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtSource'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtStorageType'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIpSgtRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_ip_sgt_mapping_group = ctspIpSgtMappingGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspIpSgtMappingGroup.setDescription('A collection of objects which provides managed information regarding IP-to-Sgt mapping in the device.')
ctsp_sgt_policy_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 17)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspAllSgtPolicyAction'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgtPolicySgtGenId'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgtPolicyLifeTime'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgtPolicyLastUpdate'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgtPolicyAction'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedDefSgtPolicySgtGenId'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedDefSgtPolicyLifeTime'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedDefSgtPolicyLastUpdate'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedDefSgtPolicyAction'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_sgt_policy_group = ctspSgtPolicyGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspSgtPolicyGroup.setDescription('A collection of object which provides SGT policy information in the device.')
ctsp_if_sgt_mapping_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 18)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIfSgtValue'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIfSgName'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspL3IPMStatus'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIfSgtStorageType'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspIfSgtRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_if_sgt_mapping_group = ctspIfSgtMappingGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspIfSgtMappingGroup.setDescription('A collection of objects which provides managed information regarding Interface-to-Sgt mapping in the device.')
ctsp_vlan_sgt_mapping_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 19)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanSgtMapValue'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanSgtStorageType'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspVlanSgtRowStatus'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_vlan_sgt_mapping_group = ctspVlanSgtMappingGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspVlanSgtMappingGroup.setDescription('A collection of objects which provides sgt mapping information for the IP traffic in the specified Vlan.')
ctsp_sgt_caching_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 20)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgtCachingMode'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgtCachingVlansFirst2K'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgtCachingVlansSecond2K'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_sgt_caching_group = ctspSgtCachingGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspSgtCachingGroup.setDescription('A collection of objects which provides sgt Caching information.')
ctsp_sgacl_monitor_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 21)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspSgaclMonitorEnable'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspConfigSgaclMonitor'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefConfigIpv4SgaclsMonitor'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefConfigIpv6SgaclsMonitor'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDownloadedSgaclMonitor'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefDownloadedSgaclMonitor'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspOperSgaclMonitor'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefOperSgaclMonitor'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_sgacl_monitor_group = ctspSgaclMonitorGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspSgaclMonitorGroup.setDescription('A collection of objects which provides SGACL monitor information.')
ctsp_sgacl_monitor_statistic_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 22)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspStatsIpSwMonitorPkts'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspStatsIpHwMonitorPkts'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefIpSwMonitorPkts'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspDefIpHwMonitorPkts'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_sgacl_monitor_statistic_group = ctspSgaclMonitorStatisticGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspSgaclMonitorStatisticGroup.setDescription('A collection of objects which provides monitor statistics counters for unicast IP traffic subjected to SGACL enforcement.')
ctsp_notif_ctrl_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 23)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerPolicyUpdatedNotifEnable'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspAuthorizationSgaclFailNotifEnable'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_notif_ctrl_group = ctspNotifCtrlGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspNotifCtrlGroup.setDescription('A collection of objects providing notification control for TrustSec policy notifications.')
ctsp_notif_group = notification_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 24)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspPeerPolicyUpdatedNotif'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspAuthorizationSgaclFailNotif'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_notif_group = ctspNotifGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspNotifGroup.setDescription('A collection of notifications for TrustSec policy.')
ctsp_notif_info_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 713, 2, 2, 25)).setObjects(('CISCO-TRUSTSEC-POLICY-MIB', 'ctspOldPeerSgt'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspAuthorizationSgaclFailReason'), ('CISCO-TRUSTSEC-POLICY-MIB', 'ctspAuthorizationSgaclFailInfo'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
ctsp_notif_info_group = ctspNotifInfoGroup.setStatus('current')
if mibBuilder.loadTexts:
ctspNotifInfoGroup.setDescription('A collection of objects providing the variable binding for TrustSec policy notifications.')
mibBuilder.exportSymbols('CISCO-TRUSTSEC-POLICY-MIB', ctspDefDownloadedIpTrafficType=ctspDefDownloadedIpTrafficType, ctspLayer3PolicyType=ctspLayer3PolicyType, ctspPeerTrustState=ctspPeerTrustState, ctspIfSgtValue=ctspIfSgtValue, ctspDownloadedSgaclName=ctspDownloadedSgaclName, ctspSgtCachingVlansSecond2K=ctspSgtCachingVlansSecond2K, ctspDownloadedSgtPolicyLifeTime=ctspDownloadedSgtPolicyLifeTime, ctspSgacl=ctspSgacl, ctspDownloadedDefSgtPolicyLastUpdate=ctspDownloadedDefSgtPolicyLastUpdate, ctspLayer3PolicyLocalConfig=ctspLayer3PolicyLocalConfig, ctspSgaclMappings=ctspSgaclMappings, ctspAllPeerPolicyAction=ctspAllPeerPolicyAction, ctspDefOperationalSgaclGenId=ctspDefOperationalSgaclGenId, ctspSgaclStatistics=ctspSgaclStatistics, ctspDefStatsEntry=ctspDefStatsEntry, ctspOperSgaclMappingSource=ctspOperSgaclMappingSource, ctspDefIpSwPermitPkts=ctspDefIpSwPermitPkts, ciscoTrustSecPolicyMIBObjects=ciscoTrustSecPolicyMIBObjects, ctspIfSgtMappingGroup=ctspIfSgtMappingGroup, ctspVlanConfigStorageType=ctspVlanConfigStorageType, ctspOperSgaclSourceSgt=ctspOperSgaclSourceSgt, ctspDownloadedSgtPolicyLastUpdate=ctspDownloadedSgtPolicyLastUpdate, ctspPeerPolicyUpdatedNotifEnable=ctspPeerPolicyUpdatedNotifEnable, ctspIpSgtVrfName=ctspIpSgtVrfName, ctspConfigSgaclMappingEntry=ctspConfigSgaclMappingEntry, ctspDefIpHwDropPkts=ctspDefIpHwDropPkts, ctspDefOperSgaclMappingEntry=ctspDefOperSgaclMappingEntry, ctspOperIpTrafficType=ctspOperIpTrafficType, ctspStatsIpHwMonitorPkts=ctspStatsIpHwMonitorPkts, ctspDefDownloadedSgaclMappingTable=ctspDefDownloadedSgaclMappingTable, ctspOperSgaclDestSgt=ctspOperSgaclDestSgt, ctspIpSgtMappingGroup=ctspIpSgtMappingGroup, ctspIfSgtRowStatus=ctspIfSgtRowStatus, ctspDownloadedDefSgtPolicyType=ctspDownloadedDefSgtPolicyType, ctspLayer3PolicyDownloaded=ctspLayer3PolicyDownloaded, ctspStatsDestSgt=ctspStatsDestSgt, ctspPeerSgt=ctspPeerSgt, ctspVlanConfigIndex=ctspVlanConfigIndex, ctspDefDownloadedSgaclIndex=ctspDefDownloadedSgaclIndex, ctspConfigSgaclMappingStorageType=ctspConfigSgaclMappingStorageType, ctspPeerName=ctspPeerName, ctspDefIpTrafficType=ctspDefIpTrafficType, ctspOperSgaclMappingGroup=ctspOperSgaclMappingGroup, ctspPeerPolicyUpdatedNotif=ctspPeerPolicyUpdatedNotif, ctspSgtCaching=ctspSgtCaching, ciscoTrustSecPolicyMIBComplianceRev2=ciscoTrustSecPolicyMIBComplianceRev2, ciscoTrustSecPolicyMIBConformance=ciscoTrustSecPolicyMIBConformance, ctspDefOperSgaclIndex=ctspDefOperSgaclIndex, ctspOperSgaclMappingTable=ctspOperSgaclMappingTable, ctspDownloadedSgaclGenId=ctspDownloadedSgaclGenId, ctspIfSgtMappings=ctspIfSgtMappings, ctspSgaclIpv6DropNetflowMonitor=ctspSgaclIpv6DropNetflowMonitor, ciscoTrustSecPolicyMIBGroups=ciscoTrustSecPolicyMIBGroups, ctspNotifsOnlyInfo=ctspNotifsOnlyInfo, ctspVlanConfigEntry=ctspVlanConfigEntry, ctspPeerPolicy=ctspPeerPolicy, ctspDownloadedSgaclDestSgt=ctspDownloadedSgaclDestSgt, ctspDefIpHwMonitorPkts=ctspDefIpHwMonitorPkts, ctspLayer3TransportGroup=ctspLayer3TransportGroup, ctspGlobalSgaclEnforcementGroup=ctspGlobalSgaclEnforcementGroup, ctspDownloadedSgaclMappingEntry=ctspDownloadedSgaclMappingEntry, ctspPeerPolicyActionGroup=ctspPeerPolicyActionGroup, ctspSgaclGlobals=ctspSgaclGlobals, ctspNotifInfoGroup=ctspNotifInfoGroup, ctspSgaclMonitorEnable=ctspSgaclMonitorEnable, ctspStatsIpTrafficType=ctspStatsIpTrafficType, ctspConfigSgaclMonitor=ctspConfigSgaclMonitor, ctspDefConfigIpv4Sgacls=ctspDefConfigIpv4Sgacls, ctspVlanSgtMappingGroup=ctspVlanSgtMappingGroup, ctspSgtCachingGroup=ctspSgtCachingGroup, ctspIfL3PolicyConfigEntry=ctspIfL3PolicyConfigEntry, ctspConfigSgaclMappingRowStatus=ctspConfigSgaclMappingRowStatus, ctspIpSwStatisticsGroup=ctspIpSwStatisticsGroup, ctspDownloadedSgtPolicySgt=ctspDownloadedSgtPolicySgt, ctspDefConfigIpv6SgaclsMonitor=ctspDefConfigIpv6SgaclsMonitor, ctspOperSgaclIndex=ctspOperSgaclIndex, ctspVlanSgtMappingTable=ctspVlanSgtMappingTable, ctspIfSgtMappingEntry=ctspIfSgtMappingEntry, ctspAuthorizationSgaclFailNotif=ctspAuthorizationSgaclFailNotif, ctspConfigSgaclMappingGroup=ctspConfigSgaclMappingGroup, ctspIfSgtMappingTable=ctspIfSgtMappingTable, ctspStatsIpSwDropPkts=ctspStatsIpSwDropPkts, ctspIpSgtSource=ctspIpSgtSource, ctspConfigSgaclMappingSgaclName=ctspConfigSgaclMappingSgaclName, ctspLayer3PolicyEntry=ctspLayer3PolicyEntry, ctspDownloadedSgaclSourceSgt=ctspDownloadedSgaclSourceSgt, ctspVlanConfigSgaclEnforcement=ctspVlanConfigSgaclEnforcement, ctspDefDownloadedSgaclMappingEntry=ctspDefDownloadedSgaclMappingEntry, ctspIpSgtIpAddress=ctspIpSgtIpAddress, ctspDownloadedSgaclMappingTable=ctspDownloadedSgaclMappingTable, ctspDefOperSgaclMappingTable=ctspDefOperSgaclMappingTable, ctspL3IPMStatus=ctspL3IPMStatus, ctspIfL3Ipv6PolicyEnabled=ctspIfL3Ipv6PolicyEnabled, ctspOperSgaclMonitor=ctspOperSgaclMonitor, ctspIpSgtMappings=ctspIpSgtMappings, ctspPeerPolicyAction=ctspPeerPolicyAction, ctspDownloadedDefSgtPolicyTable=ctspDownloadedDefSgtPolicyTable, ctspPeerPolicyTable=ctspPeerPolicyTable, ctspIfSgtStorageType=ctspIfSgtStorageType, ctspConfigSgaclMappingTable=ctspConfigSgaclMappingTable, PYSNMP_MODULE_ID=ciscoTrustSecPolicyMIB, ctspVlanSgtMappings=ctspVlanSgtMappings, ctspSgtCachingVlansFirst2K=ctspSgtCachingVlansFirst2K, ctspDefOperIpTrafficType=ctspDefOperIpTrafficType, ctspVlanSgtMapValue=ctspVlanSgtMapValue, ctspAuthorizationSgaclFailInfo=ctspAuthorizationSgaclFailInfo, ctspVlanSviActive=ctspVlanSviActive, ctspDownloadedSgtPolicyTable=ctspDownloadedSgtPolicyTable, ctspLayer3PolicyTable=ctspLayer3PolicyTable, ctspDownloadedIpTrafficType=ctspDownloadedIpTrafficType, ctspDownloadedSgtPolicyEntry=ctspDownloadedSgtPolicyEntry, ctspDefOperSgaclMappingSource=ctspDefOperSgaclMappingSource, ctspPeerPolicyEntry=ctspPeerPolicyEntry, ctspSgtStatsTable=ctspSgtStatsTable, ctspIfL3Ipv4PolicyEnabled=ctspIfL3Ipv4PolicyEnabled, ctspSgaclMonitorStatisticGroup=ctspSgaclMonitorStatisticGroup, ctspOperationalSgaclName=ctspOperationalSgaclName, ctspIpSgtStorageType=ctspIpSgtStorageType, ctspStatsIpSwPermitPkts=ctspStatsIpSwPermitPkts, ctspVlanSgtMappingIndex=ctspVlanSgtMappingIndex, ctspNotifsControl=ctspNotifsControl, ctspVlanSgtRowStatus=ctspVlanSgtRowStatus, ctspStatsIpSwMonitorPkts=ctspStatsIpSwMonitorPkts, ctspDefHwStatisticsGroup=ctspDefHwStatisticsGroup, ctspDownloadedDefSgtPolicyEntry=ctspDownloadedDefSgtPolicyEntry, ctspIpSgtValue=ctspIpSgtValue, ctspLayer3PolicyOperational=ctspLayer3PolicyOperational, ctspDefIpSwMonitorPkts=ctspDefIpSwMonitorPkts, ctspSgaclIpv4DropNetflowMonitor=ctspSgaclIpv4DropNetflowMonitor, ciscoTrustSecPolicyMIBNotifs=ciscoTrustSecPolicyMIBNotifs, ctspAuthorizationSgaclFailReason=ctspAuthorizationSgaclFailReason, ciscoTrustSecPolicyMIBCompliance=ciscoTrustSecPolicyMIBCompliance, ctspIpSgtMappingEntry=ctspIpSgtMappingEntry, ctspSgtStatsEntry=ctspSgtStatsEntry, ctspIfL3PolicyConfigGroup=ctspIfL3PolicyConfigGroup, ctspSgtPolicyGroup=ctspSgtPolicyGroup, ctspSgtPolicy=ctspSgtPolicy, ctspVlanConfigTable=ctspVlanConfigTable, ctspStatsSourceSgt=ctspStatsSourceSgt, ctspLayer3PolicyIpTrafficType=ctspLayer3PolicyIpTrafficType, ctspPeerPolicyLifeTime=ctspPeerPolicyLifeTime, ctspDefDownloadedSgaclGenId=ctspDefDownloadedSgaclGenId, ctspStatsIpHwPermitPkts=ctspStatsIpHwPermitPkts, ctspIpHwStatisticsGroup=ctspIpHwStatisticsGroup, ctspIpSgtAddressLength=ctspIpSgtAddressLength, ctspDownloadedSgtPolicyAction=ctspDownloadedSgtPolicyAction, ctspAllSgtPolicyAction=ctspAllSgtPolicyAction, ctspDownloadedDefSgtPolicyLifeTime=ctspDownloadedDefSgtPolicyLifeTime, ctspVlanConfigVrfName=ctspVlanConfigVrfName, ctspDownloadedDefSgtPolicySgtGenId=ctspDownloadedDefSgtPolicySgtGenId, ctspPeerSgtGenId=ctspPeerSgtGenId, ctspIfSgName=ctspIfSgName, ctspSgaclMonitorGroup=ctspSgaclMonitorGroup, ctspVlanSgtStorageType=ctspVlanSgtStorageType, ctspSgaclEnforcementEnable=ctspSgaclEnforcementEnable, ctspDefOperSgaclMonitor=ctspDefOperSgaclMonitor, ctspDownloadedSgaclMappingGroup=ctspDownloadedSgaclMappingGroup, ctspPeerPolicyGroup=ctspPeerPolicyGroup, ctspDefDownloadedSgaclMonitor=ctspDefDownloadedSgaclMonitor, ctspIfL3PolicyConfigTable=ctspIfL3PolicyConfigTable, ctspDefDownloadedSgaclName=ctspDefDownloadedSgaclName, ctspDownloadedSgtPolicySgtGenId=ctspDownloadedSgtPolicySgtGenId, ciscoTrustSecPolicyMIB=ciscoTrustSecPolicyMIB, ctspVlanConfigRowStatus=ctspVlanConfigRowStatus, ctspIpSgtRowStatus=ctspIpSgtRowStatus, ctspAuthorizationSgaclFailNotifEnable=ctspAuthorizationSgaclFailNotifEnable, ctspConfigSgaclMappingSourceSgt=ctspConfigSgaclMappingSourceSgt, ctspVlanConfigGroup=ctspVlanConfigGroup, ctspDefConfigIpv4SgaclsMonitor=ctspDefConfigIpv4SgaclsMonitor, ctspDefIpSwDropPkts=ctspDefIpSwDropPkts, ctspDefConfigIpv6Sgacls=ctspDefConfigIpv6Sgacls, ctspConfigSgaclMappingIpTrafficType=ctspConfigSgaclMappingIpTrafficType, ciscoTrustSecPolicyMIBCompliances=ciscoTrustSecPolicyMIBCompliances, ctspStatsIpHwDropPkts=ctspStatsIpHwDropPkts, ctspVlanSgtMappingEntry=ctspVlanSgtMappingEntry, ctspDefIpHwPermitPkts=ctspDefIpHwPermitPkts, ctspOperationalSgaclGenId=ctspOperationalSgaclGenId, ctspDefOperationalSgaclName=ctspDefOperationalSgaclName, ctspOperSgaclMappingEntry=ctspOperSgaclMappingEntry, ctspIpSgtMappingTable=ctspIpSgtMappingTable, ctspIfSgtMappingInfoEntry=ctspIfSgtMappingInfoEntry, ctspLayer3Transport=ctspLayer3Transport, ctspSgaclIpv4DropNetflowMonitorGroup=ctspSgaclIpv4DropNetflowMonitorGroup, ctspSgtCachingMode=ctspSgtCachingMode, ctspOperSgaclConfigSource=ctspOperSgaclConfigSource, ctspDownloadedSgaclMonitor=ctspDownloadedSgaclMonitor, ctspDefSwStatisticsGroup=ctspDefSwStatisticsGroup, ctspIpSgtAddressType=ctspIpSgtAddressType, ctspPeerPolicyLastUpdate=ctspPeerPolicyLastUpdate, ctspDownloadedDefSgtPolicyAction=ctspDownloadedDefSgtPolicyAction, ctspOldPeerSgt=ctspOldPeerSgt, ctspNotifGroup=ctspNotifGroup, ctspDefOperSgaclConfigSource=ctspDefOperSgaclConfigSource, ctspDefStatsTable=ctspDefStatsTable, ctspSgaclIpv6DropNetflowMonitorGroup=ctspSgaclIpv6DropNetflowMonitorGroup, ctspConfigSgaclMappingDestSgt=ctspConfigSgaclMappingDestSgt, ctspIfSgtMappingInfoTable=ctspIfSgtMappingInfoTable, ctspNotifCtrlGroup=ctspNotifCtrlGroup, ctspDownloadedSgaclIndex=ctspDownloadedSgaclIndex) |
"""
Simple file to validate that maketests is working. Call maketests via:
>>> from x7.shell import *; maketests('x7.sample.needs_tests')
"""
def needs_a_test(a, b):
return a+b
| """
Simple file to validate that maketests is working. Call maketests via:
>>> from x7.shell import *; maketests('x7.sample.needs_tests')
"""
def needs_a_test(a, b):
return a + b |
class Event:
def __init__(self):
self.handlers = set()
def subscribe(self, func):
self.handlers.add(func)
def unsubscribe(self, func):
self.handlers.remove(func)
def emit(self, *args):
for func in self.handlers:
func(*args)
| class Event:
def __init__(self):
self.handlers = set()
def subscribe(self, func):
self.handlers.add(func)
def unsubscribe(self, func):
self.handlers.remove(func)
def emit(self, *args):
for func in self.handlers:
func(*args) |
dataset_type = 'FlyingChairs'
data_root = 'data/FlyingChairs_release'
img_norm_cfg = dict(mean=[0., 0., 0.], std=[255., 255., 255.], to_rgb=False)
global_transform = dict(
translates=(0.05, 0.05),
zoom=(1.0, 1.5),
shear=(0.86, 1.16),
rotate=(-10., 10.))
relative_transform = dict(
translates=(0.00375, 0.00375),
zoom=(0.985, 1.015),
shear=(1.0, 1.0),
rotate=(-1.0, 1.0))
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(
type='ColorJitter',
brightness=0.5,
contrast=0.5,
saturation=0.5,
hue=0.5),
dict(type='RandomGamma', gamma_range=(0.7, 1.5)),
dict(type='Normalize', **img_norm_cfg),
dict(type='GaussianNoise', sigma_range=(0, 0.04), clamp_range=(0., 1.)),
dict(type='RandomFlip', prob=0.5, direction='horizontal'),
dict(type='RandomFlip', prob=0.5, direction='vertical'),
dict(
type='RandomAffine',
global_transform=global_transform,
relative_transform=relative_transform),
dict(type='RandomCrop', crop_size=(320, 448)),
dict(type='DefaultFormatBundle'),
dict(
type='Collect',
keys=['imgs', 'flow_gt'],
meta_keys=[
'img_fields', 'ann_fields', 'filename1', 'filename2',
'ori_filename1', 'ori_filename2', 'filename_flow',
'ori_filename_flow', 'ori_shape', 'img_shape', 'img_norm_cfg'
]),
]
test_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations'),
dict(type='InputResize', exponent=6),
dict(type='Normalize', **img_norm_cfg),
dict(type='TestFormatBundle'),
dict(
type='Collect',
keys=['imgs'],
meta_keys=[
'flow_gt', 'filename1', 'filename2', 'ori_filename1',
'ori_filename2', 'ori_shape', 'img_shape', 'img_norm_cfg',
'scale_factor', 'pad_shape'
])
]
flyingchairs_train = dict(
type=dataset_type,
pipeline=train_pipeline,
data_root=data_root,
split_file='data/FlyingChairs_release/FlyingChairs_train_val.txt')
data = dict(
train_dataloader=dict(
samples_per_gpu=1,
workers_per_gpu=2,
drop_last=True,
persistent_workers=True),
val_dataloader=dict(samples_per_gpu=1, workers_per_gpu=2, shuffle=False),
test_dataloader=dict(samples_per_gpu=1, workers_per_gpu=2, shuffle=False),
train=flyingchairs_train,
val=dict(
type=dataset_type,
pipeline=test_pipeline,
data_root=data_root,
test_mode=True,
split_file='data/FlyingChairs_release/FlyingChairs_train_val.txt'),
test=dict(
type=dataset_type,
pipeline=test_pipeline,
data_root=data_root,
test_mode=True,
split_file='data/FlyingChairs_release/FlyingChairs_train_val.txt'))
| dataset_type = 'FlyingChairs'
data_root = 'data/FlyingChairs_release'
img_norm_cfg = dict(mean=[0.0, 0.0, 0.0], std=[255.0, 255.0, 255.0], to_rgb=False)
global_transform = dict(translates=(0.05, 0.05), zoom=(1.0, 1.5), shear=(0.86, 1.16), rotate=(-10.0, 10.0))
relative_transform = dict(translates=(0.00375, 0.00375), zoom=(0.985, 1.015), shear=(1.0, 1.0), rotate=(-1.0, 1.0))
train_pipeline = [dict(type='LoadImageFromFile'), dict(type='LoadAnnotations'), dict(type='ColorJitter', brightness=0.5, contrast=0.5, saturation=0.5, hue=0.5), dict(type='RandomGamma', gamma_range=(0.7, 1.5)), dict(type='Normalize', **img_norm_cfg), dict(type='GaussianNoise', sigma_range=(0, 0.04), clamp_range=(0.0, 1.0)), dict(type='RandomFlip', prob=0.5, direction='horizontal'), dict(type='RandomFlip', prob=0.5, direction='vertical'), dict(type='RandomAffine', global_transform=global_transform, relative_transform=relative_transform), dict(type='RandomCrop', crop_size=(320, 448)), dict(type='DefaultFormatBundle'), dict(type='Collect', keys=['imgs', 'flow_gt'], meta_keys=['img_fields', 'ann_fields', 'filename1', 'filename2', 'ori_filename1', 'ori_filename2', 'filename_flow', 'ori_filename_flow', 'ori_shape', 'img_shape', 'img_norm_cfg'])]
test_pipeline = [dict(type='LoadImageFromFile'), dict(type='LoadAnnotations'), dict(type='InputResize', exponent=6), dict(type='Normalize', **img_norm_cfg), dict(type='TestFormatBundle'), dict(type='Collect', keys=['imgs'], meta_keys=['flow_gt', 'filename1', 'filename2', 'ori_filename1', 'ori_filename2', 'ori_shape', 'img_shape', 'img_norm_cfg', 'scale_factor', 'pad_shape'])]
flyingchairs_train = dict(type=dataset_type, pipeline=train_pipeline, data_root=data_root, split_file='data/FlyingChairs_release/FlyingChairs_train_val.txt')
data = dict(train_dataloader=dict(samples_per_gpu=1, workers_per_gpu=2, drop_last=True, persistent_workers=True), val_dataloader=dict(samples_per_gpu=1, workers_per_gpu=2, shuffle=False), test_dataloader=dict(samples_per_gpu=1, workers_per_gpu=2, shuffle=False), train=flyingchairs_train, val=dict(type=dataset_type, pipeline=test_pipeline, data_root=data_root, test_mode=True, split_file='data/FlyingChairs_release/FlyingChairs_train_val.txt'), test=dict(type=dataset_type, pipeline=test_pipeline, data_root=data_root, test_mode=True, split_file='data/FlyingChairs_release/FlyingChairs_train_val.txt')) |
"""TurboGears project related information"""
version = "2.4.3"
description = "Next generation TurboGears"
long_description="""
TurboGears brings together a best of breed python tools
to create a flexible, full featured, and easy to use web
framework.
TurboGears 2 provides an integrated and well tested set of tools for
everything you need to build dynamic, database driven applications.
It provides a full range of tools for front end javascript
develeopment, back database development and everything in between:
* dynamic javascript powered widgets (ToscaWidgets2)
* automatic JSON generation from your controllers
* powerful, designer friendly XHTML based templating
* object or route based URL dispatching
* powerful Object Relational Mappers (SQLAlchemy)
The latest development version is available in the
`TurboGears Git repositories`_.
.. _TurboGears Git repositories:
https://github.com/TurboGears
"""
url="http://www.turbogears.org/"
author= "Alessandro Molina, Mark Ramm, Christopher Perkins, Jonathan LaCour, Rick Copland, Alberto Valverde, Michael Pedersen and the TurboGears community"
email = "amol@turbogears.org"
copyright = """Copyright 2005-2020 Kevin Dangoor, Alberto Valverde, Mark Ramm, Christopher Perkins, Alessandro Molina and contributors"""
license = "MIT"
| """TurboGears project related information"""
version = '2.4.3'
description = 'Next generation TurboGears'
long_description = '\nTurboGears brings together a best of breed python tools\nto create a flexible, full featured, and easy to use web\nframework.\n\nTurboGears 2 provides an integrated and well tested set of tools for\neverything you need to build dynamic, database driven applications.\nIt provides a full range of tools for front end javascript\ndeveleopment, back database development and everything in between:\n\n * dynamic javascript powered widgets (ToscaWidgets2)\n * automatic JSON generation from your controllers\n * powerful, designer friendly XHTML based templating\n * object or route based URL dispatching\n * powerful Object Relational Mappers (SQLAlchemy)\n\nThe latest development version is available in the\n`TurboGears Git repositories`_.\n\n.. _TurboGears Git repositories:\n https://github.com/TurboGears\n'
url = 'http://www.turbogears.org/'
author = 'Alessandro Molina, Mark Ramm, Christopher Perkins, Jonathan LaCour, Rick Copland, Alberto Valverde, Michael Pedersen and the TurboGears community'
email = 'amol@turbogears.org'
copyright = 'Copyright 2005-2020 Kevin Dangoor, Alberto Valverde, Mark Ramm, Christopher Perkins, Alessandro Molina and contributors'
license = 'MIT' |
__all__ = ("DottedMarkupLanguageException", "DecodeError")
class DottedMarkupLanguageException(Exception):
"""Base class for all exceptions in this module."""
pass
class DecodeError(DottedMarkupLanguageException):
"""Raised when there is an error decoding a string."""
pass
| __all__ = ('DottedMarkupLanguageException', 'DecodeError')
class Dottedmarkuplanguageexception(Exception):
"""Base class for all exceptions in this module."""
pass
class Decodeerror(DottedMarkupLanguageException):
"""Raised when there is an error decoding a string."""
pass |
security = """
New Web users get the Roles "User,Nosy"
New Email users get the Role "User"
Role "admin":
User may access the rest interface (Rest Access)
User may access the web interface (Web Access)
User may access the xmlrpc interface (Xmlrpc Access)
User may create everything (Create)
User may edit everything (Edit)
User may manipulate user Roles through the web (Web Roles)
User may restore everything (Restore)
User may retire everything (Retire)
User may use the email interface (Email Access)
User may view everything (View)
Role "anonymous":
User may access the web interface (Web Access)
Role "cc-permission":
(Restore for "cost_center_permission_group" only)
(Retire for "cost_center_permission_group" only)
User is allowed to create cost_center_permission_group (Create for "cost_center_permission_group" only)
User is allowed to edit cost_center_permission_group (Edit for "cost_center_permission_group" only)
Role "contact":
User is allowed to create contact (Create for "contact" only)
User is allowed to edit contact (Edit for "contact" only)
Role "controlling":
User is allowed Edit on (Edit for "daily_record": ('status', 'time_record') only)
User is allowed Edit on (Edit for "sap_cc": ('group_lead', 'team_lead') only)
User is allowed Edit on (Edit for "time_project": ('group_lead', 'team_lead') only)
User is allowed Edit on (Edit for "time_wp": ('project',) only)
User is allowed View on (View for "user": ('roles',) only)
User is allowed View on (View for "user_dynamic": ('id', 'sap_cc', 'user', 'valid_from', 'valid_to') only)
User is allowed to access contract_type (View for "contract_type" only)
User is allowed to access daily_record (View for "daily_record" only)
User is allowed to access daily_record_freeze (View for "daily_record_freeze" only)
User is allowed to access leave_submission (View for "leave_submission" only)
User is allowed to access overtime_correction (View for "overtime_correction" only)
User is allowed to access query (View for "query" only)
User is allowed to access time_project (View for "time_project" only)
User is allowed to access time_record (View for "time_record" only)
User is allowed to access time_report (View for "time_report" only)
User is allowed to access time_wp (View for "time_wp" only)
User is allowed to access vacation_correction (View for "vacation_correction" only)
User is allowed to create cost_center (Create for "cost_center" only)
User is allowed to create cost_center_group (Create for "cost_center_group" only)
User is allowed to create cost_center_status (Create for "cost_center_status" only)
User is allowed to create department (Create for "department" only)
User is allowed to create organisation (Create for "organisation" only)
User is allowed to create product_family (Create for "product_family" only)
User is allowed to create public_holiday (Create for "public_holiday" only)
User is allowed to create query (Create for "query" only)
User is allowed to create reporting_group (Create for "reporting_group" only)
User is allowed to create sap_cc (Create for "sap_cc" only)
User is allowed to create time_activity (Create for "time_activity" only)
User is allowed to create time_activity_perm (Create for "time_activity_perm" only)
User is allowed to create time_record (Create for "time_record" only)
User is allowed to create work_location (Create for "work_location" only)
User is allowed to edit cost_center (Edit for "cost_center" only)
User is allowed to edit cost_center_group (Edit for "cost_center_group" only)
User is allowed to edit cost_center_status (Edit for "cost_center_status" only)
User is allowed to edit department (Edit for "department" only)
User is allowed to edit organisation (Edit for "organisation" only)
User is allowed to edit product_family (Edit for "product_family" only)
User is allowed to edit public_holiday (Edit for "public_holiday" only)
User is allowed to edit query (Edit for "query" only)
User is allowed to edit reporting_group (Edit for "reporting_group" only)
User is allowed to edit sap_cc (Edit for "sap_cc" only)
User is allowed to edit time_activity (Edit for "time_activity" only)
User is allowed to edit time_activity_perm (Edit for "time_activity_perm" only)
User is allowed to edit time_record (Edit for "time_record" only)
User is allowed to edit work_location (Edit for "work_location" only)
Role "doc_admin":
User is allowed Edit on (Edit for "department": ('doc_num',) only)
User is allowed to create artefact (Create for "artefact" only)
User is allowed to create doc (Create for "doc" only)
User is allowed to create doc_category (Create for "doc_category" only)
User is allowed to create doc_status (Create for "doc_status" only)
User is allowed to create product_type (Create for "product_type" only)
User is allowed to create reference (Create for "reference" only)
User is allowed to edit artefact (Edit for "artefact" only)
User is allowed to edit doc (Edit for "doc" only)
User is allowed to edit doc_category (Edit for "doc_category" only)
User is allowed to edit doc_status (Edit for "doc_status" only)
User is allowed to edit product_type (Edit for "product_type" only)
User is allowed to edit reference (Edit for "reference" only)
Role "dom-user-edit-facility":
Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (Edit for "user": ['room'] only)
Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (View for "user": ['room'] only)
Role "dom-user-edit-gtt":
(Search for "user_dynamic" only)
May only view/edit records with the correct domain (Edit for "user_dynamic" only)
May only view/edit records with the correct domain (View for "user_dynamic" only)
User is allowed to access contract_type (View for "contract_type" only)
User is allowed to create user (Create for "user" only)
User is allowed to create user_contact (Create for "user_contact" only)
User is allowed to create user_dynamic (Create for "user_dynamic" only)
User is allowed to edit user_contact (Edit for "user_contact" only)
Users may view user_dynamic records for ad_domain for which they are in the domain_permission for the user (View for "user_dynamic" only)
Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (Edit for "user": ['contacts', 'csv_delimiter', 'department_temp', 'entry_date', 'firstname', 'hide_message_files', 'job_description', 'lastname', 'lunch_duration', 'lunch_start', 'nickname', 'pictures', 'position_text', 'room', 'sex', 'status', 'subst_active', 'substitute', 'supervisor', 'sync_foreign_key', 'timezone', 'tt_lines', 'username', 'vie_user'] only)
Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (View for "user": ['contacts', 'csv_delimiter', 'department_temp', 'entry_date', 'firstname', 'hide_message_files', 'job_description', 'lastname', 'lunch_duration', 'lunch_start', 'nickname', 'pictures', 'position_text', 'room', 'sex', 'status', 'subst_active', 'substitute', 'supervisor', 'sync_foreign_key', 'timezone', 'tt_lines', 'username', 'vie_user'] only)
Role "dom-user-edit-hr":
(Search for "user_dynamic" only)
May only view/edit records with the correct domain (Edit for "user_dynamic" only)
May only view/edit records with the correct domain (View for "user_dynamic" only)
User is allowed to access contract_type (View for "contract_type" only)
User is allowed to create user_contact (Create for "user_contact" only)
User is allowed to create user_dynamic (Create for "user_dynamic" only)
User is allowed to edit user_contact (Edit for "user_contact" only)
Users may view user_dynamic records for ad_domain for which they are in the domain_permission for the user (View for "user_dynamic" only)
Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (Edit for "user": ['clearance_by', 'contacts', 'csv_delimiter', 'entry_date', 'firstname', 'hide_message_files', 'job_description', 'lastname', 'lunch_duration', 'lunch_start', 'nickname', 'pictures', 'position_text', 'reduced_activity_list', 'roles', 'room', 'sex', 'status', 'subst_active', 'substitute', 'supervisor', 'timezone', 'tt_lines', 'vie_user'] only)
Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (View for "user": ['clearance_by', 'contacts', 'csv_delimiter', 'entry_date', 'firstname', 'hide_message_files', 'job_description', 'lastname', 'lunch_duration', 'lunch_start', 'nickname', 'pictures', 'position_text', 'reduced_activity_list', 'roles', 'room', 'sex', 'status', 'subst_active', 'substitute', 'supervisor', 'timezone', 'tt_lines', 'vie_user'] only)
Role "dom-user-edit-office":
User is allowed to create user_contact (Create for "user_contact" only)
User is allowed to edit user_contact (Edit for "user_contact" only)
Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (Edit for "user": ['contacts', 'position_text', 'room'] only)
Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (View for "user": ['contacts', 'position_text', 'room'] only)
Role "external":
(Search for "ext_tracker_state": ('id', 'issue') only)
(Search for "user": ('id', 'nickname', 'username') only)
External users are allowed to access issue if they are on the list of allowed external users or there is a transitive permission via containers (Edit for "issue": ['activity', 'actor', 'area', 'category', 'closed', 'composed_of', 'creation', 'creator', 'cur_est_begin', 'cur_est_end', 'deadline', 'depends', 'doc_issue_status', 'earliest_start', 'effective_prio', 'effort_hours', 'external_users', 'files', 'files_affected', 'fixed_in', 'id', 'keywords', 'kind', 'maturity_index', 'messages', 'needs', 'nosy', 'numeric_effort', 'part_of', 'planned_begin', 'planned_end', 'priority', 'release', 'responsible', 'safety_level', 'severity', 'status', 'superseder', 'test_level', 'title'] only)
External users are allowed to access issue if they are on the list of allowed external users or there is a transitive permission via containers (View for "issue": ['activity', 'actor', 'area', 'category', 'closed', 'composed_of', 'creation', 'creator', 'cur_est_begin', 'cur_est_end', 'deadline', 'depends', 'doc_issue_status', 'earliest_start', 'effective_prio', 'effort_hours', 'external_users', 'files', 'files_affected', 'fixed_in', 'id', 'keywords', 'kind', 'maturity_index', 'messages', 'needs', 'nosy', 'numeric_effort', 'part_of', 'planned_begin', 'planned_end', 'priority', 'release', 'responsible', 'safety_level', 'severity', 'status', 'superseder', 'test_level', 'title'] only)
User is allowed View on (View for "category": ('id', 'name') only)
User is allowed View on (View for "user": ('nickname', 'status', 'username') only)
User is allowed View on (View for "user_status": ('name',) only)
User is allowed View on file if file is linked from an item with View permission (View for "file" only)
User is allowed View on msg if msg is linked from an item with View permission (View for "msg" only)
User is allowed to access area (View for "area" only)
User is allowed to access doc_issue_status (View for "doc_issue_status" only)
User is allowed to access ext_tracker (View for "ext_tracker" only)
User is allowed to access ext_tracker_state (View for "ext_tracker_state" only)
User is allowed to access ext_tracker_type (View for "ext_tracker_type" only)
User is allowed to access keyword (View for "keyword" only)
User is allowed to access kind (View for "kind" only)
User is allowed to access msg_keyword (View for "msg_keyword" only)
User is allowed to access safety_level (View for "safety_level" only)
User is allowed to access severity (View for "severity" only)
User is allowed to access status (View for "status" only)
User is allowed to access status_transition (View for "status_transition" only)
User is allowed to access test_level (View for "test_level" only)
User is allowed to create file (Create for "file" only)
User is allowed to create issue (Create for "issue" only)
User is allowed to create msg (Create for "msg" only)
User is allowed to create query (Create for "query" only)
User is allowed to edit their queries (Edit for "query" only)
User is allowed to retire their queries (Retire for "query" only)
User is allowed to search for their own files (Search for "file" only)
User is allowed to search for their own messages (Search for "msg" only)
User is allowed to search for their queries (Search for "query" only)
User is allowed to search issue (Search for "issue" only)
User is allowed to view their own files (View for "file" only)
User may access the web interface (Web Access)
User may use the email interface (Email Access)
Users are allowed to edit some of their details (Edit for "user": ('csv_delimiter', 'hide_message_files', 'password', 'timezone') only)
Users are allowed to view some of their details (View for "user": ('activity', 'actor', 'creation', 'creator', 'firstname', 'lastname', 'realname', 'username') only)
Users are allowed to view their own and public queries for classes where they have search permission (View for "query" only)
Role "facility":
(Restore for "room" only)
(Retire for "room" only)
User is allowed to create room (Create for "room" only)
User is allowed to edit room (Edit for "room" only)
Role "functional-role":
(Restore for "user_functional_role" only)
(Retire for "user_functional_role" only)
User is allowed Edit on (Edit for "user": ('business_responsible', 'scale_seniority') only)
User is allowed View on (View for "user": ('business_responsible', 'planning_role', 'scale_seniority') only)
User is allowed to access user_functional_role (View for "user_functional_role" only)
User is allowed to create user_functional_role (Create for "user_functional_role" only)
User is allowed to edit user_functional_role (Edit for "user_functional_role" only)
Role "hr":
(Edit for "overtime_period": ('name', 'order') only)
(Restore for "room" only)
(Retire for "room" only)
User is allowed Edit on (Edit for "daily_record": ('required_overtime', 'weekend_allowed') only)
User is allowed Edit on (Edit for "daily_record": ('status', 'time_record') only)
User is allowed Edit on (Edit for "time_project": ('approval_hr', 'approval_required', 'is_extern', 'is_public_holiday', 'is_special_leave', 'is_vacation', 'no_overtime', 'no_overtime_day', 'only_hours', 'overtime_reduction') only)
User is allowed View on (View for "user": ('contacts',) only)
User is allowed to access auto_wp (View for "auto_wp" only)
User is allowed to access contract_type (View for "contract_type" only)
User is allowed to access daily_record (View for "daily_record" only)
User is allowed to access daily_record_freeze (View for "daily_record_freeze" only)
User is allowed to access leave_submission (View for "leave_submission" only)
User is allowed to access overtime_correction (View for "overtime_correction" only)
User is allowed to access time_record (View for "time_record" only)
User is allowed to access user_contact (View for "user_contact" only)
User is allowed to access user_dynamic (View for "user_dynamic" only)
User is allowed to access vacation_correction (View for "vacation_correction" only)
User is allowed to create auto_wp (Create for "auto_wp" only)
User is allowed to create daily_record_freeze (Create for "daily_record_freeze" only)
User is allowed to create location (Create for "location" only)
User is allowed to create org_location (Create for "org_location" only)
User is allowed to create organisation (Create for "organisation" only)
User is allowed to create overtime_correction (Create for "overtime_correction" only)
User is allowed to create overtime_period (Create for "overtime_period" only)
User is allowed to create product_family (Create for "product_family" only)
User is allowed to create public_holiday (Create for "public_holiday" only)
User is allowed to create reporting_group (Create for "reporting_group" only)
User is allowed to create room (Create for "room" only)
User is allowed to create sap_cc (Create for "sap_cc" only)
User is allowed to create time_record (Create for "time_record" only)
User is allowed to create uc_type (Create for "uc_type" only)
User is allowed to create user (Create for "user" only)
User is allowed to create user_dynamic (Create for "user_dynamic" only)
User is allowed to edit auto_wp (Edit for "auto_wp" only)
User is allowed to edit dynamic user data if not frozen in validity span of dynamic user record (Edit for "user_dynamic" only)
User is allowed to edit freeze record if not frozen at the given date (Edit for "daily_record_freeze": ('frozen',) only)
User is allowed to edit location (Edit for "location" only)
User is allowed to edit org_location (Edit for "org_location" only)
User is allowed to edit organisation (Edit for "organisation" only)
User is allowed to edit overtime correction if the overtime correction is not frozen (Edit for "overtime_correction" only)
User is allowed to edit product_family (Edit for "product_family" only)
User is allowed to edit public_holiday (Edit for "public_holiday" only)
User is allowed to edit reporting_group (Edit for "reporting_group" only)
User is allowed to edit room (Edit for "room" only)
User is allowed to edit sap_cc (Edit for "sap_cc" only)
User is allowed to edit time_record (Edit for "time_record" only)
User is allowed to edit uc_type (Edit for "uc_type" only)
User may manipulate user Roles through the web (Web Roles)
Role "hr-leave-approval":
User is allowed Edit on (Edit for "leave_submission": ('status',) only)
User is allowed to access contract_type (View for "contract_type" only)
User is allowed to access leave_submission (View for "leave_submission" only)
User is allowed to access vacation_correction (View for "vacation_correction" only)
Role "hr-org-location":
(Search for "daily_record_freeze" only)
(Search for "overtime_correction" only)
(Search for "time_activity_perm" only)
(Search for "time_record" only)
(Search for "user_dynamic" only)
User is allowed to view dynamic user data if he/she is in group HR-Org-Location and in the same Org-Location as the given user (View for "user_dynamic" only)
User is allowed to view freeze information if he/she is in group HR-Org-Location and in the same Org-Location as the given user (View for "daily_record_freeze" only)
User is allowed to view overtime information if he/she is in group HR-Org-Location and in the same Org-Location as the given user (View for "overtime_correction" only)
User is allowed to view time record data if he/she is in group HR-Org-Location and in the same Org-Location as the given user (View for "time_record" only)
Role "hr-vacation":
User is allowed to access contract_type (View for "contract_type" only)
User is allowed to access leave_submission (View for "leave_submission" only)
User is allowed to access vacation_correction (View for "vacation_correction" only)
User is allowed to create contract_type (Create for "contract_type" only)
User is allowed to create leave_submission (Create for "leave_submission" only)
User is allowed to create vacation_correction (Create for "vacation_correction" only)
User is allowed to edit contract_type (Edit for "contract_type" only)
User is allowed to edit leave_submission (Edit for "leave_submission" only)
User is allowed to edit vacation_correction (Edit for "vacation_correction" only)
Role "issue_admin":
User is allowed Edit on msg if msg is linked from an item with Edit permission (Edit for "msg" only)
User is allowed to access issue (View for "issue" only)
User is allowed to create area (Create for "area" only)
User is allowed to create category (Create for "category" only)
User is allowed to create doc_issue_status (Create for "doc_issue_status" only)
User is allowed to create ext_tracker (Create for "ext_tracker" only)
User is allowed to create issue (Create for "issue" only)
User is allowed to create keyword (Create for "keyword" only)
User is allowed to create kind (Create for "kind" only)
User is allowed to create msg_keyword (Create for "msg_keyword" only)
User is allowed to create safety_level (Create for "safety_level" only)
User is allowed to create severity (Create for "severity" only)
User is allowed to create status (Create for "status" only)
User is allowed to create status_transition (Create for "status_transition" only)
User is allowed to create test_level (Create for "test_level" only)
User is allowed to edit area (Edit for "area" only)
User is allowed to edit category (Edit for "category" only)
User is allowed to edit doc_issue_status (Edit for "doc_issue_status" only)
User is allowed to edit ext_tracker (Edit for "ext_tracker" only)
User is allowed to edit issue (Edit for "issue" only)
User is allowed to edit keyword (Edit for "keyword" only)
User is allowed to edit kind (Edit for "kind" only)
User is allowed to edit msg_keyword (Edit for "msg_keyword" only)
User is allowed to edit safety_level (Edit for "safety_level" only)
User is allowed to edit severity (Edit for "severity" only)
User is allowed to edit status (Edit for "status" only)
User is allowed to edit status_transition (Edit for "status_transition" only)
User is allowed to edit test_level (Edit for "test_level" only)
Role "it":
Create (Create for "user_contact" only)
User is allowed Edit on (Edit for "file": ('name', 'type') only)
User is allowed Edit on (Edit for "location": ('domain_part',) only)
User is allowed Edit on (Edit for "organisation": ('domain_part',) only)
User is allowed Edit on (Edit for "user": ('ad_domain', 'nickname', 'password', 'pictures', 'roles', 'timetracking_by', 'timezone', 'username') only)
User is allowed Edit on (Edit for "user": ('address', 'alternate_addresses', 'nickname', 'password', 'timezone', 'username') only)
User is allowed Edit on file if file is linked from an item with Edit permission (Edit for "file" only)
User is allowed Edit on msg if msg is linked from an item with Edit permission (Edit for "msg" only)
User is allowed View on file if file is linked from an item with View permission (View for "file" only)
User is allowed to access domain_permission (View for "domain_permission" only)
User is allowed to access it_int_prio (View for "it_int_prio" only)
User is allowed to access it_issue (View for "it_issue" only)
User is allowed to access it_project (View for "it_project" only)
User is allowed to create domain_permission (Create for "domain_permission" only)
User is allowed to create it_category (Create for "it_category" only)
User is allowed to create it_int_prio (Create for "it_int_prio" only)
User is allowed to create it_issue (Create for "it_issue" only)
User is allowed to create it_project (Create for "it_project" only)
User is allowed to create it_request_type (Create for "it_request_type" only)
User is allowed to create mailgroup (Create for "mailgroup" only)
User is allowed to edit domain_permission (Edit for "domain_permission" only)
User is allowed to edit it_category (Edit for "it_category" only)
User is allowed to edit it_int_prio (Edit for "it_int_prio" only)
User is allowed to edit it_issue (Edit for "it_issue" only)
User is allowed to edit it_project (Edit for "it_project" only)
User is allowed to edit it_request_type (Edit for "it_request_type" only)
User is allowed to edit mailgroup (Edit for "mailgroup" only)
User may manipulate user Roles through the web (Web Roles)
Role "itview":
User is allowed to access it_int_prio (View for "it_int_prio" only)
User is allowed to access it_issue (View for "it_issue" only)
User is allowed to access it_project (View for "it_project" only)
Role "msgedit":
(Search for "msg": ('date', 'id') only)
User is allowed Edit on (Edit for "msg": ('author', 'date', 'id', 'keywords', 'subject', 'summary') only)
User is allowed to access ext_msg (View for "ext_msg" only)
User is allowed to access ext_tracker_state (View for "ext_tracker_state" only)
User is allowed to access ext_tracker_type (View for "ext_tracker_type" only)
Role "msgsync":
(Search for "msg": ('date', 'id') only)
User is allowed Edit on (Edit for "msg": ('author', 'date', 'id', 'keywords', 'subject', 'summary') only)
User is allowed to access ext_msg (View for "ext_msg" only)
User is allowed to access ext_tracker_state (View for "ext_tracker_state" only)
User is allowed to access ext_tracker_type (View for "ext_tracker_type" only)
User is allowed to create ext_msg (Create for "ext_msg" only)
User is allowed to create ext_tracker_state (Create for "ext_tracker_state" only)
User is allowed to edit ext_msg (Edit for "ext_msg" only)
User is allowed to edit ext_tracker_state (Edit for "ext_tracker_state" only)
Role "nosy":
User may get nosy messages for doc (Nosy for "doc" only)
User may get nosy messages for issue (Nosy for "issue" only)
User may get nosy messages for it_issue (Nosy for "it_issue" only)
User may get nosy messages for it_project (Nosy for "it_project" only)
User may get nosy messages for support (Nosy for "support" only)
Role "office":
(Restore for "room" only)
(Retire for "room" only)
User is allowed View on (View for "user": ('contacts',) only)
User is allowed to access user_contact (View for "user_contact" only)
User is allowed to create absence (Create for "absence" only)
User is allowed to create absence_type (Create for "absence_type" only)
User is allowed to create room (Create for "room" only)
User is allowed to create uc_type (Create for "uc_type" only)
User is allowed to edit absence (Edit for "absence" only)
User is allowed to edit absence_type (Edit for "absence_type" only)
User is allowed to edit room (Edit for "room" only)
User is allowed to edit uc_type (Edit for "uc_type" only)
Role "organisation":
User is allowed to access location (View for "location" only)
User is allowed to access org_location (View for "org_location" only)
User is allowed to access organisation (View for "organisation" only)
User is allowed to create location (Create for "location" only)
User is allowed to create org_location (Create for "org_location" only)
User is allowed to create organisation (Create for "organisation" only)
User is allowed to edit location (Edit for "location" only)
User is allowed to edit org_location (Edit for "org_location" only)
User is allowed to edit organisation (Edit for "organisation" only)
Role "pgp":
Role "procurement":
(View for "sap_cc" only)
(View for "time_project" only)
User is allowed Edit on (Edit for "sap_cc": ('group_lead', 'purchasing_agents', 'team_lead') only)
User is allowed Edit on (Edit for "time_project": ('group_lead', 'purchasing_agents', 'team_lead') only)
Role "project":
User is allowed Edit on (Edit for "time_project": ('cost_center', 'department', 'deputy', 'description', 'name', 'nosy', 'organisation', 'responsible', 'status') only)
User is allowed Edit on (Edit for "time_project": ('infosec_req', 'is_extern', 'max_hours', 'op_project', 'planned_effort', 'product_family', 'project_type', 'reporting_group', 'work_location') only)
User is allowed to access time_project (View for "time_project" only)
User is allowed to access time_report (View for "time_report" only)
User is allowed to access time_wp (View for "time_wp" only)
User is allowed to create time_project (Create for "time_project" only)
User is allowed to create time_project_status (Create for "time_project_status" only)
User is allowed to create time_wp (Create for "time_wp" only)
User is allowed to create time_wp_group (Create for "time_wp_group" only)
User is allowed to edit time_project_status (Edit for "time_project_status" only)
User is allowed to edit time_wp (Edit for "time_wp" only)
User is allowed to edit time_wp_group (Edit for "time_wp_group" only)
Role "project_view":
User is allowed to access time_project (View for "time_project" only)
User is allowed to access time_report (View for "time_report" only)
User is allowed to access time_wp (View for "time_wp" only)
Role "sec-incident-nosy":
User is allowed to access it_int_prio (View for "it_int_prio" only)
User is allowed to access it_issue (View for "it_issue" only)
User is allowed to access it_project (View for "it_project" only)
Role "sec-incident-responsible":
User is allowed to access it_int_prio (View for "it_int_prio" only)
User is allowed to access it_issue (View for "it_issue" only)
User is allowed to access it_project (View for "it_project" only)
Role "staff-report":
Role "sub-login":
Role "summary_view":
Role "supportadmin":
User is allowed to access analysis_result (View for "analysis_result" only)
User is allowed to access contact (View for "contact" only)
User is allowed to access customer (View for "customer" only)
User is allowed to access customer_agreement (View for "customer_agreement" only)
User is allowed to access mailgroup (View for "mailgroup" only)
User is allowed to access return_type (View for "return_type" only)
User is allowed to access sup_classification (View for "sup_classification" only)
User is allowed to access support (View for "support" only)
User is allowed to create analysis_result (Create for "analysis_result" only)
User is allowed to create contact (Create for "contact" only)
User is allowed to create customer (Create for "customer" only)
User is allowed to create customer_agreement (Create for "customer_agreement" only)
User is allowed to create mailgroup (Create for "mailgroup" only)
User is allowed to create return_type (Create for "return_type" only)
User is allowed to create sup_classification (Create for "sup_classification" only)
User is allowed to create support (Create for "support" only)
User is allowed to edit analysis_result (Edit for "analysis_result" only)
User is allowed to edit contact (Edit for "contact" only)
User is allowed to edit customer (Edit for "customer" only)
User is allowed to edit customer_agreement (Edit for "customer_agreement" only)
User is allowed to edit mailgroup (Edit for "mailgroup" only)
User is allowed to edit return_type (Edit for "return_type" only)
User is allowed to edit sup_classification (Edit for "sup_classification" only)
User is allowed to edit support (Edit for "support" only)
Role "time-report":
User is allowed to access time_report (View for "time_report" only)
User is allowed to create time_report (Create for "time_report" only)
User is allowed to edit time_report (Edit for "time_report" only)
User may edit own file (file created by user) (Edit for "file" only)
Role "user":
(Search for "time_project": ('activity', 'actor', 'creation', 'creator', 'deputy', 'description', 'id', 'is_extern', 'is_public_holiday', 'is_special_leave', 'is_vacation', 'name', 'nosy', 'only_hours', 'op_project', 'overtime_reduction', 'responsible', 'status', 'work_location', 'wps') only)
(Search for "time_wp": ('activity', 'actor', 'auto_wp', 'bookers', 'cost_center', 'creation', 'creator', 'description', 'durations_allowed', 'epic_key', 'has_expiration_date', 'id', 'is_extern', 'is_public', 'name', 'project', 'responsible', 'time_end', 'time_start', 'time_wp_summary_no', 'travel', 'wp_no') only)
(View for "time_project": ('activity', 'actor', 'creation', 'creator', 'deputy', 'description', 'id', 'is_extern', 'is_public_holiday', 'is_special_leave', 'is_vacation', 'name', 'nosy', 'only_hours', 'op_project', 'overtime_reduction', 'responsible', 'status', 'work_location', 'wps') only)
Search (Search for "user_contact" only)
User is allowed Edit on (Edit for "msg": ('keywords',) only)
User is allowed Edit on file if file is linked from an item with Edit permission (Edit for "file" only)
User is allowed Edit on issue if issue is non-confidential or user is on nosy list (Edit for "issue" only)
User is allowed Edit on it_issue if it_issue is non-confidential or user is on nosy list (Edit for "it_issue": ('messages', 'files', 'nosy') only)
User is allowed Edit on it_project if it_project is non-confidential or user is on nosy list (Edit for "it_project": ('messages', 'files', 'nosy') only)
User is allowed Edit on support if support is non-confidential or user is on nosy list (Edit for "support": ('analysis_end', 'analysis_result', 'analysis_start', 'bcc', 'business_unit', 'category', 'cc', 'cc_emails', 'classification', 'closed', 'confidential', 'customer', 'emails', 'execution', 'external_ref', 'files', 'goods_received', 'goods_sent', 'lot', 'messages', 'nosy', 'number_effected', 'numeric_effort', 'prio', 'prodcat', 'product', 'related_issues', 'related_support', 'release', 'responsible', 'return_type', 'sap_ref', 'send_to_customer', 'serial_number', 'set_first_reply', 'status', 'superseder', 'title', 'type', 'warranty') only)
User is allowed View on (View for "user": ('activity', 'actor', 'ad_domain', 'address', 'alternate_addresses', 'business_responsible', 'clearance_by', 'creation', 'creator', 'firstname', 'id', 'job_description', 'lastname', 'lunch_duration', 'lunch_start', 'nickname', 'pictures', 'position_text', 'queries', 'realname', 'room', 'sex', 'status', 'subst_active', 'substitute', 'supervisor', 'timezone', 'title', 'tt_lines', 'username') only)
User is allowed View on (View for "user": ('activity', 'actor', 'address', 'alternate_addresses', 'creation', 'creator', 'id', 'queries', 'realname', 'status', 'timezone', 'username') only)
User is allowed View on (View for "user": ('business_responsible', 'department_temp', 'timetracking_by', 'vie_user', 'vie_user_bl_override', 'vie_user_ml') only)
User is allowed View on (View for "user": ('contacts',) only)
User is allowed View on (View for "user_dynamic": ('department', 'org_location') only)
User is allowed View on file if file is linked from an item with View permission (View for "file" only)
User is allowed View on issue if issue is non-confidential or user is on nosy list (View for "issue" only)
User is allowed View on it_issue if it_issue is non-confidential or user is on nosy list (View for "it_issue" only)
User is allowed View on it_project if it_project is non-confidential or user is on nosy list (View for "it_project" only)
User is allowed View on msg if msg is linked from an item with View permission (View for "msg" only)
User is allowed View on support if support is non-confidential or user is on nosy list (View for "support" only)
User is allowed to access absence (View for "absence" only)
User is allowed to access absence_type (View for "absence_type" only)
User is allowed to access analysis_result (View for "analysis_result" only)
User is allowed to access area (View for "area" only)
User is allowed to access artefact (View for "artefact" only)
User is allowed to access business_unit (View for "business_unit" only)
User is allowed to access category (View for "category" only)
User is allowed to access contact (View for "contact" only)
User is allowed to access contact_type (View for "contact_type" only)
User is allowed to access cost_center (View for "cost_center" only)
User is allowed to access cost_center_group (View for "cost_center_group" only)
User is allowed to access cost_center_permission_group (View for "cost_center_permission_group" only)
User is allowed to access cost_center_status (View for "cost_center_status" only)
User is allowed to access customer (View for "customer" only)
User is allowed to access customer_agreement (View for "customer_agreement" only)
User is allowed to access daily record if he is owner or supervisor or timetracking-by user (Edit for "daily_record": ('status', 'time_record') only)
User is allowed to access daily record if he is owner or supervisor or timetracking-by user (View for "daily_record" only)
User is allowed to access daily_record_status (View for "daily_record_status" only)
User is allowed to access department (View for "department" only)
User is allowed to access doc (View for "doc" only)
User is allowed to access doc_category (View for "doc_category" only)
User is allowed to access doc_issue_status (View for "doc_issue_status" only)
User is allowed to access doc_status (View for "doc_status" only)
User is allowed to access ext_tracker (View for "ext_tracker" only)
User is allowed to access ext_tracker_state (View for "ext_tracker_state" only)
User is allowed to access ext_tracker_type (View for "ext_tracker_type" only)
User is allowed to access functional_role (View for "functional_role" only)
User is allowed to access it_category (View for "it_category" only)
User is allowed to access it_issue_status (View for "it_issue_status" only)
User is allowed to access it_prio (View for "it_prio" only)
User is allowed to access it_project_status (View for "it_project_status" only)
User is allowed to access it_request_type (View for "it_request_type" only)
User is allowed to access keyword (View for "keyword" only)
User is allowed to access kind (View for "kind" only)
User is allowed to access leave_status (View for "leave_status" only)
User is allowed to access location (View for "location" only)
User is allowed to access mailgroup (View for "mailgroup" only)
User is allowed to access msg_keyword (View for "msg_keyword" only)
User is allowed to access org_group (View for "org_group" only)
User is allowed to access org_location (View for "org_location" only)
User is allowed to access organisation (View for "organisation" only)
User is allowed to access overtime_period (View for "overtime_period" only)
User is allowed to access prodcat (View for "prodcat" only)
User is allowed to access product (View for "product" only)
User is allowed to access product_family (View for "product_family" only)
User is allowed to access product_type (View for "product_type" only)
User is allowed to access project_type (View for "project_type" only)
User is allowed to access public_holiday (View for "public_holiday" only)
User is allowed to access reference (View for "reference" only)
User is allowed to access reporting_group (View for "reporting_group" only)
User is allowed to access return_type (View for "return_type" only)
User is allowed to access room (View for "room" only)
User is allowed to access safety_level (View for "safety_level" only)
User is allowed to access sap_cc (View for "sap_cc" only)
User is allowed to access severity (View for "severity" only)
User is allowed to access sex (View for "sex" only)
User is allowed to access status (View for "status" only)
User is allowed to access status_transition (View for "status_transition" only)
User is allowed to access summary_report (View for "summary_report" only)
User is allowed to access summary_type (View for "summary_type" only)
User is allowed to access sup_classification (View for "sup_classification" only)
User is allowed to access sup_execution (View for "sup_execution" only)
User is allowed to access sup_prio (View for "sup_prio" only)
User is allowed to access sup_status (View for "sup_status" only)
User is allowed to access sup_type (View for "sup_type" only)
User is allowed to access sup_warranty (View for "sup_warranty" only)
User is allowed to access test_level (View for "test_level" only)
User is allowed to access time_activity (View for "time_activity" only)
User is allowed to access time_activity_perm (View for "time_activity_perm" only)
User is allowed to access time_project_status (View for "time_project_status" only)
User is allowed to access time_wp_group (View for "time_wp_group" only)
User is allowed to access time_wp_summary_no (View for "time_wp_summary_no" only)
User is allowed to access timesheet (View for "timesheet" only)
User is allowed to access uc_type (View for "uc_type" only)
User is allowed to access user_status (View for "user_status" only)
User is allowed to access vac_aliq (View for "vac_aliq" only)
User is allowed to access vacation_report (View for "vacation_report" only)
User is allowed to access work_location (View for "work_location" only)
User is allowed to create daily_record (Create for "daily_record" only)
User is allowed to create doc (Create for "doc" only)
User is allowed to create ext_tracker_state (Create for "ext_tracker_state" only)
User is allowed to create file (Create for "file" only)
User is allowed to create issue (Create for "issue" only)
User is allowed to create it_issue (Create for "it_issue" only)
User is allowed to create leave_submission (Create for "leave_submission" only)
User is allowed to create msg (Create for "msg" only)
User is allowed to create queries (Create for "query" only)
User is allowed to create support (Create for "support" only)
User is allowed to create time_record (Create for "time_record" only)
User is allowed to create time_wp (Create for "time_wp" only)
User is allowed to edit (some of) their own user details (Edit for "user": ('csv_delimiter', 'hide_message_files', 'lunch_duration', 'lunch_start', 'password', 'queries', 'realname', 'room', 'subst_active', 'substitute', 'timezone', 'tt_lines') only)
User is allowed to edit category if he is responsible for it (Edit for "category": ('nosy', 'default_part_of') only)
User is allowed to edit doc (Edit for "doc" only)
User is allowed to edit ext_tracker_state (Edit for "ext_tracker_state" only)
User is allowed to edit if he's the owner of the contact (Edit for "user_contact": ('visible',) only)
User is allowed to edit several fields if he is Responsible for an it_issue (Edit for "it_issue": ('responsible',) only)
User is allowed to edit several fields if he is Stakeholder/Responsible for an it_issue (Edit for "it_issue": ('deadline', 'status', 'title') only)
User is allowed to edit their queries (Edit for "query" only)
User is allowed to edit time category if the status is "Open" and he is responsible for the time category (Edit for "time_project": ('deputy', 'planned_effort', 'nosy') only)
User is allowed to edit workpackage if he is time category owner or deputy (Edit for "time_wp": ('cost_center', 'is_public', 'name', 'responsible', 'time_wp_summary_no', 'wp_no') only)
User is allowed to retire their queries (Retire for "query" only)
User is allowed to search daily_record (Search for "daily_record" only)
User is allowed to search for their own files (Search for "file" only)
User is allowed to search for their own messages (Search for "msg" only)
User is allowed to search for their queries (Search for "query" only)
User is allowed to search issue (Search for "issue" only)
User is allowed to search it_issue (Search for "it_issue" only)
User is allowed to search it_project (Search for "it_project" only)
User is allowed to search leave_submission (Search for "leave_submission" only)
User is allowed to search support (Search for "support" only)
User is allowed to search time_record (Search for "time_record" only)
User is allowed to search time_wp (Search for "time_wp": ('activity', 'actor', 'auto_wp', 'cost_center', 'creation', 'creator', 'description', 'durations_allowed', 'epic_key', 'has_expiration_date', 'is_extern', 'is_public', 'id', 'name', 'project', 'responsible', 'time_end', 'time_start', 'time_wp_summary_no', 'travel', 'wp_no') only)
User is allowed to search user_status (Search for "user": ('status',) only)
User is allowed to see time record if he is allowed to see all details on work package or User may view a daily_record (and time_records that are attached to that daily_record) if the user owns the daily_record or has role 'HR' or 'Controlling', or the user is supervisor or substitute supervisor of the owner of the daily record (the supervisor relationship is transitive) or the user is the department manager of the owner of the daily record. If user has role HR-Org-Location and is in the same Org-Location as the record, it may also be seen (View for "time_record" only)
User is allowed to view (some of) their own user details (View for "user": ('entry_date', 'planning_role') only)
User is allowed to view contact if he's the owner of the contact or the contact is marked visible (View for "user_contact" only)
User is allowed to view leave submission if he is the supervisor or the person to whom approvals are delegated (Edit for "leave_submission": ('status',) only)
User is allowed to view leave submission if he is the supervisor or the person to whom approvals are delegated (View for "leave_submission" only)
User is allowed to view selected fields in work package if booking is allowed for this user (also applies to timetracking by, supervisor and approval delegated) (View for "time_wp": ('activity', 'actor', 'cost_center', 'creation', 'creator', 'description', 'durations_allowed', 'epic_key', 'has_expiration_date', 'id', 'is_extern', 'is_public', 'name', 'project', 'responsible', 'time_end', 'time_start', 'time_wp_summary_no', 'travel', 'wp_no') only)
User is allowed to view their own files (View for "file" only)
User is allowed to view their own messages (View for "msg" only)
User is allowed to view their own overtime information (View for "overtime_correction" only)
User is allowed to view time record if he is the supervisor or the person to whom approvals are delegated (View for "time_record" only)
User is allowed to view work package and time category names if he/she has role HR or HR-Org-Location (View for "time_project": ('name',) only)
User is allowed to view work package and time category names if he/she has role HR or HR-Org-Location (View for "time_wp": ('name', 'project') only)
User is allowed to view/edit workpackage if he is owner or project responsible/deputy (Edit for "time_wp": ('bookers', 'description', 'epic_key', 'planned_effort', 'time_end', 'time_start', 'time_wp_summary_no') only)
User may access the rest interface (Rest Access)
User may access the web interface (Web Access)
User may access the xmlrpc interface (Xmlrpc Access)
User may edit own leave submissions (Edit for "leave_submission": ('comment', 'comment_cancel', 'first_day', 'last_day', 'status', 'time_wp', 'user') only)
User may edit own leave submissions (View for "leave_submission": ('comment', 'comment_cancel', 'first_day', 'last_day', 'status', 'time_wp', 'user') only)
User may see time report if reponsible or deputy of time project or on nosy list of time project (View for "time_report" only)
User may use the email interface (Email Access)
User may view a daily_record (and time_records that are attached to that daily_record) if the user owns the daily_record or has role 'HR' or 'Controlling', or the user is supervisor or substitute supervisor of the owner of the daily record (the supervisor relationship is transitive) or the user is the department manager of the owner of the daily record. If user has role HR-Org-Location and is in the same Org-Location as the record, it may also be seen (View for "daily_record" only)
User may view their own user functional role (View for "user_functional_role" only)
User may view time category if user is owner or deputy of time category or on nosy list of time category or if user is department manager of time category (View for "time_project" only)
User may view work package if responsible for it, if user is owner or deputy of time category or on nosy list of time category or if user is department manager of time category (View for "time_wp" only)
User or Timetracking by user may edit time_records owned by user (Edit for "time_record" only)
User or Timetracking by user may edit time_records owned by user (Restore for "time_record" only)
User or Timetracking by user may edit time_records owned by user (Retire for "time_record" only)
User or Timetracking by user may edit time_records owned by user (View for "time_record" only)
Users are allowed to view their own and public queries for classes where they have search permission (View for "query" only)
Users may see daily record if they may see one of the time_records for that day (View for "daily_record" only)
Role "user_view":
User is allowed to access user (View for "user" only)
Role "vacation-report":
""".strip ()
| security = '\nNew Web users get the Roles "User,Nosy"\nNew Email users get the Role "User"\nRole "admin":\n User may access the rest interface (Rest Access)\n User may access the web interface (Web Access)\n User may access the xmlrpc interface (Xmlrpc Access)\n User may create everything (Create)\n User may edit everything (Edit)\n User may manipulate user Roles through the web (Web Roles)\n User may restore everything (Restore)\n User may retire everything (Retire)\n User may use the email interface (Email Access)\n User may view everything (View)\nRole "anonymous":\n User may access the web interface (Web Access)\nRole "cc-permission":\n (Restore for "cost_center_permission_group" only)\n (Retire for "cost_center_permission_group" only)\n User is allowed to create cost_center_permission_group (Create for "cost_center_permission_group" only)\n User is allowed to edit cost_center_permission_group (Edit for "cost_center_permission_group" only)\nRole "contact":\n User is allowed to create contact (Create for "contact" only)\n User is allowed to edit contact (Edit for "contact" only)\nRole "controlling":\n User is allowed Edit on (Edit for "daily_record": (\'status\', \'time_record\') only)\n User is allowed Edit on (Edit for "sap_cc": (\'group_lead\', \'team_lead\') only)\n User is allowed Edit on (Edit for "time_project": (\'group_lead\', \'team_lead\') only)\n User is allowed Edit on (Edit for "time_wp": (\'project\',) only)\n User is allowed View on (View for "user": (\'roles\',) only)\n User is allowed View on (View for "user_dynamic": (\'id\', \'sap_cc\', \'user\', \'valid_from\', \'valid_to\') only)\n User is allowed to access contract_type (View for "contract_type" only)\n User is allowed to access daily_record (View for "daily_record" only)\n User is allowed to access daily_record_freeze (View for "daily_record_freeze" only)\n User is allowed to access leave_submission (View for "leave_submission" only)\n User is allowed to access overtime_correction (View for "overtime_correction" only)\n User is allowed to access query (View for "query" only)\n User is allowed to access time_project (View for "time_project" only)\n User is allowed to access time_record (View for "time_record" only)\n User is allowed to access time_report (View for "time_report" only)\n User is allowed to access time_wp (View for "time_wp" only)\n User is allowed to access vacation_correction (View for "vacation_correction" only)\n User is allowed to create cost_center (Create for "cost_center" only)\n User is allowed to create cost_center_group (Create for "cost_center_group" only)\n User is allowed to create cost_center_status (Create for "cost_center_status" only)\n User is allowed to create department (Create for "department" only)\n User is allowed to create organisation (Create for "organisation" only)\n User is allowed to create product_family (Create for "product_family" only)\n User is allowed to create public_holiday (Create for "public_holiday" only)\n User is allowed to create query (Create for "query" only)\n User is allowed to create reporting_group (Create for "reporting_group" only)\n User is allowed to create sap_cc (Create for "sap_cc" only)\n User is allowed to create time_activity (Create for "time_activity" only)\n User is allowed to create time_activity_perm (Create for "time_activity_perm" only)\n User is allowed to create time_record (Create for "time_record" only)\n User is allowed to create work_location (Create for "work_location" only)\n User is allowed to edit cost_center (Edit for "cost_center" only)\n User is allowed to edit cost_center_group (Edit for "cost_center_group" only)\n User is allowed to edit cost_center_status (Edit for "cost_center_status" only)\n User is allowed to edit department (Edit for "department" only)\n User is allowed to edit organisation (Edit for "organisation" only)\n User is allowed to edit product_family (Edit for "product_family" only)\n User is allowed to edit public_holiday (Edit for "public_holiday" only)\n User is allowed to edit query (Edit for "query" only)\n User is allowed to edit reporting_group (Edit for "reporting_group" only)\n User is allowed to edit sap_cc (Edit for "sap_cc" only)\n User is allowed to edit time_activity (Edit for "time_activity" only)\n User is allowed to edit time_activity_perm (Edit for "time_activity_perm" only)\n User is allowed to edit time_record (Edit for "time_record" only)\n User is allowed to edit work_location (Edit for "work_location" only)\nRole "doc_admin":\n User is allowed Edit on (Edit for "department": (\'doc_num\',) only)\n User is allowed to create artefact (Create for "artefact" only)\n User is allowed to create doc (Create for "doc" only)\n User is allowed to create doc_category (Create for "doc_category" only)\n User is allowed to create doc_status (Create for "doc_status" only)\n User is allowed to create product_type (Create for "product_type" only)\n User is allowed to create reference (Create for "reference" only)\n User is allowed to edit artefact (Edit for "artefact" only)\n User is allowed to edit doc (Edit for "doc" only)\n User is allowed to edit doc_category (Edit for "doc_category" only)\n User is allowed to edit doc_status (Edit for "doc_status" only)\n User is allowed to edit product_type (Edit for "product_type" only)\n User is allowed to edit reference (Edit for "reference" only)\nRole "dom-user-edit-facility":\n Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (Edit for "user": [\'room\'] only)\n Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (View for "user": [\'room\'] only)\nRole "dom-user-edit-gtt":\n (Search for "user_dynamic" only)\n May only view/edit records with the correct domain (Edit for "user_dynamic" only)\n May only view/edit records with the correct domain (View for "user_dynamic" only)\n User is allowed to access contract_type (View for "contract_type" only)\n User is allowed to create user (Create for "user" only)\n User is allowed to create user_contact (Create for "user_contact" only)\n User is allowed to create user_dynamic (Create for "user_dynamic" only)\n User is allowed to edit user_contact (Edit for "user_contact" only)\n Users may view user_dynamic records for ad_domain for which they are in the domain_permission for the user (View for "user_dynamic" only)\n Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (Edit for "user": [\'contacts\', \'csv_delimiter\', \'department_temp\', \'entry_date\', \'firstname\', \'hide_message_files\', \'job_description\', \'lastname\', \'lunch_duration\', \'lunch_start\', \'nickname\', \'pictures\', \'position_text\', \'room\', \'sex\', \'status\', \'subst_active\', \'substitute\', \'supervisor\', \'sync_foreign_key\', \'timezone\', \'tt_lines\', \'username\', \'vie_user\'] only)\n Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (View for "user": [\'contacts\', \'csv_delimiter\', \'department_temp\', \'entry_date\', \'firstname\', \'hide_message_files\', \'job_description\', \'lastname\', \'lunch_duration\', \'lunch_start\', \'nickname\', \'pictures\', \'position_text\', \'room\', \'sex\', \'status\', \'subst_active\', \'substitute\', \'supervisor\', \'sync_foreign_key\', \'timezone\', \'tt_lines\', \'username\', \'vie_user\'] only)\nRole "dom-user-edit-hr":\n (Search for "user_dynamic" only)\n May only view/edit records with the correct domain (Edit for "user_dynamic" only)\n May only view/edit records with the correct domain (View for "user_dynamic" only)\n User is allowed to access contract_type (View for "contract_type" only)\n User is allowed to create user_contact (Create for "user_contact" only)\n User is allowed to create user_dynamic (Create for "user_dynamic" only)\n User is allowed to edit user_contact (Edit for "user_contact" only)\n Users may view user_dynamic records for ad_domain for which they are in the domain_permission for the user (View for "user_dynamic" only)\n Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (Edit for "user": [\'clearance_by\', \'contacts\', \'csv_delimiter\', \'entry_date\', \'firstname\', \'hide_message_files\', \'job_description\', \'lastname\', \'lunch_duration\', \'lunch_start\', \'nickname\', \'pictures\', \'position_text\', \'reduced_activity_list\', \'roles\', \'room\', \'sex\', \'status\', \'subst_active\', \'substitute\', \'supervisor\', \'timezone\', \'tt_lines\', \'vie_user\'] only)\n Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (View for "user": [\'clearance_by\', \'contacts\', \'csv_delimiter\', \'entry_date\', \'firstname\', \'hide_message_files\', \'job_description\', \'lastname\', \'lunch_duration\', \'lunch_start\', \'nickname\', \'pictures\', \'position_text\', \'reduced_activity_list\', \'roles\', \'room\', \'sex\', \'status\', \'subst_active\', \'substitute\', \'supervisor\', \'timezone\', \'tt_lines\', \'vie_user\'] only)\nRole "dom-user-edit-office":\n User is allowed to create user_contact (Create for "user_contact" only)\n User is allowed to edit user_contact (Edit for "user_contact" only)\n Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (Edit for "user": [\'contacts\', \'position_text\', \'room\'] only)\n Users may view/edit user records for ad_domain for which they are in the domain_permission for the user (View for "user": [\'contacts\', \'position_text\', \'room\'] only)\nRole "external":\n (Search for "ext_tracker_state": (\'id\', \'issue\') only)\n (Search for "user": (\'id\', \'nickname\', \'username\') only)\n External users are allowed to access issue if they are on the list of allowed external users or there is a transitive permission via containers (Edit for "issue": [\'activity\', \'actor\', \'area\', \'category\', \'closed\', \'composed_of\', \'creation\', \'creator\', \'cur_est_begin\', \'cur_est_end\', \'deadline\', \'depends\', \'doc_issue_status\', \'earliest_start\', \'effective_prio\', \'effort_hours\', \'external_users\', \'files\', \'files_affected\', \'fixed_in\', \'id\', \'keywords\', \'kind\', \'maturity_index\', \'messages\', \'needs\', \'nosy\', \'numeric_effort\', \'part_of\', \'planned_begin\', \'planned_end\', \'priority\', \'release\', \'responsible\', \'safety_level\', \'severity\', \'status\', \'superseder\', \'test_level\', \'title\'] only)\n External users are allowed to access issue if they are on the list of allowed external users or there is a transitive permission via containers (View for "issue": [\'activity\', \'actor\', \'area\', \'category\', \'closed\', \'composed_of\', \'creation\', \'creator\', \'cur_est_begin\', \'cur_est_end\', \'deadline\', \'depends\', \'doc_issue_status\', \'earliest_start\', \'effective_prio\', \'effort_hours\', \'external_users\', \'files\', \'files_affected\', \'fixed_in\', \'id\', \'keywords\', \'kind\', \'maturity_index\', \'messages\', \'needs\', \'nosy\', \'numeric_effort\', \'part_of\', \'planned_begin\', \'planned_end\', \'priority\', \'release\', \'responsible\', \'safety_level\', \'severity\', \'status\', \'superseder\', \'test_level\', \'title\'] only)\n User is allowed View on (View for "category": (\'id\', \'name\') only)\n User is allowed View on (View for "user": (\'nickname\', \'status\', \'username\') only)\n User is allowed View on (View for "user_status": (\'name\',) only)\n User is allowed View on file if file is linked from an item with View permission (View for "file" only)\n User is allowed View on msg if msg is linked from an item with View permission (View for "msg" only)\n User is allowed to access area (View for "area" only)\n User is allowed to access doc_issue_status (View for "doc_issue_status" only)\n User is allowed to access ext_tracker (View for "ext_tracker" only)\n User is allowed to access ext_tracker_state (View for "ext_tracker_state" only)\n User is allowed to access ext_tracker_type (View for "ext_tracker_type" only)\n User is allowed to access keyword (View for "keyword" only)\n User is allowed to access kind (View for "kind" only)\n User is allowed to access msg_keyword (View for "msg_keyword" only)\n User is allowed to access safety_level (View for "safety_level" only)\n User is allowed to access severity (View for "severity" only)\n User is allowed to access status (View for "status" only)\n User is allowed to access status_transition (View for "status_transition" only)\n User is allowed to access test_level (View for "test_level" only)\n User is allowed to create file (Create for "file" only)\n User is allowed to create issue (Create for "issue" only)\n User is allowed to create msg (Create for "msg" only)\n User is allowed to create query (Create for "query" only)\n User is allowed to edit their queries (Edit for "query" only)\n User is allowed to retire their queries (Retire for "query" only)\n User is allowed to search for their own files (Search for "file" only)\n User is allowed to search for their own messages (Search for "msg" only)\n User is allowed to search for their queries (Search for "query" only)\n User is allowed to search issue (Search for "issue" only)\n User is allowed to view their own files (View for "file" only)\n User may access the web interface (Web Access)\n User may use the email interface (Email Access)\n Users are allowed to edit some of their details (Edit for "user": (\'csv_delimiter\', \'hide_message_files\', \'password\', \'timezone\') only)\n Users are allowed to view some of their details (View for "user": (\'activity\', \'actor\', \'creation\', \'creator\', \'firstname\', \'lastname\', \'realname\', \'username\') only)\n Users are allowed to view their own and public queries for classes where they have search permission (View for "query" only)\nRole "facility":\n (Restore for "room" only)\n (Retire for "room" only)\n User is allowed to create room (Create for "room" only)\n User is allowed to edit room (Edit for "room" only)\nRole "functional-role":\n (Restore for "user_functional_role" only)\n (Retire for "user_functional_role" only)\n User is allowed Edit on (Edit for "user": (\'business_responsible\', \'scale_seniority\') only)\n User is allowed View on (View for "user": (\'business_responsible\', \'planning_role\', \'scale_seniority\') only)\n User is allowed to access user_functional_role (View for "user_functional_role" only)\n User is allowed to create user_functional_role (Create for "user_functional_role" only)\n User is allowed to edit user_functional_role (Edit for "user_functional_role" only)\nRole "hr":\n (Edit for "overtime_period": (\'name\', \'order\') only)\n (Restore for "room" only)\n (Retire for "room" only)\n User is allowed Edit on (Edit for "daily_record": (\'required_overtime\', \'weekend_allowed\') only)\n User is allowed Edit on (Edit for "daily_record": (\'status\', \'time_record\') only)\n User is allowed Edit on (Edit for "time_project": (\'approval_hr\', \'approval_required\', \'is_extern\', \'is_public_holiday\', \'is_special_leave\', \'is_vacation\', \'no_overtime\', \'no_overtime_day\', \'only_hours\', \'overtime_reduction\') only)\n User is allowed View on (View for "user": (\'contacts\',) only)\n User is allowed to access auto_wp (View for "auto_wp" only)\n User is allowed to access contract_type (View for "contract_type" only)\n User is allowed to access daily_record (View for "daily_record" only)\n User is allowed to access daily_record_freeze (View for "daily_record_freeze" only)\n User is allowed to access leave_submission (View for "leave_submission" only)\n User is allowed to access overtime_correction (View for "overtime_correction" only)\n User is allowed to access time_record (View for "time_record" only)\n User is allowed to access user_contact (View for "user_contact" only)\n User is allowed to access user_dynamic (View for "user_dynamic" only)\n User is allowed to access vacation_correction (View for "vacation_correction" only)\n User is allowed to create auto_wp (Create for "auto_wp" only)\n User is allowed to create daily_record_freeze (Create for "daily_record_freeze" only)\n User is allowed to create location (Create for "location" only)\n User is allowed to create org_location (Create for "org_location" only)\n User is allowed to create organisation (Create for "organisation" only)\n User is allowed to create overtime_correction (Create for "overtime_correction" only)\n User is allowed to create overtime_period (Create for "overtime_period" only)\n User is allowed to create product_family (Create for "product_family" only)\n User is allowed to create public_holiday (Create for "public_holiday" only)\n User is allowed to create reporting_group (Create for "reporting_group" only)\n User is allowed to create room (Create for "room" only)\n User is allowed to create sap_cc (Create for "sap_cc" only)\n User is allowed to create time_record (Create for "time_record" only)\n User is allowed to create uc_type (Create for "uc_type" only)\n User is allowed to create user (Create for "user" only)\n User is allowed to create user_dynamic (Create for "user_dynamic" only)\n User is allowed to edit auto_wp (Edit for "auto_wp" only)\n User is allowed to edit dynamic user data if not frozen in validity span of dynamic user record (Edit for "user_dynamic" only)\n User is allowed to edit freeze record if not frozen at the given date (Edit for "daily_record_freeze": (\'frozen\',) only)\n User is allowed to edit location (Edit for "location" only)\n User is allowed to edit org_location (Edit for "org_location" only)\n User is allowed to edit organisation (Edit for "organisation" only)\n User is allowed to edit overtime correction if the overtime correction is not frozen (Edit for "overtime_correction" only)\n User is allowed to edit product_family (Edit for "product_family" only)\n User is allowed to edit public_holiday (Edit for "public_holiday" only)\n User is allowed to edit reporting_group (Edit for "reporting_group" only)\n User is allowed to edit room (Edit for "room" only)\n User is allowed to edit sap_cc (Edit for "sap_cc" only)\n User is allowed to edit time_record (Edit for "time_record" only)\n User is allowed to edit uc_type (Edit for "uc_type" only)\n User may manipulate user Roles through the web (Web Roles)\nRole "hr-leave-approval":\n User is allowed Edit on (Edit for "leave_submission": (\'status\',) only)\n User is allowed to access contract_type (View for "contract_type" only)\n User is allowed to access leave_submission (View for "leave_submission" only)\n User is allowed to access vacation_correction (View for "vacation_correction" only)\nRole "hr-org-location":\n (Search for "daily_record_freeze" only)\n (Search for "overtime_correction" only)\n (Search for "time_activity_perm" only)\n (Search for "time_record" only)\n (Search for "user_dynamic" only)\n User is allowed to view dynamic user data if he/she is in group HR-Org-Location and in the same Org-Location as the given user (View for "user_dynamic" only)\n User is allowed to view freeze information if he/she is in group HR-Org-Location and in the same Org-Location as the given user (View for "daily_record_freeze" only)\n User is allowed to view overtime information if he/she is in group HR-Org-Location and in the same Org-Location as the given user (View for "overtime_correction" only)\n User is allowed to view time record data if he/she is in group HR-Org-Location and in the same Org-Location as the given user (View for "time_record" only)\nRole "hr-vacation":\n User is allowed to access contract_type (View for "contract_type" only)\n User is allowed to access leave_submission (View for "leave_submission" only)\n User is allowed to access vacation_correction (View for "vacation_correction" only)\n User is allowed to create contract_type (Create for "contract_type" only)\n User is allowed to create leave_submission (Create for "leave_submission" only)\n User is allowed to create vacation_correction (Create for "vacation_correction" only)\n User is allowed to edit contract_type (Edit for "contract_type" only)\n User is allowed to edit leave_submission (Edit for "leave_submission" only)\n User is allowed to edit vacation_correction (Edit for "vacation_correction" only)\nRole "issue_admin":\n User is allowed Edit on msg if msg is linked from an item with Edit permission (Edit for "msg" only)\n User is allowed to access issue (View for "issue" only)\n User is allowed to create area (Create for "area" only)\n User is allowed to create category (Create for "category" only)\n User is allowed to create doc_issue_status (Create for "doc_issue_status" only)\n User is allowed to create ext_tracker (Create for "ext_tracker" only)\n User is allowed to create issue (Create for "issue" only)\n User is allowed to create keyword (Create for "keyword" only)\n User is allowed to create kind (Create for "kind" only)\n User is allowed to create msg_keyword (Create for "msg_keyword" only)\n User is allowed to create safety_level (Create for "safety_level" only)\n User is allowed to create severity (Create for "severity" only)\n User is allowed to create status (Create for "status" only)\n User is allowed to create status_transition (Create for "status_transition" only)\n User is allowed to create test_level (Create for "test_level" only)\n User is allowed to edit area (Edit for "area" only)\n User is allowed to edit category (Edit for "category" only)\n User is allowed to edit doc_issue_status (Edit for "doc_issue_status" only)\n User is allowed to edit ext_tracker (Edit for "ext_tracker" only)\n User is allowed to edit issue (Edit for "issue" only)\n User is allowed to edit keyword (Edit for "keyword" only)\n User is allowed to edit kind (Edit for "kind" only)\n User is allowed to edit msg_keyword (Edit for "msg_keyword" only)\n User is allowed to edit safety_level (Edit for "safety_level" only)\n User is allowed to edit severity (Edit for "severity" only)\n User is allowed to edit status (Edit for "status" only)\n User is allowed to edit status_transition (Edit for "status_transition" only)\n User is allowed to edit test_level (Edit for "test_level" only)\nRole "it":\n Create (Create for "user_contact" only)\n User is allowed Edit on (Edit for "file": (\'name\', \'type\') only)\n User is allowed Edit on (Edit for "location": (\'domain_part\',) only)\n User is allowed Edit on (Edit for "organisation": (\'domain_part\',) only)\n User is allowed Edit on (Edit for "user": (\'ad_domain\', \'nickname\', \'password\', \'pictures\', \'roles\', \'timetracking_by\', \'timezone\', \'username\') only)\n User is allowed Edit on (Edit for "user": (\'address\', \'alternate_addresses\', \'nickname\', \'password\', \'timezone\', \'username\') only)\n User is allowed Edit on file if file is linked from an item with Edit permission (Edit for "file" only)\n User is allowed Edit on msg if msg is linked from an item with Edit permission (Edit for "msg" only)\n User is allowed View on file if file is linked from an item with View permission (View for "file" only)\n User is allowed to access domain_permission (View for "domain_permission" only)\n User is allowed to access it_int_prio (View for "it_int_prio" only)\n User is allowed to access it_issue (View for "it_issue" only)\n User is allowed to access it_project (View for "it_project" only)\n User is allowed to create domain_permission (Create for "domain_permission" only)\n User is allowed to create it_category (Create for "it_category" only)\n User is allowed to create it_int_prio (Create for "it_int_prio" only)\n User is allowed to create it_issue (Create for "it_issue" only)\n User is allowed to create it_project (Create for "it_project" only)\n User is allowed to create it_request_type (Create for "it_request_type" only)\n User is allowed to create mailgroup (Create for "mailgroup" only)\n User is allowed to edit domain_permission (Edit for "domain_permission" only)\n User is allowed to edit it_category (Edit for "it_category" only)\n User is allowed to edit it_int_prio (Edit for "it_int_prio" only)\n User is allowed to edit it_issue (Edit for "it_issue" only)\n User is allowed to edit it_project (Edit for "it_project" only)\n User is allowed to edit it_request_type (Edit for "it_request_type" only)\n User is allowed to edit mailgroup (Edit for "mailgroup" only)\n User may manipulate user Roles through the web (Web Roles)\nRole "itview":\n User is allowed to access it_int_prio (View for "it_int_prio" only)\n User is allowed to access it_issue (View for "it_issue" only)\n User is allowed to access it_project (View for "it_project" only)\nRole "msgedit":\n (Search for "msg": (\'date\', \'id\') only)\n User is allowed Edit on (Edit for "msg": (\'author\', \'date\', \'id\', \'keywords\', \'subject\', \'summary\') only)\n User is allowed to access ext_msg (View for "ext_msg" only)\n User is allowed to access ext_tracker_state (View for "ext_tracker_state" only)\n User is allowed to access ext_tracker_type (View for "ext_tracker_type" only)\nRole "msgsync":\n (Search for "msg": (\'date\', \'id\') only)\n User is allowed Edit on (Edit for "msg": (\'author\', \'date\', \'id\', \'keywords\', \'subject\', \'summary\') only)\n User is allowed to access ext_msg (View for "ext_msg" only)\n User is allowed to access ext_tracker_state (View for "ext_tracker_state" only)\n User is allowed to access ext_tracker_type (View for "ext_tracker_type" only)\n User is allowed to create ext_msg (Create for "ext_msg" only)\n User is allowed to create ext_tracker_state (Create for "ext_tracker_state" only)\n User is allowed to edit ext_msg (Edit for "ext_msg" only)\n User is allowed to edit ext_tracker_state (Edit for "ext_tracker_state" only)\nRole "nosy":\n User may get nosy messages for doc (Nosy for "doc" only)\n User may get nosy messages for issue (Nosy for "issue" only)\n User may get nosy messages for it_issue (Nosy for "it_issue" only)\n User may get nosy messages for it_project (Nosy for "it_project" only)\n User may get nosy messages for support (Nosy for "support" only)\nRole "office":\n (Restore for "room" only)\n (Retire for "room" only)\n User is allowed View on (View for "user": (\'contacts\',) only)\n User is allowed to access user_contact (View for "user_contact" only)\n User is allowed to create absence (Create for "absence" only)\n User is allowed to create absence_type (Create for "absence_type" only)\n User is allowed to create room (Create for "room" only)\n User is allowed to create uc_type (Create for "uc_type" only)\n User is allowed to edit absence (Edit for "absence" only)\n User is allowed to edit absence_type (Edit for "absence_type" only)\n User is allowed to edit room (Edit for "room" only)\n User is allowed to edit uc_type (Edit for "uc_type" only)\nRole "organisation":\n User is allowed to access location (View for "location" only)\n User is allowed to access org_location (View for "org_location" only)\n User is allowed to access organisation (View for "organisation" only)\n User is allowed to create location (Create for "location" only)\n User is allowed to create org_location (Create for "org_location" only)\n User is allowed to create organisation (Create for "organisation" only)\n User is allowed to edit location (Edit for "location" only)\n User is allowed to edit org_location (Edit for "org_location" only)\n User is allowed to edit organisation (Edit for "organisation" only)\nRole "pgp":\nRole "procurement":\n (View for "sap_cc" only)\n (View for "time_project" only)\n User is allowed Edit on (Edit for "sap_cc": (\'group_lead\', \'purchasing_agents\', \'team_lead\') only)\n User is allowed Edit on (Edit for "time_project": (\'group_lead\', \'purchasing_agents\', \'team_lead\') only)\nRole "project":\n User is allowed Edit on (Edit for "time_project": (\'cost_center\', \'department\', \'deputy\', \'description\', \'name\', \'nosy\', \'organisation\', \'responsible\', \'status\') only)\n User is allowed Edit on (Edit for "time_project": (\'infosec_req\', \'is_extern\', \'max_hours\', \'op_project\', \'planned_effort\', \'product_family\', \'project_type\', \'reporting_group\', \'work_location\') only)\n User is allowed to access time_project (View for "time_project" only)\n User is allowed to access time_report (View for "time_report" only)\n User is allowed to access time_wp (View for "time_wp" only)\n User is allowed to create time_project (Create for "time_project" only)\n User is allowed to create time_project_status (Create for "time_project_status" only)\n User is allowed to create time_wp (Create for "time_wp" only)\n User is allowed to create time_wp_group (Create for "time_wp_group" only)\n User is allowed to edit time_project_status (Edit for "time_project_status" only)\n User is allowed to edit time_wp (Edit for "time_wp" only)\n User is allowed to edit time_wp_group (Edit for "time_wp_group" only)\nRole "project_view":\n User is allowed to access time_project (View for "time_project" only)\n User is allowed to access time_report (View for "time_report" only)\n User is allowed to access time_wp (View for "time_wp" only)\nRole "sec-incident-nosy":\n User is allowed to access it_int_prio (View for "it_int_prio" only)\n User is allowed to access it_issue (View for "it_issue" only)\n User is allowed to access it_project (View for "it_project" only)\nRole "sec-incident-responsible":\n User is allowed to access it_int_prio (View for "it_int_prio" only)\n User is allowed to access it_issue (View for "it_issue" only)\n User is allowed to access it_project (View for "it_project" only)\nRole "staff-report":\nRole "sub-login":\nRole "summary_view":\nRole "supportadmin":\n User is allowed to access analysis_result (View for "analysis_result" only)\n User is allowed to access contact (View for "contact" only)\n User is allowed to access customer (View for "customer" only)\n User is allowed to access customer_agreement (View for "customer_agreement" only)\n User is allowed to access mailgroup (View for "mailgroup" only)\n User is allowed to access return_type (View for "return_type" only)\n User is allowed to access sup_classification (View for "sup_classification" only)\n User is allowed to access support (View for "support" only)\n User is allowed to create analysis_result (Create for "analysis_result" only)\n User is allowed to create contact (Create for "contact" only)\n User is allowed to create customer (Create for "customer" only)\n User is allowed to create customer_agreement (Create for "customer_agreement" only)\n User is allowed to create mailgroup (Create for "mailgroup" only)\n User is allowed to create return_type (Create for "return_type" only)\n User is allowed to create sup_classification (Create for "sup_classification" only)\n User is allowed to create support (Create for "support" only)\n User is allowed to edit analysis_result (Edit for "analysis_result" only)\n User is allowed to edit contact (Edit for "contact" only)\n User is allowed to edit customer (Edit for "customer" only)\n User is allowed to edit customer_agreement (Edit for "customer_agreement" only)\n User is allowed to edit mailgroup (Edit for "mailgroup" only)\n User is allowed to edit return_type (Edit for "return_type" only)\n User is allowed to edit sup_classification (Edit for "sup_classification" only)\n User is allowed to edit support (Edit for "support" only)\nRole "time-report":\n User is allowed to access time_report (View for "time_report" only)\n User is allowed to create time_report (Create for "time_report" only)\n User is allowed to edit time_report (Edit for "time_report" only)\n User may edit own file (file created by user) (Edit for "file" only)\nRole "user":\n (Search for "time_project": (\'activity\', \'actor\', \'creation\', \'creator\', \'deputy\', \'description\', \'id\', \'is_extern\', \'is_public_holiday\', \'is_special_leave\', \'is_vacation\', \'name\', \'nosy\', \'only_hours\', \'op_project\', \'overtime_reduction\', \'responsible\', \'status\', \'work_location\', \'wps\') only)\n (Search for "time_wp": (\'activity\', \'actor\', \'auto_wp\', \'bookers\', \'cost_center\', \'creation\', \'creator\', \'description\', \'durations_allowed\', \'epic_key\', \'has_expiration_date\', \'id\', \'is_extern\', \'is_public\', \'name\', \'project\', \'responsible\', \'time_end\', \'time_start\', \'time_wp_summary_no\', \'travel\', \'wp_no\') only)\n (View for "time_project": (\'activity\', \'actor\', \'creation\', \'creator\', \'deputy\', \'description\', \'id\', \'is_extern\', \'is_public_holiday\', \'is_special_leave\', \'is_vacation\', \'name\', \'nosy\', \'only_hours\', \'op_project\', \'overtime_reduction\', \'responsible\', \'status\', \'work_location\', \'wps\') only)\n Search (Search for "user_contact" only)\n User is allowed Edit on (Edit for "msg": (\'keywords\',) only)\n User is allowed Edit on file if file is linked from an item with Edit permission (Edit for "file" only)\n User is allowed Edit on issue if issue is non-confidential or user is on nosy list (Edit for "issue" only)\n User is allowed Edit on it_issue if it_issue is non-confidential or user is on nosy list (Edit for "it_issue": (\'messages\', \'files\', \'nosy\') only)\n User is allowed Edit on it_project if it_project is non-confidential or user is on nosy list (Edit for "it_project": (\'messages\', \'files\', \'nosy\') only)\n User is allowed Edit on support if support is non-confidential or user is on nosy list (Edit for "support": (\'analysis_end\', \'analysis_result\', \'analysis_start\', \'bcc\', \'business_unit\', \'category\', \'cc\', \'cc_emails\', \'classification\', \'closed\', \'confidential\', \'customer\', \'emails\', \'execution\', \'external_ref\', \'files\', \'goods_received\', \'goods_sent\', \'lot\', \'messages\', \'nosy\', \'number_effected\', \'numeric_effort\', \'prio\', \'prodcat\', \'product\', \'related_issues\', \'related_support\', \'release\', \'responsible\', \'return_type\', \'sap_ref\', \'send_to_customer\', \'serial_number\', \'set_first_reply\', \'status\', \'superseder\', \'title\', \'type\', \'warranty\') only)\n User is allowed View on (View for "user": (\'activity\', \'actor\', \'ad_domain\', \'address\', \'alternate_addresses\', \'business_responsible\', \'clearance_by\', \'creation\', \'creator\', \'firstname\', \'id\', \'job_description\', \'lastname\', \'lunch_duration\', \'lunch_start\', \'nickname\', \'pictures\', \'position_text\', \'queries\', \'realname\', \'room\', \'sex\', \'status\', \'subst_active\', \'substitute\', \'supervisor\', \'timezone\', \'title\', \'tt_lines\', \'username\') only)\n User is allowed View on (View for "user": (\'activity\', \'actor\', \'address\', \'alternate_addresses\', \'creation\', \'creator\', \'id\', \'queries\', \'realname\', \'status\', \'timezone\', \'username\') only)\n User is allowed View on (View for "user": (\'business_responsible\', \'department_temp\', \'timetracking_by\', \'vie_user\', \'vie_user_bl_override\', \'vie_user_ml\') only)\n User is allowed View on (View for "user": (\'contacts\',) only)\n User is allowed View on (View for "user_dynamic": (\'department\', \'org_location\') only)\n User is allowed View on file if file is linked from an item with View permission (View for "file" only)\n User is allowed View on issue if issue is non-confidential or user is on nosy list (View for "issue" only)\n User is allowed View on it_issue if it_issue is non-confidential or user is on nosy list (View for "it_issue" only)\n User is allowed View on it_project if it_project is non-confidential or user is on nosy list (View for "it_project" only)\n User is allowed View on msg if msg is linked from an item with View permission (View for "msg" only)\n User is allowed View on support if support is non-confidential or user is on nosy list (View for "support" only)\n User is allowed to access absence (View for "absence" only)\n User is allowed to access absence_type (View for "absence_type" only)\n User is allowed to access analysis_result (View for "analysis_result" only)\n User is allowed to access area (View for "area" only)\n User is allowed to access artefact (View for "artefact" only)\n User is allowed to access business_unit (View for "business_unit" only)\n User is allowed to access category (View for "category" only)\n User is allowed to access contact (View for "contact" only)\n User is allowed to access contact_type (View for "contact_type" only)\n User is allowed to access cost_center (View for "cost_center" only)\n User is allowed to access cost_center_group (View for "cost_center_group" only)\n User is allowed to access cost_center_permission_group (View for "cost_center_permission_group" only)\n User is allowed to access cost_center_status (View for "cost_center_status" only)\n User is allowed to access customer (View for "customer" only)\n User is allowed to access customer_agreement (View for "customer_agreement" only)\n User is allowed to access daily record if he is owner or supervisor or timetracking-by user (Edit for "daily_record": (\'status\', \'time_record\') only)\n User is allowed to access daily record if he is owner or supervisor or timetracking-by user (View for "daily_record" only)\n User is allowed to access daily_record_status (View for "daily_record_status" only)\n User is allowed to access department (View for "department" only)\n User is allowed to access doc (View for "doc" only)\n User is allowed to access doc_category (View for "doc_category" only)\n User is allowed to access doc_issue_status (View for "doc_issue_status" only)\n User is allowed to access doc_status (View for "doc_status" only)\n User is allowed to access ext_tracker (View for "ext_tracker" only)\n User is allowed to access ext_tracker_state (View for "ext_tracker_state" only)\n User is allowed to access ext_tracker_type (View for "ext_tracker_type" only)\n User is allowed to access functional_role (View for "functional_role" only)\n User is allowed to access it_category (View for "it_category" only)\n User is allowed to access it_issue_status (View for "it_issue_status" only)\n User is allowed to access it_prio (View for "it_prio" only)\n User is allowed to access it_project_status (View for "it_project_status" only)\n User is allowed to access it_request_type (View for "it_request_type" only)\n User is allowed to access keyword (View for "keyword" only)\n User is allowed to access kind (View for "kind" only)\n User is allowed to access leave_status (View for "leave_status" only)\n User is allowed to access location (View for "location" only)\n User is allowed to access mailgroup (View for "mailgroup" only)\n User is allowed to access msg_keyword (View for "msg_keyword" only)\n User is allowed to access org_group (View for "org_group" only)\n User is allowed to access org_location (View for "org_location" only)\n User is allowed to access organisation (View for "organisation" only)\n User is allowed to access overtime_period (View for "overtime_period" only)\n User is allowed to access prodcat (View for "prodcat" only)\n User is allowed to access product (View for "product" only)\n User is allowed to access product_family (View for "product_family" only)\n User is allowed to access product_type (View for "product_type" only)\n User is allowed to access project_type (View for "project_type" only)\n User is allowed to access public_holiday (View for "public_holiday" only)\n User is allowed to access reference (View for "reference" only)\n User is allowed to access reporting_group (View for "reporting_group" only)\n User is allowed to access return_type (View for "return_type" only)\n User is allowed to access room (View for "room" only)\n User is allowed to access safety_level (View for "safety_level" only)\n User is allowed to access sap_cc (View for "sap_cc" only)\n User is allowed to access severity (View for "severity" only)\n User is allowed to access sex (View for "sex" only)\n User is allowed to access status (View for "status" only)\n User is allowed to access status_transition (View for "status_transition" only)\n User is allowed to access summary_report (View for "summary_report" only)\n User is allowed to access summary_type (View for "summary_type" only)\n User is allowed to access sup_classification (View for "sup_classification" only)\n User is allowed to access sup_execution (View for "sup_execution" only)\n User is allowed to access sup_prio (View for "sup_prio" only)\n User is allowed to access sup_status (View for "sup_status" only)\n User is allowed to access sup_type (View for "sup_type" only)\n User is allowed to access sup_warranty (View for "sup_warranty" only)\n User is allowed to access test_level (View for "test_level" only)\n User is allowed to access time_activity (View for "time_activity" only)\n User is allowed to access time_activity_perm (View for "time_activity_perm" only)\n User is allowed to access time_project_status (View for "time_project_status" only)\n User is allowed to access time_wp_group (View for "time_wp_group" only)\n User is allowed to access time_wp_summary_no (View for "time_wp_summary_no" only)\n User is allowed to access timesheet (View for "timesheet" only)\n User is allowed to access uc_type (View for "uc_type" only)\n User is allowed to access user_status (View for "user_status" only)\n User is allowed to access vac_aliq (View for "vac_aliq" only)\n User is allowed to access vacation_report (View for "vacation_report" only)\n User is allowed to access work_location (View for "work_location" only)\n User is allowed to create daily_record (Create for "daily_record" only)\n User is allowed to create doc (Create for "doc" only)\n User is allowed to create ext_tracker_state (Create for "ext_tracker_state" only)\n User is allowed to create file (Create for "file" only)\n User is allowed to create issue (Create for "issue" only)\n User is allowed to create it_issue (Create for "it_issue" only)\n User is allowed to create leave_submission (Create for "leave_submission" only)\n User is allowed to create msg (Create for "msg" only)\n User is allowed to create queries (Create for "query" only)\n User is allowed to create support (Create for "support" only)\n User is allowed to create time_record (Create for "time_record" only)\n User is allowed to create time_wp (Create for "time_wp" only)\n User is allowed to edit (some of) their own user details (Edit for "user": (\'csv_delimiter\', \'hide_message_files\', \'lunch_duration\', \'lunch_start\', \'password\', \'queries\', \'realname\', \'room\', \'subst_active\', \'substitute\', \'timezone\', \'tt_lines\') only)\n User is allowed to edit category if he is responsible for it (Edit for "category": (\'nosy\', \'default_part_of\') only)\n User is allowed to edit doc (Edit for "doc" only)\n User is allowed to edit ext_tracker_state (Edit for "ext_tracker_state" only)\n User is allowed to edit if he\'s the owner of the contact (Edit for "user_contact": (\'visible\',) only)\n User is allowed to edit several fields if he is Responsible for an it_issue (Edit for "it_issue": (\'responsible\',) only)\n User is allowed to edit several fields if he is Stakeholder/Responsible for an it_issue (Edit for "it_issue": (\'deadline\', \'status\', \'title\') only)\n User is allowed to edit their queries (Edit for "query" only)\n User is allowed to edit time category if the status is "Open" and he is responsible for the time category (Edit for "time_project": (\'deputy\', \'planned_effort\', \'nosy\') only)\n User is allowed to edit workpackage if he is time category owner or deputy (Edit for "time_wp": (\'cost_center\', \'is_public\', \'name\', \'responsible\', \'time_wp_summary_no\', \'wp_no\') only)\n User is allowed to retire their queries (Retire for "query" only)\n User is allowed to search daily_record (Search for "daily_record" only)\n User is allowed to search for their own files (Search for "file" only)\n User is allowed to search for their own messages (Search for "msg" only)\n User is allowed to search for their queries (Search for "query" only)\n User is allowed to search issue (Search for "issue" only)\n User is allowed to search it_issue (Search for "it_issue" only)\n User is allowed to search it_project (Search for "it_project" only)\n User is allowed to search leave_submission (Search for "leave_submission" only)\n User is allowed to search support (Search for "support" only)\n User is allowed to search time_record (Search for "time_record" only)\n User is allowed to search time_wp (Search for "time_wp": (\'activity\', \'actor\', \'auto_wp\', \'cost_center\', \'creation\', \'creator\', \'description\', \'durations_allowed\', \'epic_key\', \'has_expiration_date\', \'is_extern\', \'is_public\', \'id\', \'name\', \'project\', \'responsible\', \'time_end\', \'time_start\', \'time_wp_summary_no\', \'travel\', \'wp_no\') only)\n User is allowed to search user_status (Search for "user": (\'status\',) only)\n User is allowed to see time record if he is allowed to see all details on work package or User may view a daily_record (and time_records that are attached to that daily_record) if the user owns the daily_record or has role \'HR\' or \'Controlling\', or the user is supervisor or substitute supervisor of the owner of the daily record (the supervisor relationship is transitive) or the user is the department manager of the owner of the daily record. If user has role HR-Org-Location and is in the same Org-Location as the record, it may also be seen (View for "time_record" only)\n User is allowed to view (some of) their own user details (View for "user": (\'entry_date\', \'planning_role\') only)\n User is allowed to view contact if he\'s the owner of the contact or the contact is marked visible (View for "user_contact" only)\n User is allowed to view leave submission if he is the supervisor or the person to whom approvals are delegated (Edit for "leave_submission": (\'status\',) only)\n User is allowed to view leave submission if he is the supervisor or the person to whom approvals are delegated (View for "leave_submission" only)\n User is allowed to view selected fields in work package if booking is allowed for this user (also applies to timetracking by, supervisor and approval delegated) (View for "time_wp": (\'activity\', \'actor\', \'cost_center\', \'creation\', \'creator\', \'description\', \'durations_allowed\', \'epic_key\', \'has_expiration_date\', \'id\', \'is_extern\', \'is_public\', \'name\', \'project\', \'responsible\', \'time_end\', \'time_start\', \'time_wp_summary_no\', \'travel\', \'wp_no\') only)\n User is allowed to view their own files (View for "file" only)\n User is allowed to view their own messages (View for "msg" only)\n User is allowed to view their own overtime information (View for "overtime_correction" only)\n User is allowed to view time record if he is the supervisor or the person to whom approvals are delegated (View for "time_record" only)\n User is allowed to view work package and time category names if he/she has role HR or HR-Org-Location (View for "time_project": (\'name\',) only)\n User is allowed to view work package and time category names if he/she has role HR or HR-Org-Location (View for "time_wp": (\'name\', \'project\') only)\n User is allowed to view/edit workpackage if he is owner or project responsible/deputy (Edit for "time_wp": (\'bookers\', \'description\', \'epic_key\', \'planned_effort\', \'time_end\', \'time_start\', \'time_wp_summary_no\') only)\n User may access the rest interface (Rest Access)\n User may access the web interface (Web Access)\n User may access the xmlrpc interface (Xmlrpc Access)\n User may edit own leave submissions (Edit for "leave_submission": (\'comment\', \'comment_cancel\', \'first_day\', \'last_day\', \'status\', \'time_wp\', \'user\') only)\n User may edit own leave submissions (View for "leave_submission": (\'comment\', \'comment_cancel\', \'first_day\', \'last_day\', \'status\', \'time_wp\', \'user\') only)\n User may see time report if reponsible or deputy of time project or on nosy list of time project (View for "time_report" only)\n User may use the email interface (Email Access)\n User may view a daily_record (and time_records that are attached to that daily_record) if the user owns the daily_record or has role \'HR\' or \'Controlling\', or the user is supervisor or substitute supervisor of the owner of the daily record (the supervisor relationship is transitive) or the user is the department manager of the owner of the daily record. If user has role HR-Org-Location and is in the same Org-Location as the record, it may also be seen (View for "daily_record" only)\n User may view their own user functional role (View for "user_functional_role" only)\n User may view time category if user is owner or deputy of time category or on nosy list of time category or if user is department manager of time category (View for "time_project" only)\n User may view work package if responsible for it, if user is owner or deputy of time category or on nosy list of time category or if user is department manager of time category (View for "time_wp" only)\n User or Timetracking by user may edit time_records owned by user (Edit for "time_record" only)\n User or Timetracking by user may edit time_records owned by user (Restore for "time_record" only)\n User or Timetracking by user may edit time_records owned by user (Retire for "time_record" only)\n User or Timetracking by user may edit time_records owned by user (View for "time_record" only)\n Users are allowed to view their own and public queries for classes where they have search permission (View for "query" only)\n Users may see daily record if they may see one of the time_records for that day (View for "daily_record" only)\nRole "user_view":\n User is allowed to access user (View for "user" only)\nRole "vacation-report":\n'.strip() |
tc = int(input())
while tc:
tc -= 1
best = 0
n, x = map(int, input().split())
for i in range(n):
s, r = map(int, input().split())
if x >= s:
best = max(best, r)
print(best) | tc = int(input())
while tc:
tc -= 1
best = 0
(n, x) = map(int, input().split())
for i in range(n):
(s, r) = map(int, input().split())
if x >= s:
best = max(best, r)
print(best) |
#
# Copyright (c) 2020, Andrey "Limych" Khrolenok <andrey@khrolenok.ru>
# Creative Commons BY-NC-SA 4.0 International Public License
# (see LICENSE.md or https://creativecommons.org/licenses/by-nc-sa/4.0/)
#
"""
The Snowtire binary sensor.
For more details about this platform, please refer to the documentation at
https://github.com/Limych/ha-snowtire/
"""
| """
The Snowtire binary sensor.
For more details about this platform, please refer to the documentation at
https://github.com/Limych/ha-snowtire/
""" |
##
# This class encapsulates a Region Of Interest, which may be either horizontal
# (pixels) or vertical (rows/lines).
class ROI:
def __init__(self, start, end):
self.start = start
self.end = end
self.len = end - start + 1
def valid(self):
return self.start >= 0 and self.start < self.end
def crop(self, spectrum):
return spectrum[self.start:self.end+1]
def contains(self, value):
return self.start <= value <= self.end
| class Roi:
def __init__(self, start, end):
self.start = start
self.end = end
self.len = end - start + 1
def valid(self):
return self.start >= 0 and self.start < self.end
def crop(self, spectrum):
return spectrum[self.start:self.end + 1]
def contains(self, value):
return self.start <= value <= self.end |
__all__ = ['EnemyBucketWithStar',
'Nut',
'Beam',
'Enemy',
'Friend',
'Hero',
'Launcher',
'Rotor',
'SpikeyBuddy',
'Star',
'Wizard',
'EnemyEquipedRotor',
'CyclingEnemyObject',
'Joints',
'Bomb',
'Contacts']
| __all__ = ['EnemyBucketWithStar', 'Nut', 'Beam', 'Enemy', 'Friend', 'Hero', 'Launcher', 'Rotor', 'SpikeyBuddy', 'Star', 'Wizard', 'EnemyEquipedRotor', 'CyclingEnemyObject', 'Joints', 'Bomb', 'Contacts'] |
days_of_week = ['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday', 'Sunday']
operation = ''
options = ['Info', 'Check-in/Out', 'Edit games', 'Back']
admins = ['admin1_telegram_nickname', 'admin2_telegram_nickname']
avail_days = []
TOKEN = 'bot_token'
group_id = id_of_group_chat | days_of_week = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
operation = ''
options = ['Info', 'Check-in/Out', 'Edit games', 'Back']
admins = ['admin1_telegram_nickname', 'admin2_telegram_nickname']
avail_days = []
token = 'bot_token'
group_id = id_of_group_chat |
#analysis function for three level game
def stat_analysis(c1,c2,c3):
#ask question for viewing analysis of game
analysis=input('\nDo you want to see your game analysis? (Yes/No) ')
if analysis=='Yes':
levels=['Level 1','Level 2','Level 3']
#calculating the score of levels
l1_score= c1*10
l2_score= c2*10
l3_score= c3*10
level_score=[l1_score,l2_score,l3_score]
#plot bar chart
plt.bar(levels,level_score,color='blue',edgecolor='black')
plt.title('Levelwise Scores',fontsize=16)#add title
plt.xlabel('Levels')#set x-axis label
plt.ylabel('Scores')#set y-axis label
plt.show()
print('\nDescriptive Statistics of Scores:')
#find mean value
print('\nMean: ',statistics.mean(level_score))
#find median value
print('\nMediand: ',statistics.median(level_score))
#Mode calculation
#create numPy array of values with only one mode
arr_val = np.array(level_score)
#find unique values in array along with their counts
vals, uni_val_counts = np.unique(arr_val, return_counts=True)
#find mode
mode_value = np.argwhere(counts == np.max(uni_val_counts))
print('\nMode: ',vals[mode_value].flatten().tolist())
#find variance
print('\nVariance: ',np.var(level_score))
#find standard deviation
print('\nStandard Deviation: ',statistics.stdev(level_score))
print('\nGood Bye.See you later!!!')
elif analysis=='No':
print('\nGood Bye.See you later!!!')
else:
print('Invalid value enter')
stat_analysis(c1,c2,c3)
| def stat_analysis(c1, c2, c3):
analysis = input('\nDo you want to see your game analysis? (Yes/No) ')
if analysis == 'Yes':
levels = ['Level 1', 'Level 2', 'Level 3']
l1_score = c1 * 10
l2_score = c2 * 10
l3_score = c3 * 10
level_score = [l1_score, l2_score, l3_score]
plt.bar(levels, level_score, color='blue', edgecolor='black')
plt.title('Levelwise Scores', fontsize=16)
plt.xlabel('Levels')
plt.ylabel('Scores')
plt.show()
print('\nDescriptive Statistics of Scores:')
print('\nMean: ', statistics.mean(level_score))
print('\nMediand: ', statistics.median(level_score))
arr_val = np.array(level_score)
(vals, uni_val_counts) = np.unique(arr_val, return_counts=True)
mode_value = np.argwhere(counts == np.max(uni_val_counts))
print('\nMode: ', vals[mode_value].flatten().tolist())
print('\nVariance: ', np.var(level_score))
print('\nStandard Deviation: ', statistics.stdev(level_score))
print('\nGood Bye.See you later!!!')
elif analysis == 'No':
print('\nGood Bye.See you later!!!')
else:
print('Invalid value enter')
stat_analysis(c1, c2, c3) |
# -*- coding: utf-8 -*-
__author__ = """Hendrix Demers"""
__email__ = 'hendrix.demers@mail.mcgill.ca'
__version__ = '0.1.0'
| __author__ = 'Hendrix Demers'
__email__ = 'hendrix.demers@mail.mcgill.ca'
__version__ = '0.1.0' |
#!/usr/bin/env python3
def date_time(time):
months = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"]
hour, minute = int(time[11:13]), int(time[14:16])
return f"{int(time[0:2])} {months[int(time[3:5])-1]} {time[6:10]} year {hour} hour{'s' if hour!=1 else ''} {minute} minute{'s' if minute!=1 else ''}"
if __name__ == '__main__':
print(date_time("01.01.2018 00:00"))
assert date_time("01.01.2018 00:00") == "1 January 2018 year 0 hours 0 minutes"
assert date_time("04.08.1984 08:15") == "4 August 1984 year 8 hours 15 minutes"
assert date_time("17.12.1990 07:42") == "17 December 1990 year 7 hours 42 minutes"
| def date_time(time):
months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
(hour, minute) = (int(time[11:13]), int(time[14:16]))
return f"{int(time[0:2])} {months[int(time[3:5]) - 1]} {time[6:10]} year {hour} hour{('s' if hour != 1 else '')} {minute} minute{('s' if minute != 1 else '')}"
if __name__ == '__main__':
print(date_time('01.01.2018 00:00'))
assert date_time('01.01.2018 00:00') == '1 January 2018 year 0 hours 0 minutes'
assert date_time('04.08.1984 08:15') == '4 August 1984 year 8 hours 15 minutes'
assert date_time('17.12.1990 07:42') == '17 December 1990 year 7 hours 42 minutes' |
item1='phone'
item1_price = 100
item1_quantity = 5
item1_price_total = item1_price * item1_quantity
print(type(item1)) # str
print(type(item1_price)) # int
print(type(item1_quantity)) # int
print(type(item1_price_total)) # int
# output:
# <class 'str'>
# <class 'int'>
# <class 'int'>
# <class 'int'> | item1 = 'phone'
item1_price = 100
item1_quantity = 5
item1_price_total = item1_price * item1_quantity
print(type(item1))
print(type(item1_price))
print(type(item1_quantity))
print(type(item1_price_total)) |
a = int(input())
while a:
for x in range(a-1):
out = '*' + ' ' * (a-x-2) + '*' + ' ' * (a-x-2) + '*'
print(out.center(2*a-1))
print('*' * (2 * a - 1))
for x in range(a-1):
out = '*' + ' ' * x + '*' + ' ' * x + '*'
print(out.center(2*a-1))
a = int(input())
| a = int(input())
while a:
for x in range(a - 1):
out = '*' + ' ' * (a - x - 2) + '*' + ' ' * (a - x - 2) + '*'
print(out.center(2 * a - 1))
print('*' * (2 * a - 1))
for x in range(a - 1):
out = '*' + ' ' * x + '*' + ' ' * x + '*'
print(out.center(2 * a - 1))
a = int(input()) |
class Dataset:
_data = None
_first_text_col = 'text'
_second_text_col = None
_label_col = 'label'
def __init__(self):
self._idx = 0
if self._data is None:
raise Exception('Dataset is not loaded')
def __iter__(self):
return self
def __next__(self):
if self._idx >= len(self._data):
raise StopIteration
else:
item = self._data.iloc[self._idx]
self._idx += 1
if self._second_text_col:
return item[self._first_text_col], item[self._second_text_col], int(item[self._label_col])
else:
return item[self._first_text_col], int(item[self._label_col])
def __getitem__(self, item):
if isinstance(item, int):
item = self._data.iloc[item]
if self._second_text_col:
return item[self._first_text_col], item[self._second_text_col], int(item[self._label_col])
else:
return item[self._first_text_col], int(item[self._label_col])
elif isinstance(item, slice):
start = item.start if item.start else 0
stop = item.stop if item.stop else len(self._data)
step = item.step if item.step else 1
items = self._data.iloc[start:stop:step]
if self._second_text_col:
return [(item[self._first_text_col], item[self._second_text_col], int(item[self._label_col])) for _, item in items.iterrows()]
else:
return [(item[self._first_text_col], int(item[self._label_col])) for _, item in items.iterrows()]
else:
raise KeyError
def __str__(self):
return str(self._data) | class Dataset:
_data = None
_first_text_col = 'text'
_second_text_col = None
_label_col = 'label'
def __init__(self):
self._idx = 0
if self._data is None:
raise exception('Dataset is not loaded')
def __iter__(self):
return self
def __next__(self):
if self._idx >= len(self._data):
raise StopIteration
else:
item = self._data.iloc[self._idx]
self._idx += 1
if self._second_text_col:
return (item[self._first_text_col], item[self._second_text_col], int(item[self._label_col]))
else:
return (item[self._first_text_col], int(item[self._label_col]))
def __getitem__(self, item):
if isinstance(item, int):
item = self._data.iloc[item]
if self._second_text_col:
return (item[self._first_text_col], item[self._second_text_col], int(item[self._label_col]))
else:
return (item[self._first_text_col], int(item[self._label_col]))
elif isinstance(item, slice):
start = item.start if item.start else 0
stop = item.stop if item.stop else len(self._data)
step = item.step if item.step else 1
items = self._data.iloc[start:stop:step]
if self._second_text_col:
return [(item[self._first_text_col], item[self._second_text_col], int(item[self._label_col])) for (_, item) in items.iterrows()]
else:
return [(item[self._first_text_col], int(item[self._label_col])) for (_, item) in items.iterrows()]
else:
raise KeyError
def __str__(self):
return str(self._data) |
"Actions for compiling resx files"
load(
"@io_bazel_rules_dotnet//dotnet/private:providers.bzl",
"DotnetResourceInfo",
)
def _make_runner_arglist(dotnet, source, output, resgen):
args = dotnet.actions.args()
if type(source) == "Target":
args.add_all(source.files)
else:
args.add(source)
args.add(output)
return args
def emit_resx_core(
dotnet,
name = "",
src = None,
identifier = None,
out = None,
customresgen = None):
"""The function adds an action that compiles a single .resx file into .resources file.
Returns [DotnetResourceInfo](api.md#dotnetresourceinfo).
Args:
dotnet: [DotnetContextInfo](api.md#dotnetcontextinfo).
name: name of the file to generate.
src: The .resx source file that is transformed into .resources file. Only `.resx` files are permitted.
identifier: The logical name for the resource; the name that is used to load the resource. The default is the basename of the file name (no subfolder).
out: An alternative name of the output file (if name should not be used).
customresgen: custom resgen program to use.
Returns:
DotnetResourceInfo: [DotnetResourceInfo](api.md#dotnetresourceinfo).
"""
if name == "" and out == None:
fail("either name or out must be set")
if not out:
result = dotnet.actions.declare_file(name + ".resources")
else:
result = dotnet.actions.declare_file(out)
args = _make_runner_arglist(dotnet, src, result, customresgen.files_to_run.executable.path)
# We use the command to extrace shell path and force runfiles creation
resolve = dotnet._ctx.resolve_tools(tools = [customresgen])
inputs = src.files.to_list() if type(src) == "Target" else [src]
dotnet.actions.run(
inputs = inputs + resolve[0].to_list(),
tools = customresgen.default_runfiles.files,
outputs = [result],
executable = customresgen.files_to_run,
arguments = [args],
env = {"RUNFILES_MANIFEST_FILE": customresgen.files_to_run.runfiles_manifest.path},
mnemonic = "CoreResxCompile",
input_manifests = resolve[1],
progress_message = (
"Compiling resoources" + dotnet.label.package + ":" + dotnet.label.name
),
)
return DotnetResourceInfo(
name = name,
result = result,
identifier = identifier,
)
| """Actions for compiling resx files"""
load('@io_bazel_rules_dotnet//dotnet/private:providers.bzl', 'DotnetResourceInfo')
def _make_runner_arglist(dotnet, source, output, resgen):
args = dotnet.actions.args()
if type(source) == 'Target':
args.add_all(source.files)
else:
args.add(source)
args.add(output)
return args
def emit_resx_core(dotnet, name='', src=None, identifier=None, out=None, customresgen=None):
"""The function adds an action that compiles a single .resx file into .resources file.
Returns [DotnetResourceInfo](api.md#dotnetresourceinfo).
Args:
dotnet: [DotnetContextInfo](api.md#dotnetcontextinfo).
name: name of the file to generate.
src: The .resx source file that is transformed into .resources file. Only `.resx` files are permitted.
identifier: The logical name for the resource; the name that is used to load the resource. The default is the basename of the file name (no subfolder).
out: An alternative name of the output file (if name should not be used).
customresgen: custom resgen program to use.
Returns:
DotnetResourceInfo: [DotnetResourceInfo](api.md#dotnetresourceinfo).
"""
if name == '' and out == None:
fail('either name or out must be set')
if not out:
result = dotnet.actions.declare_file(name + '.resources')
else:
result = dotnet.actions.declare_file(out)
args = _make_runner_arglist(dotnet, src, result, customresgen.files_to_run.executable.path)
resolve = dotnet._ctx.resolve_tools(tools=[customresgen])
inputs = src.files.to_list() if type(src) == 'Target' else [src]
dotnet.actions.run(inputs=inputs + resolve[0].to_list(), tools=customresgen.default_runfiles.files, outputs=[result], executable=customresgen.files_to_run, arguments=[args], env={'RUNFILES_MANIFEST_FILE': customresgen.files_to_run.runfiles_manifest.path}, mnemonic='CoreResxCompile', input_manifests=resolve[1], progress_message='Compiling resoources' + dotnet.label.package + ':' + dotnet.label.name)
return dotnet_resource_info(name=name, result=result, identifier=identifier) |
class OCDSMergeError(Exception):
"""Base class for exceptions from within this package"""
class MissingDateKeyError(OCDSMergeError, KeyError):
"""Raised when a release is missing a 'date' key"""
def __init__(self, key, message):
self.key = key
self.message = message
def __str__(self):
return str(self.message)
class NonObjectReleaseError(OCDSMergeError, TypeError):
"""Raised when a release is not an object"""
class NullDateValueError(OCDSMergeError, TypeError):
"""Raised when a release has a null 'date' value"""
class NonStringDateValueError(OCDSMergeError, TypeError):
"""Raised when a release has a non-string 'date' value"""
class InconsistentTypeError(OCDSMergeError, TypeError):
"""Raised when a path is a literal and an object in different releases"""
class OCDSMergeWarning(UserWarning):
"""Base class for warnings from within this package"""
class DuplicateIdValueWarning(OCDSMergeWarning):
"""Used when at least two objects in the same array have the same value for the 'id' field"""
def __init__(self, path, id, message):
self.path = path
self.id = id
self.message = message
def __str__(self):
return str(self.message)
| class Ocdsmergeerror(Exception):
"""Base class for exceptions from within this package"""
class Missingdatekeyerror(OCDSMergeError, KeyError):
"""Raised when a release is missing a 'date' key"""
def __init__(self, key, message):
self.key = key
self.message = message
def __str__(self):
return str(self.message)
class Nonobjectreleaseerror(OCDSMergeError, TypeError):
"""Raised when a release is not an object"""
class Nulldatevalueerror(OCDSMergeError, TypeError):
"""Raised when a release has a null 'date' value"""
class Nonstringdatevalueerror(OCDSMergeError, TypeError):
"""Raised when a release has a non-string 'date' value"""
class Inconsistenttypeerror(OCDSMergeError, TypeError):
"""Raised when a path is a literal and an object in different releases"""
class Ocdsmergewarning(UserWarning):
"""Base class for warnings from within this package"""
class Duplicateidvaluewarning(OCDSMergeWarning):
"""Used when at least two objects in the same array have the same value for the 'id' field"""
def __init__(self, path, id, message):
self.path = path
self.id = id
self.message = message
def __str__(self):
return str(self.message) |
n=int(input("Enter number "))
fact=1
for i in range(1,n+1):
fact=fact*i
print("Factorial is ",fact)
| n = int(input('Enter number '))
fact = 1
for i in range(1, n + 1):
fact = fact * i
print('Factorial is ', fact) |
# Fractional Knapsack
wt = [40,50,30,10,10,40,30]
pro = [30,20,20,25,5,35,15]
n = len(wt)
data = [ (i,pro[i],wt[i]) for i in range(n) ]
bag = 100
data.sort(key=lambda x: x[1]/x[2], reverse=True)
profit=0
ans=[]
i=0
while i<n:
if data[i][2]<=bag:
bag-=data[i][2]
ans.append(data[i][0])
profit+=data[i][1]
i+=1
else:
break
if i<n:
ans.append(data[i][0])
profit += (bag*data[i][1])/data[i][2]
print(profit,ans)
| wt = [40, 50, 30, 10, 10, 40, 30]
pro = [30, 20, 20, 25, 5, 35, 15]
n = len(wt)
data = [(i, pro[i], wt[i]) for i in range(n)]
bag = 100
data.sort(key=lambda x: x[1] / x[2], reverse=True)
profit = 0
ans = []
i = 0
while i < n:
if data[i][2] <= bag:
bag -= data[i][2]
ans.append(data[i][0])
profit += data[i][1]
i += 1
else:
break
if i < n:
ans.append(data[i][0])
profit += bag * data[i][1] / data[i][2]
print(profit, ans) |
class DeviceSettings:
def __init__(self, settings):
self._id = settings["id"]
self._title = settings["title"]
self._type = settings["type"]["name"]
self._value = settings["value"]
@property
def id(self):
return self._id
@property
def value(self):
return self._value
| class Devicesettings:
def __init__(self, settings):
self._id = settings['id']
self._title = settings['title']
self._type = settings['type']['name']
self._value = settings['value']
@property
def id(self):
return self._id
@property
def value(self):
return self._value |
word = input("Enter a word: ")
if word == "a":
print("one; any")
elif word == "apple":
print("familiar, round fleshy fruit")
elif word == "rhinoceros":
print("large thick-skinned animal with one or two horns on its nose")
else:
print("That word must not exist. This dictionary is very comprehensive.")
| word = input('Enter a word: ')
if word == 'a':
print('one; any')
elif word == 'apple':
print('familiar, round fleshy fruit')
elif word == 'rhinoceros':
print('large thick-skinned animal with one or two horns on its nose')
else:
print('That word must not exist. This dictionary is very comprehensive.') |
cnt = int(input())
num = list(map(int, input()))
sum = 0
for i in range(len(num)):
sum = sum + num[i]
print(sum) | cnt = int(input())
num = list(map(int, input()))
sum = 0
for i in range(len(num)):
sum = sum + num[i]
print(sum) |
def test_xrange(judge_command):
judge_command(
"XRANGE somestream - +",
{"command": "XRANGE", "key": "somestream", "stream_id": ["-", "+"]},
)
judge_command(
"XRANGE somestream 1526985054069 1526985055069",
{
"command": "XRANGE",
"key": "somestream",
"stream_id": ["1526985054069", "1526985055069"],
},
)
judge_command(
"XRANGE somestream 1526985054069 1526985055069-10",
{
"command": "XRANGE",
"key": "somestream",
"stream_id": ["1526985054069", "1526985055069-10"],
},
)
judge_command(
"XRANGE somestream 1526985054069 1526985055069-10 count 10",
{
"command": "XRANGE",
"key": "somestream",
"stream_id": ["1526985054069", "1526985055069-10"],
"count_const": "count",
"count": "10",
},
)
def test_xgroup_create(judge_command):
judge_command(
"XGROUP CREATE mykey mygroup 123",
{
"command": "XGROUP",
"stream_create": "CREATE",
"key": "mykey",
"group": "mygroup",
"stream_id": "123",
},
)
judge_command(
"XGROUP CREATE mykey mygroup $",
{
"command": "XGROUP",
"stream_create": "CREATE",
"key": "mykey",
"group": "mygroup",
"stream_id": "$",
},
)
# short of a parameter
judge_command("XGROUP CREATE mykey mygroup", None)
judge_command("XGROUP CREATE mykey", None)
def test_xgroup_setid(judge_command):
judge_command(
"XGROUP SETID mykey mygroup 123",
{
"command": "XGROUP",
"stream_setid": "SETID",
"key": "mykey",
"group": "mygroup",
"stream_id": "123",
},
)
judge_command(
"XGROUP SETID mykey mygroup $",
{
"command": "XGROUP",
"stream_setid": "SETID",
"key": "mykey",
"group": "mygroup",
"stream_id": "$",
},
)
# two subcommand together shouldn't match
judge_command("XGROUP CREATE mykey mygroup 123 SETID mykey mygroup $", None)
def test_xgroup_destroy(judge_command):
judge_command(
"XGROUP destroy mykey mygroup",
{
"command": "XGROUP",
"stream_destroy": "destroy",
"key": "mykey",
"group": "mygroup",
},
)
judge_command("XGROUP destroy mykey", None)
judge_command("XGROUP DESTROY mykey mygroup $", None)
def test_xgroup_delconsumer(judge_command):
judge_command(
"XGROUP delconsumer mykey mygroup myconsumer",
{
"command": "XGROUP",
"stream_delconsumer": "delconsumer",
"key": "mykey",
"group": "mygroup",
"consumer": "myconsumer",
},
)
judge_command(
"XGROUP delconsumer mykey mygroup $",
{
"command": "XGROUP",
"stream_delconsumer": "delconsumer",
"key": "mykey",
"group": "mygroup",
"consumer": "$",
},
)
judge_command("XGROUP delconsumer mykey mygroup", None)
def test_xgroup_stream(judge_command):
judge_command(
"XACK mystream group1 123123",
{
"command": "XACK",
"key": "mystream",
"group": "group1",
"stream_id": "123123",
},
)
judge_command(
"XACK mystream group1 123123 111",
{"command": "XACK", "key": "mystream", "group": "group1", "stream_id": "111"},
)
def test_xinfo(judge_command):
judge_command(
"XINFO consumers mystream mygroup",
{
"command": "XINFO",
"stream_consumers": "consumers",
"key": "mystream",
"group": "mygroup",
},
)
judge_command(
"XINFO GROUPS mystream",
{"command": "XINFO", "stream_groups": "GROUPS", "key": "mystream"},
)
judge_command(
"XINFO STREAM mystream",
{"command": "XINFO", "stream": "STREAM", "key": "mystream"},
)
judge_command("XINFO HELP", {"command": "XINFO", "help": "HELP"})
judge_command("XINFO consumers mystream mygroup GROUPS mystream", None)
judge_command("XINFO groups mystream mygroup", None)
def test_xinfo_with_full(judge_command):
judge_command(
"XINFO STREAM mystream FULL",
{
"command": "XINFO",
"stream": "STREAM",
"key": "mystream",
"full_const": "FULL",
},
)
judge_command(
"XINFO STREAM mystream FULL count 10",
{
"command": "XINFO",
"stream": "STREAM",
"key": "mystream",
"full_const": "FULL",
"count_const": "count",
"count": "10",
},
)
def test_xpending(judge_command):
judge_command(
"XPENDING mystream group55",
{"command": "XPENDING", "key": "mystream", "group": "group55"},
)
judge_command(
"XPENDING mystream group55 myconsumer",
{
"command": "XPENDING",
"key": "mystream",
"group": "group55",
"consumer": "myconsumer",
},
)
judge_command(
"XPENDING mystream group55 - + 10",
{
"command": "XPENDING",
"key": "mystream",
"group": "group55",
"stream_id": ["-", "+"],
"count": "10",
},
)
judge_command(
"XPENDING mystream group55 - + 10 myconsumer",
{
"command": "XPENDING",
"key": "mystream",
"group": "group55",
"stream_id": ["-", "+"],
"count": "10",
"consumer": "myconsumer",
},
)
judge_command("XPENDING mystream group55 - + ", None)
def test_xadd(judge_command):
judge_command(
"xadd mystream MAXLEN ~ 1000 * key value",
{
"command": "xadd",
"key": "mystream",
"maxlen": "MAXLEN",
"approximately": "~",
"count": "1000",
"sfield": "key",
"svalue": "value",
"stream_id": "*",
},
)
# test for MAXLEN option
judge_command(
"xadd mystream MAXLEN 1000 * key value",
{
"command": "xadd",
"key": "mystream",
"maxlen": "MAXLEN",
"count": "1000",
"sfield": "key",
"svalue": "value",
"stream_id": "*",
},
)
judge_command(
"xadd mystream * key value",
{
"command": "xadd",
"key": "mystream",
"sfield": "key",
"svalue": "value",
"stream_id": "*",
},
)
# spcify stream id
judge_command(
"xadd mystream 123-123 key value",
{
"command": "xadd",
"key": "mystream",
"sfield": "key",
"svalue": "value",
"stream_id": "123-123",
},
)
judge_command(
"xadd mystream 123-123 key value foo bar hello world",
{
"command": "xadd",
"key": "mystream",
"sfield": "hello",
"svalue": "world",
"stream_id": "123-123",
},
)
def test_xtrim(judge_command):
judge_command(
" XTRIM mystream MAXLEN 2",
{"command": "XTRIM", "key": "mystream", "maxlen": "MAXLEN", "count": "2"},
)
judge_command(
" XTRIM mystream MAXLEN ~ 2",
{
"command": "XTRIM",
"key": "mystream",
"maxlen": "MAXLEN",
"count": "2",
"approximately": "~",
},
)
judge_command(" XTRIM mystream", None)
def test_xdel(judge_command):
judge_command(
"XDEL mystream 1581165000000 1549611229000 1581060831000",
{"command": "XDEL", "key": "mystream", "stream_id": "1581060831000"},
)
judge_command(
"XDEL mystream 1581165000000",
{"command": "XDEL", "key": "mystream", "stream_id": "1581165000000"},
)
def test_xclaim(judge_command):
judge_command(
"XCLAIM mystream mygroup Alice 3600000 1526569498055-0",
{
"command": "XCLAIM",
"key": "mystream",
"group": "mygroup",
"consumer": "Alice",
"millisecond": "3600000",
"stream_id": "1526569498055-0",
},
)
judge_command(
"XCLAIM mystream mygroup Alice 3600000 1526569498055-0 123 456 789",
{
"command": "XCLAIM",
"key": "mystream",
"group": "mygroup",
"consumer": "Alice",
"millisecond": "3600000",
"stream_id": "789",
},
)
judge_command(
"XCLAIM mystream mygroup Alice 3600000 1526569498055-0 IDEL 300",
{
"command": "XCLAIM",
"key": "mystream",
"group": "mygroup",
"consumer": "Alice",
"millisecond": ["3600000", "300"],
"stream_id": "1526569498055-0",
"idel": "IDEL",
},
)
judge_command(
"XCLAIM mystream mygroup Alice 3600000 1526569498055-0 retrycount 7",
{
"command": "XCLAIM",
"key": "mystream",
"group": "mygroup",
"consumer": "Alice",
"millisecond": "3600000",
"stream_id": "1526569498055-0",
"retrycount": "retrycount",
"count": "7",
},
)
judge_command(
"XCLAIM mystream mygroup Alice 3600000 1526569498055-0 TIME 123456789",
{
"command": "XCLAIM",
"key": "mystream",
"group": "mygroup",
"consumer": "Alice",
"millisecond": "3600000",
"stream_id": "1526569498055-0",
"time": "TIME",
"timestamp": "123456789",
},
)
judge_command(
"XCLAIM mystream mygroup Alice 3600000 1526569498055-0 FORCE",
{
"command": "XCLAIM",
"key": "mystream",
"group": "mygroup",
"consumer": "Alice",
"millisecond": "3600000",
"stream_id": "1526569498055-0",
"force": "FORCE",
},
)
judge_command(
"XCLAIM mystream mygroup Alice 3600000 1526569498055-0 JUSTID",
{
"command": "XCLAIM",
"key": "mystream",
"group": "mygroup",
"consumer": "Alice",
"millisecond": "3600000",
"stream_id": "1526569498055-0",
"justid": "JUSTID",
},
)
def test_xread(judge_command):
judge_command(
"XREAD COUNT 2 STREAMS mystream writers 0-0 0-0",
{
"command": "XREAD",
"count_const": "COUNT",
"count": "2",
"streams": "STREAMS",
# FIXME current grammar can't support multiple tokens
# so the ids will be recongized to keys.
"keys": "mystream writers 0-0",
"stream_id": "0-0",
},
)
judge_command(
"XREAD COUNT 2 BLOCK 1000 STREAMS mystream writers 0-0 0-0",
{
"command": "XREAD",
"count_const": "COUNT",
"count": "2",
"streams": "STREAMS",
"keys": "mystream writers 0-0",
"block": "BLOCK",
"millisecond": "1000",
"stream_id": "0-0",
},
)
def test_xreadgroup(judge_command):
judge_command(
"XREADGROUP GROUP mygroup1 Bob COUNT 1 BLOCK 100 NOACK STREAMS key1 1 key2 2",
{
"command": "XREADGROUP",
"stream_group": "GROUP",
"group": "mygroup1",
"consumer": "Bob",
"count_const": "COUNT",
"count": "1",
"block": "BLOCK",
"millisecond": "100",
"noack": "NOACK",
"streams": "STREAMS",
"keys": "key1 1 key2",
"stream_id": "2",
},
)
judge_command(
"XREADGROUP GROUP mygroup1 Bob STREAMS key1 1 key2 2",
{
"command": "XREADGROUP",
"stream_group": "GROUP",
"group": "mygroup1",
"consumer": "Bob",
"streams": "STREAMS",
"keys": "key1 1 key2",
"stream_id": "2",
},
)
judge_command("XREADGROUP GROUP group consumer", None)
| def test_xrange(judge_command):
judge_command('XRANGE somestream - +', {'command': 'XRANGE', 'key': 'somestream', 'stream_id': ['-', '+']})
judge_command('XRANGE somestream 1526985054069 1526985055069', {'command': 'XRANGE', 'key': 'somestream', 'stream_id': ['1526985054069', '1526985055069']})
judge_command('XRANGE somestream 1526985054069 1526985055069-10', {'command': 'XRANGE', 'key': 'somestream', 'stream_id': ['1526985054069', '1526985055069-10']})
judge_command('XRANGE somestream 1526985054069 1526985055069-10 count 10', {'command': 'XRANGE', 'key': 'somestream', 'stream_id': ['1526985054069', '1526985055069-10'], 'count_const': 'count', 'count': '10'})
def test_xgroup_create(judge_command):
judge_command('XGROUP CREATE mykey mygroup 123', {'command': 'XGROUP', 'stream_create': 'CREATE', 'key': 'mykey', 'group': 'mygroup', 'stream_id': '123'})
judge_command('XGROUP CREATE mykey mygroup $', {'command': 'XGROUP', 'stream_create': 'CREATE', 'key': 'mykey', 'group': 'mygroup', 'stream_id': '$'})
judge_command('XGROUP CREATE mykey mygroup', None)
judge_command('XGROUP CREATE mykey', None)
def test_xgroup_setid(judge_command):
judge_command('XGROUP SETID mykey mygroup 123', {'command': 'XGROUP', 'stream_setid': 'SETID', 'key': 'mykey', 'group': 'mygroup', 'stream_id': '123'})
judge_command('XGROUP SETID mykey mygroup $', {'command': 'XGROUP', 'stream_setid': 'SETID', 'key': 'mykey', 'group': 'mygroup', 'stream_id': '$'})
judge_command('XGROUP CREATE mykey mygroup 123 SETID mykey mygroup $', None)
def test_xgroup_destroy(judge_command):
judge_command('XGROUP destroy mykey mygroup', {'command': 'XGROUP', 'stream_destroy': 'destroy', 'key': 'mykey', 'group': 'mygroup'})
judge_command('XGROUP destroy mykey', None)
judge_command('XGROUP DESTROY mykey mygroup $', None)
def test_xgroup_delconsumer(judge_command):
judge_command('XGROUP delconsumer mykey mygroup myconsumer', {'command': 'XGROUP', 'stream_delconsumer': 'delconsumer', 'key': 'mykey', 'group': 'mygroup', 'consumer': 'myconsumer'})
judge_command('XGROUP delconsumer mykey mygroup $', {'command': 'XGROUP', 'stream_delconsumer': 'delconsumer', 'key': 'mykey', 'group': 'mygroup', 'consumer': '$'})
judge_command('XGROUP delconsumer mykey mygroup', None)
def test_xgroup_stream(judge_command):
judge_command('XACK mystream group1 123123', {'command': 'XACK', 'key': 'mystream', 'group': 'group1', 'stream_id': '123123'})
judge_command('XACK mystream group1 123123 111', {'command': 'XACK', 'key': 'mystream', 'group': 'group1', 'stream_id': '111'})
def test_xinfo(judge_command):
judge_command('XINFO consumers mystream mygroup', {'command': 'XINFO', 'stream_consumers': 'consumers', 'key': 'mystream', 'group': 'mygroup'})
judge_command('XINFO GROUPS mystream', {'command': 'XINFO', 'stream_groups': 'GROUPS', 'key': 'mystream'})
judge_command('XINFO STREAM mystream', {'command': 'XINFO', 'stream': 'STREAM', 'key': 'mystream'})
judge_command('XINFO HELP', {'command': 'XINFO', 'help': 'HELP'})
judge_command('XINFO consumers mystream mygroup GROUPS mystream', None)
judge_command('XINFO groups mystream mygroup', None)
def test_xinfo_with_full(judge_command):
judge_command('XINFO STREAM mystream FULL', {'command': 'XINFO', 'stream': 'STREAM', 'key': 'mystream', 'full_const': 'FULL'})
judge_command('XINFO STREAM mystream FULL count 10', {'command': 'XINFO', 'stream': 'STREAM', 'key': 'mystream', 'full_const': 'FULL', 'count_const': 'count', 'count': '10'})
def test_xpending(judge_command):
judge_command('XPENDING mystream group55', {'command': 'XPENDING', 'key': 'mystream', 'group': 'group55'})
judge_command('XPENDING mystream group55 myconsumer', {'command': 'XPENDING', 'key': 'mystream', 'group': 'group55', 'consumer': 'myconsumer'})
judge_command('XPENDING mystream group55 - + 10', {'command': 'XPENDING', 'key': 'mystream', 'group': 'group55', 'stream_id': ['-', '+'], 'count': '10'})
judge_command('XPENDING mystream group55 - + 10 myconsumer', {'command': 'XPENDING', 'key': 'mystream', 'group': 'group55', 'stream_id': ['-', '+'], 'count': '10', 'consumer': 'myconsumer'})
judge_command('XPENDING mystream group55 - + ', None)
def test_xadd(judge_command):
judge_command('xadd mystream MAXLEN ~ 1000 * key value', {'command': 'xadd', 'key': 'mystream', 'maxlen': 'MAXLEN', 'approximately': '~', 'count': '1000', 'sfield': 'key', 'svalue': 'value', 'stream_id': '*'})
judge_command('xadd mystream MAXLEN 1000 * key value', {'command': 'xadd', 'key': 'mystream', 'maxlen': 'MAXLEN', 'count': '1000', 'sfield': 'key', 'svalue': 'value', 'stream_id': '*'})
judge_command('xadd mystream * key value', {'command': 'xadd', 'key': 'mystream', 'sfield': 'key', 'svalue': 'value', 'stream_id': '*'})
judge_command('xadd mystream 123-123 key value', {'command': 'xadd', 'key': 'mystream', 'sfield': 'key', 'svalue': 'value', 'stream_id': '123-123'})
judge_command('xadd mystream 123-123 key value foo bar hello world', {'command': 'xadd', 'key': 'mystream', 'sfield': 'hello', 'svalue': 'world', 'stream_id': '123-123'})
def test_xtrim(judge_command):
judge_command(' XTRIM mystream MAXLEN 2', {'command': 'XTRIM', 'key': 'mystream', 'maxlen': 'MAXLEN', 'count': '2'})
judge_command(' XTRIM mystream MAXLEN ~ 2', {'command': 'XTRIM', 'key': 'mystream', 'maxlen': 'MAXLEN', 'count': '2', 'approximately': '~'})
judge_command(' XTRIM mystream', None)
def test_xdel(judge_command):
judge_command('XDEL mystream 1581165000000 1549611229000 1581060831000', {'command': 'XDEL', 'key': 'mystream', 'stream_id': '1581060831000'})
judge_command('XDEL mystream 1581165000000', {'command': 'XDEL', 'key': 'mystream', 'stream_id': '1581165000000'})
def test_xclaim(judge_command):
judge_command('XCLAIM mystream mygroup Alice 3600000 1526569498055-0', {'command': 'XCLAIM', 'key': 'mystream', 'group': 'mygroup', 'consumer': 'Alice', 'millisecond': '3600000', 'stream_id': '1526569498055-0'})
judge_command('XCLAIM mystream mygroup Alice 3600000 1526569498055-0 123 456 789', {'command': 'XCLAIM', 'key': 'mystream', 'group': 'mygroup', 'consumer': 'Alice', 'millisecond': '3600000', 'stream_id': '789'})
judge_command('XCLAIM mystream mygroup Alice 3600000 1526569498055-0 IDEL 300', {'command': 'XCLAIM', 'key': 'mystream', 'group': 'mygroup', 'consumer': 'Alice', 'millisecond': ['3600000', '300'], 'stream_id': '1526569498055-0', 'idel': 'IDEL'})
judge_command('XCLAIM mystream mygroup Alice 3600000 1526569498055-0 retrycount 7', {'command': 'XCLAIM', 'key': 'mystream', 'group': 'mygroup', 'consumer': 'Alice', 'millisecond': '3600000', 'stream_id': '1526569498055-0', 'retrycount': 'retrycount', 'count': '7'})
judge_command('XCLAIM mystream mygroup Alice 3600000 1526569498055-0 TIME 123456789', {'command': 'XCLAIM', 'key': 'mystream', 'group': 'mygroup', 'consumer': 'Alice', 'millisecond': '3600000', 'stream_id': '1526569498055-0', 'time': 'TIME', 'timestamp': '123456789'})
judge_command('XCLAIM mystream mygroup Alice 3600000 1526569498055-0 FORCE', {'command': 'XCLAIM', 'key': 'mystream', 'group': 'mygroup', 'consumer': 'Alice', 'millisecond': '3600000', 'stream_id': '1526569498055-0', 'force': 'FORCE'})
judge_command('XCLAIM mystream mygroup Alice 3600000 1526569498055-0 JUSTID', {'command': 'XCLAIM', 'key': 'mystream', 'group': 'mygroup', 'consumer': 'Alice', 'millisecond': '3600000', 'stream_id': '1526569498055-0', 'justid': 'JUSTID'})
def test_xread(judge_command):
judge_command('XREAD COUNT 2 STREAMS mystream writers 0-0 0-0', {'command': 'XREAD', 'count_const': 'COUNT', 'count': '2', 'streams': 'STREAMS', 'keys': 'mystream writers 0-0', 'stream_id': '0-0'})
judge_command('XREAD COUNT 2 BLOCK 1000 STREAMS mystream writers 0-0 0-0', {'command': 'XREAD', 'count_const': 'COUNT', 'count': '2', 'streams': 'STREAMS', 'keys': 'mystream writers 0-0', 'block': 'BLOCK', 'millisecond': '1000', 'stream_id': '0-0'})
def test_xreadgroup(judge_command):
judge_command('XREADGROUP GROUP mygroup1 Bob COUNT 1 BLOCK 100 NOACK STREAMS key1 1 key2 2', {'command': 'XREADGROUP', 'stream_group': 'GROUP', 'group': 'mygroup1', 'consumer': 'Bob', 'count_const': 'COUNT', 'count': '1', 'block': 'BLOCK', 'millisecond': '100', 'noack': 'NOACK', 'streams': 'STREAMS', 'keys': 'key1 1 key2', 'stream_id': '2'})
judge_command('XREADGROUP GROUP mygroup1 Bob STREAMS key1 1 key2 2', {'command': 'XREADGROUP', 'stream_group': 'GROUP', 'group': 'mygroup1', 'consumer': 'Bob', 'streams': 'STREAMS', 'keys': 'key1 1 key2', 'stream_id': '2'})
judge_command('XREADGROUP GROUP group consumer', None) |
""":mod:`sider.warnings` --- Warning categories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module defines several custom warning category classes.
"""
class SiderWarning(Warning):
"""All warning classes used by Sider extend this base class."""
class PerformanceWarning(SiderWarning, RuntimeWarning):
"""The category for warnings about performance worries. Operations
that warn this category would work but be inefficient.
"""
class TransactionWarning(SiderWarning, RuntimeWarning):
"""The category for warnings about transactions."""
| """:mod:`sider.warnings` --- Warning categories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module defines several custom warning category classes.
"""
class Siderwarning(Warning):
"""All warning classes used by Sider extend this base class."""
class Performancewarning(SiderWarning, RuntimeWarning):
"""The category for warnings about performance worries. Operations
that warn this category would work but be inefficient.
"""
class Transactionwarning(SiderWarning, RuntimeWarning):
"""The category for warnings about transactions.""" |
MEDIA_SEARCH = """
query ($search: String, $type: MediaType, $exclude: MediaFormat, $isAdult: Boolean) {
Media(search: $search, type: $type, format_not: $exclude, isAdult: $isAdult) {
id
type
format
title {
english
romaji
native
}
synonyms
status
description
startDate {
year
month
day
}
endDate {
year
month
day
}
episodes
chapters
volumes
coverImage {
large
color
}
bannerImage
genres
averageScore
siteUrl
isAdult
nextAiringEpisode {
timeUntilAiring
episode
}
}
}
"""
MEDIA_BY_ID = """
query ($id: Int, $type: MediaType) {
Media(id: $id, type: $type) {
id
type
format
title {
english
romaji
native
}
synonyms
status
description
startDate {
year
month
day
}
endDate {
year
month
day
}
episodes
chapters
coverImage {
large
color
}
bannerImage
genres
averageScore
siteUrl
isAdult
nextAiringEpisode {
timeUntilAiring
episode
}
}
}
"""
MEDIA_PAGED = """
query (
$id: Int,
$page: Int,
$perPage: Int,
$search: String,
$type: MediaType,
$sort: [MediaSort] = [SEARCH_MATCH],
$exclude: MediaFormat,
$isAdult: Boolean
) {
Page(page: $page, perPage: $perPage) {
media(id: $id, search: $search, type: $type, sort: $sort, format_not: $exclude, isAdult: $isAdult) {
id
type
format
title {
english
romaji
native
}
synonyms
status
description
startDate {
year
month
day
}
endDate {
year
month
day
}
episodes
chapters
volumes
coverImage {
large
color
}
bannerImage
genres
averageScore
siteUrl
isAdult
popularity
}
}
}
"""
USER_SEARCH = """
query ($search: String) {
User(search: $search) {
id
name
html_about: about(asHtml: true)
about
avatar {
large
}
bannerImage
siteUrl
stats {
watchedTime
chaptersRead
}
}
}
"""
USER_BY_ID = """
query ($id: Int) {
User(id: $id) {
id
name
html_about: about(asHtml: true)
about
avatar {
large
}
bannerImage
siteUrl
stats {
watchedTime
chaptersRead
}
}
}
"""
| media_search = '\nquery ($search: String, $type: MediaType, $exclude: MediaFormat, $isAdult: Boolean) {\n Media(search: $search, type: $type, format_not: $exclude, isAdult: $isAdult) {\n id\n type\n format\n title {\n english\n romaji\n native\n }\n synonyms\n status\n description\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n episodes\n chapters\n volumes\n coverImage {\n large\n color\n }\n bannerImage\n genres\n averageScore\n siteUrl\n isAdult\n nextAiringEpisode {\n timeUntilAiring\n episode\n }\n }\n}\n'
media_by_id = '\nquery ($id: Int, $type: MediaType) {\n Media(id: $id, type: $type) {\n id\n type\n format\n title {\n english\n romaji\n native\n }\n synonyms\n status\n description\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n episodes\n chapters\n coverImage {\n large\n color\n }\n bannerImage\n genres\n averageScore\n siteUrl\n isAdult\n nextAiringEpisode {\n timeUntilAiring\n episode\n }\n }\n}\n'
media_paged = '\nquery (\n $id: Int,\n $page: Int,\n $perPage: Int,\n $search: String,\n $type: MediaType,\n $sort: [MediaSort] = [SEARCH_MATCH],\n $exclude: MediaFormat,\n $isAdult: Boolean\n) {\n Page(page: $page, perPage: $perPage) {\n media(id: $id, search: $search, type: $type, sort: $sort, format_not: $exclude, isAdult: $isAdult) {\n id\n type\n format\n title {\n english\n romaji\n native\n }\n synonyms\n status\n description\n startDate {\n year\n month\n day\n }\n endDate {\n year\n month\n day\n }\n episodes\n chapters\n volumes\n coverImage {\n large\n color\n }\n bannerImage\n genres\n averageScore\n siteUrl\n isAdult\n popularity\n }\n }\n}\n'
user_search = '\nquery ($search: String) {\n User(search: $search) {\n id\n name\n html_about: about(asHtml: true)\n about\n avatar {\n large\n }\n bannerImage\n siteUrl\n stats {\n watchedTime\n chaptersRead\n }\n }\n}\n'
user_by_id = '\nquery ($id: Int) {\n User(id: $id) {\n id\n name\n html_about: about(asHtml: true)\n about\n avatar {\n large\n }\n bannerImage\n siteUrl\n stats {\n watchedTime\n chaptersRead\n }\n }\n}\n' |
def decode(word1,word2,code):
if len(word1)==1:
code+=word1+word2
return code
else:
code+=word1[0]+word2[0]
return decode(word1[1:],word2[1:],code)
Alice='Ti rga eoe esg o h ore"ermetsCmuainls'
Bob='hspormdcdsamsaefrtecus Hraina optcoae"'
print(decode(Alice,Bob,''))
| def decode(word1, word2, code):
if len(word1) == 1:
code += word1 + word2
return code
else:
code += word1[0] + word2[0]
return decode(word1[1:], word2[1:], code)
alice = 'Ti rga eoe esg o h ore"ermetsCmuainls'
bob = 'hspormdcdsamsaefrtecus Hraina optcoae"'
print(decode(Alice, Bob, '')) |
# constants for configuration parameters of our tensorflow models
LABEL = "label"
IDS = "ids"
# LABEL_PAD_ID is used to pad multi-label training examples.
# It should be < 0 to avoid index out of bounds errors by tf.one_hot.
LABEL_PAD_ID = -1
HIDDEN_LAYERS_SIZES = "hidden_layers_sizes"
SHARE_HIDDEN_LAYERS = "share_hidden_layers"
TRANSFORMER_SIZE = "transformer_size"
NUM_TRANSFORMER_LAYERS = "number_of_transformer_layers"
NUM_HEADS = "number_of_attention_heads"
UNIDIRECTIONAL_ENCODER = "unidirectional_encoder"
KEY_RELATIVE_ATTENTION = "use_key_relative_attention"
VALUE_RELATIVE_ATTENTION = "use_value_relative_attention"
MAX_RELATIVE_POSITION = "max_relative_position"
BATCH_SIZES = "batch_size"
BATCH_STRATEGY = "batch_strategy"
EPOCHS = "epochs"
RANDOM_SEED = "random_seed"
LEARNING_RATE = "learning_rate"
DENSE_DIMENSION = "dense_dimension"
CONCAT_DIMENSION = "concat_dimension"
EMBEDDING_DIMENSION = "embedding_dimension"
ENCODING_DIMENSION = "encoding_dimension"
SIMILARITY_TYPE = "similarity_type"
LOSS_TYPE = "loss_type"
NUM_NEG = "number_of_negative_examples"
MAX_POS_SIM = "maximum_positive_similarity"
MAX_NEG_SIM = "maximum_negative_similarity"
USE_MAX_NEG_SIM = "use_maximum_negative_similarity"
SCALE_LOSS = "scale_loss"
REGULARIZATION_CONSTANT = "regularization_constant"
NEGATIVE_MARGIN_SCALE = "negative_margin_scale"
DROP_RATE = "drop_rate"
DROP_RATE_ATTENTION = "drop_rate_attention"
DROP_RATE_DIALOGUE = "drop_rate_dialogue"
DROP_RATE_LABEL = "drop_rate_label"
CONSTRAIN_SIMILARITIES = "constrain_similarities"
WEIGHT_SPARSITY = "weight_sparsity" # Deprecated and superseeded by CONNECTION_DENSITY
CONNECTION_DENSITY = "connection_density"
EVAL_NUM_EPOCHS = "evaluate_every_number_of_epochs"
EVAL_NUM_EXAMPLES = "evaluate_on_number_of_examples"
INTENT_CLASSIFICATION = "intent_classification"
ENTITY_RECOGNITION = "entity_recognition"
MASKED_LM = "use_masked_language_model"
SPARSE_INPUT_DROPOUT = "use_sparse_input_dropout"
DENSE_INPUT_DROPOUT = "use_dense_input_dropout"
RANKING_LENGTH = "ranking_length"
MODEL_CONFIDENCE = "model_confidence"
BILOU_FLAG = "BILOU_flag"
RETRIEVAL_INTENT = "retrieval_intent"
USE_TEXT_AS_LABEL = "use_text_as_label"
SOFTMAX = "softmax"
MARGIN = "margin"
AUTO = "auto"
INNER = "inner"
LINEAR_NORM = "linear_norm"
COSINE = "cosine"
CROSS_ENTROPY = "cross_entropy"
BALANCED = "balanced"
SEQUENCE = "sequence"
SEQUENCE_LENGTH = f"{SEQUENCE}_lengths"
SENTENCE = "sentence"
POOLING = "pooling"
MAX_POOLING = "max"
MEAN_POOLING = "mean"
TENSORBOARD_LOG_DIR = "tensorboard_log_directory"
TENSORBOARD_LOG_LEVEL = "tensorboard_log_level"
SEQUENCE_FEATURES = "sequence_features"
SENTENCE_FEATURES = "sentence_features"
FEATURIZERS = "featurizers"
CHECKPOINT_MODEL = "checkpoint_model"
MASK = "mask"
IGNORE_INTENTS_LIST = "ignore_intents_list"
TOLERANCE = "tolerance"
POSITIVE_SCORES_KEY = "positive_scores"
NEGATIVE_SCORES_KEY = "negative_scores"
RANKING_KEY = "label_ranking"
QUERY_INTENT_KEY = "query_intent"
SCORE_KEY = "score"
THRESHOLD_KEY = "threshold"
SEVERITY_KEY = "severity"
NAME = "name"
EPOCH_OVERRIDE = "epoch_override"
| label = 'label'
ids = 'ids'
label_pad_id = -1
hidden_layers_sizes = 'hidden_layers_sizes'
share_hidden_layers = 'share_hidden_layers'
transformer_size = 'transformer_size'
num_transformer_layers = 'number_of_transformer_layers'
num_heads = 'number_of_attention_heads'
unidirectional_encoder = 'unidirectional_encoder'
key_relative_attention = 'use_key_relative_attention'
value_relative_attention = 'use_value_relative_attention'
max_relative_position = 'max_relative_position'
batch_sizes = 'batch_size'
batch_strategy = 'batch_strategy'
epochs = 'epochs'
random_seed = 'random_seed'
learning_rate = 'learning_rate'
dense_dimension = 'dense_dimension'
concat_dimension = 'concat_dimension'
embedding_dimension = 'embedding_dimension'
encoding_dimension = 'encoding_dimension'
similarity_type = 'similarity_type'
loss_type = 'loss_type'
num_neg = 'number_of_negative_examples'
max_pos_sim = 'maximum_positive_similarity'
max_neg_sim = 'maximum_negative_similarity'
use_max_neg_sim = 'use_maximum_negative_similarity'
scale_loss = 'scale_loss'
regularization_constant = 'regularization_constant'
negative_margin_scale = 'negative_margin_scale'
drop_rate = 'drop_rate'
drop_rate_attention = 'drop_rate_attention'
drop_rate_dialogue = 'drop_rate_dialogue'
drop_rate_label = 'drop_rate_label'
constrain_similarities = 'constrain_similarities'
weight_sparsity = 'weight_sparsity'
connection_density = 'connection_density'
eval_num_epochs = 'evaluate_every_number_of_epochs'
eval_num_examples = 'evaluate_on_number_of_examples'
intent_classification = 'intent_classification'
entity_recognition = 'entity_recognition'
masked_lm = 'use_masked_language_model'
sparse_input_dropout = 'use_sparse_input_dropout'
dense_input_dropout = 'use_dense_input_dropout'
ranking_length = 'ranking_length'
model_confidence = 'model_confidence'
bilou_flag = 'BILOU_flag'
retrieval_intent = 'retrieval_intent'
use_text_as_label = 'use_text_as_label'
softmax = 'softmax'
margin = 'margin'
auto = 'auto'
inner = 'inner'
linear_norm = 'linear_norm'
cosine = 'cosine'
cross_entropy = 'cross_entropy'
balanced = 'balanced'
sequence = 'sequence'
sequence_length = f'{SEQUENCE}_lengths'
sentence = 'sentence'
pooling = 'pooling'
max_pooling = 'max'
mean_pooling = 'mean'
tensorboard_log_dir = 'tensorboard_log_directory'
tensorboard_log_level = 'tensorboard_log_level'
sequence_features = 'sequence_features'
sentence_features = 'sentence_features'
featurizers = 'featurizers'
checkpoint_model = 'checkpoint_model'
mask = 'mask'
ignore_intents_list = 'ignore_intents_list'
tolerance = 'tolerance'
positive_scores_key = 'positive_scores'
negative_scores_key = 'negative_scores'
ranking_key = 'label_ranking'
query_intent_key = 'query_intent'
score_key = 'score'
threshold_key = 'threshold'
severity_key = 'severity'
name = 'name'
epoch_override = 'epoch_override' |
PROTO = {
'spaceone.monitoring.interface.grpc.v1.data_source': ['DataSource'],
'spaceone.monitoring.interface.grpc.v1.metric': ['Metric'],
'spaceone.monitoring.interface.grpc.v1.project_alert_config': ['ProjectAlertConfig'],
'spaceone.monitoring.interface.grpc.v1.escalation_policy': ['EscalationPolicy'],
'spaceone.monitoring.interface.grpc.v1.event_rule': ['EventRule'],
'spaceone.monitoring.interface.grpc.v1.webhook': ['Webhook'],
'spaceone.monitoring.interface.grpc.v1.maintenance_window': ['MaintenanceWindow'],
'spaceone.monitoring.interface.grpc.v1.alert': ['Alert'],
'spaceone.monitoring.interface.grpc.v1.note': ['Note'],
'spaceone.monitoring.interface.grpc.v1.event': ['Event'],
}
| proto = {'spaceone.monitoring.interface.grpc.v1.data_source': ['DataSource'], 'spaceone.monitoring.interface.grpc.v1.metric': ['Metric'], 'spaceone.monitoring.interface.grpc.v1.project_alert_config': ['ProjectAlertConfig'], 'spaceone.monitoring.interface.grpc.v1.escalation_policy': ['EscalationPolicy'], 'spaceone.monitoring.interface.grpc.v1.event_rule': ['EventRule'], 'spaceone.monitoring.interface.grpc.v1.webhook': ['Webhook'], 'spaceone.monitoring.interface.grpc.v1.maintenance_window': ['MaintenanceWindow'], 'spaceone.monitoring.interface.grpc.v1.alert': ['Alert'], 'spaceone.monitoring.interface.grpc.v1.note': ['Note'], 'spaceone.monitoring.interface.grpc.v1.event': ['Event']} |
"""Ingredient dto.
"""
class Ingredient():
"""Class to represent an ingredient.
"""
def __init__(self, name, availability_per_month):
self.name = name
self.availability_per_month = availability_per_month
def __repr__(self):
return """{} is the name.""".format(self.name)
| """Ingredient dto.
"""
class Ingredient:
"""Class to represent an ingredient.
"""
def __init__(self, name, availability_per_month):
self.name = name
self.availability_per_month = availability_per_month
def __repr__(self):
return '{} is the name.'.format(self.name) |
# -*- coding: utf-8 -*-
class Config(object):
def __init__(self):
self.init_scale = 0.1
self.learning_rate = 1.0
self.max_grad_norm = 5
self.num_layers = 2
self.slice_size = 30
self.hidden_size = 200
self.max_epoch = 13
self.keep_prob = 0.8
self.lr_const_epoch = 4
self.lr_decay = 0.7
self.batch_size = 30
self.vocab_size = 10000
self.rnn_model = "gru"
self.data_path = "./data/"
self.save_path = "../out/cudnn/gru/"
| class Config(object):
def __init__(self):
self.init_scale = 0.1
self.learning_rate = 1.0
self.max_grad_norm = 5
self.num_layers = 2
self.slice_size = 30
self.hidden_size = 200
self.max_epoch = 13
self.keep_prob = 0.8
self.lr_const_epoch = 4
self.lr_decay = 0.7
self.batch_size = 30
self.vocab_size = 10000
self.rnn_model = 'gru'
self.data_path = './data/'
self.save_path = '../out/cudnn/gru/' |
{
'targets': [
{
# have to specify 'liblib' here since gyp will remove the first one :\
'target_name': 'mysql_bindings',
'sources': [
'src/mysql_bindings.cc',
'src/mysql_bindings_connection.cc',
'src/mysql_bindings_result.cc',
'src/mysql_bindings_statement.cc',
],
'conditions': [
['OS=="win"', {
# no Windows support yet...
}, {
'libraries': [
'<!@(mysql_config --libs_r)'
],
}],
['OS=="mac"', {
# cflags on OS X are stupid and have to be defined like this
'xcode_settings': {
'OTHER_CFLAGS': [
'<!@(mysql_config --cflags)'
]
}
}, {
'cflags': [
'<!@(mysql_config --cflags)'
],
}]
]
}
]
}
| {'targets': [{'target_name': 'mysql_bindings', 'sources': ['src/mysql_bindings.cc', 'src/mysql_bindings_connection.cc', 'src/mysql_bindings_result.cc', 'src/mysql_bindings_statement.cc'], 'conditions': [['OS=="win"', {}, {'libraries': ['<!@(mysql_config --libs_r)']}], ['OS=="mac"', {'xcode_settings': {'OTHER_CFLAGS': ['<!@(mysql_config --cflags)']}}, {'cflags': ['<!@(mysql_config --cflags)']}]]}]} |
# TODO turn prints into actual error raise, they are print for testing
def qSystemInitErrors(init):
def newFunction(obj, **kwargs):
init(obj, **kwargs)
if obj._genericQSys__dimension is None:
className = obj.__class__.__name__
print(className + ' requires a dimension')
elif obj.frequency is None:
className = obj.__class__.__name__
print(className + ' requires a frequency')
return newFunction
def qCouplingInitErrors(init):
def newFunction(obj, *args, **kwargs):
init(obj, *args, **kwargs)
if obj.couplingOperators is None: # pylint: disable=protected-access
className = obj.__class__.__name__
print(className + ' requires a coupling functions')
elif obj.coupledSystems is None: # pylint: disable=protected-access
className = obj.__class__.__name__
print(className + ' requires a coupling systems')
#for ind in range(len(obj._qCoupling__qSys)):
# if len(obj._qCoupling__cFncs) != len(obj._qCoupling__qSys):
# className = obj.__class__.__name__
# print(className + ' requires same number of systems as coupling functions')
return newFunction
def sweepInitError(init):
def newFunction(obj, **kwargs):
init(obj, **kwargs)
if obj.sweepList is None:
className = obj.__class__.__name__
print(className + ' requires either a list or relevant info, here are givens'
+ '\n' + # noqa: W503, W504
'sweepList: ', obj.sweepList, '\n' + # noqa: W504
'sweepMax: ', obj.sweepMax, '\n' + # noqa: W504
'sweepMin: ', obj.sweepMin, '\n' + # noqa: W504
'sweepPert: ', obj.sweepPert, '\n' + # noqa: W504
'logSweep: ', obj.logSweep)
return newFunction
| def q_system_init_errors(init):
def new_function(obj, **kwargs):
init(obj, **kwargs)
if obj._genericQSys__dimension is None:
class_name = obj.__class__.__name__
print(className + ' requires a dimension')
elif obj.frequency is None:
class_name = obj.__class__.__name__
print(className + ' requires a frequency')
return newFunction
def q_coupling_init_errors(init):
def new_function(obj, *args, **kwargs):
init(obj, *args, **kwargs)
if obj.couplingOperators is None:
class_name = obj.__class__.__name__
print(className + ' requires a coupling functions')
elif obj.coupledSystems is None:
class_name = obj.__class__.__name__
print(className + ' requires a coupling systems')
return newFunction
def sweep_init_error(init):
def new_function(obj, **kwargs):
init(obj, **kwargs)
if obj.sweepList is None:
class_name = obj.__class__.__name__
print(className + ' requires either a list or relevant info, here are givens' + '\n' + 'sweepList: ', obj.sweepList, '\n' + 'sweepMax: ', obj.sweepMax, '\n' + 'sweepMin: ', obj.sweepMin, '\n' + 'sweepPert: ', obj.sweepPert, '\n' + 'logSweep: ', obj.logSweep)
return newFunction |
""" some math tools """
class MathTools:
""" some math tools """
def add(a, b):
""" add two values """
return a + b
def sub(a, b):
""" subtract two values """
| """ some math tools """
class Mathtools:
""" some math tools """
def add(a, b):
""" add two values """
return a + b
def sub(a, b):
""" subtract two values """ |
def insertion_sort(l):
for i in range(1, len(l)):
j = i - 1
key = l[i]
while (j >= 0) and (l[j] > key):
l[j + 1] = l[j]
j -= 1
l[j + 1] = key
m = int(input().strip())
ar = [int(i) for i in input().strip().split()]
insertion_sort(ar)
print(" ".join(map(str, ar)))
| def insertion_sort(l):
for i in range(1, len(l)):
j = i - 1
key = l[i]
while j >= 0 and l[j] > key:
l[j + 1] = l[j]
j -= 1
l[j + 1] = key
m = int(input().strip())
ar = [int(i) for i in input().strip().split()]
insertion_sort(ar)
print(' '.join(map(str, ar))) |
age = 24
print("My age is " + str(age) + " years ")
# the above procedure is tedious since we dont really want to include str for every number we encounter
#Method1 Replacement Fields
print("My age is {0} years ".format(age)) # {0} is the actual replacement field, number important for multiple replacement fields
print("There are {0} days in {1}, {2}, {3}, {4}, {5}, {6} and {7} ".format(31,"January","March","May","july","August","october","december"))
#each of the arguments of .format are matched to their respective replacement fields
print("""January:{2}
February:{0}
March:{2}
April:{1}
""".format(28,30,31))
#Method2 Formatting operator not recommended though style from python 2
print("My age is %d years" % age)
print("My age is %d %s, %d %s" % (age,"years",6,"months"))
#^ old format and it was elegant -__-
#
# for i in range(1,12):
# print("No, %2d squared is %4d and cubed is %4d" %(i,i**2,i**3)) # ** operator raises power %xd x allocates spaces
#
#
#
#
# #for comparison
# print()
# for i in range(1,12):
# print("No, %d squared is %d and cubed is %d" % (i,i**2,i**3))
#
#
# #adding more precision
#
# print("Pi is approximately %12.50f" % (22/7)) # 50 decimal precsion and 12 for spaces default is 6 spaces
#
#
#
#
#Replacement field syntax variant of above Python 2 tricks
for i in range(1,12):
print("No. {0:2} squared is {1:4} and cubed is {2:4}".format(i,i**2,i**3))
print()
#for left alignment
for i in range(1,12):
print("NO. {0:<2} squared is {1:<4} and cubed is {2:<4}".format(i,i**2,i**3))
#floating point precision
print("Pi is approximately {0:.50}".format(22/7))
#use of numbers in replacement fields is optional when the default order is implied
for i in range(1,12):
print("No. {:2} squared is {:4} and cubed is {:4}".format(i,i**2,i**3))
days = "Mon, Tue, Wed, Thu, Fri, Sat, Sun"
print(days[::5]) | age = 24
print('My age is ' + str(age) + ' years ')
print('My age is {0} years '.format(age))
print('There are {0} days in {1}, {2}, {3}, {4}, {5}, {6} and {7} '.format(31, 'January', 'March', 'May', 'july', 'August', 'october', 'december'))
print('January:{2}\nFebruary:{0}\nMarch:{2}\nApril:{1}\n'.format(28, 30, 31))
print('My age is %d years' % age)
print('My age is %d %s, %d %s' % (age, 'years', 6, 'months'))
for i in range(1, 12):
print('No. {0:2} squared is {1:4} and cubed is {2:4}'.format(i, i ** 2, i ** 3))
print()
for i in range(1, 12):
print('NO. {0:<2} squared is {1:<4} and cubed is {2:<4}'.format(i, i ** 2, i ** 3))
print('Pi is approximately {0:.50}'.format(22 / 7))
for i in range(1, 12):
print('No. {:2} squared is {:4} and cubed is {:4}'.format(i, i ** 2, i ** 3))
days = 'Mon, Tue, Wed, Thu, Fri, Sat, Sun'
print(days[::5]) |
def Euler0001():
max = 1000
sum = 0
for i in range(1, max):
if i%3 == 0 or i%5 == 0:
sum += i
print(sum)
Euler0001() | def euler0001():
max = 1000
sum = 0
for i in range(1, max):
if i % 3 == 0 or i % 5 == 0:
sum += i
print(sum)
euler0001() |
"""
Person class
"""
# Create a Person class with the following properties
# 1. name
# 2. age
# 3. social security number
class Person:
def __init__(self, name, age, social_number):
self.name = name
self.age = age
self.social = social_number
p1 = Person("John", 36, "111-11-1111")
print(p1.name)
print(p1.age)
print(p1.social)
| """
Person class
"""
class Person:
def __init__(self, name, age, social_number):
self.name = name
self.age = age
self.social = social_number
p1 = person('John', 36, '111-11-1111')
print(p1.name)
print(p1.age)
print(p1.social) |
"""
Module for higher level SharePoint REST api actions - utilize methods in the api.py module
"""
class Site():
def __init__(self, sp):
self.sp = sp
@property
def info(self):
endpoint = "_api/site"
value = self.sp.get(endpoint).json()
return value
@property
def web(self):
endpoint = "_api/web"
value = self.sp.get(endpoint).json()
return value
@property
def contextinfo(self):
return self.sp.contextinfo
@property
def contenttypes(self):
endpoint = "_api/web/contenttypes"
value = self.sp.get(endpoint).json().get('value')
return value
@property
def eventreceivers(self):
endpoint = "_api/web/eventreceivers"
value = self.sp.get(endpoint).json().get('value')
return value
@property
def features(self):
endpoint = "_api/web/features"
value = self.sp.get(endpoint).json().get('value')
return value
@property
def fields(self):
endpoint = "_api/web/fields"
value = self.sp.get(endpoint).json().get('value')
return value
@property
def lists(self):
endpoint = "_api/web/lists"
value = self.sp.get(endpoint).json().get('value')
return value
@property
def siteusers(self):
endpoint = "_api/web/siteusers"
value = self.sp.get(endpoint).json().get('value')
return value
@property
def groups(self):
endpoint = "_api/web/sitegroups"
value = self.sp.get(endpoint).json().get('value')
return value
@property
def roleassignments(self):
endpoint = "_api/web/roleassignments"
value = self.sp.get(endpoint).json().get('value')
return value
# def set_title_field_to_optional(self, list_title):
# """Sets the Title field in the given list to optional
# :param list_title: str: title of SharePoint list
# """
# # TODO - this likely is not necessary anymore, since we are not creating new lists
# field_rec = [x for x in self.get_field(list_title)
# if x['InternalName'] == "Title"][0]
# if field_rec and field_rec.get('Required'):
# body = {'Required': False}
# self.update_list_field(field_rec, list_title, body)
# def check_field_exists(self, list_title, field_title):
# """Check that a field exists to avoid error from attempting to access non-existent field
# :param list_title: str: title of SharePoint list
# :param field_title: str: title of field in SharePoint list
# :returns: bool
# """
# field_rec = self._get_first_or_none(
# "InternalName", field_title, list_data=self.get_list_fields(list_title))
# return field_rec is not None
# def update_list_field(self, field_rec, list_title, body):
# """Given a field record, a list title, and the json body to update with, updates the SharePoint list field
# :param field_rec: dict: field record from SharePoint field query
# :param list_title: str: title of SharePoint list
# :param body: dict: dictionary structured for SharePoint REST api fields endpoint
# """
# field_id = field_rec.get('Id')
# update_field_url = "_api/web/lists/GetByTitle('{0}')/fields('{1}')".format(
# list_title, field_id)
# response = self.sp.post(url=update_field_url, json=body)
# response.raise_for_status()
# def get_email_from_sharepoint_id(self, sharepoint_id: int):
# """Returns email address from a SharePoint integer user id value
# :param sp_user_id: int: SharePoint user id
# :returns: str
# """
# return self._get_first_or_none("Id", sharepoint_id, list_data=self.siteusers).get("Email")
# def get_sharepoint_id_from_email(self, email):
# """Returns SharePoint integer user ID from an email address
# :param username: str: email address
# :returns: int
# """
# return self._get_first_or_none("Email", email, list_data=self.siteusers).get("Id")
def _get_first_or_none(self, compare_column, compare_value, list_data=None, url=None):
if not list_data and not url:
return ValueError("either list_data or url must be provided")
if not list_data:
list_data = self.sp.get(url).json().get('value')
try:
return [x for x in list_data if x[compare_column] == compare_value][0]
except IndexError as e:
return None
# TODO Add large file upload with chunking
# https://github.com/JonathanHolvey/sharepy/issues/23
| """
Module for higher level SharePoint REST api actions - utilize methods in the api.py module
"""
class Site:
def __init__(self, sp):
self.sp = sp
@property
def info(self):
endpoint = '_api/site'
value = self.sp.get(endpoint).json()
return value
@property
def web(self):
endpoint = '_api/web'
value = self.sp.get(endpoint).json()
return value
@property
def contextinfo(self):
return self.sp.contextinfo
@property
def contenttypes(self):
endpoint = '_api/web/contenttypes'
value = self.sp.get(endpoint).json().get('value')
return value
@property
def eventreceivers(self):
endpoint = '_api/web/eventreceivers'
value = self.sp.get(endpoint).json().get('value')
return value
@property
def features(self):
endpoint = '_api/web/features'
value = self.sp.get(endpoint).json().get('value')
return value
@property
def fields(self):
endpoint = '_api/web/fields'
value = self.sp.get(endpoint).json().get('value')
return value
@property
def lists(self):
endpoint = '_api/web/lists'
value = self.sp.get(endpoint).json().get('value')
return value
@property
def siteusers(self):
endpoint = '_api/web/siteusers'
value = self.sp.get(endpoint).json().get('value')
return value
@property
def groups(self):
endpoint = '_api/web/sitegroups'
value = self.sp.get(endpoint).json().get('value')
return value
@property
def roleassignments(self):
endpoint = '_api/web/roleassignments'
value = self.sp.get(endpoint).json().get('value')
return value
def _get_first_or_none(self, compare_column, compare_value, list_data=None, url=None):
if not list_data and (not url):
return value_error('either list_data or url must be provided')
if not list_data:
list_data = self.sp.get(url).json().get('value')
try:
return [x for x in list_data if x[compare_column] == compare_value][0]
except IndexError as e:
return None |
# Copyright 2019 The TensorFlow Probability Authors.
#
# 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.
# ============================================================================
"""Build defs for TF/NumPy/JAX-variadic libraries & tests."""
# [internal] load python3.bzl
NO_REWRITE_NEEDED = [
"internal:all_util",
"internal:docstring_util",
"internal:reparameterization",
"layers",
"platform_google",
]
REWRITER_TARGET = "//tensorflow_probability/substrates/meta:rewrite"
RUNFILES_ROOT = "tensorflow_probability/"
def _substrate_src(src, substrate):
"""Rewrite a single src filename for the given substrate."""
return "_{}/_generated_{}".format(substrate, src)
def _substrate_srcs(srcs, substrate):
"""Rewrite src filenames for the given substrate."""
return [_substrate_src(src, substrate) for src in srcs]
def _substrate_dep(dep, substrate):
"""Convert a single dep to one appropriate for the given substrate."""
dep_to_check = dep
if dep.startswith(":"):
dep_to_check = "{}{}".format(native.package_name(), dep)
for no_rewrite in NO_REWRITE_NEEDED:
if no_rewrite in dep_to_check:
return dep
if "tensorflow_probability/" in dep or dep.startswith(":"):
if "internal/backend" in dep:
return dep
if ":" in dep:
return "{}.{}".format(dep, substrate)
return "{}:{}.{}".format(dep, dep.split("/")[-1], substrate)
return dep
def _substrate_deps(deps, substrate):
"""Convert deps to those appropriate for the given substrate."""
new_deps = [_substrate_dep(dep, substrate) for dep in deps]
backend_dep = "//tensorflow_probability/python/internal/backend/{}".format(substrate)
if backend_dep not in new_deps:
new_deps.append(backend_dep)
return new_deps
# This is needed for the transitional period during which we have the internal
# py2and3_test and py_test comingling in BUILD files. Otherwise the OSS export
# rewrite process becomes irreversible.
def py3_test(*args, **kwargs):
"""Internal/external reversibility, denotes py3-only vs py2+3 tests.
Args:
*args: Passed to underlying py_test.
**kwargs: Passed to underlying py_test. srcs_version and python_version
are added (with value `"PY3"`) if not specified.
"""
kwargs = dict(kwargs)
if "srcs_version" not in kwargs:
kwargs["srcs_version"] = "PY3"
if "python_version" not in kwargs:
kwargs["python_version"] = "PY3"
native.py_test(*args, **kwargs)
def _resolve_omit_dep(dep):
"""Resolves a `substrates_omit_deps` item to full target."""
if ":" not in dep:
dep = "{}:{}".format(dep, dep.split("/")[-1])
if dep.startswith(":"):
dep = "{}{}".format(native.package_name(), dep)
return dep
def _substrate_runfiles_symlinks_impl(ctx):
"""A custom BUILD rule to generate python runfiles symlinks.
A custom build rule which adds runfiles symlinks for files matching a
substrate genrule file pattern, i.e. `'_jax/_generated_normal.py'`.
This rule will aggregate and pass along deps while adding the given
symlinks to the runfiles structure.
Build rule attributes:
- substrate: One of 'jax' or 'numpy'; which substrate this applies to.
- deps: A list of py_library labels. These are passed along.
Args:
ctx: Rule analysis context.
Returns:
Info objects to propagate deps and add runfiles symlinks.
"""
# Aggregate the depset inputs to resolve transitive dependencies.
transitive_sources = []
uses_shared_libraries = []
imports = []
has_py2_only_sources = []
has_py3_only_sources = []
cc_infos = []
for dep in ctx.attr.deps:
if PyInfo in dep:
transitive_sources.append(dep[PyInfo].transitive_sources)
uses_shared_libraries.append(dep[PyInfo].uses_shared_libraries)
imports.append(dep[PyInfo].imports)
has_py2_only_sources.append(dep[PyInfo].has_py2_only_sources)
has_py3_only_sources.append(dep[PyInfo].has_py3_only_sources)
# if PyCcLinkParamsProvider in dep: # DisableOnExport
# cc_infos.append(dep[PyCcLinkParamsProvider].cc_info) # DisableOnExport
if CcInfo in dep:
cc_infos.append(dep[CcInfo])
# Determine the set of symlinks to generate.
transitive_sources = depset(transitive = transitive_sources)
runfiles_dict = {}
substrate = ctx.attr.substrate
file_substr = "_{}/_generated_".format(substrate)
for f in transitive_sources.to_list():
if "tensorflow_probability" in f.dirname and file_substr in f.short_path:
pre, post = f.short_path.split("/python/")
out_path = "{}/substrates/{}/{}".format(
pre,
substrate,
post.replace(file_substr, ""),
)
runfiles_dict[RUNFILES_ROOT + out_path] = f
# Construct the output structures to pass along Python srcs/deps/etc.
py_info = PyInfo(
transitive_sources = transitive_sources,
uses_shared_libraries = any(uses_shared_libraries),
imports = depset(transitive = imports),
has_py2_only_sources = any(has_py2_only_sources),
has_py3_only_sources = any(has_py3_only_sources),
)
py_cc_link_info = cc_common.merge_cc_infos(cc_infos = cc_infos)
py_runfiles = depset(
transitive = [depset(transitive = [
dep[DefaultInfo].data_runfiles.files,
dep[DefaultInfo].default_runfiles.files,
]) for dep in ctx.attr.deps],
)
runfiles = DefaultInfo(runfiles = ctx.runfiles(
transitive_files = py_runfiles,
root_symlinks = runfiles_dict,
))
return py_info, py_cc_link_info, runfiles
# See documentation at:
# https://docs.bazel.build/versions/3.4.0/skylark/rules.html
substrate_runfiles_symlinks = rule(
implementation = _substrate_runfiles_symlinks_impl,
attrs = {
"substrate": attr.string(),
"deps": attr.label_list(),
},
)
def multi_substrate_py_library(
name,
srcs = [],
deps = [],
substrates_omit_deps = [],
jax_omit_deps = [],
numpy_omit_deps = [],
testonly = 0,
srcs_version = "PY2AND3"):
"""A TFP `py_library` for each of TF, NumPy, and JAX.
Args:
name: The TF `py_library` name. NumPy and JAX libraries have '.numpy' and
'.jax' appended.
srcs: As with `py_library`. A `genrule` is used to rewrite srcs for NumPy
and JAX substrates.
deps: As with `py_library`. The list is rewritten to depend on
substrate-specific libraries for substrate variants.
substrates_omit_deps: List of deps to omit if those libraries are not
rewritten for the substrates.
jax_omit_deps: List of deps to omit for the JAX substrate.
numpy_omit_deps: List of deps to omit for the NumPy substrate.
testonly: As with `py_library`.
srcs_version: As with `py_library`.
"""
native.py_library(
name = name,
srcs = srcs,
deps = deps,
srcs_version = srcs_version,
testonly = testonly,
)
remove_deps = [
"//third_party/py/tensorflow",
"//third_party/py/tensorflow:tensorflow",
]
trimmed_deps = [dep for dep in deps if (dep not in substrates_omit_deps and
dep not in remove_deps)]
resolved_omit_deps_numpy = [
_resolve_omit_dep(dep)
for dep in substrates_omit_deps + numpy_omit_deps
]
for src in srcs:
native.genrule(
name = "rewrite_{}_numpy".format(src.replace(".", "_")),
srcs = [src],
outs = [_substrate_src(src, "numpy")],
cmd = "$(location {}) $(SRCS) --omit_deps={} > $@".format(
REWRITER_TARGET,
",".join(resolved_omit_deps_numpy),
),
tools = [REWRITER_TARGET],
)
native.py_library(
name = "{}.numpy.raw".format(name),
srcs = _substrate_srcs(srcs, "numpy"),
deps = _substrate_deps(trimmed_deps, "numpy"),
srcs_version = srcs_version,
testonly = testonly,
)
# Add symlinks under tfp/substrates/numpy.
substrate_runfiles_symlinks(
name = "{}.numpy".format(name),
substrate = "numpy",
deps = [":{}.numpy.raw".format(name)],
testonly = testonly,
)
resolved_omit_deps_jax = [
_resolve_omit_dep(dep)
for dep in substrates_omit_deps + jax_omit_deps
]
jax_srcs = _substrate_srcs(srcs, "jax")
for src in srcs:
native.genrule(
name = "rewrite_{}_jax".format(src.replace(".", "_")),
srcs = [src],
outs = [_substrate_src(src, "jax")],
cmd = "$(location {}) $(SRCS) --omit_deps={} --numpy_to_jax > $@".format(
REWRITER_TARGET,
",".join(resolved_omit_deps_jax),
),
tools = [REWRITER_TARGET],
)
native.py_library(
name = "{}.jax.raw".format(name),
srcs = jax_srcs,
deps = _substrate_deps(trimmed_deps, "jax"),
srcs_version = srcs_version,
testonly = testonly,
)
# Add symlinks under tfp/substrates/jax.
substrate_runfiles_symlinks(
name = "{}.jax".format(name),
substrate = "jax",
deps = [":{}.jax.raw".format(name)],
testonly = testonly,
)
def multi_substrate_py_test(
name,
size = "small",
jax_size = None,
numpy_size = None,
srcs = [],
deps = [],
tags = [],
numpy_tags = [],
jax_tags = [],
disabled_substrates = [],
srcs_version = "PY2AND3",
timeout = None,
shard_count = None):
"""A TFP `py2and3_test` for each of TF, NumPy, and JAX.
Args:
name: Name of the `test_suite` which covers TF, NumPy and JAX variants
of the test. Each substrate will have a dedicated `py2and3_test`
suffixed with '.tf', '.numpy', or '.jax' as appropriate.
size: As with `py_test`.
jax_size: A size override for the JAX target.
numpy_size: A size override for the numpy target.
srcs: As with `py_test`. These will have a `genrule` emitted to rewrite
NumPy and JAX variants, writing the test file into a subdirectory.
deps: As with `py_test`. The list is rewritten to depend on
substrate-specific libraries for substrate variants.
tags: Tags global to this test target. NumPy also gets a `'tfp_numpy'`
tag, and JAX gets a `'tfp_jax'` tag. A `f'_{name}'` tag is used
to produce the `test_suite`.
numpy_tags: Tags specific to the NumPy test. (e.g. `"notap"`).
jax_tags: Tags specific to the JAX test. (e.g. `"notap"`).
disabled_substrates: Iterable of substrates to disable, items from
["numpy", "jax"].
srcs_version: As with `py_test`.
timeout: As with `py_test`.
shard_count: As with `py_test`.
"""
name_tag = "_{}".format(name)
tags = [t for t in tags]
tags.append(name_tag)
tags.append("multi_substrate")
native.py_test(
name = "{}.tf".format(name),
size = size,
srcs = srcs,
main = "{}.py".format(name),
deps = deps,
tags = tags,
srcs_version = srcs_version,
timeout = timeout,
shard_count = shard_count,
)
if "numpy" not in disabled_substrates:
numpy_srcs = _substrate_srcs(srcs, "numpy")
native.genrule(
name = "rewrite_{}_numpy".format(name),
srcs = srcs,
outs = numpy_srcs,
cmd = "$(location {}) $(SRCS) > $@".format(REWRITER_TARGET),
tools = [REWRITER_TARGET],
)
py3_test(
name = "{}.numpy".format(name),
size = numpy_size or size,
srcs = numpy_srcs,
main = _substrate_src("{}.py".format(name), "numpy"),
deps = _substrate_deps(deps, "numpy"),
tags = tags + ["tfp_numpy"] + numpy_tags,
srcs_version = srcs_version,
python_version = "PY3",
timeout = timeout,
shard_count = shard_count,
)
if "jax" not in disabled_substrates:
jax_srcs = _substrate_srcs(srcs, "jax")
native.genrule(
name = "rewrite_{}_jax".format(name),
srcs = srcs,
outs = jax_srcs,
cmd = "$(location {}) $(SRCS) --numpy_to_jax > $@".format(REWRITER_TARGET),
tools = [REWRITER_TARGET],
)
jax_deps = _substrate_deps(deps, "jax")
# [internal] Add JAX build dep
py3_test(
name = "{}.jax".format(name),
size = jax_size or size,
srcs = jax_srcs,
main = _substrate_src("{}.py".format(name), "jax"),
deps = jax_deps,
tags = tags + ["tfp_jax"] + jax_tags,
srcs_version = srcs_version,
python_version = "PY3",
timeout = timeout,
shard_count = shard_count,
)
native.test_suite(
name = name,
tags = [name_tag],
)
| """Build defs for TF/NumPy/JAX-variadic libraries & tests."""
no_rewrite_needed = ['internal:all_util', 'internal:docstring_util', 'internal:reparameterization', 'layers', 'platform_google']
rewriter_target = '//tensorflow_probability/substrates/meta:rewrite'
runfiles_root = 'tensorflow_probability/'
def _substrate_src(src, substrate):
"""Rewrite a single src filename for the given substrate."""
return '_{}/_generated_{}'.format(substrate, src)
def _substrate_srcs(srcs, substrate):
"""Rewrite src filenames for the given substrate."""
return [_substrate_src(src, substrate) for src in srcs]
def _substrate_dep(dep, substrate):
"""Convert a single dep to one appropriate for the given substrate."""
dep_to_check = dep
if dep.startswith(':'):
dep_to_check = '{}{}'.format(native.package_name(), dep)
for no_rewrite in NO_REWRITE_NEEDED:
if no_rewrite in dep_to_check:
return dep
if 'tensorflow_probability/' in dep or dep.startswith(':'):
if 'internal/backend' in dep:
return dep
if ':' in dep:
return '{}.{}'.format(dep, substrate)
return '{}:{}.{}'.format(dep, dep.split('/')[-1], substrate)
return dep
def _substrate_deps(deps, substrate):
"""Convert deps to those appropriate for the given substrate."""
new_deps = [_substrate_dep(dep, substrate) for dep in deps]
backend_dep = '//tensorflow_probability/python/internal/backend/{}'.format(substrate)
if backend_dep not in new_deps:
new_deps.append(backend_dep)
return new_deps
def py3_test(*args, **kwargs):
"""Internal/external reversibility, denotes py3-only vs py2+3 tests.
Args:
*args: Passed to underlying py_test.
**kwargs: Passed to underlying py_test. srcs_version and python_version
are added (with value `"PY3"`) if not specified.
"""
kwargs = dict(kwargs)
if 'srcs_version' not in kwargs:
kwargs['srcs_version'] = 'PY3'
if 'python_version' not in kwargs:
kwargs['python_version'] = 'PY3'
native.py_test(*args, **kwargs)
def _resolve_omit_dep(dep):
"""Resolves a `substrates_omit_deps` item to full target."""
if ':' not in dep:
dep = '{}:{}'.format(dep, dep.split('/')[-1])
if dep.startswith(':'):
dep = '{}{}'.format(native.package_name(), dep)
return dep
def _substrate_runfiles_symlinks_impl(ctx):
"""A custom BUILD rule to generate python runfiles symlinks.
A custom build rule which adds runfiles symlinks for files matching a
substrate genrule file pattern, i.e. `'_jax/_generated_normal.py'`.
This rule will aggregate and pass along deps while adding the given
symlinks to the runfiles structure.
Build rule attributes:
- substrate: One of 'jax' or 'numpy'; which substrate this applies to.
- deps: A list of py_library labels. These are passed along.
Args:
ctx: Rule analysis context.
Returns:
Info objects to propagate deps and add runfiles symlinks.
"""
transitive_sources = []
uses_shared_libraries = []
imports = []
has_py2_only_sources = []
has_py3_only_sources = []
cc_infos = []
for dep in ctx.attr.deps:
if PyInfo in dep:
transitive_sources.append(dep[PyInfo].transitive_sources)
uses_shared_libraries.append(dep[PyInfo].uses_shared_libraries)
imports.append(dep[PyInfo].imports)
has_py2_only_sources.append(dep[PyInfo].has_py2_only_sources)
has_py3_only_sources.append(dep[PyInfo].has_py3_only_sources)
if CcInfo in dep:
cc_infos.append(dep[CcInfo])
transitive_sources = depset(transitive=transitive_sources)
runfiles_dict = {}
substrate = ctx.attr.substrate
file_substr = '_{}/_generated_'.format(substrate)
for f in transitive_sources.to_list():
if 'tensorflow_probability' in f.dirname and file_substr in f.short_path:
(pre, post) = f.short_path.split('/python/')
out_path = '{}/substrates/{}/{}'.format(pre, substrate, post.replace(file_substr, ''))
runfiles_dict[RUNFILES_ROOT + out_path] = f
py_info = py_info(transitive_sources=transitive_sources, uses_shared_libraries=any(uses_shared_libraries), imports=depset(transitive=imports), has_py2_only_sources=any(has_py2_only_sources), has_py3_only_sources=any(has_py3_only_sources))
py_cc_link_info = cc_common.merge_cc_infos(cc_infos=cc_infos)
py_runfiles = depset(transitive=[depset(transitive=[dep[DefaultInfo].data_runfiles.files, dep[DefaultInfo].default_runfiles.files]) for dep in ctx.attr.deps])
runfiles = default_info(runfiles=ctx.runfiles(transitive_files=py_runfiles, root_symlinks=runfiles_dict))
return (py_info, py_cc_link_info, runfiles)
substrate_runfiles_symlinks = rule(implementation=_substrate_runfiles_symlinks_impl, attrs={'substrate': attr.string(), 'deps': attr.label_list()})
def multi_substrate_py_library(name, srcs=[], deps=[], substrates_omit_deps=[], jax_omit_deps=[], numpy_omit_deps=[], testonly=0, srcs_version='PY2AND3'):
"""A TFP `py_library` for each of TF, NumPy, and JAX.
Args:
name: The TF `py_library` name. NumPy and JAX libraries have '.numpy' and
'.jax' appended.
srcs: As with `py_library`. A `genrule` is used to rewrite srcs for NumPy
and JAX substrates.
deps: As with `py_library`. The list is rewritten to depend on
substrate-specific libraries for substrate variants.
substrates_omit_deps: List of deps to omit if those libraries are not
rewritten for the substrates.
jax_omit_deps: List of deps to omit for the JAX substrate.
numpy_omit_deps: List of deps to omit for the NumPy substrate.
testonly: As with `py_library`.
srcs_version: As with `py_library`.
"""
native.py_library(name=name, srcs=srcs, deps=deps, srcs_version=srcs_version, testonly=testonly)
remove_deps = ['//third_party/py/tensorflow', '//third_party/py/tensorflow:tensorflow']
trimmed_deps = [dep for dep in deps if dep not in substrates_omit_deps and dep not in remove_deps]
resolved_omit_deps_numpy = [_resolve_omit_dep(dep) for dep in substrates_omit_deps + numpy_omit_deps]
for src in srcs:
native.genrule(name='rewrite_{}_numpy'.format(src.replace('.', '_')), srcs=[src], outs=[_substrate_src(src, 'numpy')], cmd='$(location {}) $(SRCS) --omit_deps={} > $@'.format(REWRITER_TARGET, ','.join(resolved_omit_deps_numpy)), tools=[REWRITER_TARGET])
native.py_library(name='{}.numpy.raw'.format(name), srcs=_substrate_srcs(srcs, 'numpy'), deps=_substrate_deps(trimmed_deps, 'numpy'), srcs_version=srcs_version, testonly=testonly)
substrate_runfiles_symlinks(name='{}.numpy'.format(name), substrate='numpy', deps=[':{}.numpy.raw'.format(name)], testonly=testonly)
resolved_omit_deps_jax = [_resolve_omit_dep(dep) for dep in substrates_omit_deps + jax_omit_deps]
jax_srcs = _substrate_srcs(srcs, 'jax')
for src in srcs:
native.genrule(name='rewrite_{}_jax'.format(src.replace('.', '_')), srcs=[src], outs=[_substrate_src(src, 'jax')], cmd='$(location {}) $(SRCS) --omit_deps={} --numpy_to_jax > $@'.format(REWRITER_TARGET, ','.join(resolved_omit_deps_jax)), tools=[REWRITER_TARGET])
native.py_library(name='{}.jax.raw'.format(name), srcs=jax_srcs, deps=_substrate_deps(trimmed_deps, 'jax'), srcs_version=srcs_version, testonly=testonly)
substrate_runfiles_symlinks(name='{}.jax'.format(name), substrate='jax', deps=[':{}.jax.raw'.format(name)], testonly=testonly)
def multi_substrate_py_test(name, size='small', jax_size=None, numpy_size=None, srcs=[], deps=[], tags=[], numpy_tags=[], jax_tags=[], disabled_substrates=[], srcs_version='PY2AND3', timeout=None, shard_count=None):
"""A TFP `py2and3_test` for each of TF, NumPy, and JAX.
Args:
name: Name of the `test_suite` which covers TF, NumPy and JAX variants
of the test. Each substrate will have a dedicated `py2and3_test`
suffixed with '.tf', '.numpy', or '.jax' as appropriate.
size: As with `py_test`.
jax_size: A size override for the JAX target.
numpy_size: A size override for the numpy target.
srcs: As with `py_test`. These will have a `genrule` emitted to rewrite
NumPy and JAX variants, writing the test file into a subdirectory.
deps: As with `py_test`. The list is rewritten to depend on
substrate-specific libraries for substrate variants.
tags: Tags global to this test target. NumPy also gets a `'tfp_numpy'`
tag, and JAX gets a `'tfp_jax'` tag. A `f'_{name}'` tag is used
to produce the `test_suite`.
numpy_tags: Tags specific to the NumPy test. (e.g. `"notap"`).
jax_tags: Tags specific to the JAX test. (e.g. `"notap"`).
disabled_substrates: Iterable of substrates to disable, items from
["numpy", "jax"].
srcs_version: As with `py_test`.
timeout: As with `py_test`.
shard_count: As with `py_test`.
"""
name_tag = '_{}'.format(name)
tags = [t for t in tags]
tags.append(name_tag)
tags.append('multi_substrate')
native.py_test(name='{}.tf'.format(name), size=size, srcs=srcs, main='{}.py'.format(name), deps=deps, tags=tags, srcs_version=srcs_version, timeout=timeout, shard_count=shard_count)
if 'numpy' not in disabled_substrates:
numpy_srcs = _substrate_srcs(srcs, 'numpy')
native.genrule(name='rewrite_{}_numpy'.format(name), srcs=srcs, outs=numpy_srcs, cmd='$(location {}) $(SRCS) > $@'.format(REWRITER_TARGET), tools=[REWRITER_TARGET])
py3_test(name='{}.numpy'.format(name), size=numpy_size or size, srcs=numpy_srcs, main=_substrate_src('{}.py'.format(name), 'numpy'), deps=_substrate_deps(deps, 'numpy'), tags=tags + ['tfp_numpy'] + numpy_tags, srcs_version=srcs_version, python_version='PY3', timeout=timeout, shard_count=shard_count)
if 'jax' not in disabled_substrates:
jax_srcs = _substrate_srcs(srcs, 'jax')
native.genrule(name='rewrite_{}_jax'.format(name), srcs=srcs, outs=jax_srcs, cmd='$(location {}) $(SRCS) --numpy_to_jax > $@'.format(REWRITER_TARGET), tools=[REWRITER_TARGET])
jax_deps = _substrate_deps(deps, 'jax')
py3_test(name='{}.jax'.format(name), size=jax_size or size, srcs=jax_srcs, main=_substrate_src('{}.py'.format(name), 'jax'), deps=jax_deps, tags=tags + ['tfp_jax'] + jax_tags, srcs_version=srcs_version, python_version='PY3', timeout=timeout, shard_count=shard_count)
native.test_suite(name=name, tags=[name_tag]) |