content
stringlengths
1
1.05M
input_ids
listlengths
1
883k
ratio_char_token
float64
1
22.9
token_count
int64
1
883k
""" This is an extract config intended for S3 object manifests produced by TBD. To use it, you must import it in another extract config and override at least the `source_data_url`. You may also append additional operations to the `operations` list as well. For example you could have the following in your extract config module: from kf_ingest_packages.common.extract_configs.s3_object_info import * source_data_url = 'file://../data/kf-seq-data-bcm-chung-s3-objects.tsv' operations.append( value_map( in_col='Key', out_col=CONCEPT.BIOSPECIMEN.ID, m=lambda x: x ) ) """ import os from kf_lib_data_ingest.common import constants from kf_lib_data_ingest.common.constants import GENOMIC_FILE from kf_lib_data_ingest.common.concept_schema import CONCEPT from kf_lib_data_ingest.etl.extract.operations import ( keep_map, row_map, value_map, constant_map, ) def file_ext(x): """ Get genomic file extension """ matches = [ file_ext for file_ext in FILE_EXT_FORMAT_MAP if x.endswith(file_ext) ] if matches: file_ext = max(matches, key=len) else: file_ext = None return file_ext FILE_EXT_FORMAT_MAP = { "fq": GENOMIC_FILE.FORMAT.FASTQ, "fastq": GENOMIC_FILE.FORMAT.FASTQ, "fq.gz": GENOMIC_FILE.FORMAT.FASTQ, "fastq.gz": GENOMIC_FILE.FORMAT.FASTQ, "bam": GENOMIC_FILE.FORMAT.BAM, "hgv.bam": GENOMIC_FILE.FORMAT.BAM, "cram": GENOMIC_FILE.FORMAT.CRAM, "bam.bai": GENOMIC_FILE.FORMAT.BAI, "bai": GENOMIC_FILE.FORMAT.BAI, "cram.crai": GENOMIC_FILE.FORMAT.CRAI, "crai": GENOMIC_FILE.FORMAT.CRAI, "g.vcf.gz": GENOMIC_FILE.FORMAT.GVCF, "g.vcf.gz.tbi": GENOMIC_FILE.FORMAT.TBI, "vcf.gz": GENOMIC_FILE.FORMAT.VCF, "vcf": GENOMIC_FILE.FORMAT.VCF, "vcf.gz.tbi": GENOMIC_FILE.FORMAT.TBI, "peddy.html": "html", } DATA_TYPES = { GENOMIC_FILE.FORMAT.FASTQ: GENOMIC_FILE.DATA_TYPE.UNALIGNED_READS, GENOMIC_FILE.FORMAT.BAM: GENOMIC_FILE.DATA_TYPE.ALIGNED_READS, GENOMIC_FILE.FORMAT.CRAM: GENOMIC_FILE.DATA_TYPE.ALIGNED_READS, GENOMIC_FILE.FORMAT.BAI: "Aligned Reads Index", GENOMIC_FILE.FORMAT.CRAI: "Aligned Reads Index", GENOMIC_FILE.FORMAT.VCF: "Variant Calls", GENOMIC_FILE.FORMAT.GVCF: "gVCF", "g.vcf.gz.tbi": "gVCF Index", "vcf.gz.tbi": "Variant Calls Index", "html": "Other", } def filter_df_by_file_ext(df): """ Only keep rows where file extension is one of those in FILE_EXT_FORMAT_MAP.keys """ df[CONCEPT.GENOMIC_FILE.FILE_FORMAT] = df["Key"].apply( lambda x: file_format(x) ) return df[df[CONCEPT.GENOMIC_FILE.FILE_FORMAT].notnull()] source_data_url = ( 'https://localhost:5002/download/study/SD_ME0WME0W/' 'file/SF_Y1JMXTTS/version/FV_4RYEMD71' ) do_after_read = filter_df_by_file_ext def s3_url(row): """ Create S3 URL for object from S3 bucket and key """ return f's3://{row["Bucket"]}/{row["Key"]}' def file_format(x): """ Get genomic file format by looking genomic file ext up in FILE_EXT_FORMAT_MAP dict """ # File format return FILE_EXT_FORMAT_MAP.get(file_ext(x)) def data_type(x): """ Get genomic file data type by looking up file format in DATA_TYPES. However, if the file's extension has `tbi` in it, then use the file extension itself to do the data type lookup. """ ext = file_ext(x) if "tbi" in ext: data_type = DATA_TYPES.get(ext) else: data_type = DATA_TYPES.get(file_format(x)) return data_type operations = [ row_map(out_col=CONCEPT.GENOMIC_FILE.ID, m=lambda row: s3_url(row)), row_map( out_col=CONCEPT.GENOMIC_FILE.URL_LIST, m=lambda row: [s3_url(row)] ), value_map( in_col="Key", out_col=CONCEPT.GENOMIC_FILE.FILE_NAME, m=lambda x: os.path.split(x)[-1], ), keep_map(in_col="Size", out_col=CONCEPT.GENOMIC_FILE.SIZE), value_map( in_col="ETag", out_col=CONCEPT.GENOMIC_FILE.HASH_DICT, m=lambda x: {constants.FILE.HASH.S3_ETAG.lower(): x.replace('"', "")}, ), constant_map( out_col=CONCEPT.GENOMIC_FILE.AVAILABILITY, m=constants.GENOMIC_FILE.AVAILABILITY.IMMEDIATE, ), keep_map( in_col=CONCEPT.GENOMIC_FILE.FILE_FORMAT, out_col=CONCEPT.GENOMIC_FILE.FILE_FORMAT, ), value_map( in_col="Key", out_col=CONCEPT.GENOMIC_FILE.DATA_TYPE, m=lambda x: data_type(x), ), ]
[ 37811, 198, 1212, 318, 281, 7925, 4566, 5292, 329, 311, 18, 2134, 42190, 4635, 416, 34343, 13, 198, 198, 2514, 779, 340, 11, 345, 1276, 1330, 340, 287, 1194, 7925, 4566, 290, 20957, 379, 1551, 198, 1169, 4600, 10459, 62, 7890, 62, 6...
2.137636
2,107
import bpy from bpy.app.handlers import persistent bl_info = { "name": "Playback Once", "author": "Adhi Hargo", "version": (1, 0, 0), "blender": (2, 67, 3), "location": "", "description": "Playback once.", "warning": "", "wiki_url": "", "tracker_url": "", "category": "Animation"} if __name__ == "__main__": register()
[ 11748, 275, 9078, 198, 6738, 275, 9078, 13, 1324, 13, 4993, 8116, 1330, 16218, 198, 198, 2436, 62, 10951, 796, 1391, 198, 220, 220, 220, 366, 3672, 1298, 366, 11002, 1891, 4874, 1600, 198, 220, 220, 220, 366, 9800, 1298, 366, 2782, ...
2.291925
161
""" To master this you should consider using the builtin-``min``-function. """ from ...challenge import Challenge from random import randint x = [] for _ in range(randint(2, 10)): x.append(randint(1, 100)) intro = f"You have to print the lowest value of {', '.join(str(_) for _ in x[:-1])} and {x[-1]}. (values: x)" challenge = Challenge( intro=intro, validate_function=validate_function, help=__doc__, values={"x": x}, capture_stdout=True, )
[ 37811, 198, 2514, 4958, 428, 345, 815, 2074, 1262, 262, 3170, 259, 12, 15506, 1084, 15506, 12, 8818, 13, 198, 37811, 198, 6738, 2644, 36747, 3540, 1330, 13879, 198, 6738, 4738, 1330, 43720, 600, 628, 198, 87, 796, 17635, 198, 1640, 48...
2.657303
178
# pylint:disable=unused-variable # pylint:disable=unused-argument # pylint:disable=redefined-outer-name from typing import AsyncIterator import pytest from aioresponses import aioresponses from faker import Faker from hypothesis import HealthCheck, given, settings from hypothesis import strategies as st from models_library.clusters import ClusterID from models_library.projects import ProjectID from models_library.projects_pipeline import ComputationTask from models_library.projects_state import RunningState from models_library.users import UserID from simcore_service_webserver import director_v2_api from simcore_service_webserver.director_v2_models import ( ClusterCreate, ClusterPatch, ClusterPing, )
[ 2, 279, 2645, 600, 25, 40223, 28, 403, 1484, 12, 45286, 198, 2, 279, 2645, 600, 25, 40223, 28, 403, 1484, 12, 49140, 198, 2, 279, 2645, 600, 25, 40223, 28, 445, 18156, 12, 39605, 12, 3672, 628, 198, 6738, 19720, 1330, 1081, 13361,...
3.490566
212
''' converts video to frames and saves images by different interval, or overlap, etc ''' import folium from folium import plugins from folium.plugins import HeatMap import csv # class plitterMap(): # def __int__(self, file_path): # self.data = file_path # df = [] # with open(self.data) as f: # reader = csv.reader(f) # for row in reader: # df_row = [] # df_row.append(row[0]) # df_row.append(row[0]) # df_row.append(row[0]) # df.append(row) # self.tooltip = df[0][0] # def loadMap(): # self.map = folium.Map(location=[float(row[1]), float(row[2])], zoom_start = 18) # def loadGpsLoc(): # folium.Marker([float(row[1]), float(row[2])], popup="<i>"+row[0]+"</i>", tooltip=tooltip, icon=icon_circle).add_to(rangsit_map) # rangsit_map
[ 7061, 6, 198, 1102, 24040, 2008, 284, 13431, 290, 16031, 4263, 416, 1180, 16654, 11, 393, 21721, 11, 3503, 198, 7061, 6, 198, 11748, 5955, 1505, 198, 6738, 5955, 1505, 1330, 20652, 198, 6738, 5955, 1505, 13, 37390, 1330, 12308, 13912, ...
1.929461
482
import numpy as np
[ 11748, 299, 32152, 355, 45941, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198 ]
1.866667
15
# Copyright (c) 2016 Ansible, Inc. # All Rights Reserved. from collections import OrderedDict # Django from django.core.exceptions import PermissionDenied from django.db.models.fields import PositiveIntegerField, BooleanField from django.db.models.fields.related import ForeignKey from django.http import Http404 from django.utils.encoding import force_text, smart_text from django.utils.translation import ugettext_lazy as _ # Django REST Framework from rest_framework import exceptions from rest_framework import metadata from rest_framework import serializers from rest_framework.relations import RelatedField, ManyRelatedField from rest_framework.fields import JSONField as DRFJSONField from rest_framework.request import clone_request # AWX from awx.main.fields import JSONField, ImplicitRoleField from awx.main.models import InventorySource, NotificationTemplate from awx.main.scheduler.kubernetes import PodManager
[ 2, 15069, 357, 66, 8, 1584, 28038, 856, 11, 3457, 13, 198, 2, 1439, 6923, 33876, 13, 198, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 198, 2, 37770, 198, 6738, 42625, 14208, 13, 7295, 13, 1069, 11755, 1330, 2448, 3411, 21306,...
3.823045
243
import json from washer.worker.actions import AppendStdout, AppendStderr from washer.worker.actions import CreateNamedLog, AppendToLog from washer.worker.actions import SetProperty from washer.worker.commands import washertask
[ 11748, 33918, 198, 198, 6738, 373, 372, 13, 28816, 13, 4658, 1330, 2034, 437, 1273, 67, 448, 11, 2034, 437, 1273, 1082, 81, 198, 6738, 373, 372, 13, 28816, 13, 4658, 1330, 13610, 45, 2434, 11187, 11, 2034, 437, 2514, 11187, 198, 673...
3.447761
67
import json import os # get site profile # get all site profile #sites_folder = "sites" #print getAllSiteProfiles(sites_folder)
[ 11748, 33918, 198, 11748, 28686, 198, 198, 2, 651, 2524, 7034, 198, 198, 2, 651, 477, 2524, 7034, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 2, 49315, 62, 43551, 796, 366, 49315, 1, 198, 2, 4798, 651, 3237, 29123, 15404, 29...
2.78
50
import os, sys from env.LaneChangeEnv import LaneChangeEnv import random import numpy as np if 'SUMO_HOME' in os.environ: tools = os.path.join(os.environ['SUMO_HOME'], 'tools') sys.path.append(tools) print('success') else: sys.exit("please declare environment variable 'SUMO_HOME'") import traci NUM_EPS = 100 IS_GUI = False # f = open('../data/baseline_evaluation/testseed2.csv', 'w+') # safety_gap = 2 constraints_list = [3.0] # [1.0, 2.0, 3.0, 4.0, 5.0, 10.0, 20.0] ttcs = [0.1, 0.3, 0.5, 1, 2, 3] # ttcs = [2] gap = 0 reward_list = [] danger_rate_list = [] crash_rate_list = [] level_1_danger_list = [] level_2_danger_list = [] coll_rate_list = [] succ_rate_list = [] succ_len_list = [] for ttc in ttcs: ret_eval, danger_rate, crash_rate, level_1_danger_rate, level_2_danger_rate, coll_rate, success_rate, success_len = evaluate_baseline(NUM_EPS, ttc, gap, IS_GUI) reward_list.append(ret_eval) danger_rate_list.append(danger_rate) crash_rate_list.append(crash_rate) level_1_danger_list.append(level_1_danger_rate) level_2_danger_list.append(level_2_danger_rate) coll_rate_list.append(coll_rate) succ_rate_list.append(success_rate) succ_len_list.append(success_len) print('reward: ', reward_list) print('danger rate: ', danger_rate_list) print('crash rate: ', crash_rate_list) print('level-1-danger_rate: ', level_1_danger_list) print('level-2-danger_rate: ', level_2_danger_list) print('collison rate: ', coll_rate_list) print('success rate: ', succ_rate_list) print('sucess len: ', succ_len_list) # reward: [-89.12552753359037, -69.84537459892903, -73.81562785829651, -148.23580687485645, -227.71842861064192, -229.9101089174337] # danger rate: [2.13, 0.88, 0.77, 1.88, 3.82, 3.82] # crash rate: [0.58, 0.33, 0.5, 1.24, 2.09, 2.09] # level-1-danger_rate: [0.23, 0.09, 0.05, 0.14, 0.25, 0.25] # level-2-danger_rate: [0.05, 0.03, 0.05, 0.12, 0.2, 0.2] # collison rate: [0.0, 0.0, 0.02, 0.09, 0.14, 0.14] # success rate: [0.99, 0.99, 0.9, 0.6, 0.08, 0.05] # sucess len: [55.656565656565654, 62.43434343434343, 67.5, 90.1, 66.625, 73.4]
[ 11748, 28686, 11, 25064, 198, 6738, 17365, 13, 43, 1531, 19400, 4834, 85, 1330, 15016, 19400, 4834, 85, 198, 11748, 4738, 198, 11748, 299, 32152, 355, 45941, 198, 361, 705, 50, 5883, 46, 62, 39069, 6, 287, 28686, 13, 268, 2268, 25, ...
2.213012
953
import numpy as np import pickle from collections import defaultdict from parsing import parser from analysis import training if __name__ == '__main__': main()
[ 11748, 299, 32152, 355, 45941, 198, 11748, 2298, 293, 198, 6738, 17268, 1330, 4277, 11600, 198, 198, 6738, 32096, 1330, 30751, 198, 6738, 3781, 1330, 3047, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 22...
3.711111
45
# # Copyright (c) Contributors to the Open 3D Engine Project. # For complete copyright and license terms please see the LICENSE at the root of this distribution. # # SPDX-License-Identifier: Apache-2.0 OR MIT # # import abc import importlib import os import pkgutil import re import time from typing import Dict, List, Tuple VERBOSE = False def validate_commit(commit: Commit, out_errors: List[str] = None, ignore_validators: List[str] = None) -> bool: """Validates a commit against all validators :param commit: The commit to validate :param out_errors: if not None, will populate with the list of errors given by the validators :param ignore_validators: Optional list of CommitValidator classes to ignore, by class name :return: True if there are no validation errors, and False otherwise """ failed_count = 0 passed_count = 0 start_time = time.time() # Find all the validators in the validators package (recursively) validator_classes = [] validators_dir = os.path.join(os.path.dirname(__file__), 'validators') for _, module_name, is_package in pkgutil.iter_modules([validators_dir]): if not is_package: module = importlib.import_module('commit_validation.validators.' + module_name) validator = module.get_validator() if ignore_validators and validator.__name__ in ignore_validators: print(f"Disabled validation for '{validator.__name__}'") else: validator_classes.append(validator) error_summary = {} # Process validators for validator_class in validator_classes: validator = validator_class() validator_name = validator.__class__.__name__ error_list = [] passed = validator.run(commit, errors = error_list) if passed: passed_count += 1 print(f'{validator.__class__.__name__} PASSED') else: failed_count += 1 print(f'{validator.__class__.__name__} FAILED') error_summary[validator_name] = error_list end_time = time.time() if failed_count: print("VALIDATION FAILURE SUMMARY") for val_name in error_summary.keys(): errors = error_summary[val_name] if errors: for error_message in errors: first_line = True for line in error_message.splitlines(): if first_line: first_line = False print(f'VALIDATOR_FAILED: {val_name} {line}') else: print(f' {line}') # extra detail lines do not need machine parsing stats_strs = [] if failed_count > 0: stats_strs.append(f'{failed_count} failed') if passed_count > 0: stats_strs.append(f'{passed_count} passed') stats_str = ', '.join(stats_strs) + f' in {end_time - start_time:.2f}s' print() print(stats_str) return failed_count == 0 SOURCE_FILE_EXTENSIONS: Tuple[str, ...] = ( '.c', '.cc', '.cpp', '.cxx', '.h', '.hpp', '.hxx', '.inl', '.m', '.mm', '.cs', '.java' ) """File extensions for compiled source code""" SCRIPT_FILE_EXTENSIONS: Tuple[str, ...] = ( '.py', '.lua', '.bat', '.cmd', '.sh', '.js' ) """File extensions for interpreted code""" BUILD_FILE_EXTENSIONS: Tuple[str, ...] = ( '.cmake', ) """File extensions for build files""" SOURCE_AND_SCRIPT_FILE_EXTENSIONS: Tuple[str, ...] = SOURCE_FILE_EXTENSIONS + SCRIPT_FILE_EXTENSIONS + BUILD_FILE_EXTENSIONS """File extensions for both compiled and interpreted code""" BUILD_FILE_PATTERNS: Tuple[re.Pattern, ...] = ( re.compile(r'.*CMakeLists\.txt'), re.compile(r'.*Jenkinsfile') ) """File patterns for build files""" SOURCE_AND_SCRIPT_FILE_PATTERNS: Tuple[re.Pattern, ...] = BUILD_FILE_PATTERNS EXCLUDED_VALIDATION_PATTERNS = [ '*/.git/*', '*/3rdParty/*', '*/__pycache__/*', '*/External/*', 'build', 'Cache', '*/Code/Framework/AzCore/azgnmx/azgnmx/*', 'Code/Tools/CryFXC', 'Code/Tools/HLSLCrossCompiler', 'Code/Tools/HLSLCrossCompilerMETAL', 'Docs', 'python/runtime', 'restricted/*/Tools/*RemoteControl', 'Tools/3dsmax', '*/user/Cache/*', '*/user/log/*', ]
[ 2, 198, 2, 15069, 357, 66, 8, 25767, 669, 284, 262, 4946, 513, 35, 7117, 4935, 13, 198, 2, 1114, 1844, 6634, 290, 5964, 2846, 3387, 766, 262, 38559, 24290, 379, 262, 6808, 286, 428, 6082, 13, 198, 2, 198, 2, 30628, 55, 12, 34156...
2.360197
1,824
#!/usr/bin/env python # -*- coding: utf-8 -*- from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals range = getattr(__builtins__, 'xrange', range) # end of py2 compatability boilerplate import numpy as np from matrixprofile import core from matrixprofile.algorithms.mpdist import mpdist_vector def snippets(ts, snippet_size, num_snippets=2, window_size=None): """ The snippets algorithm is used to summarize your time series by identifying N number of representative subsequences. If you want to identify typical patterns in your time series, then this is the algorithm to use. Parameters ---------- ts : array_like The time series. snippet_size : int The size of snippet desired. num_snippets : int, Default 2 The number of snippets you would like to find. window_size : int, Default (snippet_size / 2) The window size. Returns ------- list : snippets A list of snippets as dictionary objects with the following structure. >>> { >>> fraction: fraction of the snippet, >>> index: the index of the snippet, >>> snippet: the snippet values >>> } """ ts = core.to_np_array(ts).astype('d') n = len(ts) if not isinstance(snippet_size, int) or snippet_size < 4: raise ValueError('snippet_size must be an integer >= 4') if n < (2 * snippet_size): raise ValueError('Time series is too short relative to snippet length') if not window_size: window_size = int(np.floor(snippet_size / 2)) if window_size >= snippet_size: raise ValueError('window_size must be smaller than snippet_size') # pad end of time series with zeros num_zeros = int(snippet_size * np.ceil(n / snippet_size) - n) ts = np.append(ts, np.zeros(num_zeros)) # compute all profiles indices = np.arange(0, len(ts) - snippet_size, snippet_size) distances = [] for j, i in enumerate(indices): distance = mpdist_vector(ts, ts[i:(i + snippet_size - 1)], int(window_size)) distances.append(distance) distances = np.array(distances) # find N snippets snippets = [] minis = np.inf total_min = None for n in range(num_snippets): minims = np.inf for i in range(len(indices)): s = np.sum(np.minimum(distances[i, :], minis)) if minims > s: minims = s index = i minis = np.minimum(distances[index, :], minis) actual_index = indices[index] snippet = ts[actual_index:actual_index + snippet_size] snippet_distance = distances[index] snippets.append({ 'index': actual_index, 'snippet': snippet, 'distance': snippet_distance }) if isinstance(total_min, type(None)): total_min = snippet_distance else: total_min = np.minimum(total_min, snippet_distance) # compute the fraction of each snippet for snippet in snippets: mask = (snippet['distance'] <= total_min) snippet['fraction'] = mask.sum() / (len(ts) - snippet_size) total_min = total_min - mask del snippet['distance'] return snippets
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 4112, 62, 11748, 198, 6738, 11593, 37443, 834, 1330, 7297, 198, 6738, 11593, 37443, 834, ...
2.516854
1,335
import json import re from copy import copy from logging import Formatter from .profile import used_memory from ..helper import colored
[ 11748, 33918, 198, 11748, 302, 198, 6738, 4866, 1330, 4866, 198, 6738, 18931, 1330, 5178, 1436, 198, 198, 6738, 764, 13317, 1330, 973, 62, 31673, 198, 6738, 11485, 2978, 525, 1330, 16396, 628, 628, 198 ]
4.028571
35
import sys sys.setrecursionlimit(10000000) input=lambda : sys.stdin.readline().rstrip() n,x=map(int,input().split()) a=list(map(int,input().split())) aa=list(filter(lambda b:b!=x,a)) print(*aa)
[ 11748, 25064, 198, 17597, 13, 2617, 8344, 24197, 32374, 7, 16, 24598, 8, 198, 15414, 28, 50033, 1058, 25064, 13, 19282, 259, 13, 961, 1370, 22446, 81, 36311, 3419, 198, 198, 77, 11, 87, 28, 8899, 7, 600, 11, 15414, 22446, 35312, 289...
2.455696
79
"""Streaming integration tests.""" # pylint:disable=no-self-use,invalid-name,too-many-arguments,too-few-public-methods,line-too-long # pylint:disable=too-many-statements,too-many-locals,too-many-lines import threading import time import json from queue import Queue from splitio.client.factory import get_factory from tests.helpers.mockserver import SSEMockServer, SplitMockServer try: # try to import python3 names. fallback to python2 from urllib.parse import parse_qs except ImportError: from urlparse import parse_qs def make_split_change_event(change_number): """Make a split change event.""" return { 'event': 'message', 'data': json.dumps({ 'id':'TVUsxaabHs:0:0', 'clientId':'pri:MzM0ODI1MTkxMw==', 'timestamp': change_number-1, 'encoding':'json', 'channel':'MTYyMTcxOTQ4Mw==_MjA4MzczNDU1Mg==_splits', 'data': json.dumps({ 'type': 'SPLIT_UPDATE', 'changeNumber': change_number }) }) } def make_split_kill_event(name, default_treatment, change_number): """Make a split change event.""" return { 'event': 'message', 'data': json.dumps({ 'id':'TVUsxaabHs:0:0', 'clientId':'pri:MzM0ODI1MTkxMw==', 'timestamp': change_number-1, 'encoding':'json', 'channel':'MTYyMTcxOTQ4Mw==_MjA4MzczNDU1Mg==_splits', 'data': json.dumps({ 'type': 'SPLIT_KILL', 'splitName': name, 'defaultTreatment': default_treatment, 'changeNumber': change_number }) }) } def make_initial_event(): """Make a split change event.""" return {'id':'TVUsxaabHs:0:0'} def make_occupancy(channel, publishers): """Make an occupancy event.""" return { 'event': 'message', 'data': json.dumps({ 'id':'aP6EuhrcUm:0:0', 'timestamp':1604325712734, 'encoding': 'json', 'channel': "[?occupancy=metrics.publishers]%s" % channel, 'data': json.dumps({'metrics': {'publishers': publishers}}), 'name':'[meta]occupancy' }) } def make_segment_change_event(name, change_number): """Make a split change event.""" return { 'event': 'message', 'data': json.dumps({ 'id':'TVUsxaabHs:0:0', 'clientId':'pri:MzM0ODI1MTkxMw==', 'timestamp': change_number-1, 'encoding':'json', 'channel':'MTYyMTcxOTQ4Mw==_MjA4MzczNDU1Mg==_segments', 'data': json.dumps({ 'type': 'SEGMENT_UPDATE', 'segmentName': name, 'changeNumber': change_number }) }) } def make_control_event(control_type, timestamp): """Make a control event.""" return { 'event': 'message', 'data': json.dumps({ 'id':'TVUsxaabHs:0:0', 'clientId':'pri:MzM0ODI1MTkxMw==', 'timestamp': timestamp, 'encoding':'json', 'channel':'[?occupancy=metrics.publishers]control_pri', 'data': json.dumps({ 'type': 'CONTROL', 'controlType': control_type, }) }) } def make_ably_error_event(code, status): """Make a control event.""" return { 'event': 'error', 'data': json.dumps({ 'message':'Invalid accessToken in request: sarasa', 'code': code, 'statusCode': status, 'href':"https://help.ably.io/error/%d" % code }) } def make_simple_split(name, cn, active, killed, default_treatment, tt, on): """Make a simple split.""" return { 'trafficTypeName': tt, 'name': name, 'seed': 1699838640, 'status': 'ACTIVE' if active else 'ARCHIVED', 'changeNumber': cn, 'killed': killed, 'defaultTreatment': default_treatment, 'conditions': [ { 'matcherGroup': { 'combiner': 'AND', 'matchers': [ { 'matcherType': 'ALL_KEYS', 'negate': False, 'userDefinedSegmentMatcherData': None, 'whitelistMatcherData': None } ] }, 'partitions': [ {'treatment': 'on' if on else 'off', 'size': 100}, {'treatment': 'off' if on else 'on', 'size': 0} ] } ] } def make_split_with_segment(name, cn, active, killed, default_treatment, tt, on, segment): """Make a split with a segment.""" return { 'trafficTypeName': tt, 'name': name, 'seed': cn, 'status': 'ACTIVE' if active else 'ARCHIVED', 'changeNumber': cn, 'killed': killed, 'defaultTreatment': default_treatment, 'configurations': { 'on': '{\'size\':15,\'test\':20}' }, 'conditions': [ { 'matcherGroup': { 'combiner': 'AND', 'matchers': [ { 'matcherType': 'IN_SEGMENT', 'negate': False, 'userDefinedSegmentMatcherData': {'segmentName': segment}, 'whitelistMatcherData': None } ] }, 'partitions': [{ 'treatment': 'on' if on else 'off', 'size': 100 }] } ] }
[ 37811, 12124, 278, 11812, 5254, 526, 15931, 198, 2, 279, 2645, 600, 25, 40223, 28, 3919, 12, 944, 12, 1904, 11, 259, 12102, 12, 3672, 11, 18820, 12, 21834, 12, 853, 2886, 11, 18820, 12, 32146, 12, 11377, 12, 24396, 82, 11, 1370, 1...
1.800431
3,247
import re from abc import ABC, abstractmethod from typing import Any, Dict, Generator # class AbstractVenue(metaclass=ABC):
[ 11748, 302, 198, 6738, 450, 66, 1330, 9738, 11, 12531, 24396, 198, 6738, 19720, 1330, 4377, 11, 360, 713, 11, 35986, 628, 198, 198, 2, 1398, 27741, 37522, 518, 7, 4164, 330, 31172, 28, 24694, 2599, 198 ]
3.432432
37
# Copyright 2018 Johns Hopkins University. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import namedtuple import tensorflow as tf from tensorflow.python.framework import sparse_tensor as sparse_tensor_lib from tensorflow.python.ops import parsing_ops # namedtuple for bucket_info object (used in Pipeline) # func: a mapping from examples to tf.int64 keys # pads: a set of tf shapes that correspond to padded examples bucket_info = namedtuple("bucket_info", "func pads") def int64_feature(value): """ Takes a single int (e.g. 3) and converts it to a tf Feature """ return tf.train.Feature(int64_list=tf.train.Int64List(value=[value])) def int64_list_feature(sequence): """ Sequence of ints (e.g [1,2,3]) to TF feature """ return tf.train.Feature(int64_list=tf.train.Int64List(value=sequence))
[ 2, 15069, 2864, 25824, 21183, 2059, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, ...
3.631455
426
from py65.devices import mpu6502 from py65.utils.devices import make_instruction_decorator
[ 6738, 12972, 2996, 13, 42034, 1330, 285, 19944, 17544, 17, 220, 198, 6738, 12972, 2996, 13, 26791, 13, 42034, 1330, 787, 62, 8625, 2762, 62, 12501, 273, 1352, 628 ]
3.206897
29
import pandas as pd import shutil import os import io from ms_mint.Mint import Mint from pathlib import Path as P from ms_mint.io import ( ms_file_to_df, mzml_to_pandas_df_pyteomics, convert_ms_file_to_feather, convert_ms_file_to_parquet, MZMLB_AVAILABLE, ) from paths import ( TEST_MZML, TEST_MZXML, TEST_PARQUET, TEST_MZMLB_POS, TEST_MZML_POS, TEST_MZML_NEG, )
[ 11748, 19798, 292, 355, 279, 67, 198, 11748, 4423, 346, 198, 11748, 28686, 198, 11748, 33245, 198, 198, 6738, 13845, 62, 34289, 13, 44, 600, 1330, 20873, 198, 198, 6738, 3108, 8019, 1330, 10644, 355, 350, 198, 198, 6738, 13845, 62, 34...
2.043478
207
from django.core.files.storage import FileSystemStorage from django.shortcuts import render, redirect from core.forms import DocumentForm from core.models import Document from media import image_cv2
[ 6738, 42625, 14208, 13, 7295, 13, 16624, 13, 35350, 1330, 9220, 11964, 31425, 198, 6738, 42625, 14208, 13, 19509, 23779, 1330, 8543, 11, 18941, 198, 6738, 4755, 13, 23914, 1330, 16854, 8479, 198, 198, 6738, 4755, 13, 27530, 1330, 16854, ...
4.06
50
from .helper import *
[ 6738, 764, 2978, 525, 1330, 1635, 628 ]
3.285714
7
import dask import datetime import logging import time import torch import numpy as np import pandas as pd from collections import OrderedDict from ml4chem.metrics import compute_rmse from ml4chem.atomistic.models.base import DeepLearningModel, DeepLearningTrainer from ml4chem.atomistic.models.loss import AtomicMSELoss from ml4chem.optim.handler import get_optimizer, get_lr_scheduler, get_lr from ml4chem.utils import convert_elapsed_time, get_chunks, get_number_of_parameters from pprint import pformat # Setting precision and starting logger object torch.set_printoptions(precision=10) logger = logging.getLogger()
[ 11748, 288, 2093, 198, 11748, 4818, 8079, 198, 11748, 18931, 198, 11748, 640, 198, 11748, 28034, 198, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 19798, 292, 355, 279, 67, 198, 6738, 17268, 1330, 14230, 1068, 35, 713, 198, 6738, 259...
3.378378
185
#!/usr/bin/env python3 # # MIT License # # Copyright (c) 2020-2022 EntySec # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # import json import os from hatsploit.core.cli.badges import Badges from hatsploit.lib.config import Config from hatsploit.lib.storage import LocalStorage
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 198, 2, 198, 2, 17168, 13789, 198, 2, 198, 2, 15069, 357, 66, 8, 12131, 12, 1238, 1828, 7232, 88, 6558, 198, 2, 198, 2, 2448, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11,...
3.670455
352
from bluesky.plans import scan from bluesky.simulators import (print_summary, print_summary_wrapper, summarize_plan, check_limits, plot_raster_path) import pytest from bluesky.plans import grid_scan
[ 6738, 25570, 2584, 13, 489, 504, 1330, 9367, 198, 6738, 25570, 2584, 13, 14323, 24325, 1330, 357, 4798, 62, 49736, 11, 3601, 62, 49736, 62, 48553, 11, 198, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, ...
1.923077
156
import random numbers_list = [1,2,3,4,5,6,7,8,9,10] game_won = False game_completed = False #Stats games_played = 0 games_won = 0 games_lost = 0 average_score = 0 total_score = 0 keep_playing = True while keep_playing: numbers_list = [1,2,3,4,5,6,7,8,9,10] welcome() roll_total = 0 while roll_total < 55: dice_amount = 2 if all_less_than_7(): dice_amount = choose_dice_amount() dice_total = dice_roll(dice_amount) print("Your roll is: " + str(dice_total)) if check_lost_game(dice_total): print("It is impossible to continue the game with this roll") break choose_number_to_drop(dice_total) roll_total += dice_total if roll_total == 55: game_won = win_game() if game_won: print("Congrats you won!!!!") games_played +=1 games_won +=1 else: print("You lose, your score is " + str(score_game())) print("Numbers remaining: " + str(numbers_list)) games_played += 1 games_lost += 1 total_score += score_game() average_score = total_score/games_played game_won = False print("STATS:\n Games Played: " + str(games_played) + "\nGames Won: " + str(games_won) + "\nGames Lost: " + str(games_lost) + "\nAverage Score: " + str(average_score) + "\nTotal Score: " + str(total_score)) keep_playing_input()
[ 11748, 4738, 198, 77, 17024, 62, 4868, 796, 685, 16, 11, 17, 11, 18, 11, 19, 11, 20, 11, 21, 11, 22, 11, 23, 11, 24, 11, 940, 60, 198, 6057, 62, 26502, 796, 10352, 198, 6057, 62, 785, 16838, 796, 10352, 198, 2, 29668, 198, 1...
2.243243
629
import warnings import pytest from leapp.libraries.actor.systemfacts import get_selinux_status from leapp.models import SELinuxFacts no_selinux = False try: import selinux except ImportError: no_selinux = True warnings.warn( 'Tests which uses `selinux` will be skipped' ' due to library unavailability.', ImportWarning) reason_to_skip_msg = "Selinux is not available" # FIXME: create valid tests... class MockNoConfigFileOSError(object):
[ 11748, 14601, 198, 198, 11748, 12972, 9288, 198, 198, 6738, 443, 1324, 13, 75, 11127, 13, 11218, 13, 10057, 37473, 1330, 651, 62, 741, 259, 2821, 62, 13376, 198, 6738, 443, 1324, 13, 27530, 1330, 311, 3698, 259, 2821, 37, 8656, 198, ...
2.845238
168
""" 1. Write a Python program to reverse only the vowels of a given string. Sample Output: w3resuorce Python Perl ASU 2. Write a Python program to check whether a given integer is a palindrome or not. Note: An integer is a palindrome when it reads the same backward as forward. Negative numbers are not palindromic. Sample Output: False True False 3. Write a Python program to remove the duplicate elements of a given array of numbers such that each element appear only once and return the new length of the given array. Sample Output: 5 4 4. Write a Python program to calculate the maximum profit from selling and buying values of stock. An array of numbers represent the stock prices in chronological order. For example, given [8, 10, 7, 5, 7, 15], the function will return 10, since the buying value of the stock is 5 dollars and sell value is 15 dollars. Sample Output: 10 7 0 5. Write a Python program to remove all instances of a given value from a given array of integers and find the length of the new array. For example, given [8, 10, 7, 5, 7, 15], the function will return 10, since the buying value of the stock is 5 dollars and sell value is 15 dollars. Sample Output: 6 0 5 0 6. Write a Python program to find the starting and ending position of a given value in a given array of integers, sorted in ascending order. If the target is not found in the array, return [0, 0]. Input: [5, 7, 7, 8, 8, 8] target value = 8 Output: [0, 5] Input: [1, 3, 6, 9, 13, 14] target value = 4 Output: [0, 0] Sample Output: [0, 5] [0, 0] 7. The price of a given stock on each day is stored in an array. Write a Python program to find the maximum profit in one transaction i.e., buy one and sell one share of the stock from the given price value of the said array. You cannot sell a stock before you buy one. Input (Stock price of each day): [224, 236, 247, 258, 259, 225] Output: 35 Explanation: 236 - 224 = 12 247 - 224 = 23 258 - 224 = 34 259 - 224 = 35 225 - 224 = 1 247 - 236 = 11 258 - 236 = 22 259 - 236 = 23 225 - 236 = -11 258 - 247 = 11 259 - 247 = 12 225 - 247 = -22 259 - 258 = 1 225 - 258 = -33 225 - 259 = -34 8. Write a Python program to print a given N by M matrix of numbers line by line in forward > backwards > forward >... order. Input matrix: [[1, 2, 3,4], [5, 6, 7, 8], [0, 6, 2, 8], [2, 3, 0, 2]] Output: 1 2 3 4 8 7 6 5 0 6 2 8 2 0 3 2 9. Write a Python program to compute the largest product of three integers from a given list of integers. Sample Output: 4000 8 120 10. Write a Python program to find the first missing positive integer that does not exist in a given list. """
[ 37811, 198, 198, 16, 13, 19430, 257, 11361, 1430, 284, 9575, 691, 262, 23268, 1424, 286, 257, 1813, 4731, 13, 198, 36674, 25235, 25, 198, 86, 18, 411, 84, 8387, 198, 37906, 198, 5990, 75, 198, 1921, 52, 198, 198, 17, 13, 19430, 25...
3.297092
791
# -*- coding: utf-8 -*- """ Microsoft-Windows-IPxlatCfg GUID : 3e5ac668-af52-4c15-b99b-a3e7a6616ebd """ from construct import Int8sl, Int8ul, Int16ul, Int16sl, Int32sl, Int32ul, Int64sl, Int64ul, Bytes, Double, Float32l, Struct from etl.utils import WString, CString, SystemTime, Guid from etl.dtyp import Sid from etl.parsers.etw.core import Etw, declare, guid
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 15905, 12, 11209, 12, 4061, 87, 15460, 34, 40616, 198, 38, 27586, 1058, 513, 68, 20, 330, 35809, 12, 1878, 4309, 12, 19, 66, 1314, 12, 65, 2079, 65, 12, ...
2.394904
157
# -*- coding: utf-8 -*- import os from distutils.util import strtobool
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 198, 11748, 28686, 198, 6738, 1233, 26791, 13, 22602, 1330, 965, 83, 672, 970, 628 ]
2.517241
29
# CHECK-TREE: { const <- \x -> \y -> x; y <- const #true #true; z <- const #false #false; #record { const: const, y : y, z: z, }} const = lambda x, y: x y = const(True, True) z = const(False, False)
[ 2, 5870, 25171, 12, 51, 11587, 25, 1391, 1500, 24293, 3467, 87, 4613, 3467, 88, 4613, 2124, 26, 331, 24293, 1500, 1303, 7942, 1303, 7942, 26, 1976, 24293, 1500, 1303, 9562, 1303, 9562, 26, 1303, 22105, 1391, 1500, 25, 1500, 11, 331, ...
2.551282
78
import tensorflow as tf import os.path import warnings from distutils.version import LooseVersion import glob import helper import project_tests as tests #-------------------------- # USER-SPECIFIED DATA #-------------------------- # Tune these parameters NUMBER_OF_CLASSES = 2 IMAGE_SHAPE = (160, 576) EPOCHS = 20 BATCH_SIZE = 1 LEARNING_RATE = 0.0001 DROPOUT = 0.75 # Specify these directory paths DATA_DIRECTORY = './data' RUNS_DIRECTORY = './runs' TRAINING_DATA_DIRECTORY ='./data/data_road/training' NUMBER_OF_IMAGES = len(glob.glob('./data/data_road/training/calib/*.*')) VGG_PATH = './data/vgg' all_training_losses = [] # Used for plotting to visualize if our training is going well given parameters #-------------------------- # DEPENDENCY CHECK #-------------------------- # Check TensorFlow Version assert LooseVersion(tf.__version__) >= LooseVersion('1.0'), 'Please use TensorFlow version 1.0 or newer. You are using {}'.format(tf.__version__) print('TensorFlow Version: {}'.format(tf.__version__)) # Check for a GPU if not tf.test.gpu_device_name(): warnings.warn('No GPU found. Please use a GPU to train your neural network.') else: print('Default GPU Device: {}'.format(tf.test.gpu_device_name())) #-------------------------- # PLACEHOLDER TENSORS #-------------------------- correct_label = tf.placeholder(tf.float32, [None, IMAGE_SHAPE[0], IMAGE_SHAPE[1], NUMBER_OF_CLASSES]) learning_rate = tf.placeholder(tf.float32) keep_prob = tf.placeholder(tf.float32) #-------------------------- # FUNCTIONS #-------------------------- def load_vgg(sess, vgg_path): """ Load Pretrained VGG Model into TensorFlow. sess: TensorFlow Session vgg_path: Path to vgg folder, containing "variables/" and "saved_model.pb" return: Tuple of Tensors from VGG model (image_input, keep_prob, layer3, layer4, layer7) """ # load the model and weights model = tf.saved_model.loader.load(sess, ['vgg16'], vgg_path) # Get Tensors to be returned from graph graph = tf.get_default_graph() image_input = graph.get_tensor_by_name('image_input:0') keep_prob = graph.get_tensor_by_name('keep_prob:0') layer3 = graph.get_tensor_by_name('layer3_out:0') layer4 = graph.get_tensor_by_name('layer4_out:0') layer7 = graph.get_tensor_by_name('layer7_out:0') return image_input, keep_prob, layer3, layer4, layer7 def conv_1x1(layer, layer_name): """ Return the output of a 1x1 convolution of a layer """ return tf.layers.conv2d(inputs = layer, filters = NUMBER_OF_CLASSES, kernel_size = (1, 1), strides = (1, 1), name = layer_name) def upsample(layer, k, s, layer_name): """ Return the output of transpose convolution given kernel_size k and strides s """ return tf.layers.conv2d_transpose(inputs = layer, filters = NUMBER_OF_CLASSES, kernel_size = (k, k), strides = (s, s), padding = 'same', name = layer_name) def layers(vgg_layer3_out, vgg_layer4_out, vgg_layer7_out, num_classes = NUMBER_OF_CLASSES): """ Create the layers for a fully convolutional network. Build skip-layers using the vgg layers. vgg_layerX_out: TF Tensor for VGG Layer X output num_classes: Number of classes to classify return: The Tensor for the last layer of output """ # Use a shorter variable name for simplicity layer3, layer4, layer7 = vgg_layer3_out, vgg_layer4_out, vgg_layer7_out # Apply a 1x1 convolution to encoder layers layer3x = conv_1x1(layer = layer3, layer_name = "layer3conv1x1") layer4x = conv_1x1(layer = layer4, layer_name = "layer4conv1x1") layer7x = conv_1x1(layer = layer7, layer_name = "layer7conv1x1") # Add decoder layers to the network with skip connections and upsampling # Note: the kernel size and strides are the same as the example in Udacity Lectures # Semantic Segmentation Scene Understanding Lesson 10-9: FCN-8 - Decoder decoderlayer1 = upsample(layer = layer7x, k = 4, s = 2, layer_name = "decoderlayer1") decoderlayer2 = tf.add(decoderlayer1, layer4x, name = "decoderlayer2") decoderlayer3 = upsample(layer = decoderlayer2, k = 4, s = 2, layer_name = "decoderlayer3") decoderlayer4 = tf.add(decoderlayer3, layer3x, name = "decoderlayer4") decoderlayer_output = upsample(layer = decoderlayer4, k = 16, s = 8, layer_name = "decoderlayer_output") return decoderlayer_output def optimize(nn_last_layer, correct_label, learning_rate, num_classes = NUMBER_OF_CLASSES): """ Build the TensorFLow loss and optimizer operations. nn_last_layer: TF Tensor of the last layer in the neural network correct_label: TF Placeholder for the correct label image learning_rate: TF Placeholder for the learning rate num_classes: Number of classes to classify return: Tuple of (logits, train_op, cross_entropy_loss) """ # Reshape 4D tensors to 2D, each row represents a pixel, each column a class logits = tf.reshape(nn_last_layer, (-1, num_classes)) class_labels = tf.reshape(correct_label, (-1, num_classes)) # The cross_entropy_loss is the cost which we are trying to minimize to yield higher accuracy cross_entropy = tf.nn.softmax_cross_entropy_with_logits(logits = logits, labels = class_labels) cross_entropy_loss = tf.reduce_mean(cross_entropy) # The model implements this operation to find the weights/parameters that would yield correct pixel labels train_op = tf.train.AdamOptimizer(learning_rate).minimize(cross_entropy_loss) return logits, train_op, cross_entropy_loss def train_nn(sess, epochs, batch_size, get_batches_fn, train_op, cross_entropy_loss, input_image, correct_label, keep_prob, learning_rate): """ Train neural network and print out the loss during training. sess: TF Session epochs: Number of epochs batch_size: Batch size get_batches_fn: Function to get batches of training data. Call using get_batches_fn(batch_size) train_op: TF Operation to train the neural network cross_entropy_loss: TF Tensor for the amount of loss input_image: TF Placeholder for input images correct_label: TF Placeholder for label images keep_prob: TF Placeholder for dropout keep probability learning_rate: TF Placeholder for learning rate """ for epoch in range(EPOCHS): losses, i = [], 0 for images, labels in get_batches_fn(BATCH_SIZE): i += 1 feed = { input_image: images, correct_label: labels, keep_prob: DROPOUT, learning_rate: LEARNING_RATE } _, partial_loss = sess.run([train_op, cross_entropy_loss], feed_dict = feed) print("---> iteration: ", i, " partial loss:", partial_loss) losses.append(partial_loss) training_loss = sum(losses) / len(losses) all_training_losses.append(training_loss) print("------------------") print("epoch: ", epoch + 1, " of ", EPOCHS, "training loss: ", training_loss) print("------------------") def run(): """ Run a train a model and save output images resulting from the test image fed on the trained model """ # Get vgg model if we can't find it where it should be helper.maybe_download_pretrained_vgg(DATA_DIRECTORY) # A function to get batches get_batches_fn = helper.gen_batch_function(TRAINING_DATA_DIRECTORY, IMAGE_SHAPE) with tf.Session() as session: # Returns the three layers, keep probability and input layer from the vgg architecture image_input, keep_prob, layer3, layer4, layer7 = load_vgg(session, VGG_PATH) # The resulting network architecture from adding a decoder on top of the given vgg model model_output = layers(layer3, layer4, layer7, NUMBER_OF_CLASSES) # Returns the output logits, training operation and cost operation to be used # - logits: each row represents a pixel, each column a class # - train_op: function used to get the right parameters to the model to correctly label the pixels # - cross_entropy_loss: function outputting the cost which we are minimizing, lower cost should yield higher accuracy logits, train_op, cross_entropy_loss = optimize(model_output, correct_label, learning_rate, NUMBER_OF_CLASSES) # Initialize all variables session.run(tf.global_variables_initializer()) session.run(tf.local_variables_initializer()) # Train the neural network train_nn(session, EPOCHS, BATCH_SIZE, get_batches_fn, train_op, cross_entropy_loss, image_input, correct_label, keep_prob, learning_rate) # Run the model with the test images and save each painted output image (roads painted green) helper.save_inference_samples(RUNS_DIRECTORY, DATA_DIRECTORY, session, IMAGE_SHAPE, logits, keep_prob, image_input) #-------------------------- # MAIN #-------------------------- if __name__ == "__main__": run_tests() run() # Run a train a model and save output images resulting from the test image fed on the trained model print(all_training_losses)
[ 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 28686, 13, 6978, 198, 11748, 14601, 198, 6738, 1233, 26791, 13, 9641, 1330, 6706, 577, 14815, 198, 11748, 15095, 198, 198, 11748, 31904, 198, 11748, 1628, 62, 41989, 355, 5254, 198, 198, ...
2.741205
3,354
# Copyright 2018 The Forseti Security Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Tests the LogSinkRulesEngine.""" import unittest import mock from tests.unittest_utils import ForsetiTestCase from tests.unittest_utils import get_datafile_path from google.cloud.forseti.common.gcp_type.billing_account import BillingAccount from google.cloud.forseti.common.gcp_type.folder import Folder from google.cloud.forseti.common.gcp_type.log_sink import LogSink from google.cloud.forseti.common.gcp_type.organization import Organization from google.cloud.forseti.common.gcp_type.project import Project from google.cloud.forseti.scanner.audit import log_sink_rules_engine as lsre from google.cloud.forseti.scanner.audit.errors import InvalidRulesSchemaError if __name__ == '__main__': unittest.main()
[ 2, 15069, 2864, 383, 27325, 316, 72, 4765, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 198, 2, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 345, 743, 407, 779, 428, 2393, 2845, 287, 11...
3.385787
394
import uuid from config import USR_ORG_MONGO_COLLECTION, USR_MONGO_COLLECTION import db from models.response import post_error import logging log = logging.getLogger('file')
[ 11748, 334, 27112, 198, 6738, 4566, 1330, 1294, 49, 62, 1581, 38, 62, 27857, 11230, 62, 25154, 16779, 2849, 11, 1294, 49, 62, 27857, 11230, 62, 25154, 16779, 2849, 198, 11748, 20613, 220, 198, 6738, 4981, 13, 26209, 1330, 1281, 62, 18...
3.034483
58
# Adapted from https://github.com/pybind/cmake_example/blob/master/setup.py import os import re import sys import platform import subprocess import importlib from sysconfig import get_paths import importlib from setuptools import setup, Extension from setuptools.command.build_ext import build_ext from setuptools.command.install import install from distutils.sysconfig import get_config_var from distutils.version import LooseVersion torch_spec = importlib.util.find_spec("torch") tf_spec = importlib.util.find_spec("tensorflow") packages = [] build_with_cuda = False if torch_spec is not None: packages.append('pydiffvg') import torch if torch.cuda.is_available(): build_with_cuda = True if tf_spec is not None and sys.platform != 'win32': packages.append('pydiffvg_tensorflow') if not build_with_cuda: import tensorflow as tf if tf.test.is_gpu_available(cuda_only=True, min_cuda_compute_capability=None): build_with_cuda = True if len(packages) == 0: print('Error: PyTorch or Tensorflow must be installed. For Windows platform only PyTorch is supported.') exit() # Override build_with_cuda with environment variable if 'DIFFVG_CUDA' in os.environ: build_with_cuda = os.environ['DIFFVG_CUDA'] == '1' setup(name='diffvg', version='0.0.1', install_requires=["svgpathtools"], description='Differentiable Vector Graphics', ext_modules=[CMakeExtension('diffvg', '', build_with_cuda)], cmdclass=dict(build_ext=Build, install=install), packages=packages, zip_safe=False)
[ 2, 30019, 276, 422, 3740, 1378, 12567, 13, 785, 14, 9078, 21653, 14, 11215, 539, 62, 20688, 14, 2436, 672, 14, 9866, 14, 40406, 13, 9078, 198, 11748, 28686, 198, 11748, 302, 198, 11748, 25064, 198, 11748, 3859, 198, 11748, 850, 14681,...
2.769231
572
# validated: 2017-02-19 DS c5e3a8a9b642 roborio/java/navx_frc/src/com/kauailabs/navx/frc/RegisterIO.java #---------------------------------------------------------------------------- # Copyright (c) Kauai Labs 2015. All Rights Reserved. # # Created in support of Team 2465 (Kauaibots). Go Purple Wave! # # Open Source Software - may be modified and shared by FRC teams. Any # modifications to this code must be accompanied by the \License.txt file # in the root directory of the project #---------------------------------------------------------------------------- from ._impl import AHRSProtocol, IMUProtocol, IMURegisters from wpilib.timer import Timer import logging logger = logging.getLogger('navx') __all__ = ['RegisterIO'] IO_TIMEOUT_SECONDS = 1.0 DELAY_OVERHEAD_SECONDS = 0.004
[ 2, 31031, 25, 2177, 12, 2999, 12, 1129, 17400, 269, 20, 68, 18, 64, 23, 64, 24, 65, 41290, 686, 2865, 952, 14, 12355, 14, 28341, 87, 62, 69, 6015, 14, 10677, 14, 785, 14, 74, 559, 603, 8937, 14, 28341, 87, 14, 69, 6015, 14, ...
3.47807
228
#pylint: disable=invalid-name #pylint: disable=too-many-instance-attributes #pylint: disable=too-many-return-statements #pylint: disable=too-many-statements """ Class structure and methods for an oscilloscope channel. The idea is to collect all the relevant information from all the Rigol scope waveforms into a single structure that can be handled in a uniform and consistent manner. Specifically this lets one just use channel.times : numpy array of signal times channel.volts : numpy array of signal voltages or the stringification method to describe a channel print(channel) """ from enum import Enum import numpy as np def best_scale(number): """Scale and units for a number with proper prefix.""" absnr = abs(number) if absnr == 0: return 1, ' ' if absnr < 0.99999999e-9: return 1e12, 'p' if absnr < 0.99999999e-6: return 1e9, 'n' if absnr < 0.99999999e-3: return 1e6, '' if absnr < 0.99999999: return 1e3, 'm' if absnr < 0.99999999e3: return 1, ' ' if absnr < 0.99999999e6: return 1e-3, 'k' if absnr < 0.999999991e9: return 1e-6, 'M' return 1e-9, 'G' def engineering_string(number, n_digits): """Format number with proper prefix.""" scale, prefix = best_scale(number) fformat = "%%.%df %%s" % n_digits s = fformat % (number * scale, prefix) return s def _channel_bytes(channel_number, w): """ Return right series of bytes for a channel for 1000Z scopes. Waveform points are interleaved stored in memory when two or more channels are saved. This unweaves them. Args: channel_number: the number of enabled channels before this one w: original waveform object Returns byte array for specified channel """ offset = 0 if w.header.stride == 2: # byte pattern CHx CHy # use odd bytes when this is the second enabled channel if any([w.header.ch[i].enabled for i in range(channel_number-1)]): offset = 1 elif w.header.stride == 4: # byte pattern CH4 CH3 CH2 CH1 offset = 4 - channel_number data = np.frombuffer(w.data.raw, dtype=np.uint8) raw_bytes = data[offset::w.header.stride] return raw_bytes
[ 2, 79, 2645, 600, 25, 15560, 28, 259, 12102, 12, 3672, 198, 2, 79, 2645, 600, 25, 15560, 28, 18820, 12, 21834, 12, 39098, 12, 1078, 7657, 198, 2, 79, 2645, 600, 25, 15560, 28, 18820, 12, 21834, 12, 7783, 12, 14269, 3196, 198, 2,...
2.572553
889
_base_ = '../faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco.py' model = dict( backbone=dict( num_stages=4, #frozen_stages=4 ), roi_head=dict( bbox_head=dict( num_classes=3 ) ) ) dataset_type = 'COCODataset' classes = ('luchs', 'rotfuchs', 'wolf') data = dict( train=dict( img_prefix='raubtierv2a/train/', classes=classes, ann_file='raubtierv2a/train/_annotations.coco.json'), val=dict( img_prefix='raubtierv2a/valid/', classes=classes, ann_file='raubtierv2a/valid/_annotations.coco.json'), test=dict( img_prefix='raubtierv2a/test/', classes=classes, ann_file='raubtierv2a/test/_annotations.coco.json')) #optimizer = dict(type='SGD', lr=0.02, momentum=0.9, weight_decay=0.0001) #original (8x2=16) optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0001) #(4x2=8) 4 GPUs #optimizer = dict(type='SGD', lr=0.0025, momentum=0.9, weight_decay=0.0001) #(1x2=2) total_epochs=24 evaluation = dict(classwise=True, interval=1, metric='bbox') work_dir = '/media/storage1/projects/WilLiCam/checkpoint_workdir/raubtierv2a/faster_rcnn_x101_64x4d_fpn_1x_raubtierv2a_nofreeze_4gpu' #http://download.openmmlab.com/mmdetection/v2.0/faster_rcnn/faster_rcnn_x101_64x4d_fpn_1x_coco/faster_rcnn_x101_64x4d_fpn_1x_coco_20200204-833ee192.pth load_from = 'checkpoints/faster_rcnn_x101_64x4d_fpn_1x_coco_20200204-833ee192.pth'
[ 62, 8692, 62, 796, 705, 40720, 69, 1603, 62, 6015, 20471, 14, 69, 1603, 62, 6015, 20471, 62, 87, 8784, 62, 2414, 87, 19, 67, 62, 69, 21999, 62, 16, 87, 62, 66, 25634, 13, 9078, 6, 628, 198, 19849, 796, 8633, 7, 198, 198, 1891,...
1.93578
763
from distutils.core import setup, Extension setup(name = 'qconf_py', version = '1.2.2', ext_modules = [Extension('qconf_py', ['lib/python_qconf.cc'], include_dirs=['/usr/local/include/qconf'], extra_objects=['/usr/local/qconf/lib/libqconf.a'] )])
[ 6738, 1233, 26791, 13, 7295, 1330, 9058, 11, 27995, 198, 40406, 7, 3672, 796, 705, 80, 10414, 62, 9078, 3256, 2196, 796, 705, 16, 13, 17, 13, 17, 3256, 1070, 62, 18170, 796, 685, 11627, 3004, 10786, 80, 10414, 62, 9078, 3256, 37250,...
2.40367
109
h = int(input()) i = 1 a = 1 b = 1 c = 1 while h >= a: a = 2 ** i i += 1 s = 0 t = True for j in range(1, i-1): c += 2 ** j print(c)
[ 71, 796, 493, 7, 15414, 28955, 198, 72, 796, 352, 198, 64, 796, 352, 198, 65, 796, 352, 198, 66, 796, 352, 198, 198, 4514, 289, 18189, 257, 25, 198, 220, 220, 220, 257, 796, 362, 12429, 1312, 198, 220, 220, 220, 1312, 15853, 352...
1.804878
82
# log_battery.py/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro). # This copyright was auto-generated on Wed, Sep 1, 2021 5:05:45 PM """Example to continuously read the battery (with no Wifi connection)""" import csv import time import logging import argparse import threading from pathlib import Path from datetime import datetime from dataclasses import dataclass from typing import Optional, Tuple, Literal, List from rich.console import Console from open_gopro import GoPro from open_gopro.constants import StatusId from open_gopro.util import setup_logging, set_logging_level logger = logging.getLogger(__name__) console = Console() # rich consoler printer BarsType = Literal[0, 1, 2, 3] SAMPLE_INDEX = 0 SAMPLES: List[Sample] = [] def dump_results_as_csv(location: Path) -> None: """Write all of the samples to a csv file Args: location (Path): File to write to """ console.print(f"Dumping results as CSV to {location}") with open(location, mode="w") as f: w = csv.writer(f, delimiter=",", quotechar='"', quoting=csv.QUOTE_MINIMAL) w.writerow(["index", "time", "percentage", "bars"]) initial_time = SAMPLES[0].time for s in SAMPLES: w.writerow([s.index, (s.time - initial_time).seconds, s.percentage, s.bars]) def process_battery_notifications(gopro: GoPro, initial_bars: BarsType, initial_percentage: int) -> None: """Separate thread to continuously check for and store battery notifications. If the CLI parameter was set to poll, this isn't used. Args: gopro (GoPro): instance to get updates from initial_bars (BarsType): Initial bars level when notifications were enabled initial_percentage (int): Initial percentage when notifications were enabled """ last_percentage = initial_percentage last_bars = initial_bars while True: # Block until we receive an update notification = gopro.get_update() # Update data points if they have changed last_percentage = ( notification.data[StatusId.INT_BATT_PER] if StatusId.INT_BATT_PER in notification.data else last_percentage ) last_bars = ( notification.data[StatusId.BATT_LEVEL] if StatusId.BATT_LEVEL in notification.data else last_bars ) # Append and print sample global SAMPLE_INDEX SAMPLES.append(Sample(index=SAMPLE_INDEX, percentage=last_percentage, bars=last_bars)) console.print(str(SAMPLES[-1])) SAMPLE_INDEX += 1 def main() -> int: """Main program functionality Returns: int: program return code """ identifier, log_location, poll = parse_arguments() global logger logger = setup_logging(logger, log_location) global SAMPLE_INDEX gopro: Optional[GoPro] = None return_code = 0 try: with GoPro(identifier, enable_wifi=False) as gopro: set_logging_level(logger, logging.ERROR) # # Setup notifications if we are not polling if poll is None: console.print("Configuring battery notifications...") # Enable notifications of the relevant battery statuses. Also store initial values. bars = gopro.ble_status.batt_level.register_value_update().flatten percentage = gopro.ble_status.int_batt_per.register_value_update().flatten # Start a thread to handle asynchronous battery level notifications threading.Thread( target=process_battery_notifications, args=(gopro, bars, percentage), daemon=True ).start() with console.status("[bold green]Receiving battery notifications until it dies..."): # Sleep forever, allowing notification handler thread to deal with battery level notifications while True: time.sleep(1) # Otherwise, poll else: with console.status("[bold green]Polling the battery until it dies..."): while True: SAMPLES.append( Sample( index=SAMPLE_INDEX, percentage=gopro.ble_status.int_batt_per.get_value().flatten, bars=gopro.ble_status.batt_level.get_value().flatten, ) ) console.print(str(SAMPLES[-1])) SAMPLE_INDEX += 1 time.sleep(poll) except Exception as e: # pylint: disable=broad-except logger.error(repr(e)) return_code = 1 except KeyboardInterrupt: logger.warning("Received keyboard interrupt. Shutting down...") finally: if len(SAMPLES) > 0: csv_location = Path(log_location.parent) / "battery_results.csv" dump_results_as_csv(csv_location) if gopro is not None: gopro.close() console.print("Exiting...") return return_code # pylint: disable=lost-exception def parse_arguments() -> Tuple[str, Path, Optional[int]]: """Parse command line arguments Returns: Tuple[str, Path, Path]: (identifier, path to save log, path to VLC) """ parser = argparse.ArgumentParser( description="Connect to the GoPro via BLE only and continuously read the battery (either by polling or notifications)." ) parser.add_argument( "-i", "--identifier", type=str, help="Last 4 digits of GoPro serial number, which is the last 4 digits of the default camera SSID. \ If not used, first discovered GoPro will be connected to", default=None, ) parser.add_argument( "-l", "--log", type=Path, help="Location to store detailed log", default="log_battery.log", ) parser.add_argument( "-p", "--poll", type=int, help="Set to poll the battery at a given interval. If not set, battery level will be notified instead. Defaults to notifications.", default=None, ) args = parser.parse_args() return args.identifier, args.log, args.poll if __name__ == "__main__": main()
[ 2, 2604, 62, 65, 16296, 13, 9078, 14, 11505, 49789, 11, 10628, 362, 13, 15, 357, 34, 8, 15069, 33448, 49789, 11, 3457, 13, 357, 4023, 1378, 70, 404, 305, 13, 785, 14, 11505, 5247, 2964, 737, 198, 2, 770, 6634, 373, 8295, 12, 275...
2.362324
2,702
# These are not the droids you are looking for.
[ 2, 2312, 389, 407, 262, 3102, 2340, 345, 389, 2045, 329, 13 ]
3.916667
12
import os import sys import base64 from django.db.models import F, Q from xos.config import Config from observer.syncstep import SyncStep from core.models import Service from hpc.models import ServiceProvider, ContentProvider, CDNPrefix, OriginServer from util.logger import Logger, logging # hpclibrary will be in steps/.. parentdir = os.path.join(os.path.dirname(__file__),"..") sys.path.insert(0,parentdir) from hpclib import HpcLibrary logger = Logger(level=logging.INFO)
[ 11748, 28686, 198, 11748, 25064, 198, 11748, 2779, 2414, 198, 198, 6738, 42625, 14208, 13, 9945, 13, 27530, 1330, 376, 11, 1195, 198, 6738, 2124, 418, 13, 11250, 1330, 17056, 198, 6738, 22890, 13, 27261, 9662, 1330, 35908, 8600, 198, 67...
3.2
150
#!/usr/bin/env python3 from PIL import Image if __name__ == '__main__': main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 6738, 350, 4146, 1330, 7412, 628, 628, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 220, 220, 1388, 3419, 198 ]
2.485714
35
"""Simple example to show how to use weave.inline on SWIG2 wrapped objects. SWIG2 refers to SWIG versions >= 1.3. To run this example you must build the trivial SWIG2 extension called swig2_ext. To do this you need to do something like this:: $ swig -c++ -python -I. -o swig2_ext_wrap.cxx swig2_ext.i $ g++ -Wall -O2 -I/usr/include/python2.3 -fPIC -I. -c \ -o swig2_ext_wrap.os swig2_ext_wrap.cxx $ g++ -shared -o _swig2_ext.so swig2_ext_wrap.os \ -L/usr/lib/python2.3/config The files swig2_ext.i and swig2_ext.h are included in the same directory that contains this file. Note that weave's SWIG2 support works fine whether SWIG_COBJECT_TYPES are used or not. Author: Prabhu Ramachandran Copyright (c) 2004, Prabhu Ramachandran License: BSD Style. """ # Import our SWIG2 wrapped library import swig2_ext import scipy.weave as weave from scipy.weave import swig2_spec, converters # SWIG2 support is not enabled by default. We do this by adding the # swig2 converter to the default list of converters. converters.default.insert(0, swig2_spec.swig2_converter()) def test(): """Instantiate the SWIG wrapped object and then call its method from C++ using weave.inline """ a = swig2_ext.A() b = swig2_ext.foo() # This will be an APtr instance. b.thisown = 1 # Prevent memory leaks. code = """a->f(); b->f(); """ weave.inline(code, ['a', 'b'], include_dirs=['.'], headers=['"swig2_ext.h"'], verbose=1) if __name__ == "__main__": test()
[ 37811, 26437, 1672, 284, 905, 703, 284, 779, 37982, 13, 45145, 319, 12672, 3528, 17, 12908, 198, 48205, 13, 220, 12672, 3528, 17, 10229, 284, 12672, 3528, 6300, 18189, 352, 13, 18, 13, 198, 198, 2514, 1057, 428, 1672, 345, 1276, 1382,...
2.53125
608
from wolframclient.language.expression import WLSymbol from nnDiff import * if __name__ == "__main__": exp = sys.argv[1:] if exp == []: exp = ["Sin", "x"] res = map(str,simplify(exp)) print(' '.join(res), file=sys.stderr)
[ 6738, 17481, 859, 16366, 13, 16129, 13, 38011, 1330, 370, 6561, 88, 23650, 198, 6738, 299, 77, 28813, 1330, 1635, 628, 198, 198, 361, 11593, 3672, 834, 6624, 366, 834, 12417, 834, 1298, 198, 220, 220, 220, 220, 198, 220, 220, 220, 1...
2.213675
117
from setuptools import setup setup( name='firetv', version='1.0.7', description='Communicate with an Amazon Fire TV device via ADB over a network.', url='https://github.com/happyleavesaoc/python-firetv/', license='MIT', author='happyleaves', author_email='happyleaves.tfr@gmail.com', packages=['firetv'], install_requires=['pycryptodome', 'rsa', 'adb-homeassistant', 'pure-python-adb-homeassistant'], extras_require={ 'firetv-server': ['Flask>=0.10.1', 'PyYAML>=3.12'] }, entry_points={ 'console_scripts': [ 'firetv-server = firetv.__main__:main' ] }, classifiers=[ 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3' ] )
[ 6738, 900, 37623, 10141, 1330, 9058, 198, 198, 40406, 7, 198, 220, 220, 220, 1438, 11639, 6495, 14981, 3256, 198, 220, 220, 220, 2196, 11639, 16, 13, 15, 13, 22, 3256, 198, 220, 220, 220, 6764, 11639, 30813, 5344, 351, 281, 6186, 37...
2.358127
363
""" neo.io have been split in 2 level API: * neo.io: this API give neo object * neo.rawio: this API give raw data as they are in files. Developper are encourage to use neo.rawio. When this is done the neo.io is done automagically with this king of following code. Author: sgarcia """ from neo.io.basefromrawio import BaseFromRaw from neo.rawio.examplerawio import ExampleRawIO
[ 37811, 198, 710, 78, 13, 952, 423, 587, 6626, 287, 362, 1241, 7824, 25, 198, 220, 1635, 19102, 13, 952, 25, 428, 7824, 1577, 19102, 2134, 198, 220, 1635, 19102, 13, 1831, 952, 25, 428, 7824, 1577, 8246, 1366, 355, 484, 389, 287, 3...
3.120968
124
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 198, 6738, 42625, 14208, 13, 9945, 1330, 15720, 602, 11, 4981, 628 ]
2.891892
37
from django import forms from django.utils.translation import gettext_lazy as _ COURSE_QUANTITY_CHOICES = [(i, str(i)) for i in range(1, 21)]
[ 6738, 42625, 14208, 1330, 5107, 198, 6738, 42625, 14208, 13, 26791, 13, 41519, 1330, 651, 5239, 62, 75, 12582, 355, 4808, 628, 198, 34, 11698, 5188, 62, 10917, 8643, 9050, 62, 44899, 34444, 796, 47527, 72, 11, 965, 7, 72, 4008, 329, ...
2.843137
51
"""Datasets of latent predictability tasks. """ from .pilgrimm import *
[ 37811, 27354, 292, 1039, 286, 41270, 4331, 1799, 8861, 13, 198, 37811, 198, 198, 6738, 764, 79, 346, 2164, 8608, 1330, 1635, 198 ]
3.173913
23
#!/usr/bin/env python # Copyright 2014 The Swarming Authors. All rights reserved. # Use of this source code is governed by the Apache v2.0 license that can be # found in the LICENSE file. import sys import unittest import test_env test_env.setup_test_env() from google.appengine.ext import ndb from components.datastore_utils import properties from support import test_case if __name__ == '__main__': if '-v' in sys.argv: unittest.TestCase.maxDiff = None unittest.main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 15069, 1946, 383, 2451, 18052, 46665, 13, 1439, 2489, 10395, 13, 198, 2, 5765, 286, 428, 2723, 2438, 318, 21825, 416, 262, 24843, 410, 17, 13, 15, 5964, 326, 460, 307, 198, 2, 1...
3.088608
158
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import copy from unittest import mock from keystoneauth1 import exceptions as ks_exc import netaddr from neutron_lib.api.definitions import qos from neutron_lib.callbacks import events from neutron_lib import constants as lib_constants from neutron_lib import context from neutron_lib import exceptions as lib_exc from neutron_lib.exceptions import placement as pl_exc from neutron_lib.exceptions import qos as qos_exc from neutron_lib.objects import utils as obj_utils from neutron_lib.plugins import constants as plugins_constants from neutron_lib.plugins import directory from neutron_lib.services.qos import constants as qos_consts from neutron_lib.utils import net as net_utils import os_resource_classes as orc from oslo_config import cfg from oslo_utils import uuidutils import webob.exc from neutron.exceptions import qos as neutron_qos_exc from neutron.extensions import qos_pps_minimum_rule_alias from neutron.extensions import qos_rules_alias from neutron import manager from neutron.objects import network as network_object from neutron.objects import ports as ports_object from neutron.objects.qos import policy as policy_object from neutron.objects.qos import rule as rule_object from neutron.services.qos import qos_plugin from neutron.tests.unit.db import test_db_base_plugin_v2 from neutron.tests.unit.services.qos import base DB_PLUGIN_KLASS = 'neutron.db.db_base_plugin_v2.NeutronDbPluginV2' SERVICE_PLUGIN_KLASS = 'neutron.services.qos.qos_plugin.QoSPlugin' class QoSRuleAliasTestExtensionManager(object): class QoSRuleAliasMinimumPacketRateTestExtensionManager(object): class TestQoSRuleAlias(test_db_base_plugin_v2.NeutronDbPluginV2TestCase): def test_show_non_existing_rule(self): for rule_type, rule_object_class in self.rule_objects.items(): rule_id = uuidutils.generate_uuid() with mock.patch('neutron.objects.qos.rule.QosRule.get_object', return_value=None): resource = '%s/alias-%s-rules' % (qos.ALIAS, rule_type.replace('_', '-')) request = self.new_show_request(resource, rule_id, self.fmt) res = request.get_response(self.ext_api) self.assertEqual(webob.exc.HTTPNotFound.code, res.status_int) class TestQoSRuleAliasMinimumPacketRate(TestQoSRuleAlias): class TestQosPluginDB(base.BaseQosTestCase): PORT_ID = 'f02f160e-1612-11ec-b2b8-bf60ab98186c' QOS_MIN_BW_RULE_ID = '8bf8eb46-160e-11ec-8024-9f96be32099d' # uuid -v5 f02f160e-1612-11ec-b2b8-bf60ab98186c # 8bf8eb46-160e-11ec-8024-9f96be32099d MIN_BW_REQUEST_GROUP_UUID = 'c8bc1b27-59a1-5135-aa33-aeecad6093f4' MIN_BW_RP = 'd7bea120-1626-11ec-9148-c32debfcf0f6' QOS_MIN_PPS_RULE_ID = '6ac5db7e-1626-11ec-8c7f-0b70dbb8a8eb' # uuid -v5 f02f160e-1612-11ec-b2b8-bf60ab98186c # 6ac5db7e-1626-11ec-8c7f-0b70dbb8a8eb MIN_PPS_REQUEST_GROUP_UUID = '995008f4-f120-547a-b051-428b89076067' MIN_PPS_RP = 'e16161f4-1626-11ec-a5a2-1fc9396e27cc'
[ 2, 220, 220, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 345, 743, 198, 2, 220, 220, 220, 407, 779, 428, 2393, 2845, 287, 11846, 351, 262, 13789, 13, 921, 743, 7330, 198, 2, 220, 220, ...
2.504492
1,447
import re import discord from redbot.core import commands
[ 11748, 302, 198, 198, 11748, 36446, 198, 6738, 2266, 13645, 13, 7295, 1330, 9729, 628 ]
4
15
# -*- coding: utf-8 -*- """ TencentBlueKing is pleased to support the open source community by making -(Bk-User) available. Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved. Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://opensource.org/licenses/MIT Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from bkuser_core.common.viewset import AdvancedListAPIView, AdvancedModelViewSet from . import serializers as local_serializers from .models import GeneralLog, LogIn, ResetPassword
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 24893, 1087, 14573, 15708, 318, 10607, 284, 1104, 262, 1280, 2723, 2055, 416, 1642, 532, 7, 33, 74, 12, 12982, 8, 1695, 13, 198, 15269, 357, 34, 8, 2177, ...
3.982063
223
import os import numpy as np import tensorflow as tf from models_gqa.model import Model from models_gqa.config import build_cfg_from_argparse from util.gqa_train.data_reader import DataReader import json # Load config cfg = build_cfg_from_argparse() # Start session os.environ["CUDA_VISIBLE_DEVICES"] = str(cfg.GPU_ID) sess = tf.Session(config=tf.ConfigProto( gpu_options=tf.GPUOptions(allow_growth=cfg.GPU_MEM_GROWTH))) # Data files imdb_file = cfg.IMDB_FILE % cfg.TEST.SPLIT_VQA scene_graph_file = cfg.SCENE_GRAPH_FILE % \ cfg.TEST.SPLIT_VQA.replace('_balanced', '').replace('_all', '') data_reader = DataReader( imdb_file, shuffle=False, one_pass=True, batch_size=cfg.TEST.BATCH_SIZE, T_encoder=cfg.T_ENCODER, vocab_question_file=cfg.VOCAB_QUESTION_FILE, vocab_answer_file=cfg.VOCAB_ANSWER_FILE, feature_type=cfg.FEAT_TYPE, spatial_feature_dir=cfg.SPATIAL_FEATURE_DIR, objects_feature_dir=cfg.OBJECTS_FEATURE_DIR, objects_max_num=cfg.W_FEAT, scene_graph_file=scene_graph_file, vocab_name_file=cfg.VOCAB_NAME_FILE, vocab_attr_file=cfg.VOCAB_ATTR_FILE, spatial_pos_enc_dim=cfg.SPATIAL_POS_ENC_DIM, bbox_tile_num=cfg.BBOX_TILE_NUM) num_vocab = data_reader.batch_loader.vocab_dict.num_vocab num_choices = data_reader.batch_loader.answer_dict.num_vocab # Inputs and model input_seq_batch = tf.placeholder(tf.int32, [None, None]) seq_length_batch = tf.placeholder(tf.int32, [None]) image_feat_batch = tf.placeholder( tf.float32, [None, cfg.H_FEAT, cfg.W_FEAT, cfg.D_FEAT]) image_valid_batch = tf.placeholder( tf.float32, [None, cfg.H_FEAT, cfg.W_FEAT]) model = Model( input_seq_batch, seq_length_batch, image_feat_batch, image_valid_batch, num_vocab=num_vocab, num_choices=num_choices, is_training=False) # Load snapshot if cfg.TEST.USE_EMA: ema = tf.train.ExponentialMovingAverage(decay=0.9) # decay doesn't matter var_names = { (ema.average_name(v) if v in model.params else v.op.name): v for v in tf.global_variables()} else: var_names = {v.op.name: v for v in tf.global_variables()} snapshot_file = cfg.TEST.SNAPSHOT_FILE % (cfg.EXP_NAME, cfg.TEST.ITER) print('loading model snapshot from %s' % snapshot_file) snapshot_saver = tf.train.Saver(var_names) snapshot_saver.restore(sess, snapshot_file) print('Done') # Write results result_dir = cfg.TEST.RESULT_DIR % (cfg.EXP_NAME, cfg.TEST.ITER) os.makedirs(result_dir, exist_ok=True) # Run test answer_correct, num_questions = 0, 0 if cfg.TEST.OUTPUT_VQA_EVAL_PRED: output_predictions = [] answer_word_list = data_reader.batch_loader.answer_dict.word_list pred_file = os.path.join( result_dir, 'gqa_eval_preds_%s_%s_%08d.json' % ( cfg.TEST.SPLIT_VQA, cfg.EXP_NAME, cfg.TEST.ITER)) for n_batch, batch in enumerate(data_reader.batches()): if 'answer_label_batch' not in batch: batch['answer_label_batch'] = -np.ones( len(batch['qid_list']), np.int32) if num_questions == 0: print('imdb has no answer labels. Using dummy labels.\n\n' '**The final accuracy will be zero (no labels provided)**\n') vqa_scores_value = sess.run(model.vqa_scores, feed_dict={ input_seq_batch: batch['input_seq_batch'], seq_length_batch: batch['seq_length_batch'], image_feat_batch: batch['image_feat_batch'], image_valid_batch: batch['image_valid_batch']}) # compute accuracy vqa_labels = batch['answer_label_batch'] vqa_predictions = np.argmax(vqa_scores_value, axis=1) answer_correct += np.sum(vqa_predictions == vqa_labels) num_questions += len(vqa_labels) accuracy = answer_correct / num_questions if n_batch % 20 == 0: print('exp: %s, iter = %d, accumulated accuracy on %s = %f (%d / %d)' % (cfg.EXP_NAME, cfg.TEST.ITER, cfg.TEST.SPLIT_VQA, accuracy, answer_correct, num_questions)) if cfg.TEST.OUTPUT_VQA_EVAL_PRED: output_predictions.extend([ {"questionId": qId, "prediction": answer_word_list[p]} for qId, p in zip(batch['qid_list'], vqa_predictions)]) with open(os.path.join( result_dir, 'vqa_results_%s.txt' % cfg.TEST.SPLIT_VQA), 'w') as f: print('\nexp: %s, iter = %d, final accuracy on %s = %f (%d / %d)' % (cfg.EXP_NAME, cfg.TEST.ITER, cfg.TEST.SPLIT_VQA, accuracy, answer_correct, num_questions)) print('exp: %s, iter = %d, final accuracy on %s = %f (%d / %d)' % (cfg.EXP_NAME, cfg.TEST.ITER, cfg.TEST.SPLIT_VQA, accuracy, answer_correct, num_questions), file=f) if cfg.TEST.OUTPUT_VQA_EVAL_PRED: with open(pred_file, 'w') as f: json.dump(output_predictions, f, indent=2) print('prediction file written to %s' % pred_file)
[ 11748, 28686, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 198, 6738, 4981, 62, 70, 20402, 13, 19849, 1330, 9104, 198, 6738, 4981, 62, 70, 20402, 13, 11250, 1330, 1382, 62, 37581, 62, 6738, 62, 8...
2.219954
2,155
from gamla import url_utils
[ 6738, 9106, 5031, 1330, 19016, 62, 26791, 628, 198 ]
3.333333
9
import numpy as np from netCDF4 import Dataset # Import development version of roppy import sys sys.path = ['..'] + sys.path import roppy # --- EDIT ----------------- # ROMS file romsfile = 'data/ocean_avg_example.nc' # Section definition lon0, lat0 = -0.67, 60.75 # Shetland lon1, lat1 = 4.72, 60.75 # Feie # --- EDIT ------------------ # Make a grid object f = Dataset(romsfile) grd = roppy.SGrid(f) # Get grid coordinates of end points x0, y0 = grd.ll2xy(lon0, lat0) x1, y1 = grd.ll2xy(lon1, lat1) # Find nearest rho-points i0, j0, i1, j1 = [int(round(v)) for v in x0, y0, x1, y1] # Make a Section object sec = roppy.linear_section(i0, i1, j0, j1, grd) # Read in a 3D temperature field temp = f.variables['temp'][0,:,:,:] # Interpolate to the section temp_sec = sec.sample3D(temp) # Compute mean temperature along section # using trapezoidal integration print "mean tempeature = ", np.sum(sec.Area * temp_sec) / np.sum(sec.Area) # TODO: Make a mean method in the Section class # Usage: sec.mean(temp_sec) # or even directly from 3D: sec.mean(temp)
[ 11748, 299, 32152, 355, 45941, 198, 6738, 2010, 34, 8068, 19, 1330, 16092, 292, 316, 198, 198, 2, 17267, 2478, 2196, 286, 686, 14097, 198, 11748, 25064, 198, 17597, 13, 6978, 796, 37250, 492, 20520, 1343, 25064, 13, 6978, 198, 11748, ...
2.55
420
#!/usr/bin/env python3 """ example of 3D scalar field If you get this error, ParaView doesn't know your data file format: TypeError: TestFileReadability argument %Id: %V """ from pathlib import Path import argparse import paraview.simple as pvs p = argparse.ArgumentParser() p.add_argument("fn", help="data file to load with paraview OpenDataFile()") P = p.parse_args() fn = Path(P.fn).expanduser() if not fn.is_file(): raise FileNotFoundError(fn) pvs.OpenDataFile(str(fn))
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 37811, 198, 20688, 286, 513, 35, 16578, 283, 2214, 198, 198, 1532, 345, 651, 428, 4049, 11, 2547, 64, 7680, 1595, 470, 760, 534, 1366, 2393, 5794, 25, 198, 6030, 12331, 25, 6208,...
2.852941
170
from django import forms from ...models import Language
[ 6738, 42625, 14208, 1330, 5107, 198, 198, 6738, 2644, 27530, 1330, 15417, 628 ]
4.461538
13
from django import forms from .models import * from server.models import *
[ 6738, 42625, 14208, 1330, 5107, 198, 198, 6738, 764, 27530, 1330, 1635, 198, 6738, 4382, 13, 27530, 1330, 1635, 198 ]
3.8
20
# # PySNMP MIB module InternetThruway-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/InternetThruway-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:58:27 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") ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") MibScalar, MibTable, MibTableRow, MibTableColumn, IpAddress, ObjectIdentity, Counter64, Gauge32, NotificationType, Bits, NotificationType, MibIdentifier, TimeTicks, enterprises, ModuleIdentity, iso, Integer32, Unsigned32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "IpAddress", "ObjectIdentity", "Counter64", "Gauge32", "NotificationType", "Bits", "NotificationType", "MibIdentifier", "TimeTicks", "enterprises", "ModuleIdentity", "iso", "Integer32", "Unsigned32", "Counter32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") nortel = MibIdentifier((1, 3, 6, 1, 4, 1, 562)) dialaccess = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14)) csg = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2)) system = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 1)) components = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 2)) traps = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 3)) alarms = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 4)) ncServer = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 5)) ss7 = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 6)) omData = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7)) disk = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1)) linkOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1)) maintenanceOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2)) callOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3)) trunkGroupOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4)) phoneNumberOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5)) systemOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6)) nasOMs = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7)) partitionTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1), ) if mibBuilder.loadTexts: partitionTable.setStatus('mandatory') if mibBuilder.loadTexts: partitionTable.setDescription('The PartitionTable contains information about each disk partition on the CSG') partitionTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "partitionIndex")) if mibBuilder.loadTexts: partitionTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: partitionTableEntry.setDescription('An entry in the PartitionTable. Indexed by partitionIndex') partitionIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))) if mibBuilder.loadTexts: partitionIndex.setStatus('mandatory') if mibBuilder.loadTexts: partitionIndex.setDescription('Identifies partition number.') partitionName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionName.setStatus('mandatory') if mibBuilder.loadTexts: partitionName.setDescription('Identifies partition name.') partitionPercentFull = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionPercentFull.setStatus('mandatory') if mibBuilder.loadTexts: partitionPercentFull.setDescription('Indicates (in Percent) how full the disk is.') partitionMegsFree = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionMegsFree.setStatus('mandatory') if mibBuilder.loadTexts: partitionMegsFree.setDescription('Indicates how many Megabytes are free on the partition.') partitionSpaceStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 5), PartitionSpaceStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionSpaceStatus.setStatus('mandatory') if mibBuilder.loadTexts: partitionSpaceStatus.setDescription('Indicates if there is currently a space alarm in progress.') partitionSpaceKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionSpaceKey.setStatus('mandatory') if mibBuilder.loadTexts: partitionSpaceKey.setDescription('Unique indicator for the partition space alarm.') partitionSpaceTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 1, 1, 1, 1, 7), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: partitionSpaceTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: partitionSpaceTimeStamp.setDescription('Indicates the time of the last partitionSpaceStatus transition.') componentTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10), ) if mibBuilder.loadTexts: componentTable.setStatus('mandatory') if mibBuilder.loadTexts: componentTable.setDescription('The ComponentTable contains information about all the Components that should be running on the CSG.') componentTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1), ).setIndexNames((0, "InternetThruway-MIB", "componentIndex")) if mibBuilder.loadTexts: componentTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: componentTableEntry.setDescription('An entry in the ComponentTable. componentTable entries are indexed by componentIndex, which is an integer. ') componentIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 1), ComponentIndex()) if mibBuilder.loadTexts: componentIndex.setStatus('mandatory') if mibBuilder.loadTexts: componentIndex.setDescription('Identifies the component entry with an enumerated list.') componentName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: componentName.setStatus('mandatory') if mibBuilder.loadTexts: componentName.setDescription('Identifies component name.') compSecsInCurrentState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compSecsInCurrentState.setStatus('mandatory') if mibBuilder.loadTexts: compSecsInCurrentState.setDescription('Indicates how many seconds a component has been running in its current state. ') compProvStateStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 4), ComponentSysmanState()).setMaxAccess("readonly") if mibBuilder.loadTexts: compProvStateStatus.setStatus('mandatory') if mibBuilder.loadTexts: compProvStateStatus.setDescription('Indicates the current state of the particular CSG component. The states are one of the following: inProvisionedState(1), notInProvisionedState(2), unknown(3)') compProvStateKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compProvStateKey.setStatus('mandatory') if mibBuilder.loadTexts: compProvStateKey.setDescription('Unique indicator for the prov state alarm.') compProvStateTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: compProvStateTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: compProvStateTimeStamp.setDescription('Indicates the time of the last state transition.') compDebugStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compDebugStatus.setStatus('mandatory') if mibBuilder.loadTexts: compDebugStatus.setDescription('Shows if the component is running with debug on.') compDebugKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compDebugKey.setStatus('mandatory') if mibBuilder.loadTexts: compDebugKey.setDescription('Unique indicator for the debug state.') compDebugTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 9), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: compDebugTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: compDebugTimeStamp.setDescription('Indicates the time of the last debug transition.') compRestartStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compRestartStatus.setStatus('mandatory') if mibBuilder.loadTexts: compRestartStatus.setDescription('Shows if the component has had multiple restarts recently.') compRestartKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: compRestartKey.setStatus('mandatory') if mibBuilder.loadTexts: compRestartKey.setDescription('Unique indicator for the multi-restart of components.') compRestartTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 2, 10, 1, 12), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: compRestartTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: compRestartTimeStamp.setDescription('Indicates the time of the last restart flagging.') linksetTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1), ) if mibBuilder.loadTexts: linksetTable.setStatus('mandatory') if mibBuilder.loadTexts: linksetTable.setDescription('The linksetTable contains information about all the linksets on the CSG.') linksetTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "linksetIndex")) if mibBuilder.loadTexts: linksetTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: linksetTableEntry.setDescription('An entry in the linksetTable. Entries in the linkset table are indexed by linksetIndex, which is an integer.') linksetIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: linksetIndex.setStatus('mandatory') if mibBuilder.loadTexts: linksetIndex.setDescription("Identifies the n'th position in the table.") linksetId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linksetId.setStatus('mandatory') if mibBuilder.loadTexts: linksetId.setDescription('The id of the linkset to be used as index.') linksetAdjPointcode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linksetAdjPointcode.setStatus('mandatory') if mibBuilder.loadTexts: linksetAdjPointcode.setDescription('The adjacent pointcode of the linkset.') linksetState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 1, 1, 4), LinksetState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linksetState.setStatus('mandatory') if mibBuilder.loadTexts: linksetState.setDescription('The state of the linkset.') linkTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2), ) if mibBuilder.loadTexts: linkTable.setStatus('mandatory') if mibBuilder.loadTexts: linkTable.setDescription('The linkTable contains information about the links in a given linkset on the CSG.') linkTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1), ).setIndexNames((0, "InternetThruway-MIB", "linksetIndex"), (0, "InternetThruway-MIB", "linkIndex")) if mibBuilder.loadTexts: linkTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: linkTableEntry.setDescription('An entry in the linkTable. Entries in the link table table are indexed by linksetIndex and linkIndex, which are both integers.') linkIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 1), Integer32()) if mibBuilder.loadTexts: linkIndex.setStatus('mandatory') if mibBuilder.loadTexts: linkIndex.setDescription("Identifies the n'th position in the table.") linkId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkId.setStatus('mandatory') if mibBuilder.loadTexts: linkId.setDescription('The id of the link.') linkHostname = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkHostname.setStatus('mandatory') if mibBuilder.loadTexts: linkHostname.setDescription('The hostname of the CSG to which this link is attached.') linkCardDeviceName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkCardDeviceName.setStatus('mandatory') if mibBuilder.loadTexts: linkCardDeviceName.setDescription('The device name of the card upon which this link is hosted.') linkState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 5), LinkState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkState.setStatus('mandatory') if mibBuilder.loadTexts: linkState.setDescription('The state of the link.') linkInhibitionState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 6), LinkInhibitionState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkInhibitionState.setStatus('mandatory') if mibBuilder.loadTexts: linkInhibitionState.setDescription('The inhibition status of the link.') linkCongestionState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 7), LinkCongestionState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkCongestionState.setStatus('mandatory') if mibBuilder.loadTexts: linkCongestionState.setDescription('The congestion status of the link.') linkAlignmentState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 8), LinkAlignmentState()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignmentState.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignmentState.setDescription('The alignment status of the link.') linkNumMSUReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumMSUReceived.setStatus('mandatory') if mibBuilder.loadTexts: linkNumMSUReceived.setDescription("This object supplies the number of MSU's received by the link.") linkNumMSUDiscarded = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumMSUDiscarded.setStatus('mandatory') if mibBuilder.loadTexts: linkNumMSUDiscarded.setDescription("This object supplies the number of received MSU's discarded by the link.") linkNumMSUTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumMSUTransmitted.setStatus('mandatory') if mibBuilder.loadTexts: linkNumMSUTransmitted.setDescription("This object supplies the number of MSU's transmitted by the link.") linkNumSIFReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumSIFReceived.setStatus('mandatory') if mibBuilder.loadTexts: linkNumSIFReceived.setDescription('This object supplies the number of SIF and SIO octets received by the link.') linkNumSIFTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumSIFTransmitted.setStatus('mandatory') if mibBuilder.loadTexts: linkNumSIFTransmitted.setDescription('This object supplies the number of SIF and SIO octects transmitted by the link.') linkNumAutoChangeovers = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumAutoChangeovers.setStatus('mandatory') if mibBuilder.loadTexts: linkNumAutoChangeovers.setDescription('This object supplies the number of automatic changeovers undergone by the link.') linkNumUnexpectedMsgs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 2, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkNumUnexpectedMsgs.setStatus('mandatory') if mibBuilder.loadTexts: linkNumUnexpectedMsgs.setDescription('This object supplies the number of unexpected messages received by the link.') routeTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3), ) if mibBuilder.loadTexts: routeTable.setStatus('mandatory') if mibBuilder.loadTexts: routeTable.setDescription('The routeTable contains information about the routes provisioned in the CSG complex.') routeTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1), ).setIndexNames((0, "InternetThruway-MIB", "routeIndex")) if mibBuilder.loadTexts: routeTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: routeTableEntry.setDescription('An entry in the routeTable. Entries in the route table are indexed by routeIndex, which is an integer.') routeIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 1), Integer32()) if mibBuilder.loadTexts: routeIndex.setStatus('mandatory') if mibBuilder.loadTexts: routeIndex.setDescription("Identifies the n'th position in the table.") routeId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeId.setStatus('mandatory') if mibBuilder.loadTexts: routeId.setDescription('The unique identifier of the route.') routeDestPointCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeDestPointCode.setStatus('mandatory') if mibBuilder.loadTexts: routeDestPointCode.setDescription('The destination point code associated with this route.') routeState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 4), RouteState()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeState.setStatus('mandatory') if mibBuilder.loadTexts: routeState.setDescription('The current state of the route.') routeRank = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeRank.setStatus('mandatory') if mibBuilder.loadTexts: routeRank.setDescription('Rank assigned to this route.') routeLinksetId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 3, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: routeLinksetId.setStatus('mandatory') if mibBuilder.loadTexts: routeLinksetId.setDescription('The linkset associated with this route.') destinationTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4), ) if mibBuilder.loadTexts: destinationTable.setStatus('mandatory') if mibBuilder.loadTexts: destinationTable.setDescription('The destinationTable contains information about the destinations provisioned in the CSG complex.') destinationTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1), ).setIndexNames((0, "InternetThruway-MIB", "destIndex")) if mibBuilder.loadTexts: destinationTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: destinationTableEntry.setDescription('An entry in the destinationTable. Entries in the destination table are indexed by destIndex, which is an integer.') destIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1, 1), Integer32()) if mibBuilder.loadTexts: destIndex.setStatus('mandatory') if mibBuilder.loadTexts: destIndex.setDescription("Identifies the n'th position in the table.") destPointCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destPointCode.setStatus('mandatory') if mibBuilder.loadTexts: destPointCode.setDescription('The destination point code of this destination.') destState = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1, 3), DestinationState()).setMaxAccess("readonly") if mibBuilder.loadTexts: destState.setStatus('mandatory') if mibBuilder.loadTexts: destState.setDescription('The current state of the destination.') destRuleId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 6, 4, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: destRuleId.setStatus('mandatory') if mibBuilder.loadTexts: destRuleId.setDescription('Rule Identifier (for the routing table to be used) for this destination.') ncServerId = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncServerId.setStatus('mandatory') if mibBuilder.loadTexts: ncServerId.setDescription(' The ServerId attribute value of the node.') ncServerName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncServerName.setStatus('mandatory') if mibBuilder.loadTexts: ncServerName.setDescription(' The ServerName attribute value of the node.') ncHostName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncHostName.setStatus('mandatory') if mibBuilder.loadTexts: ncHostName.setDescription(' The HostName attribute value of the node.') ncEthernetName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncEthernetName.setStatus('mandatory') if mibBuilder.loadTexts: ncEthernetName.setDescription(' The EthernetName attribute value of the node.') ncEthernetIP = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 6), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncEthernetIP.setStatus('mandatory') if mibBuilder.loadTexts: ncEthernetIP.setDescription(' The EthernetIP attribute value of the node.') ncClusterName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncClusterName.setStatus('mandatory') if mibBuilder.loadTexts: ncClusterName.setDescription(' The ClusterName attribute value of the node.') ncClusterIP = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncClusterIP.setStatus('mandatory') if mibBuilder.loadTexts: ncClusterIP.setDescription(' The ClusterIP attribute value of the node.') ncOperationalState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncOperationalState.setStatus('mandatory') if mibBuilder.loadTexts: ncOperationalState.setDescription(' The OperationalState of the node. Possible values are: UNKNOWN, ENABLED, ENABLED_NETDSC, ENABLED_NETPAR, DISABLED ') ncStandbyState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncStandbyState.setStatus('mandatory') if mibBuilder.loadTexts: ncStandbyState.setDescription(' The StandbyState attribute value of the node. Possible values are: UNKNOWN, HOT_STANDBY, COLD_STANDBY, WARM_STANDBY, PROVIDING_SERVICE ') ncAvailabilityState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 11), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncAvailabilityState.setStatus('mandatory') if mibBuilder.loadTexts: ncAvailabilityState.setDescription(' The AvailabilityState attribute value of the node. Possible values are: UNKNOWN, AVAILABLE, DEGRADED, OFFLINE ') ncSoftwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 12), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncSoftwareVersion.setStatus('mandatory') if mibBuilder.loadTexts: ncSoftwareVersion.setDescription(' The SoftwareVersion attribute value of the node.') ncUpgradeInProgress = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 13), UpgradeInProgress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ncUpgradeInProgress.setStatus('mandatory') if mibBuilder.loadTexts: ncUpgradeInProgress.setDescription(' The UpgradeInProgress attribute value of the node. Possible values are: 0 = UNKNOWN, 1 = ACTIVE, 2 = INACTIVE ') hgAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10), ) if mibBuilder.loadTexts: hgAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: hgAlarmTable.setDescription('The HgAlarmTable contains information about all the current HG alarms') hgAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1), ).setIndexNames((0, "InternetThruway-MIB", "hgIndex")) if mibBuilder.loadTexts: hgAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: hgAlarmTableEntry.setDescription('An entry in the HgAlarmTable. HgAlarmTable entries are indexed by componentIndex, which is an integer.') hgIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 1), Integer32()) if mibBuilder.loadTexts: hgIndex.setStatus('mandatory') if mibBuilder.loadTexts: hgIndex.setDescription("Identifies the n'th position in the table.") hgName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hgName.setStatus('mandatory') if mibBuilder.loadTexts: hgName.setDescription('The Home gateway to be used as index') hgKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hgKey.setStatus('mandatory') if mibBuilder.loadTexts: hgKey.setDescription('Unique identifier for the HgFailure alarm ') hgAlarmTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 4), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hgAlarmTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: hgAlarmTimeStamp.setDescription('Indicates the time of the HG Alarm.') hgIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 10, 1, 5), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: hgIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: hgIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') nasAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11), ) if mibBuilder.loadTexts: nasAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: nasAlarmTable.setDescription('The NasAlarmTable contains information about all the current NAS alarms') nasAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1), ).setIndexNames((0, "InternetThruway-MIB", "nasIndex")) if mibBuilder.loadTexts: nasAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: nasAlarmTableEntry.setDescription('An entry in the NasAlarmTable. NasAlarmTable entries are indexed by nasIndex, which is an integer.') nasIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 1), Integer32()) if mibBuilder.loadTexts: nasIndex.setStatus('mandatory') if mibBuilder.loadTexts: nasIndex.setDescription("Identifies the n'th position in the table.") nasName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasName.setStatus('mandatory') if mibBuilder.loadTexts: nasName.setDescription('The NAS Name') nasKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasKey.setStatus('mandatory') if mibBuilder.loadTexts: nasKey.setDescription('Unique identifier for the NAS Failure alarm ') nasAlarmTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 4), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasAlarmTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: nasAlarmTimeStamp.setDescription('Indicates the time of the NAS Alarm.') nasIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 5), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: nasIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') nasCmplxName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 11, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCmplxName.setStatus('mandatory') if mibBuilder.loadTexts: nasCmplxName.setDescription(' The complex which this alarm is raised against.') ss7LinkFailureAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12), ) if mibBuilder.loadTexts: ss7LinkFailureAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkFailureAlarmTable.setDescription('The SS7LinkFailureAlarmTable contains alarms for SS7 link failures.') ss7LinkFailureAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1), ).setIndexNames((0, "InternetThruway-MIB", "lfIndex")) if mibBuilder.loadTexts: ss7LinkFailureAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkFailureAlarmTableEntry.setDescription('This object defines a row within the SS7 Link Failure Alarm Table. A row can be uniquely identified with the row index.') lfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 1), Integer32()) if mibBuilder.loadTexts: lfIndex.setStatus('mandatory') if mibBuilder.loadTexts: lfIndex.setDescription('Identifies the row number in the table.') lfKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfKey.setStatus('mandatory') if mibBuilder.loadTexts: lfKey.setDescription('Unique identifier for the alarm.') lfIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: lfIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') lfLinkCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfLinkCode.setStatus('mandatory') if mibBuilder.loadTexts: lfLinkCode.setDescription('This object identifies the signalling link code (SLC) of the failed link.') lfTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: lfTimeStamp.setDescription('Indicates the time of the alarm.') lfName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfName.setStatus('mandatory') if mibBuilder.loadTexts: lfName.setDescription('Indicates the configured name for the machine which sent the alarm.') lfCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfCardId.setStatus('mandatory') if mibBuilder.loadTexts: lfCardId.setDescription('This object identifies the device that hosts the failed link. It provides a physical description of the device, as well as its slot number.') lfLinkSet = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 12, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lfLinkSet.setStatus('mandatory') if mibBuilder.loadTexts: lfLinkSet.setDescription('This object identifies the linkset associated with the link via its adjacent point code.') ss7LinkCongestionAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13), ) if mibBuilder.loadTexts: ss7LinkCongestionAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkCongestionAlarmTable.setDescription('The SS7LinkCongestionAlarmTable contains alarms to indicate congestion on an SS7 link.') ss7LinkCongestionAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1), ).setIndexNames((0, "InternetThruway-MIB", "lcIndex")) if mibBuilder.loadTexts: ss7LinkCongestionAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkCongestionAlarmTableEntry.setDescription('This object defines a row within the SS7 Link Congestion Alarm Table. A row can be uniquely identified with the row index.') lcIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 1), Integer32()) if mibBuilder.loadTexts: lcIndex.setStatus('mandatory') if mibBuilder.loadTexts: lcIndex.setDescription('Identifies the row number in the table.') lcKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcKey.setStatus('mandatory') if mibBuilder.loadTexts: lcKey.setDescription('Unique identifier for the alarm.') lcIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: lcIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') lcLinkCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcLinkCode.setStatus('mandatory') if mibBuilder.loadTexts: lcLinkCode.setDescription('This object identifies the signalling link code (SLC) of the affected link.') lcTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 5), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: lcTimeStamp.setDescription('Indicates the time of the alarm.') lcName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcName.setStatus('mandatory') if mibBuilder.loadTexts: lcName.setDescription('Indicates the configured name for the machine which sent the alarm.') lcCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcCardId.setStatus('mandatory') if mibBuilder.loadTexts: lcCardId.setDescription('This object identifies the device that hosts the failed link. It provides a physical description of the device, as well as its slot number.') lcLinkSet = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 13, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lcLinkSet.setStatus('mandatory') if mibBuilder.loadTexts: lcLinkSet.setDescription('This object identifies the linkset associated with the link via its adjacent point code.') ss7ISUPFailureAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14), ) if mibBuilder.loadTexts: ss7ISUPFailureAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7ISUPFailureAlarmTable.setDescription('The SS7ISUPFailureAlarmTable contains alarms for SS7 ISUP protocol stack failures.') ss7ISUPFailureAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1), ).setIndexNames((0, "InternetThruway-MIB", "ifIndex")) if mibBuilder.loadTexts: ss7ISUPFailureAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7ISUPFailureAlarmTableEntry.setDescription('This object defines a row within the SS7 ISUP Failure Alarm Table. A row can be uniquely identified with the row index.') ifIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 1), Integer32()) if mibBuilder.loadTexts: ifIndex.setStatus('mandatory') if mibBuilder.loadTexts: ifIndex.setDescription('Identifies the row number in the table.') ifKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifKey.setStatus('mandatory') if mibBuilder.loadTexts: ifKey.setDescription('Unique identifier for the alarm.') ifIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: ifIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') ifTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 4), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: ifTimeStamp.setDescription('Indicates the time of the alarm.') ifName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 14, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ifName.setStatus('mandatory') if mibBuilder.loadTexts: ifName.setDescription('Indicates the configured name for the machine which sent the alarm.') ss7ISUPCongestionAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15), ) if mibBuilder.loadTexts: ss7ISUPCongestionAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7ISUPCongestionAlarmTable.setDescription('The SS7ISUPCongestionAlarmTable contains alarms to indicate congestion with an ISUP protocol stack.') ss7ISUPCongestionAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1), ).setIndexNames((0, "InternetThruway-MIB", "icIndex")) if mibBuilder.loadTexts: ss7ISUPCongestionAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7ISUPCongestionAlarmTableEntry.setDescription('This object defines a row within the SS7 ISUP Congestion Alarm Table. A row can be uniquely identified with the row index.') icIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 1), Integer32()) if mibBuilder.loadTexts: icIndex.setStatus('mandatory') if mibBuilder.loadTexts: icIndex.setDescription('Identifies the row number in the table.') icKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icKey.setStatus('mandatory') if mibBuilder.loadTexts: icKey.setDescription('Unique identifier for the alarm.') icIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: icIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: icIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') icCongestionLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: icCongestionLevel.setStatus('mandatory') if mibBuilder.loadTexts: icCongestionLevel.setDescription('This object indicates the congestion level with an ISUP protocol stack. Possible congestion levels are: (0) Normal (1) Congestion ') icTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 5), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: icTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: icTimeStamp.setDescription('Indicates the time of the alarm.') icName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 15, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: icName.setStatus('mandatory') if mibBuilder.loadTexts: icName.setDescription('Indicates the configured name for the machine which sent the alarm.') ss7MTP3CongestionAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16), ) if mibBuilder.loadTexts: ss7MTP3CongestionAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7MTP3CongestionAlarmTable.setDescription('The SS7MTP3CongestionAlarmTable contains alarms to indicate congestion on an MTP3 link.') ss7MTP3CongestionAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1), ).setIndexNames((0, "InternetThruway-MIB", "mtp3Index")) if mibBuilder.loadTexts: ss7MTP3CongestionAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7MTP3CongestionAlarmTableEntry.setDescription('This object defines a row within the SS7 MTP3 Congestion Alarm Table. A row can be uniquely identified with the row index.') mtp3Index = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 1), Integer32()) if mibBuilder.loadTexts: mtp3Index.setStatus('mandatory') if mibBuilder.loadTexts: mtp3Index.setDescription('Identifies the row number in the table.') mtp3Key = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3Key.setStatus('mandatory') if mibBuilder.loadTexts: mtp3Key.setDescription('Unique identifier for the alarm.') mtp3IPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3IPAddress.setStatus('mandatory') if mibBuilder.loadTexts: mtp3IPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') mtp3CongestionLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3CongestionLevel.setStatus('mandatory') if mibBuilder.loadTexts: mtp3CongestionLevel.setDescription('This object indicates the congestion level on a problem SS7 Link. Possible congestion values are: (0) Normal (1) Minor (2) Major (3) Critical ') mtp3TimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 5), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3TimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: mtp3TimeStamp.setDescription('Indicates the time of the alarm.') mtp3Name = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 16, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp3Name.setStatus('mandatory') if mibBuilder.loadTexts: mtp3Name.setDescription('Represents the configured name of the machine which sent the alarm.') ss7MTP2TrunkFailureAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17), ) if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarmTable.setDescription('The SS7MTP2TrunkFailureAlarmTable contains alarms to indicate MTP2 trunk failures.') ss7MTP2TrunkFailureAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1), ).setIndexNames((0, "InternetThruway-MIB", "mtp2Index")) if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarmTableEntry.setDescription('This object defines a row within the SS7 MTP2 Failure Alarm Table. A row can be uniquely identified with the row index.') mtp2Index = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 1), Integer32()) if mibBuilder.loadTexts: mtp2Index.setStatus('mandatory') if mibBuilder.loadTexts: mtp2Index.setDescription('Identifies the row number in the table.') mtp2Key = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2Key.setStatus('mandatory') if mibBuilder.loadTexts: mtp2Key.setDescription('Unique identifier for the alarm.') mtp2IPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2IPAddress.setStatus('mandatory') if mibBuilder.loadTexts: mtp2IPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') mtp2Name = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2Name.setStatus('mandatory') if mibBuilder.loadTexts: mtp2Name.setDescription('This object identifies the configured name of the machine which sent the alarm.') mtp2CardId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2CardId.setStatus('mandatory') if mibBuilder.loadTexts: mtp2CardId.setDescription('This object indicates the device upon which the affected trunk is hosted. The string contains a physical description of the device, as well as its slot number.') mtp2AlarmCondition = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 6), MTP2AlarmConditionType()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2AlarmCondition.setStatus('mandatory') if mibBuilder.loadTexts: mtp2AlarmCondition.setDescription('This object indicates which of the possible alarm conditions is in effect. Alarms are not nested: a new alarm is only reported if there is no current alarm condition.') mtp2TimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 17, 1, 7), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mtp2TimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: mtp2TimeStamp.setDescription('Indicates the time of the alarm.') ss7LinksetFailureAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18), ) if mibBuilder.loadTexts: ss7LinksetFailureAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinksetFailureAlarmTable.setDescription('The SS7LinksetFailureAlarmTable contains alarms to indicate failure on an CSG linkset.') ss7LinksetFailureAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1), ).setIndexNames((0, "InternetThruway-MIB", "lsFailureIndex")) if mibBuilder.loadTexts: ss7LinksetFailureAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinksetFailureAlarmTableEntry.setDescription('This object defines a row within the SS7 Linkset Failure Alarm Table. A row can be uniquely identified with the row index.') lsFailureIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 1), Integer32()) if mibBuilder.loadTexts: lsFailureIndex.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureIndex.setDescription('Identifies the row number in the table.') lsFailureKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailureKey.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureKey.setDescription('Unique identifier for the alarm.') lsFailureIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailureIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') lsFailureName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailureName.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureName.setDescription('Represents the configured name of the machine which sent the alarm.') lsFailurePointcode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailurePointcode.setStatus('mandatory') if mibBuilder.loadTexts: lsFailurePointcode.setDescription('This object indicates the pointcode associated with the linkset.') lsFailureTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 18, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsFailureTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: lsFailureTimeStamp.setDescription('Indicates the time of the alarm.') ss7DestinationInaccessibleAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19), ) if mibBuilder.loadTexts: ss7DestinationInaccessibleAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7DestinationInaccessibleAlarmTable.setDescription('The SS7DestinationAccessAlarmTable contains alarms which indicate inaccessible signalling destinations.') ss7DestinationInaccessibleAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1), ).setIndexNames((0, "InternetThruway-MIB", "destInaccessIndex")) if mibBuilder.loadTexts: ss7DestinationInaccessibleAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7DestinationInaccessibleAlarmTableEntry.setDescription('This object defines a row within the SS7 Destination Inaccessible Alarm Table. A row can be uniquely identified with the row index.') destInaccessIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 1), Integer32()) if mibBuilder.loadTexts: destInaccessIndex.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessIndex.setDescription('Identifies the row number in the table.') destInaccessKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessKey.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessKey.setDescription('Unique identifier for the alarm.') destInaccessIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') destInaccessName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessName.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessName.setDescription('Represents the configured name of the machine which sent the alarm.') destInaccessPointcode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessPointcode.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessPointcode.setDescription('This object indicates the point code of the inaccessible signalling destination.') destInaccessTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 19, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destInaccessTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: destInaccessTimeStamp.setDescription('Indicates the time of the alarm.') ss7DestinationCongestedAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20), ) if mibBuilder.loadTexts: ss7DestinationCongestedAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7DestinationCongestedAlarmTable.setDescription('The SS7DestinationCongestedAlarmTable contains alarms to indicate congestion on the given destination.') ss7DestinationCongestedAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1), ).setIndexNames((0, "InternetThruway-MIB", "destCongestIndex")) if mibBuilder.loadTexts: ss7DestinationCongestedAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7DestinationCongestedAlarmTableEntry.setDescription('This object defines a row within the SS7 Destination Congestion Table. A row can be uniquely identified with the row index.') destCongestIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 1), Integer32()) if mibBuilder.loadTexts: destCongestIndex.setStatus('mandatory') if mibBuilder.loadTexts: destCongestIndex.setDescription('Identifies the row number in the table.') destCongestKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestKey.setStatus('mandatory') if mibBuilder.loadTexts: destCongestKey.setDescription('Unique identifier for the alarm.') destCongestIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: destCongestIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') destCongestName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestName.setStatus('mandatory') if mibBuilder.loadTexts: destCongestName.setDescription('Represents the configured name of the machine which sent the alarm.') destCongestPointcode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestPointcode.setStatus('mandatory') if mibBuilder.loadTexts: destCongestPointcode.setDescription('This object indicates the pointcode of the congested destination.') destCongestCongestionLevel = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestCongestionLevel.setStatus('mandatory') if mibBuilder.loadTexts: destCongestCongestionLevel.setDescription('This object indicates the congestion level on a problem SS7 pointcode. Possible congestion values are: (0) Normal (1) Minor (2) Major (3) Critical ') destCongestTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 20, 1, 7), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: destCongestTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: destCongestTimeStamp.setDescription('Indicates the time of the alarm.') ss7LinkAlignmentAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21), ) if mibBuilder.loadTexts: ss7LinkAlignmentAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkAlignmentAlarmTable.setDescription('The SS7LinkAlignmentAlarmTable contains alarms to indicate congestion on the CSG.') ss7LinkAlignmentAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1), ).setIndexNames((0, "InternetThruway-MIB", "linkAlignIndex")) if mibBuilder.loadTexts: ss7LinkAlignmentAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: ss7LinkAlignmentAlarmTableEntry.setDescription('This object defines a row within the SS7 Link Alignment Alarm Table. A row can be uniquely identified with the row index.') linkAlignIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 1), Integer32()) if mibBuilder.loadTexts: linkAlignIndex.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignIndex.setDescription('Identifies the row number in the table.') linkAlignKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignKey.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignKey.setDescription('Unique identifier for the alarm.') linkAlignIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignIPAddress.setDescription('This object identifies the IP Address of the machine which sent the alarm.') linkAlignName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignName.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignName.setDescription('Represents the configured name of the machine which sent the alarm.') linkAlignLinkCode = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignLinkCode.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignLinkCode.setDescription('This object identifies the signalling link code (SLC) of the affected link.') linkAlignTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 6), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignTimeStamp.setDescription('Indicates the time of the alarm.') linkAlignCardId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignCardId.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignCardId.setDescription('This object identifies the device that hosts the failed link. It provides a physical description of the device, as well as its slot number.') linkAlignLinkSet = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 21, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkAlignLinkSet.setStatus('mandatory') if mibBuilder.loadTexts: linkAlignLinkSet.setDescription('This object identifies the linkset associated with the link via its adjacent point code.') csgComplexStateTrapInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22)) cplxName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxName.setStatus('mandatory') if mibBuilder.loadTexts: cplxName.setDescription('CLLI, A unique identifier of the CSG Complex.') cplxLocEthernetName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocEthernetName.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocEthernetName.setDescription(' The EthernetName attribute value of the node.') cplxLocEthernetIP = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocEthernetIP.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocEthernetIP.setDescription(' The EthernetIP attribute value of the node.') cplxLocOperationalState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocOperationalState.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocOperationalState.setDescription(' The OperationalState of the node. Possible values are: UNKNOWN, ENABLED, ENABLED_NETDSC, ENABLED_NETPAR, DISABLED ') cplxLocStandbyState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocStandbyState.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocStandbyState.setDescription(' The StandbyState attribute value of the node. Possible values are: UNKNOWN, HOT_STANDBY, COLD_STANDBY, WARM_STANDBY, PROVIDING_SERVICE ') cplxLocAvailabilityState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxLocAvailabilityState.setStatus('mandatory') if mibBuilder.loadTexts: cplxLocAvailabilityState.setDescription(' The AvailabilityState attribute value of the node. Possible values are: UNKNOWN, AVAILABLE, DEGRADED, OFFLINE ') cplxMateEthernetName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateEthernetName.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateEthernetName.setDescription(' The EthernetName attribute value of the mate node.') cplxMateEthernetIP = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateEthernetIP.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateEthernetIP.setDescription(' The EthernetIP attribute value of the mate node.') cplxMateOperationalState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateOperationalState.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateOperationalState.setDescription(' The OperationalState of the mate node. Possible values are: UNKNOWN, ENABLED, ENABLED_NETDSC, ENABLED_NETPAR, DISABLED ') cplxMateStandbyState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateStandbyState.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateStandbyState.setDescription(' The StandbyState attribute value of the mate node. Possible values are: UNKNOWN, HOT_STANDBY, COLD_STANDBY, WARM_STANDBY, PROVIDING_SERVICE ') cplxMateAvailabilityState = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 11), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxMateAvailabilityState.setStatus('mandatory') if mibBuilder.loadTexts: cplxMateAvailabilityState.setDescription(' The AvailabilityState attribute value of the mate node. Possible values are: UNKNOWN, AVAILABLE, DEGRADED, OFFLINE ') cplxAlarmStatus = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 22, 12), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cplxAlarmStatus.setStatus('mandatory') if mibBuilder.loadTexts: cplxAlarmStatus.setDescription('This object indicates the alarm status of the CSG Complex. Possible status are: NORMAL, MAJOR, CRITICAL ') lostServerAlarmTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1), ) if mibBuilder.loadTexts: lostServerAlarmTable.setStatus('mandatory') if mibBuilder.loadTexts: lostServerAlarmTable.setDescription('') lostServerAlarmTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "lsIndex")) if mibBuilder.loadTexts: lostServerAlarmTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: lostServerAlarmTableEntry.setDescription('This object defines a row within the Lost Server Alarm Table. A row can be uniquely identified with the row index.') lsIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: lsIndex.setStatus('mandatory') if mibBuilder.loadTexts: lsIndex.setDescription('Identifies the row number in the table.') lsKey = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsKey.setStatus('mandatory') if mibBuilder.loadTexts: lsKey.setDescription('Unique identifier for the alarm.') lsIPAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: lsIPAddress.setDescription('This object identifies the IP Address of the machine which is lost.') lsName = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsName.setStatus('mandatory') if mibBuilder.loadTexts: lsName.setDescription('The configured name associated with the IP Address of the machine which sent the alarm.') lsTimeStamp = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 5, 1, 1, 5), TimeString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lsTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: lsTimeStamp.setDescription('Indicates the time of the alarm.') alarmMaskInt1 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 1), Gauge32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: alarmMaskInt1.setStatus('mandatory') if mibBuilder.loadTexts: alarmMaskInt1.setDescription('The value of this bit mask reflects the current filtering policy of CSG events and alarms. Management stations which wish to not receive certain events or alarm types from the CSG can modify this value as needed. Note, however, that changes in the filtration policy affect what is received by all management stations. Initially, the bit mask is set so that all bits are in a false state. Each bit in a true state reflects a currently filtered event, alarm, or alarm type. The actual bit position meanings are given below. Bit 0 is LSB. Bits 0 = Generic Normal Alarm 1 = Generic Warning Alarm 2 = Generic Minor Alarm 3 = Generic Major Alarm 4 = Generic Critical Alarm 5 = Partition Space Alarm 6 = Home Gateway Failure Alarm 7 = Component Not In Provisioned State Alarm 8 = Component Debug On Alarm 9 = Component Multiple Restart Alarm 10 = Component Restart Warning 11 = NAS Registration Failure Warning 12 = NAS Failure Alarm 13 = File Deletion Warning 14 = File Backup Warning 15 = Sysman Restart Warning 16 = File Access Warning 17 = Home Gateway/NAS Provisioning Mismatch Warning 18 = SS7 Link Failure Alarm 19 = SS7 Link Congestion Alarm 20 = ISUP Failure Alarm 21 = ISUP Congestion Alarm 22 = SS7 FEP Congestion Alarm 23 = SS7 BEP Congestion Alarm 24 = High Availability Peer Contact Lost Alarm 25 = SS7 MTP3 Congestion Alarm 26 = SS7 MTP2 Trunk Failure Alarm 27 = SS7 Linkset Failure Alarm 28 = SS7 Destination Inaccessible Alarm 29 = SS7 Destination Congested Alarm 30 = SS7 Link Alignment Failure Alarm ') alarmStatusInt1 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmStatusInt1.setStatus('mandatory') if mibBuilder.loadTexts: alarmStatusInt1.setDescription('The value of this bit mask indicates that current status of CSG component alarms. Each components is represented by a single bit within the range occupied by each component alarm type. Each bit in a true state reflects a currently raised alarm. The actual bit position meanings are given below. Bit 0 is the LSB. Bits 0-15 = Component Not In Provisioned State Alarm 16-31 = Component Multi Restart Alarm ') alarmStatusInt2 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmStatusInt2.setStatus('mandatory') if mibBuilder.loadTexts: alarmStatusInt2.setDescription('The value of this bit mask indicates the current status of active CSG alarms. Component-related alarms occupy a range of bits: each bit within that range represents the alarm status for a particular component. Each bit in a true state reflects a currently raised alarm. The actual bit position meanings are given below. Bit 0 is the LSB. Bits 0-15 = Component Debug On Alarm 16-23 = Partition Space Alarm 24 = Home Gateway Failure Alarm 25 = NAS Failure Alarm 26 = SS7 Link Failure Alarm 27 = SS7 Link Congestion Alarm 28 = ISUP Failure Alarm 29 = ISUP Congestion Alarm 30 = High Availability Peer Contact Lost Alarm 31 = SS7 MTP3 Congestion Alarm ') alarmStatusInt3 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alarmStatusInt3.setStatus('mandatory') if mibBuilder.loadTexts: alarmStatusInt3.setDescription('The value of this bit mask indicates the current status of active CSG alarms. Each bit in a true state reflects a currently raised alarm. The actual bit position meanings are given below. Bit 0 is the LSB. Bits 0 = SS7 MTP2 Trunk Failure Alarm 1 = SS7 Linkset Failure Alarm 2 = SS7 Destination Inaccessible Alarm 3 = SS7 Destination Congestion Alarm 4 = SS7 Link Alignment Failure Alarm 5 = CSG Complex Status Alarm 6 = External Ethernet Alarm ') alarmMaskInt2 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 4, 5), Gauge32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: alarmMaskInt2.setStatus('mandatory') if mibBuilder.loadTexts: alarmMaskInt2.setDescription('The value of this bit mask reflects the current additional filtering policy of CSG events and alarms. Management stations which wish to not receive certain events or alarm types from the CSG can modify this value as needed. Note, however, that changes in the filtration policy affect what is received by all management stations. Initially, the bit mask is set so that all bits are in a false state. Each bit in a true state reflects a currently filtered event, alarm, or alarm type. The actual bit position meanings are given below. Bit 0 is LSB. Bits 0 = External Ethernet Alarm 1 = Cluster Information retrieval Alarm ') trapCompName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 1), DisplayString()) if mibBuilder.loadTexts: trapCompName.setStatus('mandatory') if mibBuilder.loadTexts: trapCompName.setDescription('OID for the Component name.') trapFileName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 2), DisplayString()) if mibBuilder.loadTexts: trapFileName.setStatus('mandatory') if mibBuilder.loadTexts: trapFileName.setDescription('OID for file Name.') trapDate = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 3), TimeString()) if mibBuilder.loadTexts: trapDate.setStatus('mandatory') if mibBuilder.loadTexts: trapDate.setDescription('OID for the date.') trapGenericStr1 = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 4), DisplayString()) if mibBuilder.loadTexts: trapGenericStr1.setStatus('mandatory') if mibBuilder.loadTexts: trapGenericStr1.setDescription('OID for the generic data.') trapIdKey = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 5), Integer32()) if mibBuilder.loadTexts: trapIdKey.setStatus('mandatory') if mibBuilder.loadTexts: trapIdKey.setDescription('OID for the identification key.') trapIPAddress = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 6), IpAddress()) if mibBuilder.loadTexts: trapIPAddress.setStatus('mandatory') if mibBuilder.loadTexts: trapIPAddress.setDescription('OID for IP address.') trapName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 7), DisplayString()) if mibBuilder.loadTexts: trapName.setStatus('mandatory') if mibBuilder.loadTexts: trapName.setDescription('OID for configured name associated with an IpAddress.') trapTimeStamp = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 3, 8), DisplayString()) if mibBuilder.loadTexts: trapTimeStamp.setStatus('mandatory') if mibBuilder.loadTexts: trapTimeStamp.setDescription('Indicates the time at which the alarm occurred.') diskSpaceClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1001)).setObjects(("InternetThruway-MIB", "partitionSpaceKey"), ("InternetThruway-MIB", "partitionIndex"), ("InternetThruway-MIB", "partitionName"), ("InternetThruway-MIB", "partitionPercentFull"), ("InternetThruway-MIB", "partitionSpaceTimeStamp")) if mibBuilder.loadTexts: diskSpaceClear.setDescription('The Trap generated when a disk partition has a space increase after a previously sent DiskSpaceAlarm.') diskSpaceAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1004)).setObjects(("InternetThruway-MIB", "partitionSpaceKey"), ("InternetThruway-MIB", "partitionIndex"), ("InternetThruway-MIB", "partitionName"), ("InternetThruway-MIB", "partitionPercentFull"), ("InternetThruway-MIB", "partitionSpaceTimeStamp")) if mibBuilder.loadTexts: diskSpaceAlarm.setDescription('The Trap generated when a disk partition is running out of space provisioned state.') etherCardTrapClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1011)) if mibBuilder.loadTexts: etherCardTrapClear.setDescription(' The Trap generated when the external ethernet card becomes available.') etherCardTrapMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1014)) if mibBuilder.loadTexts: etherCardTrapMajor.setDescription('The Trap generated when the external ethernet card is down.') etherCardTrapCritical = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,1015)) if mibBuilder.loadTexts: etherCardTrapCritical.setDescription('The Trap generated when the external ethernet card is down.') compDebugOff = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2001)).setObjects(("InternetThruway-MIB", "compDebugKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compDebugTimeStamp")) if mibBuilder.loadTexts: compDebugOff.setDescription('The Trap generated when a Component turns off its debug info.') compDebugOn = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2002)).setObjects(("InternetThruway-MIB", "compDebugKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compDebugTimeStamp")) if mibBuilder.loadTexts: compDebugOn.setDescription('The Trap generated when a Component turns on its debug info.') compStateClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2011)).setObjects(("InternetThruway-MIB", "compProvStateKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compProvStateStatus"), ("InternetThruway-MIB", "compSecsInCurrentState"), ("InternetThruway-MIB", "compProvStateTimeStamp")) if mibBuilder.loadTexts: compStateClear.setDescription('The Trap generated when a component goes to its provisioned states after a CompStatusAlarm trap has been sent.') compStateAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2014)).setObjects(("InternetThruway-MIB", "compProvStateKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compProvStateStatus"), ("InternetThruway-MIB", "compSecsInCurrentState"), ("InternetThruway-MIB", "compProvStateTimeStamp")) if mibBuilder.loadTexts: compStateAlarm.setDescription("The Trap generated when a component is not in it's provisioned state.") restartStateClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2021)).setObjects(("InternetThruway-MIB", "compRestartKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compRestartStatus"), ("InternetThruway-MIB", "compRestartTimeStamp")) if mibBuilder.loadTexts: restartStateClear.setDescription('The Trap generated when a component goes to its provisioned states after a RestartStateAlarm trap has been sent.') restartStateAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,2024)).setObjects(("InternetThruway-MIB", "compRestartKey"), ("InternetThruway-MIB", "componentIndex"), ("InternetThruway-MIB", "componentName"), ("InternetThruway-MIB", "compRestartStatus"), ("InternetThruway-MIB", "compRestartTimeStamp")) if mibBuilder.loadTexts: restartStateAlarm.setDescription('The Trap generated when a component restarts repeatedly.') ss7LinkFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3004)).setObjects(("InternetThruway-MIB", "lfIndex"), ("InternetThruway-MIB", "lfKey"), ("InternetThruway-MIB", "lfIPAddress"), ("InternetThruway-MIB", "lfLinkCode"), ("InternetThruway-MIB", "lfName"), ("InternetThruway-MIB", "lfCardId"), ("InternetThruway-MIB", "lfLinkSet"), ("InternetThruway-MIB", "lfTimeStamp")) if mibBuilder.loadTexts: ss7LinkFailureAlarm.setDescription('Trap generated for an SS7 link failure.') ss7LinkFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3001)).setObjects(("InternetThruway-MIB", "lfIndex"), ("InternetThruway-MIB", "lfKey"), ("InternetThruway-MIB", "lfIPAddress"), ("InternetThruway-MIB", "lfLinkCode"), ("InternetThruway-MIB", "lfName"), ("InternetThruway-MIB", "lfCardId"), ("InternetThruway-MIB", "lfLinkSet"), ("InternetThruway-MIB", "lfTimeStamp")) if mibBuilder.loadTexts: ss7LinkFailureClear.setDescription('Trap generated to clear an SS7 link failure.') ss7LinkCongestionAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3012)).setObjects(("InternetThruway-MIB", "lcIndex"), ("InternetThruway-MIB", "lcKey"), ("InternetThruway-MIB", "lcIPAddress"), ("InternetThruway-MIB", "lcLinkCode"), ("InternetThruway-MIB", "lcName"), ("InternetThruway-MIB", "lcCardId"), ("InternetThruway-MIB", "lcLinkSet"), ("InternetThruway-MIB", "lcTimeStamp")) if mibBuilder.loadTexts: ss7LinkCongestionAlarm.setDescription('Trap generated for congestion on an SS7 Link.') ss7LinkCongestionClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3011)).setObjects(("InternetThruway-MIB", "lcIndex"), ("InternetThruway-MIB", "lcKey"), ("InternetThruway-MIB", "lcIPAddress"), ("InternetThruway-MIB", "lcLinkCode"), ("InternetThruway-MIB", "lcName"), ("InternetThruway-MIB", "lcCardId"), ("InternetThruway-MIB", "lcLinkSet"), ("InternetThruway-MIB", "lcTimeStamp")) if mibBuilder.loadTexts: ss7LinkCongestionClear.setDescription('Trap generated to indicate there is no longer congestion on an SS7 link.') ss7ISUPFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3025)).setObjects(("InternetThruway-MIB", "ifIndex"), ("InternetThruway-MIB", "ifKey"), ("InternetThruway-MIB", "ifIPAddress"), ("InternetThruway-MIB", "ifName"), ("InternetThruway-MIB", "ifTimeStamp")) if mibBuilder.loadTexts: ss7ISUPFailureAlarm.setDescription('Trap generated to indicate ISUP failure.') ss7ISUPFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3021)).setObjects(("InternetThruway-MIB", "ifIndex"), ("InternetThruway-MIB", "ifKey"), ("InternetThruway-MIB", "ifIPAddress"), ("InternetThruway-MIB", "ifName"), ("InternetThruway-MIB", "ifTimeStamp")) if mibBuilder.loadTexts: ss7ISUPFailureClear.setDescription('Trap generated to clear an ISUP failure alarm.') ss7ISUPCongestionAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3033)).setObjects(("InternetThruway-MIB", "icIndex"), ("InternetThruway-MIB", "icKey"), ("InternetThruway-MIB", "icIPAddress"), ("InternetThruway-MIB", "icCongestionLevel"), ("InternetThruway-MIB", "icName"), ("InternetThruway-MIB", "icTimeStamp")) if mibBuilder.loadTexts: ss7ISUPCongestionAlarm.setDescription('Trap generated to indicate congestion with the ISUP protocol stack.') ss7ISUPCongestionClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3031)).setObjects(("InternetThruway-MIB", "icIndex"), ("InternetThruway-MIB", "icKey"), ("InternetThruway-MIB", "icIPAddress"), ("InternetThruway-MIB", "icCongestionLevel"), ("InternetThruway-MIB", "icName"), ("InternetThruway-MIB", "icTimeStamp")) if mibBuilder.loadTexts: ss7ISUPCongestionClear.setDescription('Trap generated to indicate there is no longer congestion with the ISUP protocol stack.') ss7FEPCongestionWarning = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3042)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapIPAddress"), ("InternetThruway-MIB", "trapName"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: ss7FEPCongestionWarning.setDescription('Notification trap generated to indicate congestion encountered by the SS7 front-end process.') ss7BEPCongestionWarning = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3052)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapIPAddress"), ("InternetThruway-MIB", "trapName"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: ss7BEPCongestionWarning.setDescription('Notification trap generated to indicate congestion encountered by the SS7 back-end process.') ss7MTP3CongestionMinor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3063)).setObjects(("InternetThruway-MIB", "mtp3Index"), ("InternetThruway-MIB", "mtp3Key"), ("InternetThruway-MIB", "mtp3IPAddress"), ("InternetThruway-MIB", "mtp3Name"), ("InternetThruway-MIB", "mtp3TimeStamp")) if mibBuilder.loadTexts: ss7MTP3CongestionMinor.setDescription('Trap generated for MTP3 congestion.') ss7MTP3CongestionMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3064)).setObjects(("InternetThruway-MIB", "mtp3Index"), ("InternetThruway-MIB", "mtp3Key"), ("InternetThruway-MIB", "mtp3IPAddress"), ("InternetThruway-MIB", "mtp3Name"), ("InternetThruway-MIB", "mtp3TimeStamp")) if mibBuilder.loadTexts: ss7MTP3CongestionMajor.setDescription('Trap generated for MTP3 congestion.') ss7MTP3CongestionCritical = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3065)).setObjects(("InternetThruway-MIB", "mtp3Index"), ("InternetThruway-MIB", "mtp3Key"), ("InternetThruway-MIB", "mtp3IPAddress"), ("InternetThruway-MIB", "mtp3Name"), ("InternetThruway-MIB", "mtp3TimeStamp")) if mibBuilder.loadTexts: ss7MTP3CongestionCritical.setDescription('Trap generated for MTP3 congestion.') ss7MTP3CongestionClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3061)).setObjects(("InternetThruway-MIB", "mtp3Index"), ("InternetThruway-MIB", "mtp3Key"), ("InternetThruway-MIB", "mtp3IPAddress"), ("InternetThruway-MIB", "mtp3Name"), ("InternetThruway-MIB", "mtp3TimeStamp")) if mibBuilder.loadTexts: ss7MTP3CongestionClear.setDescription('Trap generated to indicate there is no longer MTP3 congestion.') ss7MTP2TrunkFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3075)).setObjects(("InternetThruway-MIB", "mtp2Index"), ("InternetThruway-MIB", "mtp2Key"), ("InternetThruway-MIB", "mtp2IPAddress"), ("InternetThruway-MIB", "mtp2Name"), ("InternetThruway-MIB", "mtp2CardId"), ("InternetThruway-MIB", "mtp2AlarmCondition"), ("InternetThruway-MIB", "mtp2TimeStamp")) if mibBuilder.loadTexts: ss7MTP2TrunkFailureAlarm.setDescription('Trap generated to indicate an MTP2 trunk failure condition.') ss7MTP2TrunkFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3071)).setObjects(("InternetThruway-MIB", "mtp2Index"), ("InternetThruway-MIB", "mtp2Key"), ("InternetThruway-MIB", "mtp2IPAddress"), ("InternetThruway-MIB", "mtp2Name"), ("InternetThruway-MIB", "mtp2CardId"), ("InternetThruway-MIB", "mtp2TimeStamp")) if mibBuilder.loadTexts: ss7MTP2TrunkFailureClear.setDescription('Trap generated to clear an MTP2 trunk failure alarm.') ss7LinksetFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3085)).setObjects(("InternetThruway-MIB", "lsFailureIndex"), ("InternetThruway-MIB", "lsFailureKey"), ("InternetThruway-MIB", "lsFailureIPAddress"), ("InternetThruway-MIB", "lsFailureName"), ("InternetThruway-MIB", "lsFailurePointcode"), ("InternetThruway-MIB", "lsFailureTimeStamp")) if mibBuilder.loadTexts: ss7LinksetFailureAlarm.setDescription('Trap generated to indicate a linkset failure.') ss7LinksetFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3081)).setObjects(("InternetThruway-MIB", "lsFailureIndex"), ("InternetThruway-MIB", "lsFailureKey"), ("InternetThruway-MIB", "lsFailureIPAddress"), ("InternetThruway-MIB", "lsFailureName"), ("InternetThruway-MIB", "lsFailurePointcode"), ("InternetThruway-MIB", "lsFailureTimeStamp")) if mibBuilder.loadTexts: ss7LinksetFailureClear.setDescription('Trap generated to clear a linkset failure alarm.') ss7DestinationInaccessible = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3092)).setObjects(("InternetThruway-MIB", "destInaccessIndex"), ("InternetThruway-MIB", "destInaccessKey"), ("InternetThruway-MIB", "destInaccessIPAddress"), ("InternetThruway-MIB", "destInaccessName"), ("InternetThruway-MIB", "destInaccessPointcode"), ("InternetThruway-MIB", "destInaccessTimeStamp")) if mibBuilder.loadTexts: ss7DestinationInaccessible.setDescription('Trap generated to indicate that a signalling destination is inaccessible. A destination is considered inaccessible once Transfer Prohibited (TFP) messages are received which indicate that the route to that destination is prohibited.') ss7DestinationAccessible = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3091)).setObjects(("InternetThruway-MIB", "destInaccessIndex"), ("InternetThruway-MIB", "destInaccessKey"), ("InternetThruway-MIB", "destInaccessIPAddress"), ("InternetThruway-MIB", "destInaccessName"), ("InternetThruway-MIB", "destInaccessPointcode"), ("InternetThruway-MIB", "destInaccessTimeStamp")) if mibBuilder.loadTexts: ss7DestinationAccessible.setDescription('Trap generated to clear a destination inacessible alarm. An inaccessible signalling destination is considered accessible once Transfer Allowed (TFA) messages are sent along its prohibited signalling routes.') ss7DestinationCongestedAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3103)).setObjects(("InternetThruway-MIB", "destCongestIndex"), ("InternetThruway-MIB", "destCongestKey"), ("InternetThruway-MIB", "destCongestIPAddress"), ("InternetThruway-MIB", "destCongestName"), ("InternetThruway-MIB", "destCongestPointcode"), ("InternetThruway-MIB", "destCongestCongestionLevel"), ("InternetThruway-MIB", "destCongestTimeStamp")) if mibBuilder.loadTexts: ss7DestinationCongestedAlarm.setDescription('Trap generated to indicate congestion at an SS7 destination.') ss7DestinationCongestedClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3101)).setObjects(("InternetThruway-MIB", "destCongestIndex"), ("InternetThruway-MIB", "destCongestKey"), ("InternetThruway-MIB", "destCongestIPAddress"), ("InternetThruway-MIB", "destCongestName"), ("InternetThruway-MIB", "destCongestPointcode"), ("InternetThruway-MIB", "destCongestCongestionLevel"), ("InternetThruway-MIB", "destCongestTimeStamp")) if mibBuilder.loadTexts: ss7DestinationCongestedClear.setDescription('Trap generated to indicate that there is no longer congestion at an SS7 destination.') ss7LinkAlignmentFailureAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3114)).setObjects(("InternetThruway-MIB", "linkAlignIndex"), ("InternetThruway-MIB", "linkAlignKey"), ("InternetThruway-MIB", "linkAlignIPAddress"), ("InternetThruway-MIB", "linkAlignName"), ("InternetThruway-MIB", "linkAlignLinkCode"), ("InternetThruway-MIB", "linkAlignCardId"), ("InternetThruway-MIB", "linkAlignLinkSet"), ("InternetThruway-MIB", "linkAlignTimeStamp")) if mibBuilder.loadTexts: ss7LinkAlignmentFailureAlarm.setDescription('Trap generated to indicate alignment failure on a datalink.') ss7LinkAlignmentFailureClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,3111)).setObjects(("InternetThruway-MIB", "linkAlignIndex"), ("InternetThruway-MIB", "linkAlignKey"), ("InternetThruway-MIB", "linkAlignIPAddress"), ("InternetThruway-MIB", "linkAlignName"), ("InternetThruway-MIB", "linkAlignLinkCode"), ("InternetThruway-MIB", "linkAlignCardId"), ("InternetThruway-MIB", "linkAlignLinkSet"), ("InternetThruway-MIB", "linkAlignTimeStamp")) if mibBuilder.loadTexts: ss7LinkAlignmentFailureClear.setDescription('Trap generated to clear a datalink alignment failure alarm.') ncLostServerTrap = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4014)).setObjects(("InternetThruway-MIB", "lsIndex"), ("InternetThruway-MIB", "lsKey"), ("InternetThruway-MIB", "lsName"), ("InternetThruway-MIB", "lsIPAddress"), ("InternetThruway-MIB", "lsTimeStamp")) if mibBuilder.loadTexts: ncLostServerTrap.setDescription('This trap is generated when the CSG loses contact with its peer in the cluster. The variables in this trap identify the server that has been lost. The originator of this trap is implicitly defined.') ncFoundServerTrap = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4011)).setObjects(("InternetThruway-MIB", "lsIndex"), ("InternetThruway-MIB", "lsKey"), ("InternetThruway-MIB", "lsName"), ("InternetThruway-MIB", "lsIPAddress"), ("InternetThruway-MIB", "lsTimeStamp")) if mibBuilder.loadTexts: ncFoundServerTrap.setDescription('This trap is generated when the initially comes into contact with or regains contact with its peer in the cluster. The variables in this trap identify the server that has been found. The originator of this trap is implicitly defined.') ncStateChangeTrap = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4022)).setObjects(("InternetThruway-MIB", "ncEthernetName"), ("InternetThruway-MIB", "ncEthernetIP"), ("InternetThruway-MIB", "ncOperationalState"), ("InternetThruway-MIB", "ncStandbyState"), ("InternetThruway-MIB", "ncAvailabilityState")) if mibBuilder.loadTexts: ncStateChangeTrap.setDescription('This trap is generated when any of the state values change.') csgComplexStateTrapClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4031)).setObjects(("InternetThruway-MIB", "cplxName"), ("InternetThruway-MIB", "cplxLocEthernetName"), ("InternetThruway-MIB", "cplxLocEthernetIP"), ("InternetThruway-MIB", "cplxLocOperationalState"), ("InternetThruway-MIB", "cplxLocStandbyState"), ("InternetThruway-MIB", "cplxLocAvailabilityState"), ("InternetThruway-MIB", "cplxMateEthernetName"), ("InternetThruway-MIB", "cplxMateEthernetIP"), ("InternetThruway-MIB", "cplxMateOperationalState"), ("InternetThruway-MIB", "cplxMateStandbyState"), ("InternetThruway-MIB", "cplxMateAvailabilityState"), ("InternetThruway-MIB", "cplxAlarmStatus")) if mibBuilder.loadTexts: csgComplexStateTrapClear.setDescription('This trap is generated when any of the state values change Severity is determined only by the operational and standby states of both servers.') csgComplexStateTrapMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4034)).setObjects(("InternetThruway-MIB", "cplxName"), ("InternetThruway-MIB", "cplxLocEthernetName"), ("InternetThruway-MIB", "cplxLocEthernetIP"), ("InternetThruway-MIB", "cplxLocOperationalState"), ("InternetThruway-MIB", "cplxLocStandbyState"), ("InternetThruway-MIB", "cplxLocAvailabilityState"), ("InternetThruway-MIB", "cplxMateEthernetName"), ("InternetThruway-MIB", "cplxMateEthernetIP"), ("InternetThruway-MIB", "cplxMateOperationalState"), ("InternetThruway-MIB", "cplxMateStandbyState"), ("InternetThruway-MIB", "cplxMateAvailabilityState"), ("InternetThruway-MIB", "cplxAlarmStatus")) if mibBuilder.loadTexts: csgComplexStateTrapMajor.setDescription('This trap is generated when any of the state values change Severity is determined only by the operational and standby states of both servers.') csgComplexStateTrapCritical = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4035)).setObjects(("InternetThruway-MIB", "cplxName"), ("InternetThruway-MIB", "cplxLocEthernetName"), ("InternetThruway-MIB", "cplxLocEthernetIP"), ("InternetThruway-MIB", "cplxLocOperationalState"), ("InternetThruway-MIB", "cplxLocStandbyState"), ("InternetThruway-MIB", "cplxLocAvailabilityState"), ("InternetThruway-MIB", "cplxMateEthernetName"), ("InternetThruway-MIB", "cplxMateEthernetIP"), ("InternetThruway-MIB", "cplxMateOperationalState"), ("InternetThruway-MIB", "cplxMateStandbyState"), ("InternetThruway-MIB", "cplxMateAvailabilityState"), ("InternetThruway-MIB", "cplxAlarmStatus")) if mibBuilder.loadTexts: csgComplexStateTrapCritical.setDescription('This trap is generated when any of the state values change Severity is determined only by the operational and standby states of both servers.') cisRetrievalFailureTrapMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,4044)) if mibBuilder.loadTexts: cisRetrievalFailureTrapMajor.setDescription('This trap is generated when the TruCluster ASE information retrieval attempts failed repeatedly. ') genericNormal = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9001)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericNormal.setDescription('The Trap generated for generic normal priority text messages') genericWarning = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9002)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericWarning.setDescription('The Trap generated for generic warning priority text messages') genericMinor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9003)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericMinor.setDescription('The Trap generated for generic minor priority text messages') genericMajor = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9004)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericMajor.setDescription('The Trap generated for generic major priority text messages') genericCritical = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9005)).setObjects(("InternetThruway-MIB", "trapIdKey"), ("InternetThruway-MIB", "trapGenericStr1"), ("InternetThruway-MIB", "trapTimeStamp")) if mibBuilder.loadTexts: genericCritical.setDescription('The Trap generated for generic critical priority text messages') hgStatusClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9011)).setObjects(("InternetThruway-MIB", "hgKey"), ("InternetThruway-MIB", "hgIndex"), ("InternetThruway-MIB", "hgName"), ("InternetThruway-MIB", "hgIPAddress"), ("InternetThruway-MIB", "hgAlarmTimeStamp")) if mibBuilder.loadTexts: hgStatusClear.setDescription('The Trap generated when a Home Gateway Status returns to normal after having previously been in the failed status.') hgStatusAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9014)).setObjects(("InternetThruway-MIB", "hgKey"), ("InternetThruway-MIB", "hgIndex"), ("InternetThruway-MIB", "hgName"), ("InternetThruway-MIB", "hgIPAddress"), ("InternetThruway-MIB", "hgAlarmTimeStamp")) if mibBuilder.loadTexts: hgStatusAlarm.setDescription('The Trap generated when a Home Gateway is indicated to be failed.') nasStatusClear = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9021)).setObjects(("InternetThruway-MIB", "nasKey"), ("InternetThruway-MIB", "nasIndex"), ("InternetThruway-MIB", "nasName"), ("InternetThruway-MIB", "nasIPAddress"), ("InternetThruway-MIB", "nasAlarmTimeStamp"), ("InternetThruway-MIB", "nasCmplxName")) if mibBuilder.loadTexts: nasStatusClear.setDescription('The Trap generated when a rapport registers after having previously been in the failed status.') nasStatusAlarm = NotificationType((1, 3, 6, 1, 4, 1, 562, 14, 2, 3) + (0,9024)).setObjects(("InternetThruway-MIB", "nasKey"), ("InternetThruway-MIB", "nasIndex"), ("InternetThruway-MIB", "nasName"), ("InternetThruway-MIB", "nasIPAddress"), ("InternetThruway-MIB", "nasAlarmTimeStamp"), ("InternetThruway-MIB", "nasCmplxName")) if mibBuilder.loadTexts: nasStatusAlarm.setDescription('The Trap generated when a Nas is indicated to be failed.') linkOMTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1), ) if mibBuilder.loadTexts: linkOMTable.setStatus('mandatory') if mibBuilder.loadTexts: linkOMTable.setDescription('The LinkTable contains information about each signaling link on the CSG') linkOMTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "linksetIndex"), (0, "InternetThruway-MIB", "linkIndex")) if mibBuilder.loadTexts: linkOMTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: linkOMTableEntry.setDescription('An entry in the LinkTable. Indexed by linkIndex') linkOMId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkOMId.setStatus('mandatory') if mibBuilder.loadTexts: linkOMId.setDescription('The id of the link.') linkOMSetId = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkOMSetId.setStatus('mandatory') if mibBuilder.loadTexts: linkOMSetId.setDescription('The id of the linkset.') linkFailures = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkFailures.setStatus('mandatory') if mibBuilder.loadTexts: linkFailures.setDescription('Number of times this signaling link has failed.') linkCongestions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkCongestions.setStatus('mandatory') if mibBuilder.loadTexts: linkCongestions.setDescription('Number of times this signaling link has Congested.') linkInhibits = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkInhibits.setStatus('mandatory') if mibBuilder.loadTexts: linkInhibits.setDescription('Number of times this signaling link has been inhibited.') linkTransmittedMSUs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkTransmittedMSUs.setStatus('mandatory') if mibBuilder.loadTexts: linkTransmittedMSUs.setDescription('Number of messages sent on this signaling link.') linkReceivedMSUs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkReceivedMSUs.setStatus('mandatory') if mibBuilder.loadTexts: linkReceivedMSUs.setDescription('Number of messages received on this signaling link.') linkRemoteProcOutages = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 1, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: linkRemoteProcOutages.setStatus('mandatory') if mibBuilder.loadTexts: linkRemoteProcOutages.setDescription('Number of times the remote processor outgaes have been reported.') bLATimerExpiries = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: bLATimerExpiries.setStatus('mandatory') if mibBuilder.loadTexts: bLATimerExpiries.setDescription('Number of times the BLA timer has expired.') rLCTimerExpiries = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rLCTimerExpiries.setStatus('mandatory') if mibBuilder.loadTexts: rLCTimerExpiries.setDescription('Number of times the RLC timer has expired.') uBATimerExpiries = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: uBATimerExpiries.setStatus('mandatory') if mibBuilder.loadTexts: uBATimerExpiries.setDescription('Number of times the UBA timer has expired.') rSATimerExpiries = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 2, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rSATimerExpiries.setStatus('mandatory') if mibBuilder.loadTexts: rSATimerExpiries.setDescription('Number of times the RSA timer has expired.') outCallAttempts = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: outCallAttempts.setDescription('Total number of outgoing call legs attempted.') outCallNormalCompletions = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: outCallNormalCompletions.setDescription('Total number of outgoing call legs completed normally.') outCallAbnormalCompletions = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: outCallAbnormalCompletions.setDescription('Total number of outgoing call legs completed abnormally.') userBusyOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userBusyOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: userBusyOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to user busy signal.') tempFailOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tempFailOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: tempFailOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to temporary failure.') userUnavailableOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userUnavailableOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: userUnavailableOutCallRejects.setDescription('Total number of outgoing call legs failed due to user not available.') abnormalReleaseOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: abnormalReleaseOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: abnormalReleaseOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to abnormal release.') otherOutCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: otherOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: otherOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to other reasons.') cumulativeActiveOutCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cumulativeActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: cumulativeActiveOutCalls.setDescription('Cumulatvie Number of outgoing call legs active so far.') currentlyActiveOutCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveOutCalls.setDescription('Total Number of outgoing call legs currently active.') currentlyActiveDigitalOutCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveDigitalOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveDigitalOutCalls.setDescription('Total Number of outgoing digital call legs currently active.') currentlyActiveAnalogOutCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveAnalogOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveAnalogOutCalls.setDescription('Total Number of outgoing analog call legs currently active.') inCallAttempts = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: inCallAttempts.setDescription('Total number of incoming call legs attempted.') inCallNormalCompletions = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: inCallNormalCompletions.setDescription('Total number of incoming call legs completed normally.') inCallAbnormalCompletions = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: inCallAbnormalCompletions.setDescription('Total number of incoming call legs completed abnormally.') userBusyInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userBusyInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: userBusyInCallRejects.setDescription('Total Number of incoming call legs rejected due to user busy signal.') tempFailInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tempFailInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: tempFailInCallRejects.setDescription('Total Number of incoming call legs rejected due to temporary failure.') userUnavailableInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userUnavailableInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: userUnavailableInCallRejects.setDescription('Total number of incoming call legs failed due to user not available.') abnormalReleaseInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: abnormalReleaseInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: abnormalReleaseInCallRejects.setDescription('Total Number of incoming call legs rejected due to abnormal release.') otherInCallRejects = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: otherInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: otherInCallRejects.setDescription('Total Number of incoming call legs rejected due to other reasons.') cumulativeActiveInCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cumulativeActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: cumulativeActiveInCalls.setDescription('Cumulatvie Number of incoming call legs active so far.') currentlyActiveInCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveInCalls.setDescription('Total Number of incoming call legs currently active.') currentlyActiveDigitalInCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveDigitalInCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveDigitalInCalls.setDescription('Total Number of incoming digital call legs currently active.') currentlyActiveAnalogInCalls = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 3, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: currentlyActiveAnalogInCalls.setStatus('mandatory') if mibBuilder.loadTexts: currentlyActiveAnalogInCalls.setDescription('Total Number of incoming analog call legs currently active.') trunkCallOMTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1), ) if mibBuilder.loadTexts: trunkCallOMTable.setStatus('mandatory') if mibBuilder.loadTexts: trunkCallOMTable.setDescription('The TrunkCallOMTable contains call related OMs on a trunk group basis') trunkCallOMTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "trunkCallOMIndex")) if mibBuilder.loadTexts: trunkCallOMTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: trunkCallOMTableEntry.setDescription('An entry in the TrunkCallOMTable. Indexed by trunkCallOMIndex.') trunkCallOMIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: trunkCallOMIndex.setStatus('mandatory') if mibBuilder.loadTexts: trunkCallOMIndex.setDescription('Identifies a trunk group index.') trunkGroupCLLI = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkGroupCLLI.setStatus('mandatory') if mibBuilder.loadTexts: trunkGroupCLLI.setDescription('The Common Language Location Identifier(CLLI), a unique alphanumeric value to identify this Trunk Group.') numberOfCircuits = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfCircuits.setStatus('mandatory') if mibBuilder.loadTexts: numberOfCircuits.setDescription('Total Number of Circuits provisioned against this trunk group.') trunkOutCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOutCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: trunkOutCallAttempts.setDescription('Total number of outgoing call legs attempted.') trunkOutCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOutCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: trunkOutCallNormalCompletions.setDescription('Total number of outgoing call legs completed normally.') trunkOutCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOutCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: trunkOutCallAbnormalCompletions.setDescription('Total number of outgoing call legs completed abnormally.') trunkUserBusyOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkUserBusyOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkUserBusyOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to user busy signal.') trunkTempFailOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkTempFailOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkTempFailOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to temporary failure.') trunkUserUnavailableOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkUserUnavailableOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkUserUnavailableOutCallRejects.setDescription('Total number of outgoing call legs failed due to user not available.') trunkAbnormalReleaseOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkAbnormalReleaseOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkAbnormalReleaseOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to abnormal release.') trunkOtherOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOtherOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkOtherOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to other reasons.') trunkCumulativeActiveOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCumulativeActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCumulativeActiveOutCalls.setDescription('Cumulatvie Number of outgoing call legs active so far.') trunkCurrentlyActiveOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveOutCalls.setDescription('Total Number of outgoing call legs currently active.') trunkCurrentlyActiveDigitalOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveDigitalOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveDigitalOutCalls.setDescription('Total Number of outgoing digital call legs currently active.') trunkCurrentlyActiveAnalogOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveAnalogOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveAnalogOutCalls.setDescription('Total Number of outgoing analog call legs currently active.') trunkInCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkInCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: trunkInCallAttempts.setDescription('Total number of incoming call legs attempted.') trunkInCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkInCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: trunkInCallNormalCompletions.setDescription('Total number of incoming call legs completed normally.') trunkInCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkInCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: trunkInCallAbnormalCompletions.setDescription('Total number of incoming call legs completed abnormally.') trunkUserBusyInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkUserBusyInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkUserBusyInCallRejects.setDescription('Total Number of incoming call legs rejected due to user busy signal.') trunkTempFailInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkTempFailInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkTempFailInCallRejects.setDescription('Total Number of incoming call legs rejected due to temporary failure.') trunkUserUnavailableInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkUserUnavailableInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkUserUnavailableInCallRejects.setDescription('Total number of incoming call legs failed due to user not available.') trunkAbnormalReleaseInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkAbnormalReleaseInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkAbnormalReleaseInCallRejects.setDescription('Total Number of incoming call legs rejected due to abnormal release.') trunkOtherInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOtherInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: trunkOtherInCallRejects.setDescription('Total Number of incoming call legs rejected due to other reasons.') trunkCumulativeActiveInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCumulativeActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCumulativeActiveInCalls.setDescription('Cumulatvie Number of incoming call legs active so far.') trunkCurrentlyActiveInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveInCalls.setDescription('Total Number of incoming call legs currently active.') trunkCurrentlyActiveDigitalInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveDigitalInCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveDigitalInCalls.setDescription('Total Number of incoming digital call legs currently active.') trunkCurrentlyActiveAnalogInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkCurrentlyActiveAnalogInCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkCurrentlyActiveAnalogInCalls.setDescription('Total Number of incoming analog call legs currently active.') trunkAllActiveCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 28), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkAllActiveCalls.setStatus('mandatory') if mibBuilder.loadTexts: trunkAllActiveCalls.setDescription('Total number of currently active call legs (all type).') trunkOccupancyPerCCS = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 29), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trunkOccupancyPerCCS.setStatus('mandatory') if mibBuilder.loadTexts: trunkOccupancyPerCCS.setDescription('Trunk occupancy in Centum Call Seconds.') trafficInCCSs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 30), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trafficInCCSs.setStatus('mandatory') if mibBuilder.loadTexts: trafficInCCSs.setDescription('Scanned om for tgms that are call busy') trafficInCCSIncomings = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 31), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trafficInCCSIncomings.setStatus('mandatory') if mibBuilder.loadTexts: trafficInCCSIncomings.setDescription('Scanned Om on tgms with an incoming call.') localBusyInCCSs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 32), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: localBusyInCCSs.setStatus('mandatory') if mibBuilder.loadTexts: localBusyInCCSs.setDescription('Scanned om for tgms that are locally blocked.') remoteBusyInCCSs = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 4, 1, 1, 33), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: remoteBusyInCCSs.setStatus('mandatory') if mibBuilder.loadTexts: remoteBusyInCCSs.setDescription('Scanned om for tgms that are remoteley blocked.') nasCallOMTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1), ) if mibBuilder.loadTexts: nasCallOMTable.setStatus('mandatory') if mibBuilder.loadTexts: nasCallOMTable.setDescription('The NasCallOMTable contains call related OMs on a nas basis') nasCallOMTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "nasCallOMIndex")) if mibBuilder.loadTexts: nasCallOMTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: nasCallOMTableEntry.setDescription('An entry in the NasCallOMTable. Indexed by nasCallOMIndex.') nasCallOMIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: nasCallOMIndex.setStatus('mandatory') if mibBuilder.loadTexts: nasCallOMIndex.setDescription('Identifies a nas Call OM .') nasName1 = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasName1.setStatus('mandatory') if mibBuilder.loadTexts: nasName1.setDescription('A unique alphanumeric value to identify this Nas.') numberOfPorts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: numberOfPorts.setStatus('mandatory') if mibBuilder.loadTexts: numberOfPorts.setDescription('Total Number of Ports provisioned against this nas.') nasOutCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOutCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: nasOutCallAttempts.setDescription('Total number of outgoing call legs attempted.') nasOutCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOutCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: nasOutCallNormalCompletions.setDescription('Total number of outgoing call legs completed normally.') nasOutCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOutCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: nasOutCallAbnormalCompletions.setDescription('Total number of outgoing call legs completed abnormally.') nasUserBusyOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasUserBusyOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasUserBusyOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to user busy signal.') nasTempFailOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasTempFailOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasTempFailOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to temporary failure.') nasUserUnavailableOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasUserUnavailableOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasUserUnavailableOutCallRejects.setDescription('Total number of outgoing call legs failed due to user not available.') nasAbnormalReleaseOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasAbnormalReleaseOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasAbnormalReleaseOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to abnormal release.') nasOtherOutCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOtherOutCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasOtherOutCallRejects.setDescription('Total Number of outgoing call legs rejected due to other reasons.') nasCumulativeActiveOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCumulativeActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCumulativeActiveOutCalls.setDescription('Cumulatvie Number of outgoing call legs active so far.') nasCurrentlyActiveOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveOutCalls.setDescription('Total Number of outgoing call legs currently active.') nasCurrentlyActiveDigitalOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveDigitalOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveDigitalOutCalls.setDescription('Total Number of outgoing digital call legs currently active.') nasCurrentlyActiveAnalogOutCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveAnalogOutCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveAnalogOutCalls.setDescription('Total Number of outgoing analog call legs currently active.') nasInCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasInCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: nasInCallAttempts.setDescription('Total number of incoming call legs attempted.') nasInCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasInCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: nasInCallNormalCompletions.setDescription('Total number of incoming call legs completed normally.') nasInCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasInCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: nasInCallAbnormalCompletions.setDescription('Total number of incoming call legs completed abnormally.') nasUserBusyInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasUserBusyInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasUserBusyInCallRejects.setDescription('Total Number of incoming call legs rejected due to user busy signal.') nasTempFailInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasTempFailInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasTempFailInCallRejects.setDescription('Total Number of incoming call legs rejected due to temporary failure.') nasUserUnavailableInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasUserUnavailableInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasUserUnavailableInCallRejects.setDescription('Total number of incoming call legs failed due to user not available.') nasAbnormalReleaseInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasAbnormalReleaseInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasAbnormalReleaseInCallRejects.setDescription('Total Number of incoming call legs rejected due to abnormal release.') nasOtherInCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasOtherInCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: nasOtherInCallRejects.setDescription('Total Number of incoming call legs rejected due to other reasons.') nasCumulativeActiveInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCumulativeActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCumulativeActiveInCalls.setDescription('Cumulatvie Number of incoming call legs active so far.') nasCurrentlyActiveInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveInCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveInCalls.setDescription('Total Number of incoming call legs currently active.') nasCurrentlyActiveDigitalInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveDigitalInCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveDigitalInCalls.setDescription('Total Number of incoming digital call legs currently active.') nasCurrentlyActiveAnalogInCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyActiveAnalogInCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyActiveAnalogInCalls.setDescription('Total Number of incoming analog call legs currently active.') nasAllActiveCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 28), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasAllActiveCalls.setStatus('mandatory') if mibBuilder.loadTexts: nasAllActiveCalls.setDescription('Total number of currently active call legs (all type).') nasMaxPortsUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 29), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasMaxPortsUsed.setStatus('mandatory') if mibBuilder.loadTexts: nasMaxPortsUsed.setDescription('Maximum number of ports used in this nas since the last system restart.') nasMinPortsUsed = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 30), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasMinPortsUsed.setStatus('mandatory') if mibBuilder.loadTexts: nasMinPortsUsed.setDescription('Minimum number of ports used in this nas since the last system restart.') nasCurrentlyInUsePorts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 7, 1, 1, 31), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: nasCurrentlyInUsePorts.setStatus('mandatory') if mibBuilder.loadTexts: nasCurrentlyInUsePorts.setDescription('Number of ports currently in use.') phoneCallOMTable = MibTable((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1), ) if mibBuilder.loadTexts: phoneCallOMTable.setStatus('mandatory') if mibBuilder.loadTexts: phoneCallOMTable.setDescription('The PhoneCallOMTable contains call related OMs on a phone number basis') phoneCallOMTableEntry = MibTableRow((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1), ).setIndexNames((0, "InternetThruway-MIB", "phoneCallOMIndex")) if mibBuilder.loadTexts: phoneCallOMTableEntry.setStatus('mandatory') if mibBuilder.loadTexts: phoneCallOMTableEntry.setDescription('An entry in the PhoneCallOMTable. Indexed by phoneGroupIndex.') phoneCallOMIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 1), Integer32()) if mibBuilder.loadTexts: phoneCallOMIndex.setStatus('mandatory') if mibBuilder.loadTexts: phoneCallOMIndex.setDescription('Uniquely identifies an entry in this table.') phoneNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneNumber.setStatus('mandatory') if mibBuilder.loadTexts: phoneNumber.setDescription('Phone number for the underlying Call OM record.') phoneDialCallAttempts = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneDialCallAttempts.setStatus('mandatory') if mibBuilder.loadTexts: phoneDialCallAttempts.setDescription('Total number of dial calls attempted.') phoneDialCallNormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneDialCallNormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: phoneDialCallNormalCompletions.setDescription('Total number of dial calls completed normally.') phoneDialCallAbnormalCompletions = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneDialCallAbnormalCompletions.setStatus('mandatory') if mibBuilder.loadTexts: phoneDialCallAbnormalCompletions.setDescription('Total number of dial calls completed abnormally.') phoneUserBusyDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneUserBusyDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneUserBusyDialCallRejects.setDescription('Total Number of dial calls rejected due to user busy signal.') phoneTempFailDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneTempFailDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneTempFailDialCallRejects.setDescription('Total Number of dial calls rejected due to temporary failure.') phoneUserUnavailableDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneUserUnavailableDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneUserUnavailableDialCallRejects.setDescription('Total number of dial calls failed due to user not available.') phoneAbnormalReleaseDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneAbnormalReleaseDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneAbnormalReleaseDialCallRejects.setDescription('Total Number of dial calls rejected due to abnormal release.') phoneOtherDialCallRejects = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneOtherDialCallRejects.setStatus('mandatory') if mibBuilder.loadTexts: phoneOtherDialCallRejects.setDescription('Total Number of dial calls rejected due to other reasons.') phoneCumulativeActiveDialCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneCumulativeActiveDialCalls.setStatus('mandatory') if mibBuilder.loadTexts: phoneCumulativeActiveDialCalls.setDescription('Cumulatvie Number of dial calls active so far.') phoneCurrentlyActiveDialCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneCurrentlyActiveDialCalls.setStatus('mandatory') if mibBuilder.loadTexts: phoneCurrentlyActiveDialCalls.setDescription('Total Number of dial calls currently active.') phoneCurrentlyActiveDigitalDialCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneCurrentlyActiveDigitalDialCalls.setStatus('mandatory') if mibBuilder.loadTexts: phoneCurrentlyActiveDigitalDialCalls.setDescription('Total Number of digital dial calls currently active.') phoneCurrentlyActiveAnalogDialCalls = MibTableColumn((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 5, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: phoneCurrentlyActiveAnalogDialCalls.setStatus('mandatory') if mibBuilder.loadTexts: phoneCurrentlyActiveAnalogDialCalls.setDescription('Total Number of analog dial calls currently active.') csgComplexCLLI = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 1), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: csgComplexCLLI.setStatus('mandatory') if mibBuilder.loadTexts: csgComplexCLLI.setDescription('A unique identifier of the CSG Complex.') serverHostName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: serverHostName.setStatus('mandatory') if mibBuilder.loadTexts: serverHostName.setDescription('Host Name of this server.') serverIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: serverIpAddress.setStatus('mandatory') if mibBuilder.loadTexts: serverIpAddress.setDescription('IP address of this server.') serverCLLI = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: serverCLLI.setStatus('mandatory') if mibBuilder.loadTexts: serverCLLI.setDescription('A unique identifier of this server (common in the telco world).') mateServerHostName = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mateServerHostName.setStatus('mandatory') if mibBuilder.loadTexts: mateServerHostName.setDescription('Host Name of this server.') mateServerIpAddress = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 6), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: mateServerIpAddress.setStatus('mandatory') if mibBuilder.loadTexts: mateServerIpAddress.setDescription('IP address of this server.') serverMemSize = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: serverMemSize.setStatus('mandatory') if mibBuilder.loadTexts: serverMemSize.setDescription('Memory size in mega bytes of this server.') provisionedDPCs = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provisionedDPCs.setStatus('mandatory') if mibBuilder.loadTexts: provisionedDPCs.setDescription('Number of destination point codes provisioned.') provisionedCircuits = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provisionedCircuits.setStatus('mandatory') if mibBuilder.loadTexts: provisionedCircuits.setDescription('Number of circuits provisioned.') inserviceCircuits = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inserviceCircuits.setStatus('mandatory') if mibBuilder.loadTexts: inserviceCircuits.setDescription('Number of circuits in service. This number goes up or down at any given time.') provisionedNASes = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provisionedNASes.setStatus('mandatory') if mibBuilder.loadTexts: provisionedNASes.setDescription('Number of NASes provisioned.') aliveNASes = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: aliveNASes.setStatus('mandatory') if mibBuilder.loadTexts: aliveNASes.setDescription('Number of NASes known to be alive. This number goes up or down at any given time.') inserviceNASes = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inserviceNASes.setStatus('mandatory') if mibBuilder.loadTexts: inserviceNASes.setDescription('Number of NASes in service. This number goes up or down at any given time.') provsionedCards = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provsionedCards.setStatus('mandatory') if mibBuilder.loadTexts: provsionedCards.setDescription('Number of NAS cards provisioned.') inserviceCards = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 16), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inserviceCards.setStatus('mandatory') if mibBuilder.loadTexts: inserviceCards.setDescription('Number of NAS cards in service. This number goes up or down at any given time.') provisionedPorts = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 17), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: provisionedPorts.setStatus('mandatory') if mibBuilder.loadTexts: provisionedPorts.setDescription('Number of ports provisioned.') inservicePorts = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 18), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: inservicePorts.setStatus('mandatory') if mibBuilder.loadTexts: inservicePorts.setDescription('Number of ports in service. This number goes up or down at any given time.') userCPUUsage = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 19), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: userCPUUsage.setStatus('mandatory') if mibBuilder.loadTexts: userCPUUsage.setDescription('Percentage of CPU used in user domain. Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') systemCPUUsage = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 20), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: systemCPUUsage.setStatus('mandatory') if mibBuilder.loadTexts: systemCPUUsage.setDescription('Percentage of CPU used in system domain in this server. Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') totalCPUUsage = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 21), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: totalCPUUsage.setStatus('mandatory') if mibBuilder.loadTexts: totalCPUUsage.setDescription('Percentage of CPU used in total in this server Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') maxCPUUsage = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 22), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: maxCPUUsage.setStatus('mandatory') if mibBuilder.loadTexts: maxCPUUsage.setDescription('High water measurement. Maximum CPU Usage (%) in this server. Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') avgLoad = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 23), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: avgLoad.setStatus('mandatory') if mibBuilder.loadTexts: avgLoad.setDescription('Average CPU load factor in this server. Survman computes this value in every 600 seconds. The value stored in the MIB will be the last one computed.') systemCallRate = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 24), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: systemCallRate.setStatus('mandatory') if mibBuilder.loadTexts: systemCallRate.setDescription('System Call rate (per second) in this Cserver. Survman computes this value in every 600 seconds. The value stored in the MIB will be the one computed the last time.') contextSwitchRate = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 25), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: contextSwitchRate.setStatus('mandatory') if mibBuilder.loadTexts: contextSwitchRate.setDescription('Process context switching rate (per second) in this server. Survman computes this value in every 600 seconds. The value stored in the MIB will be the one computed the last time.') lastUpdateOMFile = MibScalar((1, 3, 6, 1, 4, 1, 562, 14, 2, 7, 6, 26), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: lastUpdateOMFile.setStatus('mandatory') if mibBuilder.loadTexts: lastUpdateOMFile.setDescription('Name of the last updated OM file.') mibBuilder.exportSymbols("InternetThruway-MIB", cplxMateStandbyState=cplxMateStandbyState, icTimeStamp=icTimeStamp, linkAlignLinkSet=linkAlignLinkSet, nasUserUnavailableInCallRejects=nasUserUnavailableInCallRejects, phoneCallOMIndex=phoneCallOMIndex, linkOMs=linkOMs, hgIPAddress=hgIPAddress, ss7MTP2TrunkFailureAlarmTableEntry=ss7MTP2TrunkFailureAlarmTableEntry, componentIndex=componentIndex, lsIPAddress=lsIPAddress, RouteState=RouteState, ncLostServerTrap=ncLostServerTrap, LinksetState=LinksetState, nasCallOMTableEntry=nasCallOMTableEntry, trunkOccupancyPerCCS=trunkOccupancyPerCCS, routeIndex=routeIndex, destCongestPointcode=destCongestPointcode, userBusyOutCallRejects=userBusyOutCallRejects, componentTable=componentTable, routeTable=routeTable, ss7DestinationAccessible=ss7DestinationAccessible, ss7LinkCongestionAlarmTableEntry=ss7LinkCongestionAlarmTableEntry, partitionSpaceTimeStamp=partitionSpaceTimeStamp, lcKey=lcKey, nasCurrentlyActiveDigitalOutCalls=nasCurrentlyActiveDigitalOutCalls, destInaccessPointcode=destInaccessPointcode, trunkUserUnavailableOutCallRejects=trunkUserUnavailableOutCallRejects, LinkAlignmentState=LinkAlignmentState, trunkOtherOutCallRejects=trunkOtherOutCallRejects, ss7ISUPFailureAlarmTableEntry=ss7ISUPFailureAlarmTableEntry, trunkOtherInCallRejects=trunkOtherInCallRejects, lcLinkSet=lcLinkSet, lsKey=lsKey, ss7FEPCongestionWarning=ss7FEPCongestionWarning, ss7BEPCongestionWarning=ss7BEPCongestionWarning, provisionedPorts=provisionedPorts, nasUserUnavailableOutCallRejects=nasUserUnavailableOutCallRejects, phoneDialCallNormalCompletions=phoneDialCallNormalCompletions, ss7DestinationCongestedAlarm=ss7DestinationCongestedAlarm, cplxMateAvailabilityState=cplxMateAvailabilityState, totalCPUUsage=totalCPUUsage, provsionedCards=provsionedCards, compDebugStatus=compDebugStatus, provisionedNASes=provisionedNASes, trafficInCCSs=trafficInCCSs, currentlyActiveInCalls=currentlyActiveInCalls, cplxMateOperationalState=cplxMateOperationalState, nasStatusAlarm=nasStatusAlarm, nasAlarmTableEntry=nasAlarmTableEntry, PartitionSpaceStatus=PartitionSpaceStatus, linksetTableEntry=linksetTableEntry, rSATimerExpiries=rSATimerExpiries, mtp2CardId=mtp2CardId, compStateAlarm=compStateAlarm, mtp2Key=mtp2Key, ss7DestinationInaccessibleAlarmTable=ss7DestinationInaccessibleAlarmTable, nasIPAddress=nasIPAddress, inserviceNASes=inserviceNASes, linkOMTableEntry=linkOMTableEntry, nasUserBusyInCallRejects=nasUserBusyInCallRejects, lcIPAddress=lcIPAddress, hgName=hgName, phoneNumberOMs=phoneNumberOMs, linkNumSIFReceived=linkNumSIFReceived, numberOfPorts=numberOfPorts, lsName=lsName, lfCardId=lfCardId, icIndex=icIndex, provisionedDPCs=provisionedDPCs, lfIPAddress=lfIPAddress, lostServerAlarmTableEntry=lostServerAlarmTableEntry, mateServerIpAddress=mateServerIpAddress, cumulativeActiveOutCalls=cumulativeActiveOutCalls, nasCurrentlyActiveOutCalls=nasCurrentlyActiveOutCalls, nasInCallAbnormalCompletions=nasInCallAbnormalCompletions, lsFailureTimeStamp=lsFailureTimeStamp, alarmStatusInt1=alarmStatusInt1, csgComplexStateTrapClear=csgComplexStateTrapClear, partitionPercentFull=partitionPercentFull, systemCPUUsage=systemCPUUsage, destPointCode=destPointCode, destInaccessIndex=destInaccessIndex, nasTempFailInCallRejects=nasTempFailInCallRejects, destinationTable=destinationTable, destinationTableEntry=destinationTableEntry, trunkGroupCLLI=trunkGroupCLLI, nasName=nasName, TimeString=TimeString, currentlyActiveDigitalInCalls=currentlyActiveDigitalInCalls, linksetTable=linksetTable, cplxLocEthernetName=cplxLocEthernetName, genericWarning=genericWarning, phoneDialCallAttempts=phoneDialCallAttempts, ss7MTP2TrunkFailureAlarm=ss7MTP2TrunkFailureAlarm, compRestartKey=compRestartKey, linkAlignIPAddress=linkAlignIPAddress, nasCurrentlyActiveInCalls=nasCurrentlyActiveInCalls, linkFailures=linkFailures, ss7MTP3CongestionCritical=ss7MTP3CongestionCritical, contextSwitchRate=contextSwitchRate, nasCumulativeActiveOutCalls=nasCumulativeActiveOutCalls, compDebugKey=compDebugKey, rLCTimerExpiries=rLCTimerExpiries, routeId=routeId, userUnavailableInCallRejects=userUnavailableInCallRejects, outCallNormalCompletions=outCallNormalCompletions, linkHostname=linkHostname, nasCallOMTable=nasCallOMTable, compProvStateStatus=compProvStateStatus, phoneOtherDialCallRejects=phoneOtherDialCallRejects, cisRetrievalFailureTrapMajor=cisRetrievalFailureTrapMajor, maintenanceOMs=maintenanceOMs, trunkOutCallAttempts=trunkOutCallAttempts, phoneNumber=phoneNumber, icName=icName, ncSoftwareVersion=ncSoftwareVersion, linkIndex=linkIndex, ss7DestinationCongestedAlarmTableEntry=ss7DestinationCongestedAlarmTableEntry, ifTimeStamp=ifTimeStamp, partitionSpaceStatus=partitionSpaceStatus, linkCardDeviceName=linkCardDeviceName, maxCPUUsage=maxCPUUsage, mateServerHostName=mateServerHostName, linkNumMSUDiscarded=linkNumMSUDiscarded, inCallAbnormalCompletions=inCallAbnormalCompletions, ncServerId=ncServerId, serverCLLI=serverCLLI, inservicePorts=inservicePorts, ncEthernetName=ncEthernetName, nasMaxPortsUsed=nasMaxPortsUsed, lsTimeStamp=lsTimeStamp, ss7LinkAlignmentFailureClear=ss7LinkAlignmentFailureClear, phoneCurrentlyActiveDialCalls=phoneCurrentlyActiveDialCalls, phoneUserUnavailableDialCallRejects=phoneUserUnavailableDialCallRejects, csg=csg, ncFoundServerTrap=ncFoundServerTrap, systemOMs=systemOMs, ncClusterIP=ncClusterIP, compSecsInCurrentState=compSecsInCurrentState, abnormalReleaseInCallRejects=abnormalReleaseInCallRejects, nasCumulativeActiveInCalls=nasCumulativeActiveInCalls, ncAvailabilityState=ncAvailabilityState, inserviceCards=inserviceCards, trunkCumulativeActiveOutCalls=trunkCumulativeActiveOutCalls, linkAlignTimeStamp=linkAlignTimeStamp, hgAlarmTableEntry=hgAlarmTableEntry, trunkUserBusyInCallRejects=trunkUserBusyInCallRejects, csgComplexCLLI=csgComplexCLLI, linkAlignLinkCode=linkAlignLinkCode, destState=destState, ifIndex=ifIndex, ss7LinksetFailureAlarmTable=ss7LinksetFailureAlarmTable, uBATimerExpiries=uBATimerExpiries, ss7DestinationCongestedAlarmTable=ss7DestinationCongestedAlarmTable, alarmMaskInt1=alarmMaskInt1, lfKey=lfKey, lastUpdateOMFile=lastUpdateOMFile, linkAlignCardId=linkAlignCardId, genericNormal=genericNormal, lfLinkCode=lfLinkCode, lcTimeStamp=lcTimeStamp, nasStatusClear=nasStatusClear, currentlyActiveDigitalOutCalls=currentlyActiveDigitalOutCalls, LinkCongestionState=LinkCongestionState, nasKey=nasKey, cplxLocOperationalState=cplxLocOperationalState, linkNumMSUTransmitted=linkNumMSUTransmitted, linkCongestions=linkCongestions, ncStandbyState=ncStandbyState, ss7ISUPCongestionAlarmTable=ss7ISUPCongestionAlarmTable, nasOtherOutCallRejects=nasOtherOutCallRejects, linkInhibitionState=linkInhibitionState, genericMinor=genericMinor, hgAlarmTable=hgAlarmTable, ncOperationalState=ncOperationalState, phoneCurrentlyActiveAnalogDialCalls=phoneCurrentlyActiveAnalogDialCalls, trunkUserUnavailableInCallRejects=trunkUserUnavailableInCallRejects, UpgradeInProgress=UpgradeInProgress, alarms=alarms, compDebugTimeStamp=compDebugTimeStamp, cplxMateEthernetIP=cplxMateEthernetIP, trunkCallOMIndex=trunkCallOMIndex, lfName=lfName, userBusyInCallRejects=userBusyInCallRejects, linkRemoteProcOutages=linkRemoteProcOutages, trapGenericStr1=trapGenericStr1, linkAlignKey=linkAlignKey, genericCritical=genericCritical, abnormalReleaseOutCallRejects=abnormalReleaseOutCallRejects, ncServer=ncServer, compProvStateTimeStamp=compProvStateTimeStamp, ss7LinkAlignmentAlarmTableEntry=ss7LinkAlignmentAlarmTableEntry, mtp3Name=mtp3Name, destCongestKey=destCongestKey, hgStatusClear=hgStatusClear, trapName=trapName, userCPUUsage=userCPUUsage, linkOMTable=linkOMTable, ss7ISUPFailureAlarm=ss7ISUPFailureAlarm, ss7MTP3CongestionMinor=ss7MTP3CongestionMinor, partitionIndex=partitionIndex, genericMajor=genericMajor, lcLinkCode=lcLinkCode, alarmMaskInt2=alarmMaskInt2, ncStateChangeTrap=ncStateChangeTrap, ss7MTP3CongestionAlarmTable=ss7MTP3CongestionAlarmTable, remoteBusyInCCSs=remoteBusyInCCSs, csgComplexStateTrapInfo=csgComplexStateTrapInfo, aliveNASes=aliveNASes, destCongestIPAddress=destCongestIPAddress, trunkGroupOMs=trunkGroupOMs, otherOutCallRejects=otherOutCallRejects, lsFailurePointcode=lsFailurePointcode, trapFileName=trapFileName, ss7LinkAlignmentAlarmTable=ss7LinkAlignmentAlarmTable, destIndex=destIndex, destCongestName=destCongestName, nasCurrentlyInUsePorts=nasCurrentlyInUsePorts, systemCallRate=systemCallRate, mtp2TimeStamp=mtp2TimeStamp, linkNumUnexpectedMsgs=linkNumUnexpectedMsgs, trapCompName=trapCompName, linkNumSIFTransmitted=linkNumSIFTransmitted, ncEthernetIP=ncEthernetIP, nortel=nortel, tempFailOutCallRejects=tempFailOutCallRejects, inserviceCircuits=inserviceCircuits, destInaccessIPAddress=destInaccessIPAddress, linksetState=linksetState, cplxLocAvailabilityState=cplxLocAvailabilityState, nasOutCallAbnormalCompletions=nasOutCallAbnormalCompletions, ss7LinkFailureAlarmTable=ss7LinkFailureAlarmTable, ss7LinkCongestionAlarm=ss7LinkCongestionAlarm, restartStateClear=restartStateClear, alarmStatusInt2=alarmStatusInt2, trunkCurrentlyActiveDigitalInCalls=trunkCurrentlyActiveDigitalInCalls, ss7ISUPCongestionClear=ss7ISUPCongestionClear, lfIndex=lfIndex, linkTableEntry=linkTableEntry, mtp2Name=mtp2Name, mtp3IPAddress=mtp3IPAddress, ncUpgradeInProgress=ncUpgradeInProgress, nasOutCallAttempts=nasOutCallAttempts, lfLinkSet=lfLinkSet, provisionedCircuits=provisionedCircuits, partitionTable=partitionTable, ss7LinkCongestionAlarmTable=ss7LinkCongestionAlarmTable, serverMemSize=serverMemSize, ss7LinkFailureClear=ss7LinkFailureClear, trunkInCallAttempts=trunkInCallAttempts, mtp2Index=mtp2Index, trapIdKey=trapIdKey, phoneCallOMTableEntry=phoneCallOMTableEntry, ss7LinksetFailureAlarm=ss7LinksetFailureAlarm) mibBuilder.exportSymbols("InternetThruway-MIB", icIPAddress=icIPAddress, trunkCumulativeActiveInCalls=trunkCumulativeActiveInCalls, lfTimeStamp=lfTimeStamp, ss7LinkFailureAlarm=ss7LinkFailureAlarm, partitionMegsFree=partitionMegsFree, compStateClear=compStateClear, lsFailureIndex=lsFailureIndex, cumulativeActiveInCalls=cumulativeActiveInCalls, ss7LinksetFailureClear=ss7LinksetFailureClear, linksetId=linksetId, linkOMSetId=linkOMSetId, hgKey=hgKey, csgComplexStateTrapCritical=csgComplexStateTrapCritical, linkNumMSUReceived=linkNumMSUReceived, ss7LinksetFailureAlarmTableEntry=ss7LinksetFailureAlarmTableEntry, partitionName=partitionName, icKey=icKey, ss7MTP3CongestionMajor=ss7MTP3CongestionMajor, icCongestionLevel=icCongestionLevel, trunkCurrentlyActiveOutCalls=trunkCurrentlyActiveOutCalls, avgLoad=avgLoad, compDebugOff=compDebugOff, nasCurrentlyActiveDigitalInCalls=nasCurrentlyActiveDigitalInCalls, destCongestIndex=destCongestIndex, restartStateAlarm=restartStateAlarm, trunkInCallAbnormalCompletions=trunkInCallAbnormalCompletions, trunkAbnormalReleaseInCallRejects=trunkAbnormalReleaseInCallRejects, linksetIndex=linksetIndex, mtp2IPAddress=mtp2IPAddress, ifIPAddress=ifIPAddress, lsFailureName=lsFailureName, nasAlarmTimeStamp=nasAlarmTimeStamp, trafficInCCSIncomings=trafficInCCSIncomings, nasTempFailOutCallRejects=nasTempFailOutCallRejects, routeState=routeState, DestinationState=DestinationState, linkInhibits=linkInhibits, compRestartTimeStamp=compRestartTimeStamp, ss7MTP3CongestionClear=ss7MTP3CongestionClear, nasInCallNormalCompletions=nasInCallNormalCompletions, MTP2AlarmConditionType=MTP2AlarmConditionType, linkId=linkId, ss7ISUPFailureClear=ss7ISUPFailureClear, componentName=componentName, lcCardId=lcCardId, nasOMs=nasOMs, disk=disk, nasIndex=nasIndex, trunkCurrentlyActiveAnalogOutCalls=trunkCurrentlyActiveAnalogOutCalls, ncClusterName=ncClusterName, trunkCurrentlyActiveDigitalOutCalls=trunkCurrentlyActiveDigitalOutCalls, routeDestPointCode=routeDestPointCode, LinkState=LinkState, nasAlarmTable=nasAlarmTable, destCongestTimeStamp=destCongestTimeStamp, cplxAlarmStatus=cplxAlarmStatus, lsIndex=lsIndex, ss7=ss7, nasAbnormalReleaseOutCallRejects=nasAbnormalReleaseOutCallRejects, currentlyActiveOutCalls=currentlyActiveOutCalls, ComponentIndex=ComponentIndex, hgIndex=hgIndex, lostServerAlarmTable=lostServerAlarmTable, localBusyInCCSs=localBusyInCCSs, currentlyActiveAnalogOutCalls=currentlyActiveAnalogOutCalls, ss7LinkCongestionClear=ss7LinkCongestionClear, ss7DestinationCongestedClear=ss7DestinationCongestedClear, mtp3CongestionLevel=mtp3CongestionLevel, callOMs=callOMs, tempFailInCallRejects=tempFailInCallRejects, lcIndex=lcIndex, trunkOutCallAbnormalCompletions=trunkOutCallAbnormalCompletions, phoneUserBusyDialCallRejects=phoneUserBusyDialCallRejects, ss7ISUPCongestionAlarm=ss7ISUPCongestionAlarm, linkAlignIndex=linkAlignIndex, inCallNormalCompletions=inCallNormalCompletions, ifName=ifName, currentlyActiveAnalogInCalls=currentlyActiveAnalogInCalls, routeRank=routeRank, phoneDialCallAbnormalCompletions=phoneDialCallAbnormalCompletions, phoneTempFailDialCallRejects=phoneTempFailDialCallRejects, otherInCallRejects=otherInCallRejects, routeTableEntry=routeTableEntry, trapDate=trapDate, userUnavailableOutCallRejects=userUnavailableOutCallRejects, trapIPAddress=trapIPAddress, cplxMateEthernetName=cplxMateEthernetName, phoneCallOMTable=phoneCallOMTable, serverIpAddress=serverIpAddress, trunkTempFailOutCallRejects=trunkTempFailOutCallRejects, compRestartStatus=compRestartStatus, nasOutCallNormalCompletions=nasOutCallNormalCompletions, ss7DestinationInaccessible=ss7DestinationInaccessible, bLATimerExpiries=bLATimerExpiries, trunkAllActiveCalls=trunkAllActiveCalls, destInaccessName=destInaccessName, system=system, nasOtherInCallRejects=nasOtherInCallRejects, cplxName=cplxName, trunkUserBusyOutCallRejects=trunkUserBusyOutCallRejects, nasInCallAttempts=nasInCallAttempts, lcName=lcName, nasCurrentlyActiveAnalogOutCalls=nasCurrentlyActiveAnalogOutCalls, dialaccess=dialaccess, trapTimeStamp=trapTimeStamp, trunkCurrentlyActiveInCalls=trunkCurrentlyActiveInCalls, linkNumAutoChangeovers=linkNumAutoChangeovers, diskSpaceClear=diskSpaceClear, omData=omData, linkAlignName=linkAlignName, nasName1=nasName1, ss7LinkFailureAlarmTableEntry=ss7LinkFailureAlarmTableEntry, etherCardTrapMajor=etherCardTrapMajor, LinkInhibitionState=LinkInhibitionState, components=components, linkCongestionState=linkCongestionState, ss7MTP3CongestionAlarmTableEntry=ss7MTP3CongestionAlarmTableEntry, destInaccessKey=destInaccessKey, trunkCallOMTable=trunkCallOMTable, alarmStatusInt3=alarmStatusInt3, ss7ISUPCongestionAlarmTableEntry=ss7ISUPCongestionAlarmTableEntry, ifKey=ifKey, serverHostName=serverHostName, compProvStateKey=compProvStateKey, nasMinPortsUsed=nasMinPortsUsed, etherCardTrapCritical=etherCardTrapCritical, ComponentSysmanState=ComponentSysmanState, trunkCurrentlyActiveAnalogInCalls=trunkCurrentlyActiveAnalogInCalls, nasAbnormalReleaseInCallRejects=nasAbnormalReleaseInCallRejects, ss7ISUPFailureAlarmTable=ss7ISUPFailureAlarmTable, mtp2AlarmCondition=mtp2AlarmCondition, trunkOutCallNormalCompletions=trunkOutCallNormalCompletions, etherCardTrapClear=etherCardTrapClear, linkTransmittedMSUs=linkTransmittedMSUs, cplxLocEthernetIP=cplxLocEthernetIP, traps=traps, ncServerName=ncServerName, phoneCumulativeActiveDialCalls=phoneCumulativeActiveDialCalls, partitionTableEntry=partitionTableEntry, linkOMId=linkOMId, csgComplexStateTrapMajor=csgComplexStateTrapMajor, ncHostName=ncHostName, numberOfCircuits=numberOfCircuits, linkTable=linkTable, ss7MTP2TrunkFailureAlarmTable=ss7MTP2TrunkFailureAlarmTable, trunkInCallNormalCompletions=trunkInCallNormalCompletions, linkAlignmentState=linkAlignmentState, outCallAbnormalCompletions=outCallAbnormalCompletions, nasCallOMIndex=nasCallOMIndex, phoneAbnormalReleaseDialCallRejects=phoneAbnormalReleaseDialCallRejects, destRuleId=destRuleId, nasCmplxName=nasCmplxName, lsFailureIPAddress=lsFailureIPAddress, partitionSpaceKey=partitionSpaceKey, ss7DestinationInaccessibleAlarmTableEntry=ss7DestinationInaccessibleAlarmTableEntry, hgStatusAlarm=hgStatusAlarm, inCallAttempts=inCallAttempts, linkState=linkState, ss7MTP2TrunkFailureClear=ss7MTP2TrunkFailureClear, nasAllActiveCalls=nasAllActiveCalls, compDebugOn=compDebugOn, destCongestCongestionLevel=destCongestCongestionLevel, mtp3Key=mtp3Key, linkReceivedMSUs=linkReceivedMSUs, ss7LinkAlignmentFailureAlarm=ss7LinkAlignmentFailureAlarm, linksetAdjPointcode=linksetAdjPointcode, routeLinksetId=routeLinksetId, phoneCurrentlyActiveDigitalDialCalls=phoneCurrentlyActiveDigitalDialCalls, nasCurrentlyActiveAnalogInCalls=nasCurrentlyActiveAnalogInCalls, trunkTempFailInCallRejects=trunkTempFailInCallRejects, trunkCallOMTableEntry=trunkCallOMTableEntry, diskSpaceAlarm=diskSpaceAlarm, mtp3Index=mtp3Index, nasUserBusyOutCallRejects=nasUserBusyOutCallRejects, lsFailureKey=lsFailureKey, hgAlarmTimeStamp=hgAlarmTimeStamp, mtp3TimeStamp=mtp3TimeStamp, componentTableEntry=componentTableEntry, outCallAttempts=outCallAttempts, cplxLocStandbyState=cplxLocStandbyState, trunkAbnormalReleaseOutCallRejects=trunkAbnormalReleaseOutCallRejects, destInaccessTimeStamp=destInaccessTimeStamp)
[ 2, 198, 2, 9485, 15571, 7378, 337, 9865, 8265, 4455, 817, 622, 1014, 12, 8895, 33, 357, 4023, 1378, 16184, 76, 489, 8937, 13, 785, 14, 79, 893, 11632, 8, 198, 2, 7054, 45, 13, 16, 2723, 2393, 1378, 14, 14490, 14, 67, 615, 47562,...
2.946724
52,913
from bs4 import BeautifulSoup as bs import requests parsed = BBC("https://www.bbc.co.uk/news/world-europe-49345912") #print(parsed.title) #print(parsed.link) #print(parsed.author) #print(parsed.date) #print(parsed.title) #print(parsed.body) #print(parsed.images) #print(parsed.body)
[ 6738, 275, 82, 19, 1330, 23762, 50, 10486, 355, 275, 82, 198, 11748, 7007, 220, 198, 197, 197, 198, 79, 945, 276, 796, 7823, 7203, 5450, 1378, 2503, 13, 11848, 66, 13, 1073, 13, 2724, 14, 10827, 14, 6894, 12, 44252, 431, 12, 2920,...
2.186567
134
# In[42]: from scipy.integrate import odeint import numpy as np import matplotlib.pyplot as plt # In[43]: # describe the model # In[44]: # describe the parameters N = 2283 #Totala befolkningen N=s(t)+I(t)+R(t) D = 4.0 #infections last four days gamma = 1.0 / D #Reoval rate (Hur mnga som tillfrisknar) delta = 1.0 / 5.0 #incubation period of five days R_0 = 2.5 #Reproduktionstalet beta = R_0 * gamma #r_0=beta/gamma. antal som smittas per infekterad och per tid (beror pa virusets egenskaper samt hur vi beter oss). S0, E0, I0, R0 = N-1, 1, 0, 0 # initial conditions: one infected, rest susceptible #Rt = R0 * S(t)/Ntot* (1 b). b = effekt av policy och beteendeforandringar # In[45]: t = np.linspace(0, 99, 100) # Grid of time points (in days) y0 = S0, E0, I0, R0 # Initial conditions vector # Integrate the SIR equations over the time grid, t. ret = odeint(deriv, y0, t, args=(N, beta, gamma, delta)) S, E, I, R = ret.T # In[46]: # plot the graph # In[47]: plotsir(t, S, E, I, R) # In[ ]:
[ 2, 554, 58, 3682, 5974, 628, 198, 6738, 629, 541, 88, 13, 18908, 4873, 1330, 267, 2934, 600, 198, 11748, 299, 32152, 355, 45941, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 628, 198, 2, 554, 58, 3559, 5974, 628, ...
2.351598
438
pregunta = input('trabajas desde casa? ') if pregunta == True: print 'Eres afortunado' if pregunta == False: print 'Trabajas fuera de casa' tiempo = input('Cuantos minutos haces al trabajo: ') if tiempo == 0: print 'trabajas desde casa' elif tiempo <=20: print 'Es poco tiempo' elif tiempo >= 21 and tiempo <=45: print 'Es un tiempo razonable' else: print 'Busca otras rutas'
[ 79, 2301, 44424, 796, 5128, 10786, 2213, 397, 1228, 292, 748, 2934, 6124, 64, 30, 705, 8, 201, 198, 201, 198, 361, 662, 70, 44424, 6624, 6407, 25, 201, 198, 220, 220, 220, 3601, 705, 36, 411, 6580, 1922, 4533, 6, 201, 198, 201, ...
1.957983
238
import logging import re from urllib.parse import urlparse from django.conf import settings from django.utils.cache import add_never_cache_headers from django.utils.cache import patch_cache_control from django.utils.cache import patch_response_headers logger = logging.getLogger(__name__) STAC_BASE = settings.STAC_BASE STAC_BASE_V = settings.STAC_BASE_V
[ 11748, 18931, 198, 11748, 302, 198, 6738, 2956, 297, 571, 13, 29572, 1330, 19016, 29572, 198, 198, 6738, 42625, 14208, 13, 10414, 1330, 6460, 198, 6738, 42625, 14208, 13, 26791, 13, 23870, 1330, 751, 62, 12081, 62, 23870, 62, 50145, 198...
3.068376
117
# author huangchuanhong import torch from mmcv.runner import load_checkpoint from ..base import BaseDetector from ..single_stage import SingleStageDetector from ...registry import DETECTORS from ...builder import build_detector
[ 2, 1772, 289, 84, 648, 354, 7258, 71, 506, 198, 11748, 28034, 198, 6738, 8085, 33967, 13, 16737, 1330, 3440, 62, 9122, 4122, 198, 6738, 11485, 8692, 1330, 7308, 11242, 9250, 198, 6738, 11485, 29762, 62, 14247, 1330, 14206, 29391, 11242,...
3.754098
61
import numpy as np from gym.spaces import Box from metaworld.envs import reward_utils from metaworld.envs.asset_path_utils import full_v2_path_for from metaworld.envs.mujoco.sawyer_xyz.sawyer_xyz_env import SawyerXYZEnv, _assert_task_is_set
[ 11748, 299, 32152, 355, 45941, 198, 6738, 11550, 13, 2777, 2114, 1330, 8315, 198, 198, 6738, 1138, 707, 1764, 13, 268, 14259, 1330, 6721, 62, 26791, 198, 6738, 1138, 707, 1764, 13, 268, 14259, 13, 562, 316, 62, 6978, 62, 26791, 1330, ...
2.641304
92
#!/usr/bin/env python import sys import logging import os logging.basicConfig(stream=sys.stderr) file_dir = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0, file_dir) from main import app as application from main import db
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 11748, 25064, 198, 11748, 18931, 198, 11748, 28686, 198, 6404, 2667, 13, 35487, 16934, 7, 5532, 28, 17597, 13, 301, 1082, 81, 8, 198, 7753, 62, 15908, 796, 28686, 13, 6978, 13, 15908, ...
2.925926
81
from yezdi.lexer.token import TokenType from yezdi.parser.ast import Program, Statement, Participant, Title, LineStatement
[ 6738, 331, 8471, 10989, 13, 2588, 263, 13, 30001, 1330, 29130, 6030, 198, 6738, 331, 8471, 10989, 13, 48610, 13, 459, 1330, 6118, 11, 21983, 11, 29880, 11, 11851, 11, 6910, 48682, 628, 198 ]
3.676471
34
# list categories in category folder from os import walk from os.path import abspath,join, pardir categories_folder = abspath(join(__file__,pardir,pardir,"category")) post_folder = abspath(join(__file__,pardir,pardir,"_posts")) site_categories = [] for root,directories,files in walk(categories_folder): for f in files: site_categories.append(f.split(".md")[0]) site_categories = set(site_categories) for root,directories,files in walk(post_folder): for f in files: with open(join(root,f),'r',encoding="utf-8") as fi: lines = fi.readlines() for l in lines: if l.find("categories")==0: categories = l.split(":")[1] for c in [" ","[","]","\n"]: categories = categories.replace(c,"") categories=categories.split(",") if len(set(categories)-site_categories)>0: print(f,set(categories)-site_categories) break print("done")
[ 2, 1351, 9376, 287, 6536, 9483, 198, 198, 6738, 28686, 1330, 2513, 198, 6738, 28686, 13, 6978, 1330, 2352, 6978, 11, 22179, 11, 41746, 343, 198, 198, 66, 26129, 62, 43551, 796, 2352, 6978, 7, 22179, 7, 834, 7753, 834, 11, 26037, 343...
2.083333
504
#!/usr/bin/env python3 """ builds documentation files from multimarkdown (mmd) source to various formats, including the web site and pdf. """ import subprocess import glob import os import sys import time import shutil src = [ "intro.mmd", "downloads.mmd", "quickstart.mmd", "faq.mmd", "dirstruct.mmd", "premake.mmd", "legal.mmd", "concepts.mmd", "concepts3d.mmd", "voicemanagement.mmd", "examples.mmd", "foreign_interface.mmd", "c_api.mmd", "python_api.mmd", "ruby_api.mmd", "rpgmaker_api.mmd", "bmx_api.mmd", "gamemaker_api.mmd", "cs_api.mmd", "d_api.mmd", "codegen.mmd", "basics.mmd", "attributes.mmd", "faders.mmd", "voicegroups.mmd", "coremisc.mmd", "core3d.mmd", "audiosource.mmd", "newsoundsources.mmd", "wav.mmd", "wavstream.mmd", "speech.mmd", "sfxr.mmd", "modplug.mmd", "monotone.mmd", "tedsid.mmd", "vizsn.mmd", "vic.mmd", "filters.mmd", "biquadfilter.mmd", "echofilter.mmd", "lofifilter.mmd", "flangerfilter.mmd", "dcremovalfilter.mmd", "fftfilter.mmd", "bassboostfilter.mmd", "waveshaperfilter.mmd", "mixbus.mmd", "queue.mmd", "collider.mmd", "attenuator.mmd", "file.mmd", "backends.mmd" ] website_only = [ "downloads.mmd" ] unknown = 0 for file in glob.glob("*.mmd"): if file not in src: unknown = 1 print(file + " not included in docs!") if unknown: print("Add the new files to makedoc.py, soloud.tex and htmlpre.txt.") sys.exit() datestring = time.strftime("%Y%m%d") if not os.path.exists(datestring + "/web"): os.makedirs(datestring + "/web") if not os.path.exists("temp/"): os.makedirs("temp/") print("- -- --- -- - Generating single-file HTML docs") callp = ["pandoc", "-s", "-t", "html5", "-f", "markdown-smart", "--metadata", 'title="SoLoud ' + datestring + '"', "-H", "singlehtml_head.txt", "-B", "singlehtml_body.txt", "--toc", "--self-contained", "--default-image-extension=png", "-o", datestring + "/soloud_" + datestring + ".html"] for x in src: if x not in website_only: callp.append(x) subprocess.call(callp) print("- -- --- -- - Generating web site") for x in src: subprocess.call(["pandoc", "--template=html.pandoc", "-f", "markdown-smart", "--metadata", 'title="SoLoud ' + datestring + ' ' + x[:len(x)-4] + '"', "-B", "htmlpre.txt", "-A", "htmlpost.txt", "--default-image-extension=png", x, "-o", datestring + "/web/" + x[:len(x)-3]+"html.bak"]) with open(datestring + "/web/" + x[:len(x)-3]+"html", "w") as file_out: with open(datestring + "/web/" + x[:len(x)-3]+"html.bak", "r") as file_in: for line in file_in: file_out.write(line.replace('code>', 'code>\n').replace('::','::<wbr>').replace('\xc2','').replace('\xa0','')) if x == "intro.mmd": if os.path.isfile(datestring + "/web/index.html"): os.remove(datestring + "/web/index.html") os.rename(datestring + "/web/intro.html", datestring + "/web/index.html") print("- -- --- -- - Generating epub") callp = ["pandoc", "-N", "--toc", "--epub-cover-image=images/cover.png", "-t", "epub3", "--default-image-extension=png", "-f", "markdown-smart", "--css=epub.css", "--epub-metadata=metadata.xml", "-o", datestring + "/soloud_" + datestring + ".epub", "title.txt"] for x in src: if x not in website_only: callp.append(x) subprocess.call(callp) print("- -- --- -- - Converting epub -> mobi (kindlegen_output.txt)") with open('kindlegen_output.txt', 'w') as outfile: subprocess.call(["kindlegen", datestring + "/soloud_" + datestring + ".epub", "-c2"], stdout=outfile) print("- -- --- -- - Generating LaTex") for x in src: if x not in website_only: subprocess.call(["pandoc", "-t", "latex", "--listings", "--default-image-extension=pdf", "--top-level-division=chapter", x, "-o", "temp/" + x[:len(x)-3]+"tex.orig"]) with open("temp/" + x[:len(x)-3]+"tex", "w") as file_out: with open("temp/" + x[:len(x)-3]+"tex.orig", "r") as file_in: for line in file_in: file_out.write(line.replace('\\begin{longtable}[]{@{}ll@{}}', '\\begin{tabulary}{\\textwidth}{lJ}').replace('\\begin{longtable}[]{@{}lll@{}}', '\\begin{tabulary}{\\textwidth}{lJJ}').replace('\\begin{longtable}[]{@{}llll@{}}', '\\begin{tabulary}{\\textwidth}{lJJJ}').replace('\\endhead','').replace('\\end{longtable}','\\end{tabulary}')) print("- -- --- -- - Generating pdf (xelatex_output.txt)") with open('xelatex_output.txt', 'w') as outfile: subprocess.call(["xelatex", "SoLoud.tex"], stdout=outfile) print("- -- --- -- - Generating pdf pass 2..") subprocess.call(["xelatex", "SoLoud.tex"], stdout=outfile) shutil.move("SoLoud.pdf", datestring + "/soloud_" + datestring + ".pdf") print("- -- --- -- - Cleanup..") tempsuffix = ["aux", "toc", "out", "log", "lg", "4ct", "4tc", "idv", "tmp", "xdv", "xref", "bak"] for suffix in tempsuffix: for file in glob.glob("*."+suffix): os.remove(file) for file in glob.glob(datestring + "/web/*."+suffix): os.remove(file) for file in glob.glob("temp/*"): os.remove(file) os.rmdir("temp") print("- -- --- -- - Done - " + datestring)
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 18, 198, 37811, 12188, 10314, 3696, 422, 43104, 668, 2902, 357, 3020, 67, 8, 2723, 198, 220, 220, 220, 284, 2972, 17519, 11, 1390, 262, 3992, 2524, 290, 37124, 13, 198, 37811, 198, 198, 1...
2.187397
2,428
VTABLE(_Main) { <empty> Main _Main.COPY; } VTABLE(_Base) { <empty> Base _Base.COPY; } VTABLE(_Sub1) { _Base Sub1 _Sub1.COPY; } VTABLE(_Sub2) { _Base Sub2 _Sub2.COPY; } VTABLE(_Sub3) { _Sub1 Sub3 _Sub3.COPY; } VTABLE(_Sub4) { _Sub3 Sub4 _Sub4.COPY; } FUNCTION(_Main_New) { memo '' _Main_New: _T1 = 4 parm _T1 _T2 = call _Alloc _T3 = VTBL <_Main> *(_T2 + 0) = _T3 return _T2 } FUNCTION(_Main.COPY) { memo '_T4:4' _Main.COPY: _T5 = 4 parm _T5 _T6 = call _Alloc _T7 = VTBL <_Main> *(_T6 + 0) = _T7 return _T6 } FUNCTION(_Base_New) { memo '' _Base_New: _T8 = 4 parm _T8 _T9 = call _Alloc _T10 = VTBL <_Base> *(_T9 + 0) = _T10 return _T9 } FUNCTION(_Base.COPY) { memo '_T11:4' _Base.COPY: _T12 = 4 parm _T12 _T13 = call _Alloc _T14 = VTBL <_Base> *(_T13 + 0) = _T14 return _T13 } FUNCTION(_Sub1_New) { memo '' _Sub1_New: _T15 = 4 parm _T15 _T16 = call _Alloc _T17 = VTBL <_Sub1> *(_T16 + 0) = _T17 return _T16 } FUNCTION(_Sub1.COPY) { memo '_T18:4' _Sub1.COPY: _T19 = 4 parm _T19 _T20 = call _Alloc _T21 = VTBL <_Sub1> *(_T20 + 0) = _T21 return _T20 } FUNCTION(_Sub2_New) { memo '' _Sub2_New: _T22 = 4 parm _T22 _T23 = call _Alloc _T24 = VTBL <_Sub2> *(_T23 + 0) = _T24 return _T23 } FUNCTION(_Sub2.COPY) { memo '_T25:4' _Sub2.COPY: _T26 = 4 parm _T26 _T27 = call _Alloc _T28 = VTBL <_Sub2> *(_T27 + 0) = _T28 return _T27 } FUNCTION(_Sub3_New) { memo '' _Sub3_New: _T29 = 4 parm _T29 _T30 = call _Alloc _T31 = VTBL <_Sub3> *(_T30 + 0) = _T31 return _T30 } FUNCTION(_Sub3.COPY) { memo '_T32:4' _Sub3.COPY: _T33 = 4 parm _T33 _T34 = call _Alloc _T35 = VTBL <_Sub3> *(_T34 + 0) = _T35 return _T34 } FUNCTION(_Sub4_New) { memo '' _Sub4_New: _T36 = 4 parm _T36 _T37 = call _Alloc _T38 = VTBL <_Sub4> *(_T37 + 0) = _T38 return _T37 } FUNCTION(_Sub4.COPY) { memo '_T39:4' _Sub4.COPY: _T40 = 4 parm _T40 _T41 = call _Alloc _T42 = VTBL <_Sub4> *(_T41 + 0) = _T42 return _T41 } FUNCTION(main) { memo '' main: _T48 = call _Base_New _T43 = _T48 _T49 = call _Sub1_New _T44 = _T49 _T50 = call _Sub2_New _T45 = _T50 _T51 = call _Sub3_New _T46 = _T51 _T52 = call _Sub4_New _T47 = _T52 parm _T43 call _Main.printType parm _T44 call _Main.printType parm _T45 call _Main.printType parm _T46 call _Main.printType parm _T47 call _Main.printType _T43 = _T47 parm _T43 call _Main.printType _T54 = VTBL <_Sub1> _T55 = *(_T43 + 0) _L22: _T53 = (_T54 == _T55) if (_T53 != 0) branch _L23 _T55 = *(_T55 + 0) if (_T55 != 0) branch _L22 _T56 = "Decaf runtime error: " parm _T56 call _PrintString _T57 = *(_T43 + 0) _T58 = *(_T57 + 4) parm _T58 call _PrintString _T59 = " cannot be cast to " parm _T59 call _PrintString _T60 = VTBL <_Sub1> _T61 = *(_T60 + 4) parm _T61 call _PrintString _T62 = "\n" parm _T62 call _PrintString call _Halt _L23: _T44 = _T43 parm _T44 call _Main.printType } FUNCTION(_Main.printType) { memo '_T0:4' _Main.printType: _T64 = VTBL <_Sub4> _T65 = *(_T0 + 0) _L24: _T63 = (_T64 == _T65) if (_T63 != 0) branch _L25 _T65 = *(_T65 + 0) if (_T65 != 0) branch _L24 _T63 = 0 _L25: if (_T63 == 0) branch _L26 _T66 = "Sub4\n" parm _T66 call _PrintString branch _L27 _L26: _T68 = VTBL <_Sub3> _T69 = *(_T0 + 0) _L28: _T67 = (_T68 == _T69) if (_T67 != 0) branch _L29 _T69 = *(_T69 + 0) if (_T69 != 0) branch _L28 _T67 = 0 _L29: if (_T67 == 0) branch _L30 _T70 = "Sub3\n" parm _T70 call _PrintString branch _L31 _L30: _T72 = VTBL <_Sub2> _T73 = *(_T0 + 0) _L32: _T71 = (_T72 == _T73) if (_T71 != 0) branch _L33 _T73 = *(_T73 + 0) if (_T73 != 0) branch _L32 _T71 = 0 _L33: if (_T71 == 0) branch _L34 _T74 = "Sub2\n" parm _T74 call _PrintString branch _L35 _L34: _T76 = VTBL <_Sub1> _T77 = *(_T0 + 0) _L36: _T75 = (_T76 == _T77) if (_T75 != 0) branch _L37 _T77 = *(_T77 + 0) if (_T77 != 0) branch _L36 _T75 = 0 _L37: if (_T75 == 0) branch _L38 _T78 = "Sub1\n" parm _T78 call _PrintString branch _L39 _L38: _T80 = VTBL <_Base> _T81 = *(_T0 + 0) _L40: _T79 = (_T80 == _T81) if (_T79 != 0) branch _L41 _T81 = *(_T81 + 0) if (_T81 != 0) branch _L40 _T79 = 0 _L41: if (_T79 == 0) branch _L42 _T82 = "Base\n" parm _T82 call _PrintString _L42: _L39: _L35: _L31: _L27: }
[ 53, 38148, 28264, 13383, 8, 1391, 198, 220, 220, 220, 1279, 28920, 29, 198, 220, 220, 220, 8774, 198, 220, 220, 220, 4808, 13383, 13, 34, 3185, 56, 26, 198, 92, 198, 198, 53, 38148, 28264, 14881, 8, 1391, 198, 220, 220, 220, 1279,...
1.700524
2,865
# # Copyright 2019 The FATE Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #
[ 2, 198, 2, 220, 15069, 13130, 383, 376, 6158, 46665, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 220, 49962, 739, 262, 24843, 13789, 11, 10628, 362, 13, 15, 357, 1169, 366, 34156, 15341, 198, 2, 220, 345, 743, 407, 779, 428, 2393, ...
3.650888
169
""" sentry.options.defaults ~~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ from __future__ import absolute_import, print_function from sentry.logging import LoggingFormat from sentry.options import ( FLAG_IMMUTABLE, FLAG_NOSTORE, FLAG_PRIORITIZE_DISK, FLAG_REQUIRED, FLAG_ALLOW_EMPTY, register, ) from sentry.utils.types import Dict, String, Sequence # Cache # register('cache.backend', flags=FLAG_NOSTORE) # register('cache.options', type=Dict, flags=FLAG_NOSTORE) # System register('system.admin-email', flags=FLAG_REQUIRED) register('system.support-email', flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('system.security-email', flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('system.databases', type=Dict, flags=FLAG_NOSTORE) # register('system.debug', default=False, flags=FLAG_NOSTORE) register('system.rate-limit', default=0, flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('system.secret-key', flags=FLAG_NOSTORE) # Absolute URL to the sentry root directory. Should not include a trailing slash. register('system.url-prefix', ttl=60, grace=3600, flags=FLAG_REQUIRED | FLAG_PRIORITIZE_DISK) register('system.root-api-key', flags=FLAG_PRIORITIZE_DISK) register('system.logging-format', default=LoggingFormat.HUMAN, flags=FLAG_NOSTORE) # Redis register( 'redis.clusters', type=Dict, default={ 'default': { 'hosts': { 0: { 'host': '127.0.0.1', 'port': 6379, } }, }, }, flags=FLAG_NOSTORE | FLAG_IMMUTABLE ) register('redis.options', type=Dict, flags=FLAG_NOSTORE) # symbolizer specifics register('dsym.cache-path', type=String, default='/tmp/sentry-dsym-cache') # Mail register('mail.backend', default='smtp', flags=FLAG_NOSTORE) register('mail.host', default='localhost', flags=FLAG_REQUIRED | FLAG_PRIORITIZE_DISK) register('mail.port', default=25, flags=FLAG_REQUIRED | FLAG_PRIORITIZE_DISK) register('mail.username', flags=FLAG_REQUIRED | FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('mail.password', flags=FLAG_REQUIRED | FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('mail.use-tls', default=False, flags=FLAG_REQUIRED | FLAG_PRIORITIZE_DISK) register('mail.subject-prefix', default='[Sentry] ', flags=FLAG_PRIORITIZE_DISK) register('mail.from', default='root@localhost', flags=FLAG_REQUIRED | FLAG_PRIORITIZE_DISK) register('mail.list-namespace', type=String, default='localhost', flags=FLAG_NOSTORE) register('mail.enable-replies', default=False, flags=FLAG_PRIORITIZE_DISK) register('mail.reply-hostname', default='', flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('mail.mailgun-api-key', default='', flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) # SMS register('sms.twilio-account', default='', flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('sms.twilio-token', default='', flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('sms.twilio-number', default='', flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) # U2F register('u2f.app-id', default='', flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('u2f.facets', default=(), type=Sequence, flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('auth.ip-rate-limit', default=0, flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('auth.user-rate-limit', default=0, flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) register('api.rate-limit.org-create', default=5, flags=FLAG_ALLOW_EMPTY | FLAG_PRIORITIZE_DISK) # Filestore register('filestore.backend', default='filesystem', flags=FLAG_NOSTORE) register('filestore.options', default={'location': '/tmp/sentry-files'}, flags=FLAG_NOSTORE)
[ 37811, 198, 82, 13000, 13, 25811, 13, 12286, 82, 198, 27156, 8728, 4907, 93, 198, 198, 25, 22163, 4766, 25, 357, 66, 8, 3050, 12, 4967, 416, 262, 11352, 563, 4816, 11, 766, 37195, 20673, 329, 517, 3307, 13, 198, 25, 43085, 25, 347...
2.549258
1,482
"""Download `Unicodedata` files.""" from __future__ import unicode_literals import os import zipfile import codecs from urllib.request import urlopen __version__ = '2.2.0' HOME = os.path.dirname(os.path.abspath(__file__)) def zip_unicode(output, version): """Zip the Unicode files.""" zipper = zipfile.ZipFile(os.path.join(output, 'unicodedata', '%s.zip' % version), 'w', zipfile.ZIP_DEFLATED) target = os.path.join(output, 'unicodedata', version) print('Zipping %s.zip...' % version) for root, dirs, files in os.walk(target): for file in files: if file.endswith('.txt'): zipper.write(os.path.join(root, file), arcname=file) def unzip_unicode(output, version): """Unzip the Unicode files.""" unzipper = zipfile.ZipFile(os.path.join(output, 'unicodedata', '%s.zip' % version)) target = os.path.join(output, 'unicodedata', version) print('Unzipping %s.zip...' % version) os.makedirs(target) for f in unzipper.namelist(): # Do I need backslash on windows? Or is it forward as well? unzipper.extract(f, target) def download_unicodedata(version, output=HOME, no_zip=False): """Download Unicode data scripts and blocks.""" ver = tuple([int(x) for x in version.split('.')]) files = [ 'UnicodeData.txt', 'Scripts.txt', 'Blocks.txt', 'PropList.txt', 'DerivedCoreProperties.txt', 'DerivedNormalizationProps.txt', 'CompositionExclusions.txt', 'PropertyValueAliases.txt', 'PropertyAliases.txt', 'EastAsianWidth.txt', 'LineBreak.txt', 'HangulSyllableType.txt', 'DerivedAge.txt', 'auxiliary/WordBreakProperty.txt', 'auxiliary/SentenceBreakProperty.txt', 'auxiliary/GraphemeBreakProperty.txt', 'extracted/DerivedDecompositionType.txt', 'extracted/DerivedNumericType.txt', 'extracted/DerivedNumericValues.txt', 'extracted/DerivedJoiningType.txt', 'extracted/DerivedJoiningGroup.txt', 'extracted/DerivedCombiningClass.txt', 'emoji/emoji-data.txt' ] files.append('ScriptExtensions.txt') files.append('IndicPositionalCategory.txt') files.append('IndicSyllabicCategory.txt') files.append('BidiBrackets.txt') if ver >= (11, 0, 0): files.append('VerticalOrientation.txt') http_url = 'http://www.unicode.org/Public/%s/ucd/' % version ftp_url = 'ftp://ftp.unicode.org/Public/%s/ucd/' % version destination = os.path.join(output, 'unicodedata', version) if not os.path.exists(destination): os.makedirs(destination) zip_data = not no_zip for f in files: file_location = os.path.join(destination, os.path.basename(f)) retrieved = False if not os.path.exists(file_location): for url in (ftp_url, http_url): furl = url + f try: print('Downloading: %s --> %s' % (furl, file_location)) response = urlopen(furl, timeout=30) data = response.read() except Exception: print('Failed: %s' % url) continue with codecs.open(file_location, 'w', encoding='utf-8') as uf: uf.write(data.decode('utf-8')) retrieved = True break if not retrieved: print('Failed to acquire all needed Unicode files!') break else: retrieved = True print('Skipping: found %s' % file_location) if not retrieved: zip_data = False break if zip_data and not os.path.exists(os.path.join(output, 'unicodedata', '%s.zip' % version)): zip_unicode(output, version) def get_unicodedata(version, output=HOME, no_zip=False): """Ensure we have Unicode data to generate Unicode tables.""" target = os.path.join(output, 'unicodedata', version) zip_target = os.path.join(output, 'unicodedata', '%s.zip' % version) if not os.path.exists(target) and os.path.exists(zip_target): unzip_unicode(output, version) # Download missing files if any. Zip if required. download_unicodedata(version, output, no_zip) if __name__ == '__main__': import argparse import unicodedata parser = argparse.ArgumentParser(prog='unidatadownload', description='Generate a unicode property table.') parser.add_argument('--version', action='version', version="%(prog)s " + __version__) parser.add_argument('--output', default=HOME, help='Output file.') parser.add_argument('--unicode-version', default=None, help='Force a specific Unicode version.') args = parser.parse_args() if args.unicode_version is None: version = unicodedata.unidata_version else: version = args.unicode_version get_unicodedata(version, output=args.output)
[ 37811, 10002, 4600, 3118, 291, 9043, 1045, 63, 3696, 526, 15931, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198, 11748, 28686, 198, 11748, 19974, 7753, 198, 11748, 40481, 82, 198, 6738, 2956, 297, 571, 13, 25927, 1...
2.299722
2,162
# See LICENSE for licensing information. # # Copyright (c) 2021 Regents of the University of California and The Board # of Regents for the Oklahoma Agricultural and Mechanical College # (acting for and on behalf of Oklahoma State University) # All rights reserved. # import debug import datetime from policy import associativity from globals import OPTS, print_time
[ 2, 4091, 38559, 24290, 329, 15665, 1321, 13, 198, 2, 198, 2, 15069, 357, 66, 8, 33448, 3310, 658, 286, 262, 2059, 286, 3442, 290, 383, 5926, 198, 2, 286, 3310, 658, 329, 262, 10433, 36694, 290, 19663, 5535, 198, 2, 357, 27362, 329...
4.305882
85
#!/usr/bin/env python # -*- coding: utf-8 -*- __author__ = 'Shilin He' import pandas as pd import os import numpy as np def hdfs_data_loader(para): """ load the log sequence matrix and labels from the file path. Args: -------- para: the parameters dictionary Returns: -------- raw_data: log sequences matrix label_data: labels matrix """ file_path = para['path'] + para['log_seq_file_name'] label_path = para['path'] + para['label_file_name'] # load log sequence matrix pre_df = pd.read_csv(file_path, nrows=1, header=None, delimiter=r'\s+') columns = pre_df.columns.tolist() # remove the last column of block name use_cols = columns[:-1] data_df = pd.read_csv(file_path, delimiter=r'\s+', header=None, usecols =use_cols, dtype =int) raw_data = data_df.as_matrix() # load lables label_df = pd.read_csv(label_path, delimiter=r'\s+', header=None, usecols = [0], dtype =int) # usecols must be a list label_data = label_df.as_matrix() print("The raw data shape is {} and label shape is {}".format(raw_data.shape, label_data.shape)) assert raw_data.shape[0] == label_data.shape[0] print('The number of anomaly instances is %d' % sum(label_data)) return raw_data, label_data def bgl_data_loader(para): """ load the logs and the log_event_mapping from the file path. Args: -------- para: the parameters dictionary Returns: -------- raw_data: list of (label, time) event_mapping_data: a list of event index, where each row index indicates a corresponding log """ file_path = para['path'] + para['log_file_name'] event_mapping_path = para['path'] + para['log_event_mapping'] # load data data_df = pd.read_csv(file_path, delimiter=r'\s+', header=None, names = ['label','time'], usecols = para['select_column']) #, parse_dates = [1], date_parser=dateparse) # convert to date time format data_df['time'] = pd.to_datetime(data_df['time'], format="%Y-%m-%d-%H.%M.%S.%f") # calculate the time interval since the start time data_df['seconds_since'] = (data_df['time']-data_df['time'][0]).dt.total_seconds().astype(int) # get the label for each log data_df['label'] = (data_df['label'] != '-').astype(int) raw_data = data_df[['label','seconds_since']].as_matrix() # load the event mapping list event_mapping = pd.read_csv(event_mapping_path, delimiter=r'\s+', header=None, usecols = [0], dtype =int) event_mapping_data = event_mapping.as_matrix() print("The raw data shape is {} and label shape is {}".format(raw_data.shape, event_mapping_data.shape)) assert raw_data.shape[0] == event_mapping_data.shape[0] print('The number of anomaly logs is %d, but it requires further processing' % sum(raw_data[:, 0])) return raw_data, event_mapping_data def bgl_preprocess_data(para, raw_data, event_mapping_data): """ split logs into sliding windows, built an event count matrix and get the corresponding label Args: -------- para: the parameters dictionary raw_data: list of (label, time) event_mapping_data: a list of event index, where each row index indicates a corresponding log Returns: -------- event_count_matrix: event count matrix, where each row is an instance (log sequence vector) labels: a list of labels, 1 represents anomaly """ # create the directory for saving the sliding windows (start_index, end_index), which can be directly loaded in future running if not os.path.exists(para['save_path']): os.mkdir(para['save_path']) log_size = raw_data.shape[0] sliding_file_path = para['save_path']+'sliding_'+str(para['window_size'])+'h_'+str(para['step_size'])+'h.csv' #=================divide into sliding windows=============# start_end_index_list = [] # list of tuples, tuple contains two number, which represent the start and end of sliding time window label_data, time_data = raw_data[:,0], raw_data[:, 1] if not os.path.exists(sliding_file_path): # split into sliding window start_time = time_data[0] start_index = 0 end_index = 0 # get the first start, end index, end time for cur_time in time_data: if cur_time < start_time + para['window_size']*3600: end_index += 1 end_time = cur_time else: start_end_pair=tuple((start_index,end_index)) start_end_index_list.append(start_end_pair) break # move the start and end index until next sliding window while end_index < log_size: start_time = start_time + para['step_size']*3600 end_time = end_time + para['step_size']*3600 for i in range(start_index,end_index): if time_data[i] < start_time: i+=1 else: break for j in range(end_index, log_size): if time_data[j] < end_time: j+=1 else: break start_index = i end_index = j start_end_pair = tuple((start_index, end_index)) start_end_index_list.append(start_end_pair) inst_number = len(start_end_index_list) print('there are %d instances (sliding windows) in this dataset\n'%inst_number) np.savetxt(sliding_file_path,start_end_index_list,delimiter=',',fmt='%d') else: print('Loading start_end_index_list from file') start_end_index_list = pd.read_csv(sliding_file_path, header=None).as_matrix() inst_number = len(start_end_index_list) print('there are %d instances (sliding windows) in this dataset' % inst_number) # get all the log indexes in each time window by ranging from start_index to end_index expanded_indexes_list=[] for t in range(inst_number): index_list = [] expanded_indexes_list.append(index_list) for i in range(inst_number): start_index = start_end_index_list[i][0] end_index = start_end_index_list[i][1] for l in range(start_index, end_index): expanded_indexes_list[i].append(l) event_mapping_data = [row[0] for row in event_mapping_data] event_num = len(list(set(event_mapping_data))) print('There are %d log events'%event_num) #=================get labels and event count of each sliding window =============# labels = [] event_count_matrix = np.zeros((inst_number,event_num)) for j in range(inst_number): label = 0 #0 represent success, 1 represent failure for k in expanded_indexes_list[j]: event_index = event_mapping_data[k] event_count_matrix[j, event_index] += 1 if label_data[k]: label = 1 continue labels.append(label) assert inst_number == len(labels) print("Among all instances, %d are anomalies"%sum(labels)) assert event_count_matrix.shape[0] == len(labels) return event_count_matrix, labels def deepia_data_loader(para): """ load the logs and the log_event_mapping from the file path. Args: -------- para: the parameters dictionary Returns: -------- raw_data: list of (label, time) event_mapping_data: a list of event index, where each row index indicates a corresponding log """ file_path = para['path'] + para['log_file_name'] event_mapping_path = para['path'] + para['log_event_mapping'] # load data data_df = pd.read_csv(file_path, delimiter=r'\s+', header=None, names=['month', 'day', 'hour'], usecols=para['select_column']) # , parse_dates = [1], date_parser=dateparse) # convert to date time format data_df = data_df[['month', 'day', 'hour']].apply(lambda x: list(map(str, x))) data_df['time'] = data_df[['month', 'day', 'hour']].apply(lambda x: '-'.join(x), axis=1) # data_df['time'] = pd.to_datetime(data_df['time'], format="%b-%d-%H:%M:%S") # calculate the time interval since the start time data_df['seconds_since'] = (data_df['time'] - data_df['time'][0]).dt.total_seconds().astype(int) # get the label for each log # data_df['label'] = (data_df['label'] != '-').astype(int) raw_data = data_df[['seconds_since']].as_matrix() # load the event mapping list event_mapping = pd.read_csv(event_mapping_path, delimiter=r'\s+', header=None, usecols = [0], dtype =int) event_mapping_data = event_mapping.as_matrix() print("The raw data shape is {} and label shape is {}".format(raw_data.shape, event_mapping_data.shape)) assert raw_data.shape[0] == event_mapping_data.shape[0] #print('The number of anomaly logs is %d, but it requires further processing' % sum(raw_data[:, 0])) return raw_data, event_mapping_data def deepia_preprocess_data(para, raw_data, event_mapping_data): """ split logs into sliding windows, built an event count matrix and get the corresponding label Args: -------- para: the parameters dictionary raw_data: list of (label, time) event_mapping_data: a list of event index, where each row index indicates a corresponding log Returns: -------- event_count_matrix: event count matrix, where each row is an instance (log sequence vector) labels: a list of labels, 1 represents anomaly """ # create the directory for saving the sliding windows (start_index, end_index), which can be directly loaded in future running if not os.path.exists(para['save_path']): os.mkdir(para['save_path']) log_size = raw_data.shape[0] sliding_file_path = para['save_path']+'sliding_'+str(para['window_size'])+'h_'+str(para['step_size'])+'h.csv' #=================divide into sliding windows=============# start_end_index_list = [] # list of tuples, tuple contains two number, which represent the start and end of sliding time window time_data = raw_data[:,0] if not os.path.exists(sliding_file_path): # split into sliding window start_time = time_data[0] start_index = 0 end_index = 0 # get the first start, end index, end time for cur_time in time_data: if cur_time < start_time + para['window_size']*3600: end_index += 1 end_time = cur_time else: start_end_pair=tuple((start_index,end_index)) start_end_index_list.append(start_end_pair) break # move the start and end index until next sliding window while end_index < log_size: start_time = start_time + para['step_size']*3600 end_time = end_time + para['step_size']*3600 for i in range(start_index,end_index): if time_data[i] < start_time: i+=1 else: break for j in range(end_index, log_size): if time_data[j] < end_time: j+=1 else: break start_index = i end_index = j start_end_pair = tuple((start_index, end_index)) start_end_index_list.append(start_end_pair) inst_number = len(start_end_index_list) print('there are %d instances (sliding windows) in this dataset\n'%inst_number) np.savetxt(sliding_file_path,start_end_index_list,delimiter=',',fmt='%d') else: print('Loading start_end_index_list from file') start_end_index_list = pd.read_csv(sliding_file_path, header=None).as_matrix() inst_number = len(start_end_index_list) print('there are %d instances (sliding windows) in this dataset' % inst_number) # get all the log indexes in each time window by ranging from start_index to end_index expanded_indexes_list=[] for t in range(inst_number): index_list = [] expanded_indexes_list.append(index_list) for i in range(inst_number): start_index = start_end_index_list[i][0] end_index = start_end_index_list[i][1] for l in range(start_index, end_index): expanded_indexes_list[i].append(l) event_mapping_data = [row[0] for row in event_mapping_data] event_num = len(list(set(event_mapping_data))) print('There are %d log events'%event_num) #=================get labels and event count of each sliding window =============# event_count_matrix = np.zeros((inst_number,event_num)) for j in range(inst_number): for k in expanded_indexes_list[j]: event_index = event_mapping_data[k] event_count_matrix[j, event_index] += 1 #print("Among all instances, %d are anomalies"%sum(labels)) return event_count_matrix
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 834, 9800, 834, 796, 705, 2484, 346, 259, 679, 6, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 11748, 28686, 198, ...
2.70113
4,246
from __future__ import print_function import re, sys, glob, getopt, os if __name__ == '__main__': main()
[ 6738, 11593, 37443, 834, 1330, 3601, 62, 8818, 198, 11748, 302, 11, 25064, 11, 15095, 11, 651, 8738, 11, 28686, 198, 220, 220, 220, 220, 220, 220, 220, 220, 198, 361, 11593, 3672, 834, 6624, 705, 834, 12417, 834, 10354, 198, 220, 22...
2.510638
47
"""Tests of selected stdlib functions.""" from pytype.tests import test_base test_base.main(globals(), __name__ == "__main__")
[ 37811, 51, 3558, 286, 6163, 14367, 8019, 5499, 526, 15931, 198, 198, 6738, 12972, 4906, 13, 41989, 1330, 1332, 62, 8692, 628, 198, 198, 9288, 62, 8692, 13, 12417, 7, 4743, 672, 874, 22784, 11593, 3672, 834, 6624, 366, 834, 12417, 834,...
2.977273
44
# -*- coding: utf-8 -*- """ Created on Tue Oct 20 16:04:52 2020 @author: rjovelin """
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 37811, 198, 41972, 319, 30030, 2556, 1160, 1467, 25, 3023, 25, 4309, 12131, 198, 198, 31, 9800, 25, 374, 7639, 626, 259, 198, 37811, 628 ]
2.25641
39
import random from datetime import datetime from passlib.handlers.sha2_crypt import sha256_crypt from pymongo import MongoClient from pymongo.errors import ConnectionFailure from tarentsocialwall.SocialPost import SocialPost from tarentsocialwall.User import User from tarentsocialwall.Util import Util
[ 11748, 4738, 198, 6738, 4818, 8079, 1330, 4818, 8079, 198, 198, 6738, 1208, 8019, 13, 4993, 8116, 13, 26270, 17, 62, 29609, 1330, 427, 64, 11645, 62, 29609, 198, 6738, 279, 4948, 25162, 1330, 42591, 11792, 198, 6738, 279, 4948, 25162, ...
3.731707
82
#!/usr/bin/env python # # Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. # # Licensed under the MIT License. See the LICENSE accompanying this file # for the specific language governing permissions and limitations under # the License. # # # Copy this script to /sbin/mount.efs and make sure it is executable. # # You will be able to mount an EFS file system by its short name, by adding it # to /etc/fstab. The syntax of an fstab entry is: # # [Device] [Mount Point] [File System Type] [Options] [Dump] [Pass] # # Add an entry like this: # # fs-deadbeef /mount_point efs _netdev 0 0 # # Using the 'efs' type will cause '/sbin/mount.efs' to be called by 'mount -a' # for this file system. The '_netdev' option tells the init system that the # 'efs' type is a networked file system type. This has been tested with systemd # (Amazon Linux 2, CentOS 7, RHEL 7, Debian 9, and Ubuntu 16.04), and upstart # (Amazon Linux 2017.09). # # Once there is an entry in fstab, the file system can be mounted with: # # sudo mount /mount_point # # The script will add recommended mount options, if not provided in fstab. import base64 import errno import hashlib import hmac import json import logging import os import pwd import random import re import socket import subprocess import sys import threading import time from contextlib import contextmanager from datetime import datetime, timedelta from logging.handlers import RotatingFileHandler try: import ConfigParser from ConfigParser import NoOptionError, NoSectionError except ImportError: from configparser import ConfigParser, NoOptionError, NoSectionError try: from urllib.parse import quote_plus except ImportError: from urllib import quote_plus try: from urllib2 import URLError, HTTPError, build_opener, urlopen, Request, HTTPHandler from urllib import urlencode except ImportError: from urllib.request import urlopen, Request from urllib.error import URLError, HTTPError from urllib.parse import urlencode try: import botocore.session from botocore.exceptions import ClientError, NoCredentialsError, EndpointConnectionError BOTOCORE_PRESENT = True except ImportError: BOTOCORE_PRESENT = False VERSION = '1.28.2' SERVICE = 'elasticfilesystem' CONFIG_FILE = '/etc/amazon/efs/efs-utils.conf' CONFIG_SECTION = 'mount' CLIENT_INFO_SECTION = 'client-info' CLIENT_SOURCE_STR_LEN_LIMIT = 100 CLOUDWATCH_LOG_SECTION = 'cloudwatch-log' DEFAULT_CLOUDWATCH_LOG_GROUP = '/aws/efs/utils' DEFAULT_RETENTION_DAYS = 14 # Cloudwatchlog agent dict includes cloudwatchlog botocore client, cloudwatchlog group name, cloudwatchlog stream name CLOUDWATCHLOG_AGENT = None LOG_DIR = '/var/log/amazon/efs' LOG_FILE = 'mount.log' STATE_FILE_DIR = '/var/run/efs' PRIVATE_KEY_FILE = '/etc/amazon/efs/privateKey.pem' DATE_ONLY_FORMAT = '%Y%m%d' SIGV4_DATETIME_FORMAT = '%Y%m%dT%H%M%SZ' CERT_DATETIME_FORMAT = '%y%m%d%H%M%SZ' AWS_CREDENTIALS_FILE = os.path.expanduser(os.path.join('~' + pwd.getpwuid(os.getuid()).pw_name, '.aws', 'credentials')) AWS_CONFIG_FILE = os.path.expanduser(os.path.join('~' + pwd.getpwuid(os.getuid()).pw_name, '.aws', 'config')) CA_CONFIG_BODY = """dir = %s RANDFILE = $dir/database/.rand [ ca ] default_ca = local_ca [ local_ca ] database = $dir/database/index.txt serial = $dir/database/serial private_key = %s cert = $dir/certificate.pem new_certs_dir = $dir/certs default_md = sha256 preserve = no policy = efsPolicy x509_extensions = v3_ca [ efsPolicy ] CN = supplied [ req ] prompt = no distinguished_name = req_distinguished_name [ req_distinguished_name ] CN = %s %s %s %s """ # SigV4 Auth ALGORITHM = 'AWS4-HMAC-SHA256' AWS4_REQUEST = 'aws4_request' HTTP_REQUEST_METHOD = 'GET' CANONICAL_URI = '/' CANONICAL_HEADERS_DICT = { 'host': '%s' } CANONICAL_HEADERS = '\n'.join(['%s:%s' % (k, v) for k, v in sorted(CANONICAL_HEADERS_DICT.items())]) SIGNED_HEADERS = ';'.join(CANONICAL_HEADERS_DICT.keys()) REQUEST_PAYLOAD = '' FS_ID_RE = re.compile('^(?P<fs_id>fs-[0-9a-f]+)$') EFS_FQDN_RE = re.compile(r'^(?P<fs_id>fs-[0-9a-f]+)\.efs\.(?P<region>[a-z0-9-]+)\.(?P<dns_name_suffix>[a-z0-9.]+)$') AP_ID_RE = re.compile('^fsap-[0-9a-f]{17}$') CREDENTIALS_KEYS = ['AccessKeyId', 'SecretAccessKey', 'Token'] ECS_URI_ENV = 'AWS_CONTAINER_CREDENTIALS_RELATIVE_URI' ECS_TASK_METADATA_API = 'http://169.254.170.2' WEB_IDENTITY_ROLE_ARN_ENV = 'AWS_ROLE_ARN' WEB_IDENTITY_TOKEN_FILE_ENV = 'AWS_WEB_IDENTITY_TOKEN_FILE' STS_ENDPOINT_URL = 'https://sts.amazonaws.com/' INSTANCE_METADATA_TOKEN_URL = 'http://169.254.169.254/latest/api/token' INSTANCE_METADATA_SERVICE_URL = 'http://169.254.169.254/latest/dynamic/instance-identity/document/' INSTANCE_IAM_URL = 'http://169.254.169.254/latest/meta-data/iam/security-credentials/' SECURITY_CREDS_ECS_URI_HELP_URL = 'https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html' SECURITY_CREDS_WEBIDENTITY_HELP_URL = 'https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html' SECURITY_CREDS_IAM_ROLE_HELP_URL = 'https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html' DEFAULT_STUNNEL_VERIFY_LEVEL = 2 DEFAULT_STUNNEL_CAFILE = '/etc/amazon/efs/efs-utils.crt' NOT_BEFORE_MINS = 15 NOT_AFTER_HOURS = 3 EFS_ONLY_OPTIONS = [ 'accesspoint', 'awscredsuri', 'awsprofile', 'cafile', 'iam', 'netns', 'noocsp', 'ocsp', 'tls', 'tlsport', 'verify' ] UNSUPPORTED_OPTIONS = [ 'capath' ] STUNNEL_GLOBAL_CONFIG = { 'fips': 'no', 'foreground': 'yes', 'socket': [ 'l:SO_REUSEADDR=yes', 'a:SO_BINDTODEVICE=lo', ], } STUNNEL_EFS_CONFIG = { 'client': 'yes', 'accept': '127.0.0.1:%s', 'connect': '%s:2049', 'sslVersion': 'TLSv1.2', 'renegotiation': 'no', 'TIMEOUTbusy': '20', 'TIMEOUTclose': '0', 'TIMEOUTidle': '70', 'delay': 'yes', } WATCHDOG_SERVICE = 'amazon-efs-mount-watchdog' SYSTEM_RELEASE_PATH = '/etc/system-release' OS_RELEASE_PATH = '/etc/os-release' RHEL8_RELEASE_NAME = 'Red Hat Enterprise Linux release 8' CENTOS8_RELEASE_NAME = 'CentOS Linux release 8' FEDORA_RELEASE_NAME = 'Fedora release' SUSE_RELEASE_NAME = 'openSUSE Leap' SKIP_NO_LIBWRAP_RELEASES = [RHEL8_RELEASE_NAME, CENTOS8_RELEASE_NAME, FEDORA_RELEASE_NAME, SUSE_RELEASE_NAME] def get_region_from_legacy_dns_format(config): """ For backwards compatibility check dns_name_format to obtain the target region. This functionality should only be used if region is not present in the config file and metadata calls fail. """ dns_name_format = config.get(CONFIG_SECTION, 'dns_name_format') if '{region}' not in dns_name_format: split_dns_name_format = dns_name_format.split('.') if '{dns_name_suffix}' in dns_name_format: return split_dns_name_format[-2] elif 'amazonaws.com' in dns_name_format: return split_dns_name_format[-3] raise Exception('Region not found in dns_name_format') def get_aws_security_credentials(use_iam, awsprofile=None, aws_creds_uri=None): """ Lookup AWS security credentials (access key ID and secret access key). Adapted credentials provider chain from: https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html and https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/credentials.html """ if not use_iam: return None, None # attempt to lookup AWS security credentials through the credentials URI the ECS agent generated if aws_creds_uri: return get_aws_security_credentials_from_ecs(aws_creds_uri, True) # attempt to lookup AWS security credentials in AWS credentials file (~/.aws/credentials) # and configs file (~/.aws/config) with given awsprofile if awsprofile: return get_aws_security_credentials_from_awsprofile(awsprofile, True) # attempt to lookup AWS security credentials through AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable if ECS_URI_ENV in os.environ: credentials, credentials_source = get_aws_security_credentials_from_ecs(os.environ[ECS_URI_ENV], False) if credentials and credentials_source: return credentials, credentials_source # attempt to lookup AWS security credentials through AssumeRoleWithWebIdentity # (e.g. for IAM Role for Service Accounts (IRSA) approach on EKS) if WEB_IDENTITY_ROLE_ARN_ENV in os.environ and WEB_IDENTITY_TOKEN_FILE_ENV in os.environ: credentials, credentials_source = get_aws_security_credentials_from_webidentity( os.environ[WEB_IDENTITY_ROLE_ARN_ENV], os.environ[WEB_IDENTITY_TOKEN_FILE_ENV], False ) if credentials and credentials_source: return credentials, credentials_source # attempt to lookup AWS security credentials with IAM role name attached to instance # through IAM role name security credentials lookup uri iam_role_name = get_iam_role_name() if iam_role_name: credentials, credentials_source = get_aws_security_credentials_from_instance_metadata(iam_role_name) if credentials and credentials_source: return credentials, credentials_source error_msg = 'AWS Access Key ID and Secret Access Key are not found in AWS credentials file (%s), config file (%s), ' \ 'from ECS credentials relative uri, or from the instance security credentials service' % \ (AWS_CREDENTIALS_FILE, AWS_CONFIG_FILE) fatal_error(error_msg, error_msg) def write_stunnel_config_file(config, state_file_dir, fs_id, mountpoint, tls_port, dns_name, verify_level, ocsp_enabled, options, log_dir=LOG_DIR, cert_details=None): """ Serializes stunnel configuration to a file. Unfortunately this does not conform to Python's config file format, so we have to hand-serialize it. """ mount_filename = get_mount_specific_filename(fs_id, mountpoint, tls_port) global_config = dict(STUNNEL_GLOBAL_CONFIG) if config.getboolean(CONFIG_SECTION, 'stunnel_debug_enabled'): global_config['debug'] = 'debug' if config.has_option(CONFIG_SECTION, 'stunnel_logs_file'): global_config['output'] = config.get(CONFIG_SECTION, 'stunnel_logs_file').replace('{fs_id}', fs_id) else: global_config['output'] = os.path.join(log_dir, '%s.stunnel.log' % mount_filename) efs_config = dict(STUNNEL_EFS_CONFIG) efs_config['accept'] = efs_config['accept'] % tls_port efs_config['connect'] = efs_config['connect'] % dns_name efs_config['verify'] = verify_level if verify_level > 0: add_stunnel_ca_options(efs_config, config, options) if cert_details: efs_config['cert'] = cert_details['certificate'] efs_config['key'] = cert_details['privateKey'] check_host_supported, ocsp_aia_supported = get_version_specific_stunnel_options() tls_controls_message = 'WARNING: Your client lacks sufficient controls to properly enforce TLS. Please upgrade stunnel, ' \ 'or disable "%%s" in %s.\nSee %s for more detail.' % (CONFIG_FILE, 'https://docs.aws.amazon.com/console/efs/troubleshooting-tls') if config.getboolean(CONFIG_SECTION, 'stunnel_check_cert_hostname'): if check_host_supported: efs_config['checkHost'] = dns_name else: fatal_error(tls_controls_message % 'stunnel_check_cert_hostname') # Only use the config setting if the override is not set if ocsp_enabled: if ocsp_aia_supported: efs_config['OCSPaia'] = 'yes' else: fatal_error(tls_controls_message % 'stunnel_check_cert_validity') system_release_version = get_system_release_version() if not any(release in system_release_version for release in SKIP_NO_LIBWRAP_RELEASES): efs_config['libwrap'] = 'no' stunnel_config = '\n'.join(serialize_stunnel_config(global_config) + serialize_stunnel_config(efs_config, 'efs')) logging.debug('Writing stunnel configuration:\n%s', stunnel_config) stunnel_config_file = os.path.join(state_file_dir, 'stunnel-config.%s' % mount_filename) with open(stunnel_config_file, 'w') as f: f.write(stunnel_config) return stunnel_config_file def write_tls_tunnel_state_file(fs_id, mountpoint, tls_port, tunnel_pid, command, files, state_file_dir, cert_details=None): """ Return the name of the temporary file containing TLS tunnel state, prefixed with a '~'. This file needs to be renamed to a non-temporary version following a successful mount. """ state_file = '~' + get_mount_specific_filename(fs_id, mountpoint, tls_port) state = { 'pid': tunnel_pid, 'cmd': command, 'files': files, } if cert_details: state.update(cert_details) with open(os.path.join(state_file_dir, state_file), 'w') as f: json.dump(state, f) return state_file def poll_tunnel_process(tunnel_proc, fs_id, mount_completed): """ poll the tunnel process health every .5s during the mount attempt to fail fast if the tunnel dies - since this is not called from the main thread, if the tunnel fails, exit uncleanly with os._exit """ while not mount_completed.is_set(): try: test_tunnel_process(tunnel_proc, fs_id) except SystemExit as e: os._exit(e.code) mount_completed.wait(.5) def parse_arguments_early_exit(args=None): """Parse arguments, checking for early exit conditions only""" if args is None: args = sys.argv if '-h' in args[1:] or '--help' in args[1:]: usage(out=sys.stdout, exit_code=0) if '--version' in args[1:]: sys.stdout.write('%s Version: %s\n' % (args[0], VERSION)) sys.exit(0) def parse_arguments(config, args=None): """Parse arguments, return (fsid, path, mountpoint, options)""" if args is None: args = sys.argv fsname = None mountpoint = None options = {} if len(args) > 1: fsname = args[1] if len(args) > 2: mountpoint = args[2] if len(args) > 4 and '-o' in args[:-1]: options_index = args.index('-o') + 1 options = parse_options(args[options_index]) if not fsname or not mountpoint: usage(out=sys.stderr) fs_id, path = match_device(config, fsname) return fs_id, path, mountpoint, options def get_private_key_path(): """Wrapped for mocking purposes in unit tests""" return PRIVATE_KEY_FILE def create_ca_conf(config_path, common_name, directory, private_key, date, region, fs_id, security_credentials, ap_id, client_info): """Populate ca/req configuration file with fresh configurations at every mount since SigV4 signature can change""" public_key_path = os.path.join(directory, 'publicKey.pem') ca_extension_body = ca_extension_builder(ap_id, security_credentials, fs_id, client_info) efs_client_auth_body = efs_client_auth_builder(public_key_path, security_credentials['AccessKeyId'], security_credentials['SecretAccessKey'], date, region, fs_id, security_credentials['Token']) if security_credentials else '' efs_client_info_body = efs_client_info_builder(client_info) if client_info else '' full_config_body = CA_CONFIG_BODY % (directory, private_key, common_name, ca_extension_body, efs_client_auth_body, efs_client_info_body) with open(config_path, 'w') as f: f.write(full_config_body) return full_config_body def subprocess_call(cmd, error_message): """Helper method to run shell openssl command and to handle response error messages""" retry_times = 3 for retry in range(retry_times): process = subprocess.Popen(cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=True) (output, err) = process.communicate() rc = process.poll() if rc != 0: logging.error('Command %s failed, rc=%s, stdout="%s", stderr="%s"' % (cmd, rc, output, err), exc_info=True) try: process.kill() except OSError: # Silently fail if the subprocess has exited already pass else: return output, err error_message = '%s, error is: %s' % (error_message, err) fatal_error(error_message, error_message) def ca_dirs_check(config, database_dir, certs_dir): """Check if mount's database and certs directories exist and if not, create directories (also create all intermediate directories if they don't exist).""" if not os.path.exists(database_dir): create_required_directory(config, database_dir) if not os.path.exists(certs_dir): create_required_directory(config, certs_dir) def ca_supporting_files_check(index_path, index_attr_path, serial_path, rand_path): """Recreate all supporting openssl ca and req files if they're not present in their respective directories""" if not os.path.isfile(index_path): open(index_path, 'w').close() if not os.path.isfile(index_attr_path): with open(index_attr_path, 'w+') as f: f.write('unique_subject = no') if not os.path.isfile(serial_path): with open(serial_path, 'w+') as f: f.write('00') if not os.path.isfile(rand_path): open(rand_path, 'w').close() def get_utc_now(): """ Wrapped for patching purposes in unit tests """ return datetime.utcnow() def create_canonical_request(public_key_hash, date, access_key, region, fs_id, session_token=None): """ Create a Canonical Request - https://docs.aws.amazon.com/general/latest/gr/sigv4-create-canonical-request.html """ formatted_datetime = date.strftime(SIGV4_DATETIME_FORMAT) credential = quote_plus(access_key + '/' + get_credential_scope(date, region)) request = HTTP_REQUEST_METHOD + '\n' request += CANONICAL_URI + '\n' request += create_canonical_query_string(public_key_hash, credential, formatted_datetime, session_token) + '\n' request += CANONICAL_HEADERS % fs_id + '\n' request += SIGNED_HEADERS + '\n' sha256 = hashlib.sha256() sha256.update(REQUEST_PAYLOAD.encode()) request += sha256.hexdigest() return request def create_string_to_sign(canonical_request, date, region): """ Create a String to Sign - https://docs.aws.amazon.com/general/latest/gr/sigv4-create-string-to-sign.html """ string_to_sign = ALGORITHM + '\n' string_to_sign += date.strftime(SIGV4_DATETIME_FORMAT) + '\n' string_to_sign += get_credential_scope(date, region) + '\n' sha256 = hashlib.sha256() sha256.update(canonical_request.encode()) string_to_sign += sha256.hexdigest() return string_to_sign def calculate_signature(string_to_sign, date, secret_access_key, region): """ Calculate the Signature - https://docs.aws.amazon.com/general/latest/gr/sigv4-calculate-signature.html """ key_date = _sign(('AWS4' + secret_access_key).encode('utf-8'), date.strftime(DATE_ONLY_FORMAT)).digest() add_region = _sign(key_date, region).digest() add_service = _sign(add_region, SERVICE).digest() signing_key = _sign(add_service, 'aws4_request').digest() return _sign(signing_key, string_to_sign).hexdigest() def match_device(config, device): """Return the EFS id and the remote path to mount""" try: remote, path = device.split(':', 1) except ValueError: remote = device path = '/' if FS_ID_RE.match(remote): return remote, path try: primary, secondaries, _ = socket.gethostbyname_ex(remote) hostnames = list(filter(lambda e: e is not None, [primary] + secondaries)) except socket.gaierror: create_default_cloudwatchlog_agent_if_not_exist(config) fatal_error( 'Failed to resolve "%s" - check that the specified DNS name is a CNAME record resolving to a valid EFS DNS ' 'name' % remote, 'Failed to resolve "%s"' % remote ) if not hostnames: create_default_cloudwatchlog_agent_if_not_exist(config) fatal_error( 'The specified domain name "%s" did not resolve to an EFS mount target' % remote ) for hostname in hostnames: efs_fqdn_match = EFS_FQDN_RE.match(hostname) if efs_fqdn_match: fs_id = efs_fqdn_match.group('fs_id') expected_dns_name = get_dns_name(config, fs_id) # check that the DNS name of the mount target matches exactly the DNS name the CNAME resolves to if hostname == expected_dns_name: return fs_id, path else: create_default_cloudwatchlog_agent_if_not_exist(config) fatal_error('The specified CNAME "%s" did not resolve to a valid DNS name for an EFS mount target. ' 'Please refer to the EFS documentation for mounting with DNS names for examples: %s' % (remote, 'https://docs.aws.amazon.com/efs/latest/ug/mounting-fs-mount-cmd-dns-name.html')) if '__main__' == __name__: main()
[ 2, 48443, 14629, 14, 8800, 14, 24330, 21015, 198, 2, 198, 2, 15069, 2177, 12, 7908, 6186, 13, 785, 11, 3457, 13, 290, 663, 29116, 13, 1439, 6923, 33876, 13, 198, 2, 198, 2, 49962, 739, 262, 17168, 13789, 13, 4091, 262, 38559, 2429...
2.442356
8,778
import discord from discord.ext import commands from discord.utils import get
[ 11748, 36446, 198, 6738, 36446, 13, 2302, 1330, 9729, 198, 6738, 36446, 13, 26791, 1330, 651 ]
4.8125
16
""" This script is where the preprocessed data is used to train the SVM model to perform the classification. I am using Stratified K-Fold Cross Validation to prevent bias and/or any imbalance that could affect the model's accuracy. REFERENCE: https://medium.com/@bedigunjit/simple-guide-to-text-classification-nlp-using-svm-and-naive-bayes-with-python-421db3a72d34 """ import numpy as np import pandas as pd from sklearn import model_selection, svm from sklearn.metrics import accuracy_score from sklearn.preprocessing import LabelEncoder from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.model_selection import StratifiedKFold # Open preproccessed csv df = pd.read_csv("preprocessed.csv", index_col=0) print(df.head()) print("SPLITTING TRAIN-TEST") x = df["Text"] y = df["PublicationTitle"] train_x, test_x, train_y, test_y = model_selection.train_test_split( df["Text"], df["PublicationTitle"], test_size=0.3) # Label encode the target variable to transform categorical data of string # type into numerical values the model can understand encoder = LabelEncoder() # train_y = encoder.fit_transform(train_y) # test_y = encoder.fit_transform(test_y) # Word vectorization # turning a collection of text documents into numerical feature vectors # We are using Term Frequency - Inverse Document tfidf_vect = TfidfVectorizer(max_features=5000) tfidf_vect.fit(df["Text"]) # train_x_tfidf = tfidf_vect.transform(train_x) # test_x_tfidf = tfidf_vect.transform(test_x) x_tfidf = tfidf_vect.transform(df["Text"]) y = encoder.fit_transform(y) # print(tfidf_vect.vocabulary_) # Fit the training dataset to the classifier print("TRAINING THE MODEL") SVM = svm.SVC(C=1.0, kernel='linear', degree=3, gamma='auto') skf = StratifiedKFold(n_splits=10, shuffle=True, random_state=1) accuracies = [] fold = 1 for train_idx, test_idx in skf.split(x, y): print("Working on fold", fold) x_train_fold, x_test_fold = x_tfidf[train_idx], x_tfidf[test_idx] y_train_fold, y_test_fold = y[train_idx], y[test_idx] SVM.fit(x_train_fold, y_train_fold) acc = SVM.score(x_test_fold, y_test_fold) print("Acc", fold, ":", acc) accuracies.append(acc) fold += 1 print("ACCURACIES:", accuracies) print("Max Accuracy:", np.max(accuracies)) print("Min Accuracy:", np.min(accuracies)) print("Mean of Accuracies:", np.mean(accuracies)) print("STD of Accuracies:", np.std(accuracies)) # print("RUNNING TEST PREDICTIONS") # predictions = SVM.predict(test_x_tfidf) # # Calculate accuracy score # accuracy = accuracy_score(test_y, predictions) # print("Accuracy:", str(accuracy * 100) + "%")
[ 37811, 198, 1212, 4226, 318, 810, 262, 662, 14681, 276, 1366, 318, 973, 284, 4512, 262, 311, 15996, 2746, 284, 198, 525, 687, 262, 17923, 13, 314, 716, 1262, 29186, 1431, 509, 12, 37, 727, 6372, 3254, 24765, 284, 220, 198, 3866, 115...
2.730769
962
from rsterm import EntryPoint from red_dwarf.project import provide_project_context, ProjectContext
[ 6738, 374, 1706, 76, 1330, 21617, 12727, 198, 6738, 2266, 62, 67, 5767, 69, 13, 16302, 1330, 2148, 62, 16302, 62, 22866, 11, 4935, 21947, 628, 198 ]
3.777778
27
#! /usr/bin/env python # Copyright Ivan Sovic, 2015. www.sovic.org # # Creates a pileup from a given SAM/BAM file, and calls consensus bases (or variants). import os import sys import operator import subprocess if __name__ == "__main__": # if (len(sys.argv) < 5): # sys.stderr.write('Usage:\n'); # sys.stderr.write('\t%s <reference_file_path> coverage_threshold <collective_output_file> <{sb}am_file_1> [<{sb}am_file_2> <{sb}am_file_3> ...]\n' % sys.argv[0]); # sys.stderr.write('\t(If <collective_output_file> is equal to "-", no files will be written to disk.)\n'); # exit(1); if len(sys.argv) < 5: sys.stderr.write("Usage:\n") sys.stderr.write( "\t%s <reference_file_path> coverage_threshold <output_prefix> <{sb}am_file_> [position]\n" % sys.argv[0] ) sys.stderr.write( '\t(If <collective_output_file> is equal to "-", no files will be written to disk.)\n' ) sys.stderr.write( '\tPosition parameter is a string specifying "chromosome:start-end"\n\n' ) exit(1) reference_file = sys.argv[1] coverage_threshold = int(sys.argv[2]) output_prefix = sys.argv[3] sam_file = sys.argv[4] bed_position = "" if len(sys.argv) > 5: bed_position = sys.argv[5] # sys.stderr.write('bed_position: "%s"\n\n' % bed_position); processes = [] if output_prefix == "-": output_prefix = os.path.splitext(sam_file)[0] main(sam_file, reference_file, coverage_threshold, output_prefix, 0, bed_position) # if (output_prefix != '-'): # CollectSummaries([sam_file], output_prefix, output_prefix + '.variant.sum');
[ 2, 0, 1220, 14629, 14, 8800, 14, 24330, 21015, 198, 198, 2, 15069, 21798, 6917, 291, 11, 1853, 13, 7324, 13, 568, 25531, 13, 2398, 198, 2, 198, 2, 7921, 274, 257, 14540, 929, 422, 257, 1813, 28844, 14, 33, 2390, 2393, 11, 290, 3...
2.215584
770
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ############################################################################## import time from lxml import etree from openerp.osv import fields, osv # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 29113, 29113, 7804, 4242, 2235, 198, 2, 198, 2, 220, 220, 220, 4946, 1137, 47, 11, 4946, 8090, 8549, 28186, 198, 2, 220, 220, 220, 15069, 357, 34, 8, 5472, 12, 10333...
3.518868
318
# -*- coding: utf-8 -*- # Copyright (c) 2015 David R. Andersen # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. import imaplib import re import keyring from libqtile.log_utils import logger from libqtile.widget import base
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 15069, 357, 66, 8, 1853, 3271, 371, 13, 42356, 198, 2, 198, 2, 2448, 3411, 318, 29376, 7520, 11, 1479, 286, 3877, 11, 284, 597, 1048, 16727, 257, 4866, 198, 2, ...
3.708709
333
from rest_framework.response import Response from rest_framework.test import APIClient from game.models import GameDefinition, AppUser
[ 6738, 1334, 62, 30604, 13, 26209, 1330, 18261, 198, 6738, 1334, 62, 30604, 13, 9288, 1330, 3486, 2149, 75, 1153, 198, 198, 6738, 983, 13, 27530, 1330, 3776, 36621, 11, 2034, 12982, 628, 628, 628, 198 ]
3.944444
36
# 2. Repeat Strings # Write a Program That Reads a list of strings. Each string is repeated N times, where N is the length of the string. Print the concatenated string. strings = input().split() output_string = "" for string in strings: N = len(string) output_string += string * N print(output_string)
[ 2, 362, 13, 197, 40322, 4285, 654, 198, 2, 19430, 257, 6118, 1320, 4149, 82, 257, 1351, 286, 13042, 13, 5501, 4731, 318, 5100, 399, 1661, 11, 810, 399, 318, 262, 4129, 286, 262, 4731, 13, 12578, 262, 1673, 36686, 515, 4731, 13, 19...
3.315789
95
from cklib.args import get_arg_parser, ArgumentParser from cloudkeeper_plugin_cleanup_aws_loadbalancers import CleanupAWSLoadbalancersPlugin
[ 6738, 269, 74, 8019, 13, 22046, 1330, 651, 62, 853, 62, 48610, 11, 45751, 46677, 198, 6738, 6279, 13884, 62, 33803, 62, 27773, 929, 62, 8356, 62, 2220, 6893, 20811, 1330, 5985, 929, 12298, 8634, 1170, 6893, 20811, 37233, 628 ]
3.55
40
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-09-17 06:45 from __future__ import unicode_literals from django.db import migrations, models
[ 2, 532, 9, 12, 19617, 25, 3384, 69, 12, 23, 532, 9, 12, 198, 2, 2980, 515, 416, 37770, 352, 13, 1157, 13, 1157, 319, 2864, 12, 2931, 12, 1558, 9130, 25, 2231, 198, 6738, 11593, 37443, 834, 1330, 28000, 1098, 62, 17201, 874, 198,...
2.754386
57
N, M, V = map(int, input().strip().split()) visited = [False] * (N + 1) graph = [[] for _ in range(N + 1)] for i in range(M): a, b = map(int, input().strip().split()) graph[a].append(b) graph[b].append(a) for i in range(1, N + 1): graph[i].sort() dfs(V) visited = [False] * (N + 1) print() bfs(V)
[ 628, 198, 198, 45, 11, 337, 11, 569, 796, 3975, 7, 600, 11, 5128, 22446, 36311, 22446, 35312, 28955, 198, 4703, 863, 796, 685, 25101, 60, 1635, 357, 45, 1343, 352, 8, 198, 198, 34960, 796, 16410, 60, 329, 4808, 287, 2837, 7, 45, ...
2.133333
150
from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app __author__ = "Artem Vovk, Roland Kluge, and Christian Kirschner" __copyright__ = "Copyright 2013-2015 UKP TU Darmstadt" __credits__ = ["Artem Vovk", "Roland Kluge", "Christian Kirschner"] __license__ = "ASL" application = webapp.WSGIApplication( [('/.*', Redirector)], debug=True) if __name__ == "__main__": main()
[ 6738, 23645, 13, 1324, 18392, 13, 2302, 1330, 3992, 1324, 198, 6738, 23645, 13, 1324, 18392, 13, 2302, 13, 12384, 1324, 13, 22602, 1330, 1057, 62, 18504, 12397, 62, 1324, 198, 198, 834, 9800, 834, 796, 366, 8001, 368, 569, 709, 74, ...
2.677019
161
""" Augmenters that apply mirroring/flipping operations to images. Do not import directly from this file, as the categorization is not final. Use instead :: from imgaug import augmenters as iaa and then e.g. :: seq = iaa.Sequential([ iaa.Fliplr((0.0, 1.0)), iaa.Flipud((0.0, 1.0)) ]) List of augmenters: * Fliplr * Flipud """ from __future__ import print_function, division, absolute_import from .. import parameters as iap import numpy as np import six.moves as sm from .meta import Augmenter
[ 37811, 198, 12512, 434, 364, 326, 4174, 10162, 278, 14, 2704, 4501, 4560, 284, 4263, 13, 198, 198, 5211, 407, 1330, 3264, 422, 428, 2393, 11, 355, 262, 17851, 1634, 318, 407, 2457, 13, 198, 11041, 2427, 7904, 628, 220, 220, 220, 422...
2.695
200
# Time Complexity - O(n) ; Space Complexity - O(n)
[ 2, 3862, 19157, 414, 532, 440, 7, 77, 8, 2162, 4687, 19157, 414, 532, 440, 7, 77, 8 ]
2.777778
18
import numpy as np import tensorflow as tf import matplotlib.pyplot as plt from gpflow.kernels import White, RBF from gpflow.likelihoods import Gaussian from deep_gp import DeepGP np.random.seed(0) tf.random.set_seed(0) if __name__ == '__main__': Xs, X_train, Y_train, Z = get_data() dgp = make_deep_GP(3, X_train, Y_train, Z) optimizer = tf.optimizers.Adam(learning_rate=0.01, epsilon=1e-08) for _ in range(1500): with tf.GradientTape(watch_accessed_variables=False) as tape: tape.watch(dgp.trainable_variables) objective = -dgp.elbo((X_train, Y_train)) gradients = tape.gradient(objective, dgp.trainable_variables) optimizer.apply_gradients(zip(gradients, dgp.trainable_variables)) print(f"ELBO: {-objective.numpy()}") samples, _, _ = dgp.predict_all_layers(Xs, num_samples=50, full_cov=True) plt.plot(Xs, samples[-1].numpy()[:, :, 0].T, color='r', alpha=0.3) plt.title('Deep Gaussian Process') plt.scatter(X_train, Y_train) plt.show()
[ 11748, 299, 32152, 355, 45941, 198, 11748, 11192, 273, 11125, 355, 48700, 198, 11748, 2603, 29487, 8019, 13, 9078, 29487, 355, 458, 83, 198, 6738, 27809, 11125, 13, 74, 44930, 1330, 2635, 11, 17986, 37, 198, 6738, 27809, 11125, 13, 2339...
2.25054
463
from __future__ import annotations import json import logging from contextlib import contextmanager, ExitStack from typing import List, Dict import pandas as pd from lithops.storage import Storage from lithops.storage.utils import CloudObject, StorageNoSuchKeyError from sm.engine.annotation_lithops.build_moldb import ( build_moldb, InputMolDb, DbFDRData, ) from sm.engine.annotation_lithops.calculate_centroids import ( calculate_centroids, validate_centroids, ) from sm.engine.annotation_lithops.executor import Executor from sm.engine.annotation_lithops.io import ( CObj, save_cobj, iter_cobjects_with_prefetch, deserialize, ) from sm.engine.annotation_lithops.utils import jsonhash from sm.engine.utils.db_mutex import DBMutex from sm.engine.ds_config import DSConfig from sm.engine.annotation.isocalc_wrapper import IsocalcWrapper logger = logging.getLogger('annotation-pipeline')
[ 6738, 11593, 37443, 834, 1330, 37647, 198, 198, 11748, 33918, 198, 11748, 18931, 198, 6738, 4732, 8019, 1330, 4732, 37153, 11, 29739, 25896, 198, 6738, 19720, 1330, 7343, 11, 360, 713, 198, 198, 11748, 19798, 292, 355, 279, 67, 198, 673...
2.894081
321
from PyQt5.QtWidgets import QMenu from gui.main_window.node_editor.items.connector_item import ConnectorItem
[ 6738, 9485, 48, 83, 20, 13, 48, 83, 54, 312, 11407, 1330, 1195, 23381, 198, 198, 6738, 11774, 13, 12417, 62, 17497, 13, 17440, 62, 35352, 13, 23814, 13, 8443, 273, 62, 9186, 1330, 8113, 273, 7449, 628 ]
2.921053
38