hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
d99e8a9a95f28da6c2d4d1ee42e95a270ab08977
421
py
Python
coding_intereview/1475. Final Prices With a Special Discount in a Shop.py
Jahidul007/Python-Bootcamp
3c870587465ff66c2c1871c8d3c4eea72463abda
[ "MIT" ]
2
2020-12-07T16:07:07.000Z
2020-12-07T16:08:53.000Z
coding_intereview/1475. Final Prices With a Special Discount in a Shop.py
purusharthmalik/Python-Bootcamp
2ed1cf886d1081de200b0fdd4cb4e28008c7e3d1
[ "MIT" ]
null
null
null
coding_intereview/1475. Final Prices With a Special Discount in a Shop.py
purusharthmalik/Python-Bootcamp
2ed1cf886d1081de200b0fdd4cb4e28008c7e3d1
[ "MIT" ]
1
2020-10-03T16:38:02.000Z
2020-10-03T16:38:02.000Z
class Solution: def finalPrices(self, prices: List[int]) -> List[int]: res = [] for i in range(len(prices)): for j in range(i+1,len(prices)): if prices[j]<=prices[i]: res.append(prices[i]-prices[j]) break if j==len(prices)-1: res.append(prices[i]) res.append(prices[-1]) return res
35.083333
58
0.460808
52
421
3.730769
0.384615
0.139175
0.231959
0.164948
0.226804
0
0
0
0
0
0
0.011858
0.39905
421
12
59
35.083333
0.754941
0
0
0
0
0
0
0
0
0
0
0
0
1
0.083333
false
0
0
0
0.25
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d9a714b3484177f5fee5427d98c53a86bf48daf3
134
py
Python
tests/__init__.py
eloo/sensor.sbahn_munich
05e05a845178ab529dc4c80e924035fe1d072b55
[ "MIT" ]
null
null
null
tests/__init__.py
eloo/sensor.sbahn_munich
05e05a845178ab529dc4c80e924035fe1d072b55
[ "MIT" ]
null
null
null
tests/__init__.py
eloo/sensor.sbahn_munich
05e05a845178ab529dc4c80e924035fe1d072b55
[ "MIT" ]
null
null
null
"""Tests for the sbahn_munich integration""" line_dict = { "name": "S3", "color": "#333333", "text_color": "#444444", }
14.888889
44
0.567164
15
134
4.866667
0.933333
0
0
0
0
0
0
0
0
0
0
0.12381
0.216418
134
8
45
16.75
0.571429
0.283582
0
0
0
0
0.388889
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d9c310055166d8d1507c05ad91c6bc47af7f5743
32,544
py
Python
dungeoncog/enemy_skills_pb2.py
muffin-rice/pad-cogs
820ecf08f9569a3d7cf3264d0eb9567264b42edf
[ "MIT" ]
3
2021-04-16T23:47:59.000Z
2021-09-10T06:00:18.000Z
dungeoncog/enemy_skills_pb2.py
muffin-rice/pad-cogs
820ecf08f9569a3d7cf3264d0eb9567264b42edf
[ "MIT" ]
708
2020-10-31T08:02:40.000Z
2022-03-31T09:39:25.000Z
dungeoncog/enemy_skills_pb2.py
muffin-rice/pad-cogs
820ecf08f9569a3d7cf3264d0eb9567264b42edf
[ "MIT" ]
20
2020-11-01T23:11:29.000Z
2022-02-07T07:04:15.000Z
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: enemy_skills.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() DESCRIPTOR = _descriptor.FileDescriptor( name='enemy_skills.proto', package='dadguide_proto', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x12\x65nemy_skills.proto\x12\x0e\x64\x61\x64guide_proto\"\xbf\x02\n\x1cMonsterBehaviorWithOverrides\x12\x12\n\nmonster_id\x18\x01 \x01(\x05\x12-\n\x06levels\x18\x02 \x03(\x0b\x32\x1d.dadguide_proto.LevelBehavior\x12\x36\n\x0flevel_overrides\x18\x03 \x03(\x0b\x32\x1d.dadguide_proto.LevelBehavior\x12\x43\n\x06status\x18\x04 \x01(\x0e\x32\x33.dadguide_proto.MonsterBehaviorWithOverrides.Status\"_\n\x06Status\x12\x10\n\x0cNOT_APPROVED\x10\x00\x12\x12\n\x0e\x41PPROVED_AS_IS\x10\x01\x12\x14\n\x10NEEDS_REAPPROVAL\x10\x02\x12\x19\n\x15\x41PPROVED_WITH_CHANGES\x10\x03\"f\n\x0fMonsterBehavior\x12\x12\n\nmonster_id\x18\x01 \x01(\x05\x12-\n\x06levels\x18\x02 \x03(\x0b\x32\x1d.dadguide_proto.LevelBehavior\x12\x10\n\x08\x61pproved\x18\x03 \x01(\x08\"M\n\rLevelBehavior\x12\r\n\x05level\x18\x01 \x01(\x05\x12-\n\x06groups\x18\x02 \x03(\x0b\x32\x1d.dadguide_proto.BehaviorGroup\"\xd9\x02\n\rBehaviorGroup\x12;\n\ngroup_type\x18\x01 \x01(\x0e\x32\'.dadguide_proto.BehaviorGroup.GroupType\x12,\n\tcondition\x18\x02 \x01(\x0b\x32\x19.dadguide_proto.Condition\x12.\n\x08\x63hildren\x18\x03 \x03(\x0b\x32\x1c.dadguide_proto.BehaviorItem\"\xac\x01\n\tGroupType\x12\x0f\n\x0bUNSPECIFIED\x10\x00\x12\x0b\n\x07PASSIVE\x10\x01\x12\x0b\n\x07PREEMPT\x10\x02\x12\x11\n\rDISPEL_PLAYER\x10\x03\x12\x12\n\x0eMONSTER_STATUS\x10\x04\x12\r\n\tREMAINING\x10\x05\x12\x0c\n\x08STANDARD\x10\x06\x12\t\n\x05\x44\x45\x41TH\x10\x07\x12\x0f\n\x0bUNKNOWN_USE\x10\x08\x12\x14\n\x10HIGHEST_PRIORITY\x10\t\"u\n\x0c\x42\x65haviorItem\x12.\n\x05group\x18\x02 \x01(\x0b\x32\x1d.dadguide_proto.BehaviorGroupH\x00\x12,\n\x08\x62\x65havior\x18\x03 \x01(\x0b\x32\x18.dadguide_proto.BehaviorH\x00\x42\x07\n\x05value\"c\n\x08\x42\x65havior\x12,\n\tcondition\x18\x01 \x01(\x0b\x32\x19.dadguide_proto.Condition\x12\x16\n\x0e\x65nemy_skill_id\x18\x02 \x01(\x05\x12\x11\n\tchild_ids\x18\x03 \x03(\x05\"\x80\x04\n\tCondition\x12\x14\n\x0chp_threshold\x18\x01 \x01(\x05\x12\x12\n\nuse_chance\x18\x02 \x01(\x05\x12\x15\n\rrepeats_every\x18\x03 \x01(\x05\x12\x17\n\x0fglobal_one_time\x18\x04 \x01(\x08\x12\x19\n\x11limited_execution\x18\r \x01(\x05\x12!\n\x19trigger_enemies_remaining\x18\x05 \x01(\x05\x12\x13\n\x0bif_defeated\x18\x06 \x01(\x08\x12\x1f\n\x17if_attributes_available\x18\x07 \x01(\x08\x12\x18\n\x10trigger_monsters\x18\x08 \x03(\x05\x12\x16\n\x0etrigger_combos\x18\t \x01(\x05\x12\x1a\n\x12if_nothing_matched\x18\n \x01(\x08\x12\x14\n\x0ctrigger_turn\x18\x0b \x01(\x05\x12\x18\n\x10trigger_turn_end\x18\x0c \x01(\x05\x12\x1c\n\x14\x61lways_trigger_above\x18\x0e \x01(\x05\x12\x14\n\x0c\x61lways_after\x18\x0f \x01(\x05\x12\x11\n\tskill_set\x18\x10 \x01(\x05\x12\x19\n\x11\x65rased_attributes\x18\x11 \x03(\x05\x12\x13\n\x0b\x64\x61mage_done\x18\x12 \x01(\x05\x12\x1b\n\x13\x61ttributes_attacked\x18\x13 \x03(\x05\x12\x13\n\x0bskills_used\x18\x14 \x01(\x05\x62\x06proto3' ) _MONSTERBEHAVIORWITHOVERRIDES_STATUS = _descriptor.EnumDescriptor( name='Status', full_name='dadguide_proto.MonsterBehaviorWithOverrides.Status', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='NOT_APPROVED', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='APPROVED_AS_IS', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='NEEDS_REAPPROVAL', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='APPROVED_WITH_CHANGES', index=3, number=3, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=263, serialized_end=358, ) _sym_db.RegisterEnumDescriptor(_MONSTERBEHAVIORWITHOVERRIDES_STATUS) _BEHAVIORGROUP_GROUPTYPE = _descriptor.EnumDescriptor( name='GroupType', full_name='dadguide_proto.BehaviorGroup.GroupType', filename=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name='UNSPECIFIED', index=0, number=0, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PASSIVE', index=1, number=1, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='PREEMPT', index=2, number=2, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DISPEL_PLAYER', index=3, number=3, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='MONSTER_STATUS', index=4, number=4, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='REMAINING', index=5, number=5, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='STANDARD', index=6, number=6, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='DEATH', index=7, number=7, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='UNKNOWN_USE', index=8, number=8, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), _descriptor.EnumValueDescriptor( name='HIGHEST_PRIORITY', index=9, number=9, serialized_options=None, type=None, create_key=_descriptor._internal_create_key), ], containing_type=None, serialized_options=None, serialized_start=717, serialized_end=889, ) _sym_db.RegisterEnumDescriptor(_BEHAVIORGROUP_GROUPTYPE) _MONSTERBEHAVIORWITHOVERRIDES = _descriptor.Descriptor( name='MonsterBehaviorWithOverrides', full_name='dadguide_proto.MonsterBehaviorWithOverrides', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='monster_id', full_name='dadguide_proto.MonsterBehaviorWithOverrides.monster_id', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='levels', full_name='dadguide_proto.MonsterBehaviorWithOverrides.levels', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='level_overrides', full_name='dadguide_proto.MonsterBehaviorWithOverrides.level_overrides', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='status', full_name='dadguide_proto.MonsterBehaviorWithOverrides.status', index=3, number=4, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ _MONSTERBEHAVIORWITHOVERRIDES_STATUS, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=39, serialized_end=358, ) _MONSTERBEHAVIOR = _descriptor.Descriptor( name='MonsterBehavior', full_name='dadguide_proto.MonsterBehavior', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='monster_id', full_name='dadguide_proto.MonsterBehavior.monster_id', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='levels', full_name='dadguide_proto.MonsterBehavior.levels', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='approved', full_name='dadguide_proto.MonsterBehavior.approved', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=360, serialized_end=462, ) _LEVELBEHAVIOR = _descriptor.Descriptor( name='LevelBehavior', full_name='dadguide_proto.LevelBehavior', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='level', full_name='dadguide_proto.LevelBehavior.level', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='groups', full_name='dadguide_proto.LevelBehavior.groups', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=464, serialized_end=541, ) _BEHAVIORGROUP = _descriptor.Descriptor( name='BehaviorGroup', full_name='dadguide_proto.BehaviorGroup', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='group_type', full_name='dadguide_proto.BehaviorGroup.group_type', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='condition', full_name='dadguide_proto.BehaviorGroup.condition', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='children', full_name='dadguide_proto.BehaviorGroup.children', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ _BEHAVIORGROUP_GROUPTYPE, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=544, serialized_end=889, ) _BEHAVIORITEM = _descriptor.Descriptor( name='BehaviorItem', full_name='dadguide_proto.BehaviorItem', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='group', full_name='dadguide_proto.BehaviorItem.group', index=0, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='behavior', full_name='dadguide_proto.BehaviorItem.behavior', index=1, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ _descriptor.OneofDescriptor( name='value', full_name='dadguide_proto.BehaviorItem.value', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), ], serialized_start=891, serialized_end=1008, ) _BEHAVIOR = _descriptor.Descriptor( name='Behavior', full_name='dadguide_proto.Behavior', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='condition', full_name='dadguide_proto.Behavior.condition', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='enemy_skill_id', full_name='dadguide_proto.Behavior.enemy_skill_id', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='child_ids', full_name='dadguide_proto.Behavior.child_ids', index=2, number=3, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1010, serialized_end=1109, ) _CONDITION = _descriptor.Descriptor( name='Condition', full_name='dadguide_proto.Condition', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='hp_threshold', full_name='dadguide_proto.Condition.hp_threshold', index=0, number=1, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='use_chance', full_name='dadguide_proto.Condition.use_chance', index=1, number=2, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='repeats_every', full_name='dadguide_proto.Condition.repeats_every', index=2, number=3, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='global_one_time', full_name='dadguide_proto.Condition.global_one_time', index=3, number=4, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='limited_execution', full_name='dadguide_proto.Condition.limited_execution', index=4, number=13, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='trigger_enemies_remaining', full_name='dadguide_proto.Condition.trigger_enemies_remaining', index=5, number=5, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='if_defeated', full_name='dadguide_proto.Condition.if_defeated', index=6, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='if_attributes_available', full_name='dadguide_proto.Condition.if_attributes_available', index=7, number=7, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='trigger_monsters', full_name='dadguide_proto.Condition.trigger_monsters', index=8, number=8, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='trigger_combos', full_name='dadguide_proto.Condition.trigger_combos', index=9, number=9, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='if_nothing_matched', full_name='dadguide_proto.Condition.if_nothing_matched', index=10, number=10, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='trigger_turn', full_name='dadguide_proto.Condition.trigger_turn', index=11, number=11, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='trigger_turn_end', full_name='dadguide_proto.Condition.trigger_turn_end', index=12, number=12, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='always_trigger_above', full_name='dadguide_proto.Condition.always_trigger_above', index=13, number=14, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='always_after', full_name='dadguide_proto.Condition.always_after', index=14, number=15, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='skill_set', full_name='dadguide_proto.Condition.skill_set', index=15, number=16, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='erased_attributes', full_name='dadguide_proto.Condition.erased_attributes', index=16, number=17, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='damage_done', full_name='dadguide_proto.Condition.damage_done', index=17, number=18, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='attributes_attacked', full_name='dadguide_proto.Condition.attributes_attacked', index=18, number=19, type=5, cpp_type=1, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( name='skills_used', full_name='dadguide_proto.Condition.skills_used', index=19, number=20, type=5, cpp_type=1, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1112, serialized_end=1624, ) _MONSTERBEHAVIORWITHOVERRIDES.fields_by_name['levels'].message_type = _LEVELBEHAVIOR _MONSTERBEHAVIORWITHOVERRIDES.fields_by_name['level_overrides'].message_type = _LEVELBEHAVIOR _MONSTERBEHAVIORWITHOVERRIDES.fields_by_name['status'].enum_type = _MONSTERBEHAVIORWITHOVERRIDES_STATUS _MONSTERBEHAVIORWITHOVERRIDES_STATUS.containing_type = _MONSTERBEHAVIORWITHOVERRIDES _MONSTERBEHAVIOR.fields_by_name['levels'].message_type = _LEVELBEHAVIOR _LEVELBEHAVIOR.fields_by_name['groups'].message_type = _BEHAVIORGROUP _BEHAVIORGROUP.fields_by_name['group_type'].enum_type = _BEHAVIORGROUP_GROUPTYPE _BEHAVIORGROUP.fields_by_name['condition'].message_type = _CONDITION _BEHAVIORGROUP.fields_by_name['children'].message_type = _BEHAVIORITEM _BEHAVIORGROUP_GROUPTYPE.containing_type = _BEHAVIORGROUP _BEHAVIORITEM.fields_by_name['group'].message_type = _BEHAVIORGROUP _BEHAVIORITEM.fields_by_name['behavior'].message_type = _BEHAVIOR _BEHAVIORITEM.oneofs_by_name['value'].fields.append( _BEHAVIORITEM.fields_by_name['group']) _BEHAVIORITEM.fields_by_name['group'].containing_oneof = _BEHAVIORITEM.oneofs_by_name['value'] _BEHAVIORITEM.oneofs_by_name['value'].fields.append( _BEHAVIORITEM.fields_by_name['behavior']) _BEHAVIORITEM.fields_by_name['behavior'].containing_oneof = _BEHAVIORITEM.oneofs_by_name['value'] _BEHAVIOR.fields_by_name['condition'].message_type = _CONDITION DESCRIPTOR.message_types_by_name['MonsterBehaviorWithOverrides'] = _MONSTERBEHAVIORWITHOVERRIDES DESCRIPTOR.message_types_by_name['MonsterBehavior'] = _MONSTERBEHAVIOR DESCRIPTOR.message_types_by_name['LevelBehavior'] = _LEVELBEHAVIOR DESCRIPTOR.message_types_by_name['BehaviorGroup'] = _BEHAVIORGROUP DESCRIPTOR.message_types_by_name['BehaviorItem'] = _BEHAVIORITEM DESCRIPTOR.message_types_by_name['Behavior'] = _BEHAVIOR DESCRIPTOR.message_types_by_name['Condition'] = _CONDITION _sym_db.RegisterFileDescriptor(DESCRIPTOR) MonsterBehaviorWithOverrides = _reflection.GeneratedProtocolMessageType('MonsterBehaviorWithOverrides', (_message.Message,), { 'DESCRIPTOR': _MONSTERBEHAVIORWITHOVERRIDES, '__module__': 'enemy_skills_pb2' # @@protoc_insertion_point(class_scope:dadguide_proto.MonsterBehaviorWithOverrides) }) _sym_db.RegisterMessage(MonsterBehaviorWithOverrides) MonsterBehavior = _reflection.GeneratedProtocolMessageType('MonsterBehavior', (_message.Message,), { 'DESCRIPTOR': _MONSTERBEHAVIOR, '__module__': 'enemy_skills_pb2' # @@protoc_insertion_point(class_scope:dadguide_proto.MonsterBehavior) }) _sym_db.RegisterMessage(MonsterBehavior) LevelBehavior = _reflection.GeneratedProtocolMessageType('LevelBehavior', (_message.Message,), { 'DESCRIPTOR': _LEVELBEHAVIOR, '__module__': 'enemy_skills_pb2' # @@protoc_insertion_point(class_scope:dadguide_proto.LevelBehavior) }) _sym_db.RegisterMessage(LevelBehavior) BehaviorGroup = _reflection.GeneratedProtocolMessageType('BehaviorGroup', (_message.Message,), { 'DESCRIPTOR': _BEHAVIORGROUP, '__module__': 'enemy_skills_pb2' # @@protoc_insertion_point(class_scope:dadguide_proto.BehaviorGroup) }) _sym_db.RegisterMessage(BehaviorGroup) BehaviorItem = _reflection.GeneratedProtocolMessageType('BehaviorItem', (_message.Message,), { 'DESCRIPTOR': _BEHAVIORITEM, '__module__': 'enemy_skills_pb2' # @@protoc_insertion_point(class_scope:dadguide_proto.BehaviorItem) }) _sym_db.RegisterMessage(BehaviorItem) Behavior = _reflection.GeneratedProtocolMessageType('Behavior', (_message.Message,), { 'DESCRIPTOR': _BEHAVIOR, '__module__': 'enemy_skills_pb2' # @@protoc_insertion_point(class_scope:dadguide_proto.Behavior) }) _sym_db.RegisterMessage(Behavior) Condition = _reflection.GeneratedProtocolMessageType('Condition', (_message.Message,), { 'DESCRIPTOR': _CONDITION, '__module__': 'enemy_skills_pb2' # @@protoc_insertion_point(class_scope:dadguide_proto.Condition) }) _sym_db.RegisterMessage(Condition) # @@protoc_insertion_point(module_scope)
51.169811
2,854
0.703386
3,756
32,544
5.743344
0.078541
0.050065
0.0916
0.077601
0.731087
0.659651
0.637725
0.615474
0.599759
0.599759
0
0.03926
0.191495
32,544
635
2,855
51.250394
0.780594
0.02111
0
0.68386
1
0.004992
0.146451
0.10647
0
0
0
0
0
1
0
false
0.003328
0.006656
0
0.006656
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d9c4481e6f2e6c4d81a9ed81d21838df61cf431f
26,272
py
Python
tests/keras/layers/wrappers_test.py
kalyc/keras-apache-mxnet
5497ebd50a45ccc446b8944ebbe11fb7721a5533
[ "MIT" ]
300
2018-04-04T05:01:21.000Z
2022-02-25T18:56:04.000Z
tests/keras/layers/wrappers_test.py
kalyc/keras-apache-mxnet
5497ebd50a45ccc446b8944ebbe11fb7721a5533
[ "MIT" ]
163
2018-04-03T17:41:22.000Z
2021-09-03T16:44:04.000Z
tests/keras/layers/wrappers_test.py
kalyc/keras-apache-mxnet
5497ebd50a45ccc446b8944ebbe11fb7721a5533
[ "MIT" ]
72
2018-04-21T06:42:30.000Z
2021-12-26T06:02:42.000Z
import pytest import numpy as np import copy from numpy.testing import assert_allclose from keras.utils import CustomObjectScope from keras.layers import wrappers, Input, Layer from keras.layers import RNN from keras import layers from keras.models import Sequential, Model, model_from_json from keras import backend as K from keras.utils.generic_utils import object_list_uid, to_list @pytest.mark.skipif(K.backend() == 'mxnet', reason='MXNet backend does not support TimeDistributed and RNN yet') def test_TimeDistributed(): # first, test with Dense layer model = Sequential() model.add(wrappers.TimeDistributed(layers.Dense(2), input_shape=(3, 4))) model.add(layers.Activation('relu')) model.compile(optimizer='rmsprop', loss='mse') model.fit(np.random.random((10, 3, 4)), np.random.random((10, 3, 2)), epochs=1, batch_size=10) # test config model.get_config() # test when specifying a batch_input_shape test_input = np.random.random((1, 3, 4)) test_output = model.predict(test_input) weights = model.layers[0].get_weights() reference = Sequential() reference.add(wrappers.TimeDistributed(layers.Dense(2), batch_input_shape=(1, 3, 4))) reference.add(layers.Activation('relu')) reference.compile(optimizer='rmsprop', loss='mse') reference.layers[0].set_weights(weights) reference_output = reference.predict(test_input) assert_allclose(test_output, reference_output, atol=1e-05) # test with Embedding model = Sequential() model.add(wrappers.TimeDistributed(layers.Embedding(5, 6), batch_input_shape=(10, 3, 4), dtype='int32')) model.compile(optimizer='rmsprop', loss='mse') model.fit(np.random.randint(5, size=(10, 3, 4), dtype='int32'), np.random.random((10, 3, 4, 6)), epochs=1, batch_size=10) # compare to not using batch_input_shape test_input = np.random.randint(5, size=(10, 3, 4), dtype='int32') test_output = model.predict(test_input) weights = model.layers[0].get_weights() reference = Sequential() reference.add(wrappers.TimeDistributed(layers.Embedding(5, 6), input_shape=(3, 4), dtype='int32')) reference.compile(optimizer='rmsprop', loss='mse') reference.layers[0].set_weights(weights) reference_output = reference.predict(test_input) assert_allclose(test_output, reference_output, atol=1e-05) # test with Conv2D model = Sequential() model.add(wrappers.TimeDistributed(layers.Conv2D(5, (2, 2), padding='same'), input_shape=(2, 4, 4, 3))) model.add(layers.Activation('relu')) model.compile(optimizer='rmsprop', loss='mse') model.train_on_batch(np.random.random((1, 2, 4, 4, 3)), np.random.random((1, 2, 4, 4, 5))) model = model_from_json(model.to_json()) model.summary() # test stacked layers model = Sequential() model.add(wrappers.TimeDistributed(layers.Dense(2), input_shape=(3, 4))) model.add(wrappers.TimeDistributed(layers.Dense(3))) model.add(layers.Activation('relu')) model.compile(optimizer='rmsprop', loss='mse') model.fit(np.random.random((10, 3, 4)), np.random.random((10, 3, 3)), epochs=1, batch_size=10) # test wrapping Sequential model model = Sequential() model.add(layers.Dense(3, input_dim=2)) outer_model = Sequential() outer_model.add(wrappers.TimeDistributed(model, input_shape=(3, 2))) outer_model.compile(optimizer='rmsprop', loss='mse') outer_model.fit(np.random.random((10, 3, 2)), np.random.random((10, 3, 3)), epochs=1, batch_size=10) # test with functional API x = Input(shape=(3, 2)) y = wrappers.TimeDistributed(model)(x) outer_model = Model(x, y) outer_model.compile(optimizer='rmsprop', loss='mse') outer_model.fit(np.random.random((10, 3, 2)), np.random.random((10, 3, 3)), epochs=1, batch_size=10) # test with BatchNormalization model = Sequential() model.add(wrappers.TimeDistributed( layers.BatchNormalization(center=True, scale=True), name='bn', input_shape=(10, 2))) model.compile(optimizer='rmsprop', loss='mse') # Assert that mean and variance are 0 and 1. td = model.layers[0] assert np.array_equal(td.get_weights()[2], np.array([0, 0])) assert np.array_equal(td.get_weights()[3], np.array([1, 1])) # Train model.train_on_batch(np.random.normal(loc=2, scale=2, size=(1, 10, 2)), np.broadcast_to(np.array([0, 1]), (1, 10, 2))) # Assert that mean and variance changed. assert not np.array_equal(td.get_weights()[2], np.array([0, 0])) assert not np.array_equal(td.get_weights()[3], np.array([1, 1])) # Verify input_map has one mapping from inputs to reshaped inputs. uid = object_list_uid(model.inputs) assert len(td._input_map.keys()) == 1 assert uid in td._input_map assert K.int_shape(td._input_map[uid]) == (None, 2) @pytest.mark.skipif(K.backend() == 'mxnet', reason='MXNet backend does not support TimeDistributed and RNN yet') @pytest.mark.skipif((K.backend() == 'cntk'), reason='Flaky with CNTK backend') def test_TimeDistributed_learning_phase(): # test layers that need learning_phase to be set np.random.seed(1234) x = Input(shape=(3, 2)) y = wrappers.TimeDistributed(layers.Dropout(.999))(x, training=True) model = Model(x, y) y = model.predict(np.random.random((10, 3, 2))) assert_allclose(np.mean(y), 0., atol=1e-1, rtol=1e-1) @pytest.mark.skipif(K.backend() == 'mxnet', reason='MXNet backend does not support TimeDistributed and RNN yet') def test_TimeDistributed_trainable(): # test layers that need learning_phase to be set x = Input(shape=(3, 2)) layer = wrappers.TimeDistributed(layers.BatchNormalization()) _ = layer(x) assert len(layer.updates) == 2 assert len(layer.trainable_weights) == 2 layer.trainable = False assert len(layer.updates) == 0 assert len(layer.trainable_weights) == 0 layer.trainable = True assert len(layer.updates) == 2 assert len(layer.trainable_weights) == 2 @pytest.mark.skipif((K.backend() == 'cntk' or K.backend() == 'mxnet'), reason='Unknown timestamps for RNN not supported in CNTK and MXNet.') def test_TimeDistributed_with_masked_embedding_and_unspecified_shape(): # test with unspecified shape and Embeddings with mask_zero model = Sequential() model.add(wrappers.TimeDistributed(layers.Embedding(5, 6, mask_zero=True), input_shape=(None, None))) # the shape so far: (N, t_1, t_2, 6) model.add(wrappers.TimeDistributed(layers.SimpleRNN(7, return_sequences=True))) model.add(wrappers.TimeDistributed(layers.SimpleRNN(8, return_sequences=False))) model.add(layers.SimpleRNN(1, return_sequences=False)) model.compile(optimizer='rmsprop', loss='mse') model_input = np.random.randint(low=1, high=5, size=(10, 3, 4), dtype='int32') for i in range(4): model_input[i, i:, i:] = 0 model.fit(model_input, np.random.random((10, 1)), epochs=1, batch_size=10) mask_outputs = [model.layers[0].compute_mask(model.input)] for layer in model.layers[1:]: mask_outputs.append(layer.compute_mask(layer.input, mask_outputs[-1])) func = K.function([model.input], mask_outputs[:-1]) mask_outputs_val = func([model_input]) ref_mask_val_0 = model_input > 0 # embedding layer ref_mask_val_1 = ref_mask_val_0 # first RNN layer ref_mask_val_2 = np.any(ref_mask_val_1, axis=-1) # second RNN layer ref_mask_val = [ref_mask_val_0, ref_mask_val_1, ref_mask_val_2] for i in range(3): assert np.array_equal(mask_outputs_val[i], ref_mask_val[i]) assert mask_outputs[-1] is None # final layer @pytest.mark.skipif(K.backend() == 'mxnet', reason='MXNet backend does not support TimeDistributed and RNN yet') def test_TimeDistributed_with_masking_layer(): # test with Masking layer model = Sequential() model.add(wrappers.TimeDistributed(layers.Masking(mask_value=0.,), input_shape=(None, 4))) model.add(wrappers.TimeDistributed(layers.Dense(5))) model.compile(optimizer='rmsprop', loss='mse') model_input = np.random.randint(low=1, high=5, size=(10, 3, 4)) for i in range(4): model_input[i, i:, :] = 0. model.compile(optimizer='rmsprop', loss='mse') model.fit(model_input, np.random.random((10, 3, 5)), epochs=1, batch_size=6) mask_outputs = [model.layers[0].compute_mask(model.input)] mask_outputs += [model.layers[1].compute_mask(model.layers[1].input, mask_outputs[-1])] func = K.function([model.input], mask_outputs) mask_outputs_val = func([model_input]) assert np.array_equal(mask_outputs_val[0], np.any(model_input, axis=-1)) assert np.array_equal(mask_outputs_val[1], np.any(model_input, axis=-1)) def test_regularizers(): model = Sequential() model.add(wrappers.TimeDistributed( layers.Dense(2, kernel_regularizer='l1'), input_shape=(3, 4))) model.add(layers.Activation('relu')) model.compile(optimizer='rmsprop', loss='mse') assert len(model.layers[0].layer.losses) == 1 assert len(model.layers[0].losses) == 1 assert len(model.layers[0].get_losses_for(None)) == 1 assert len(model.losses) == 1 model = Sequential() model.add(wrappers.TimeDistributed( layers.Dense(2, activity_regularizer='l1'), input_shape=(3, 4))) model.add(layers.Activation('relu')) model.compile(optimizer='rmsprop', loss='mse') assert len(model.losses) == 1 def test_Bidirectional(): rnn = layers.SimpleRNN samples = 2 dim = 2 timesteps = 2 output_dim = 2 dropout_rate = 0.2 for mode in ['sum', 'concat']: x = np.random.random((samples, timesteps, dim)) target_dim = 2 * output_dim if mode == 'concat' else output_dim y = np.random.random((samples, target_dim)) # test with Sequential model model = Sequential() model.add(wrappers.Bidirectional(rnn(output_dim, dropout=dropout_rate, recurrent_dropout=dropout_rate), merge_mode=mode, input_shape=(timesteps, dim))) model.compile(loss='mse', optimizer='sgd') model.fit(x, y, epochs=1, batch_size=1) # test config model.get_config() model = model_from_json(model.to_json()) model.summary() # test stacked bidirectional layers model = Sequential() model.add(wrappers.Bidirectional(rnn(output_dim, return_sequences=True), merge_mode=mode, input_shape=(timesteps, dim))) model.add(wrappers.Bidirectional(rnn(output_dim), merge_mode=mode)) model.compile(loss='mse', optimizer='sgd') model.fit(x, y, epochs=1, batch_size=1) # test with functional API inputs = Input((timesteps, dim)) outputs = wrappers.Bidirectional(rnn(output_dim, dropout=dropout_rate, recurrent_dropout=dropout_rate), merge_mode=mode)(inputs) model = Model(inputs, outputs) model.compile(loss='mse', optimizer='sgd') model.fit(x, y, epochs=1, batch_size=1) # Bidirectional and stateful inputs = Input(batch_shape=(1, timesteps, dim)) outputs = wrappers.Bidirectional(rnn(output_dim, stateful=True), merge_mode=mode)(inputs) model = Model(inputs, outputs) model.compile(loss='mse', optimizer='sgd') model.fit(x, y, epochs=1, batch_size=1) @pytest.mark.skipif((K.backend() == 'cntk'), reason='Unknown timestamps not supported in CNTK.') def test_Bidirectional_dynamic_timesteps(): # test with functional API with dynamic length rnn = layers.SimpleRNN samples = 2 dim = 2 timesteps = 2 output_dim = 2 dropout_rate = 0.2 for mode in ['sum', 'concat']: x = np.random.random((samples, timesteps, dim)) target_dim = 2 * output_dim if mode == 'concat' else output_dim y = np.random.random((samples, target_dim)) inputs = Input((None, dim)) outputs = wrappers.Bidirectional(rnn(output_dim, dropout=dropout_rate, recurrent_dropout=dropout_rate), merge_mode=mode)(inputs) model = Model(inputs, outputs) model.compile(loss='mse', optimizer='sgd') model.fit(x, y, epochs=1, batch_size=1) @pytest.mark.parametrize('merge_mode', ['sum', 'mul', 'ave', 'concat', None]) def test_Bidirectional_merged_value(merge_mode): rnn = layers.LSTM samples = 2 dim = 5 timesteps = 3 units = 3 X = [np.random.rand(samples, timesteps, dim)] if merge_mode == 'sum': merge_func = lambda y, y_rev: y + y_rev elif merge_mode == 'mul': merge_func = lambda y, y_rev: y * y_rev elif merge_mode == 'ave': merge_func = lambda y, y_rev: (y + y_rev) / 2 elif merge_mode == 'concat': merge_func = lambda y, y_rev: np.concatenate((y, y_rev), axis=-1) else: merge_func = lambda y, y_rev: [y, y_rev] # basic case inputs = Input((timesteps, dim)) layer = wrappers.Bidirectional(rnn(units, return_sequences=True), merge_mode=merge_mode) f_merged = K.function([inputs], to_list(layer(inputs))) f_forward = K.function([inputs], [layer.forward_layer.call(inputs)]) f_backward = K.function([inputs], [K.reverse(layer.backward_layer.call(inputs), 1)]) y_merged = f_merged(X) y_expected = to_list(merge_func(f_forward(X)[0], f_backward(X)[0])) assert len(y_merged) == len(y_expected) for x1, x2 in zip(y_merged, y_expected): assert_allclose(x1, x2, atol=1e-5) # test return_state inputs = Input((timesteps, dim)) layer = wrappers.Bidirectional(rnn(units, return_state=True), merge_mode=merge_mode) f_merged = K.function([inputs], layer(inputs)) f_forward = K.function([inputs], layer.forward_layer.call(inputs)) f_backward = K.function([inputs], layer.backward_layer.call(inputs)) n_states = len(layer.layer.states) y_merged = f_merged(X) y_forward = f_forward(X) y_backward = f_backward(X) y_expected = to_list(merge_func(y_forward[0], y_backward[0])) assert len(y_merged) == len(y_expected) + n_states * 2 for x1, x2 in zip(y_merged, y_expected): assert_allclose(x1, x2, atol=1e-5) # test if the state of a BiRNN is the concatenation of the underlying RNNs y_merged = y_merged[-n_states * 2:] y_forward = y_forward[-n_states:] y_backward = y_backward[-n_states:] for state_birnn, state_inner in zip(y_merged, y_forward + y_backward): assert_allclose(state_birnn, state_inner, atol=1e-5) @pytest.mark.skipif(K.backend() == 'theano' or K.backend() == 'mxnet', reason='Not supported.') @pytest.mark.parametrize('merge_mode', ['sum', 'concat', None]) def test_Bidirectional_dropout(merge_mode): rnn = layers.LSTM samples = 2 dim = 5 timesteps = 3 units = 3 X = [np.random.rand(samples, timesteps, dim)] inputs = Input((timesteps, dim)) wrapped = wrappers.Bidirectional(rnn(units, dropout=0.2, recurrent_dropout=0.2), merge_mode=merge_mode) outputs = to_list(wrapped(inputs, training=True)) assert all(not getattr(x, '_uses_learning_phase') for x in outputs) inputs = Input((timesteps, dim)) wrapped = wrappers.Bidirectional(rnn(units, dropout=0.2, return_state=True), merge_mode=merge_mode) outputs = to_list(wrapped(inputs)) assert all(x._uses_learning_phase for x in outputs) model = Model(inputs, outputs) assert model.uses_learning_phase y1 = to_list(model.predict(X)) y2 = to_list(model.predict(X)) for x1, x2 in zip(y1, y2): assert_allclose(x1, x2, atol=1e-5) def test_Bidirectional_state_reuse(): rnn = layers.LSTM samples = 2 dim = 5 timesteps = 3 units = 3 input1 = Input((timesteps, dim)) layer = wrappers.Bidirectional(rnn(units, return_state=True, return_sequences=True)) state = layer(input1)[1:] # test passing invalid initial_state: passing a tensor input2 = Input((timesteps, dim)) with pytest.raises(ValueError): output = wrappers.Bidirectional(rnn(units))(input2, initial_state=state[0]) # test valid usage: passing a list output = wrappers.Bidirectional(rnn(units))(input2, initial_state=state) model = Model([input1, input2], output) assert len(model.layers) == 4 assert isinstance(model.layers[-1].input, list) inputs = [np.random.rand(samples, timesteps, dim), np.random.rand(samples, timesteps, dim)] outputs = model.predict(inputs) @pytest.mark.skipif(K.backend() == 'mxnet', reason='MXNet backend does not support custom RNN cell yet') def test_Bidirectional_with_constants(): class RNNCellWithConstants(Layer): def __init__(self, units, **kwargs): self.units = units self.state_size = units super(RNNCellWithConstants, self).__init__(**kwargs) def build(self, input_shape): if not isinstance(input_shape, list): raise TypeError('expects constants shape') [input_shape, constant_shape] = input_shape # will (and should) raise if more than one constant passed self.input_kernel = self.add_weight( shape=(input_shape[-1], self.units), initializer='uniform', name='kernel') self.recurrent_kernel = self.add_weight( shape=(self.units, self.units), initializer='uniform', name='recurrent_kernel') self.constant_kernel = self.add_weight( shape=(constant_shape[-1], self.units), initializer='uniform', name='constant_kernel') self.built = True def call(self, inputs, states, constants): [prev_output] = states [constant] = constants h_input = K.dot(inputs, self.input_kernel) h_state = K.dot(prev_output, self.recurrent_kernel) h_const = K.dot(constant, self.constant_kernel) output = h_input + h_state + h_const return output, [output] def get_config(self): config = {'units': self.units} base_config = super(RNNCellWithConstants, self).get_config() return dict(list(base_config.items()) + list(config.items())) # Test basic case. x = Input((5, 5)) c = Input((3,)) cell = RNNCellWithConstants(32) custom_objects = {'RNNCellWithConstants': RNNCellWithConstants} with CustomObjectScope(custom_objects): layer = wrappers.Bidirectional(RNN(cell)) y = layer(x, constants=c) model = Model([x, c], y) model.compile(optimizer='rmsprop', loss='mse') model.train_on_batch( [np.zeros((6, 5, 5)), np.zeros((6, 3))], np.zeros((6, 64)) ) # Test basic case serialization. x_np = np.random.random((6, 5, 5)) c_np = np.random.random((6, 3)) y_np = model.predict([x_np, c_np]) weights = model.get_weights() config = layer.get_config() with CustomObjectScope(custom_objects): layer = wrappers.Bidirectional.from_config(copy.deepcopy(config)) y = layer(x, constants=c) model = Model([x, c], y) model.set_weights(weights) y_np_2 = model.predict([x_np, c_np]) assert_allclose(y_np, y_np_2, atol=1e-4) # test flat list inputs with CustomObjectScope(custom_objects): layer = wrappers.Bidirectional.from_config(copy.deepcopy(config)) y = layer([x, c]) model = Model([x, c], y) model.set_weights(weights) y_np_3 = model.predict([x_np, c_np]) assert_allclose(y_np, y_np_3, atol=1e-4) @pytest.mark.skipif(K.backend() == 'mxnet', reason='MXNet backend does not support custom RNN cell yet') def test_Bidirectional_with_constants_layer_passing_initial_state(): class RNNCellWithConstants(Layer): def __init__(self, units, **kwargs): self.units = units self.state_size = units super(RNNCellWithConstants, self).__init__(**kwargs) def build(self, input_shape): if not isinstance(input_shape, list): raise TypeError('expects constants shape') [input_shape, constant_shape] = input_shape # will (and should) raise if more than one constant passed self.input_kernel = self.add_weight( shape=(input_shape[-1], self.units), initializer='uniform', name='kernel') self.recurrent_kernel = self.add_weight( shape=(self.units, self.units), initializer='uniform', name='recurrent_kernel') self.constant_kernel = self.add_weight( shape=(constant_shape[-1], self.units), initializer='uniform', name='constant_kernel') self.built = True def call(self, inputs, states, constants): [prev_output] = states [constant] = constants h_input = K.dot(inputs, self.input_kernel) h_state = K.dot(prev_output, self.recurrent_kernel) h_const = K.dot(constant, self.constant_kernel) output = h_input + h_state + h_const return output, [output] def get_config(self): config = {'units': self.units} base_config = super(RNNCellWithConstants, self).get_config() return dict(list(base_config.items()) + list(config.items())) # Test basic case. x = Input((5, 5)) c = Input((3,)) s_for = Input((32,)) s_bac = Input((32,)) cell = RNNCellWithConstants(32) custom_objects = {'RNNCellWithConstants': RNNCellWithConstants} with CustomObjectScope(custom_objects): layer = wrappers.Bidirectional(RNN(cell)) y = layer(x, initial_state=[s_for, s_bac], constants=c) model = Model([x, s_for, s_bac, c], y) model.compile(optimizer='rmsprop', loss='mse') model.train_on_batch( [np.zeros((6, 5, 5)), np.zeros((6, 32)), np.zeros((6, 32)), np.zeros((6, 3))], np.zeros((6, 64)) ) # Test basic case serialization. x_np = np.random.random((6, 5, 5)) s_fw_np = np.random.random((6, 32)) s_bk_np = np.random.random((6, 32)) c_np = np.random.random((6, 3)) y_np = model.predict([x_np, s_fw_np, s_bk_np, c_np]) weights = model.get_weights() config = layer.get_config() with CustomObjectScope(custom_objects): layer = wrappers.Bidirectional.from_config(copy.deepcopy(config)) y = layer(x, initial_state=[s_for, s_bac], constants=c) model = Model([x, s_for, s_bac, c], y) model.set_weights(weights) y_np_2 = model.predict([x_np, s_fw_np, s_bk_np, c_np]) assert_allclose(y_np, y_np_2, atol=1e-4) # verify that state is used y_np_2_different_s = model.predict([x_np, s_fw_np + 10., s_bk_np + 10., c_np]) with pytest.raises(AssertionError): assert_allclose(y_np, y_np_2_different_s, atol=1e-4) # test flat list inputs with CustomObjectScope(custom_objects): layer = wrappers.Bidirectional.from_config(copy.deepcopy(config)) y = layer([x, s_for, s_bac, c]) model = Model([x, s_for, s_bac, c], y) model.set_weights(weights) y_np_3 = model.predict([x_np, s_fw_np, s_bk_np, c_np]) assert_allclose(y_np, y_np_3, atol=1e-4) def test_Bidirectional_trainable(): # test layers that need learning_phase to be set x = Input(shape=(3, 2)) layer = wrappers.Bidirectional(layers.SimpleRNN(3)) _ = layer(x) assert len(layer.trainable_weights) == 6 layer.trainable = False assert len(layer.trainable_weights) == 0 layer.trainable = True assert len(layer.trainable_weights) == 6 def test_Bidirectional_updates(): x = Input(shape=(3, 2)) layer = wrappers.Bidirectional(layers.SimpleRNN(3)) assert len(layer.updates) == 0 assert len(layer.get_updates_for(None)) == 0 assert len(layer.get_updates_for(x)) == 0 layer.forward_layer.add_update(0, inputs=x) layer.forward_layer.add_update(1, inputs=None) layer.backward_layer.add_update(0, inputs=x) layer.backward_layer.add_update(1, inputs=None) assert len(layer.updates) == 4 assert len(layer.get_updates_for(None)) == 2 assert len(layer.get_updates_for(x)) == 2 def test_Bidirectional_losses(): x = Input(shape=(3, 2)) layer = wrappers.Bidirectional( layers.SimpleRNN(3, kernel_regularizer='l1', bias_regularizer='l1')) _ = layer(x) assert len(layer.losses) == 4 assert len(layer.get_losses_for(None)) == 4 assert len(layer.get_losses_for(x)) == 0 layer.forward_layer.add_loss(0, inputs=x) layer.forward_layer.add_loss(1, inputs=None) layer.backward_layer.add_loss(0, inputs=x) layer.backward_layer.add_loss(1, inputs=None) assert len(layer.losses) == 8 assert len(layer.get_losses_for(None)) == 6 assert len(layer.get_losses_for(x)) == 2 if __name__ == '__main__': pytest.main([__file__])
40.418462
95
0.629225
3,476
26,272
4.577675
0.086594
0.017597
0.021996
0.027149
0.794558
0.760872
0.714178
0.637192
0.602061
0.562909
0
0.023567
0.242502
26,272
649
96
40.48074
0.775991
0.052223
0
0.58365
0
0
0.044619
0
0
0
0
0
0.110266
1
0.045627
false
0.001901
0.020913
0
0.077947
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d9e48585d735333916bf5e8b10a68c72e4541093
248,866
py
Python
pysnmp-with-texts/XXX-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
8
2019-05-09T17:04:00.000Z
2021-06-09T06:50:51.000Z
pysnmp-with-texts/XXX-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
4
2019-05-31T16:42:59.000Z
2020-01-31T21:57:17.000Z
pysnmp-with-texts/XXX-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module XXX-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/XXX-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:44:42 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Gauge32, ModuleIdentity, iso, Integer32, enterprises, ObjectIdentity, Unsigned32, Counter64, IpAddress, Bits, Counter32, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "ModuleIdentity", "iso", "Integer32", "enterprises", "ObjectIdentity", "Unsigned32", "Counter64", "IpAddress", "Bits", "Counter32", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "NotificationType") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") company = ModuleIdentity((1, 3, 6, 1, 4, 1, 6688)) company.setRevisions(('2009-03-05 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: company.setRevisionsDescriptions(('1G MC supported',)) if mibBuilder.loadTexts: company.setLastUpdated('200903050000Z') if mibBuilder.loadTexts: company.setOrganization('FiberRoad') if mibBuilder.loadTexts: company.setContactInfo('www.fiberroad.com.cn') if mibBuilder.loadTexts: company.setDescription('Media Converter NMS SNMP mib file') ipProduct = ObjectIdentity((1, 3, 6, 1, 4, 1, 6688, 1)) if mibBuilder.loadTexts: ipProduct.setStatus('current') if mibBuilder.loadTexts: ipProduct.setDescription('IP product line') height2HU = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1)) systemMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1)) alarmMIB = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2)) shelfNum = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 4))).setMaxAccess("readonly") if mibBuilder.loadTexts: shelfNum.setStatus('current') if mibBuilder.loadTexts: shelfNum.setDescription('The number of shelf in current system') shelfTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2), ) if mibBuilder.loadTexts: shelfTable.setStatus('current') if mibBuilder.loadTexts: shelfTable.setDescription('Shelf table') shelfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1), ).setIndexNames((0, "XXX-MIB", "shelfName")) if mibBuilder.loadTexts: shelfEntry.setStatus('current') if mibBuilder.loadTexts: shelfEntry.setDescription('Shelf entry definition') shelfName = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("master", 1), ("slave1", 2), ("slave2", 3), ("slave3", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: shelfName.setStatus('current') if mibBuilder.loadTexts: shelfName.setDescription('Shelf name') psuA = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("on", 1), ("off", 2), ("nc", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: psuA.setStatus('current') if mibBuilder.loadTexts: psuA.setDescription('The status fan A of current shelf') psuB = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("on", 1), ("off", 2), ("nc", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: psuB.setStatus('current') if mibBuilder.loadTexts: psuB.setDescription('The status psu B of current shelf') volA = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("normal", 1), ("abnormal", 2), ("nc", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: volA.setStatus('current') if mibBuilder.loadTexts: volA.setDescription('The voltage status of psuA of current shelf') volB = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("normal", 1), ("abnormal", 2), ("nc", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: volB.setStatus('current') if mibBuilder.loadTexts: volB.setDescription('The voltage status of psuB of current shelf') fan = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("on", 1), ("off", 2), ("nc", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fan.setStatus('current') if mibBuilder.loadTexts: fan.setDescription('The status fan A of current shelf') temperature = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1, 7), Integer32()).setUnits(' oC').setMaxAccess("readonly") if mibBuilder.loadTexts: temperature.setStatus('current') if mibBuilder.loadTexts: temperature.setDescription('The temperature status of current shelf') coCardNum = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: coCardNum.setStatus('current') if mibBuilder.loadTexts: coCardNum.setDescription('The number of center card inserting of current shelf') rmtCardNum = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 16))).setMaxAccess("readonly") if mibBuilder.loadTexts: rmtCardNum.setStatus('current') if mibBuilder.loadTexts: rmtCardNum.setDescription('The number of remote card inserting of current shelf') slotObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 3)) slotTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 3, 1), ) if mibBuilder.loadTexts: slotTable.setStatus('current') if mibBuilder.loadTexts: slotTable.setDescription('Sparse table containing one entry for each slot in exist chassis in the system, indexed by shelfIdx and slotIdx.') slotEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 3, 1, 1), ).setIndexNames((0, "XXX-MIB", "shelfIdx"), (0, "XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: slotEntry.setStatus('current') if mibBuilder.loadTexts: slotEntry.setDescription("in this table ,user can find the converter module's type inserted in the system's slot.then you can get the detail information about the specified type in the cardObjects table") shelfIdx = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("master", 1), ("slave1", 2), ("slave2", 3), ("slave3", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: shelfIdx.setStatus('current') if mibBuilder.loadTexts: shelfIdx.setDescription('Chassis index - 1 = master management module, 2-4 = slave management module') slotIdx = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17))).clone(namedValues=NamedValues(("slot01", 1), ("slot02", 2), ("slot03", 3), ("slot04", 4), ("slot05", 5), ("slot06", 6), ("slot07", 7), ("slot08", 8), ("slot09", 9), ("slot10", 10), ("slot11", 11), ("slot12", 12), ("slot13", 13), ("slot14", 14), ("slot15", 15), ("slot16", 16), ("slot17", 17)))).setMaxAccess("readonly") if mibBuilder.loadTexts: slotIdx.setStatus('current') if mibBuilder.loadTexts: slotIdx.setDescription("chassis's slot,whitch is a index in this table") coCardType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 100, 101, 102))).clone(namedValues=NamedValues(("no-card", 0), ("ip113s", 1), ("ip113f", 2), ("mc-1g-e2o", 3), ("mc-1g-o2o", 4), ("mc-4-25g-oeo", 5), ("mc-ip175d", 6), ("mc-10g-oeo", 7), ("mc-10g-oee", 8), ("mc-FAN", 9), ("mc-10g-oeo-1r", 10), ("mc-2-5g", 11), ("mc-40g-oeo", 12), ("mc-2-5g-t", 13), ("mc-2-5g-f", 14), ("mc-2-5g-mux-t", 15), ("mc-2-5g-mux-f", 16), ("mc-1g-e2o-backup", 17), ("mc-e1-1sfp", 18), ("mc-e1-2sfp", 19), ("mc-100m-sfp", 20), ("mc-1g-o2o-backup", 21), ("mc-cwdm-4", 22), ("mc-cwdm-8", 23), ("mc-10g-oeo-2r", 24), ("mc-qca8334", 25), ("mc-e1t1", 26), ("fr600f-mm", 100), ("fr600f-ms", 101), ("not-support", 102)))).setMaxAccess("readonly") if mibBuilder.loadTexts: coCardType.setStatus('current') if mibBuilder.loadTexts: coCardType.setDescription("local card's type inserted in the chassis") coCardDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 3, 1, 1, 4), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: coCardDesc.setStatus('current') if mibBuilder.loadTexts: coCardDesc.setDescription("local card's description") rmtCardType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 100, 101, 102))).clone(namedValues=NamedValues(("no-card", 0), ("ip113sr", 1), ("ip113f", 2), ("mc-1g-e2o", 3), ("mc-1g-o2o", 4), ("mc-4-25g-oeor", 5), ("mc-ip175dr", 6), ("mc-10g-oeor", 7), ("mc-10g-oeer", 8), ("mc-FANr", 9), ("mc-10g-oeo-1rr", 10), ("mc-2-5gr", 11), ("mc-40g-oeor", 12), ("mc-2-5g-tr", 13), ("mc-2-5g-fr", 14), ("mc-2-5g-mux-tr", 15), ("mc-2-5g-mux-fr", 16), ("mc-1g-e2o-backupr", 17), ("mc-e1-1sfpr", 18), ("mc-e1-2sfpr", 19), ("mc-100m-sfpr", 20), ("mc-1g-o2o-backupr", 21), ("mc-cwdmr-4", 22), ("mc-cwdmr-8", 23), ("mc-10g-oeo-2rr", 24), ("mc-qca8334r", 25), ("mc-e1t1r", 26), ("fr600f-mm", 100), ("fr600f-ms", 101), ("not-support", 102)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rmtCardType.setStatus('current') if mibBuilder.loadTexts: rmtCardType.setDescription("remote card's type connect with the local converter") rmtCardDesc = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 3, 1, 1, 6), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rmtCardDesc.setStatus('current') if mibBuilder.loadTexts: rmtCardDesc.setDescription("remote card's description") cardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4)) nmuObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1)) nmuConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1)) nmuType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(100, 101, 102))).clone(namedValues=NamedValues(("fr600f-mm", 100), ("fr600f-ms", 101), ("not-support", 102)))).setMaxAccess("readonly") if mibBuilder.loadTexts: nmuType.setStatus('current') if mibBuilder.loadTexts: nmuType.setDescription('The type of NMU (network management unit)') ipaddr = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipaddr.setStatus('current') if mibBuilder.loadTexts: ipaddr.setDescription('The ethernet IP address of NMU (network management unit)') subnet = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: subnet.setStatus('current') if mibBuilder.loadTexts: subnet.setDescription('The etherent mask address of NMU (network management unit)') gateway = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 4), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: gateway.setStatus('current') if mibBuilder.loadTexts: gateway.setDescription('The ethernet gateway address of NMU (network management unit)') sysContact = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 5), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sysContact.setStatus('current') if mibBuilder.loadTexts: sysContact.setDescription('Mirror of the system.sysContact.0') sysName = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 6), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sysName.setStatus('current') if mibBuilder.loadTexts: sysName.setDescription('Mirror of the system.sysName.0') sysLocation = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 7), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: sysLocation.setStatus('current') if mibBuilder.loadTexts: sysLocation.setDescription('Mirror of the system.sysLocation.0') trapHost1 = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 8), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: trapHost1.setStatus('current') if mibBuilder.loadTexts: trapHost1.setDescription("The first host's IP address used to receive trap messages, when set 0 it simply delete this entry. This applies to the trap host 2~4 below as well.") trapHost2 = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 9), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: trapHost2.setStatus('current') if mibBuilder.loadTexts: trapHost2.setDescription("The second host's IP address used to receive trap messages") trapHost3 = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 10), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: trapHost3.setStatus('current') if mibBuilder.loadTexts: trapHost3.setDescription("The third host's IP address used to receive trap messages") trapHost4 = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 1, 1, 11), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: trapHost4.setStatus('current') if mibBuilder.loadTexts: trapHost4.setDescription("The fourth host's IP address used to receive trap messages") mcCmObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2)) mcCmTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1), ) if mibBuilder.loadTexts: mcCmTable.setStatus('current') if mibBuilder.loadTexts: mcCmTable.setDescription('MC Configuration table') mcCmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcCmEntry.setStatus('current') if mibBuilder.loadTexts: mcCmEntry.setDescription('MC Configuration entry definition') mcShelfIdx = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("master", 1), ("slave1", 2), ("slave2", 3), ("slave3", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcShelfIdx.setStatus('current') if mibBuilder.loadTexts: mcShelfIdx.setDescription('Shelf index') mcCardIdx = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16))).clone(namedValues=NamedValues(("card01", 1), ("card02", 2), ("card03", 3), ("card04", 4), ("card05", 5), ("card06", 6), ("card07", 7), ("card08", 8), ("card09", 9), ("card10", 10), ("card11", 11), ("card12", 12), ("card13", 13), ("card14", 14), ("card15", 15), ("card16", 16)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcCardIdx.setStatus('current') if mibBuilder.loadTexts: mcCardIdx.setDescription('Card index') mcType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26))).clone(namedValues=NamedValues(("no-card", 0), ("ip113s", 1), ("ip113f", 2), ("mc-1g-e2o", 3), ("mc-1g-o2o", 4), ("mc-4-25g-oeo", 5), ("mc-ip175d", 6), ("mc-10g-oeo", 7), ("mc-10g-oee", 8), ("mc-FAN", 9), ("mc-10g-oeo-1r", 10), ("mc-2-5g", 11), ("mc-40g-oeo", 12), ("mc-2-5g-t", 13), ("mc-2-5g-f", 14), ("mc-2-5g-mux-t", 15), ("mc-2-5g-mux-f", 16), ("mc-1g-e2o-backup", 17), ("mc-e1-1sfp", 18), ("mc-e1-2sfp", 19), ("mc-100m-sfp", 20), ("mc-1g-o2o-backup", 21), ("mc-cwdm-4", 22), ("mc-cwdm-8", 23), ("mc-10g-oeo-2r", 24), ("mc-qca8334", 25), ("mc-e1t1", 26)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcType.setStatus('current') if mibBuilder.loadTexts: mcType.setDescription("Center card's type") mcTransceiverMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("bidi", 1), ("duplex-fiber", 2), ("sfp", 3), ("not-support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcTransceiverMode.setStatus('current') if mibBuilder.loadTexts: mcTransceiverMode.setDescription("Center card's optical transceiver mode. 100M card support bidi/duplex-fiber; 1G card support bidi/duplex-fiber/sfp. Once sfp is given, the following mcTransceiverDist should be ignored.") mcTransceiverDist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 120))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcTransceiverDist.setStatus('current') if mibBuilder.loadTexts: mcTransceiverDist.setDescription("Center card's optical transceiver distance, 1 means 550m for duplex-fiber mode in case of 1G card, otherwise it represents the real distance (unit of km).") mcPortState = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("locked", 1), ("unlocked", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcPortState.setStatus('current') if mibBuilder.loadTexts: mcPortState.setDescription("Center card's port status, locked or unlocked") mcTransmitMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("cut-through", 1), ("store-forward", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcTransmitMode.setStatus('current') if mibBuilder.loadTexts: mcTransmitMode.setDescription("Center card's transmmit mode") mcCurWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcCurWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcCurWorkMode.setDescription("Center card's current work mode") mcCfgWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("mAuto", 1), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcCfgWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcCfgWorkMode.setDescription("Center card's configurable work mode") mcLFPCfg = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcLFPCfg.setStatus('current') if mibBuilder.loadTexts: mcLFPCfg.setDescription('Remote fault detect function, valid only on center MC card') mcUpStream = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 11), Gauge32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcUpStream.setStatus('current') if mibBuilder.loadTexts: mcUpStream.setDescription("Center card's up stream of MC") mcDownStream = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 12), Gauge32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcDownStream.setStatus('current') if mibBuilder.loadTexts: mcDownStream.setDescription("Center card's down stream of MC") mcTxlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcTxlink.setStatus('current') if mibBuilder.loadTexts: mcTxlink.setDescription("Center card's electrical port's link status") mcFxlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcFxlink.setStatus('current') if mibBuilder.loadTexts: mcFxlink.setDescription("Center card's optical port's link status") mcHWLFP = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcHWLFP.setStatus('current') if mibBuilder.loadTexts: mcHWLFP.setDescription("Center card's HW LFP, not applicable for 1G card") mcHWTransmitMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("cut-through", 1), ("store-forward", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcHWTransmitMode.setStatus('current') if mibBuilder.loadTexts: mcHWTransmitMode.setDescription("Center card's HW transmit mode, not applicable for 1G card") mcHWWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("mAuto", 1), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcHWWorkMode.setStatus('current') if mibBuilder.loadTexts: mcHWWorkMode.setDescription("Center card's HW work mode, not applicable for 1G card") mcHWRmtCtrlMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcHWRmtCtrlMode.setStatus('current') if mibBuilder.loadTexts: mcHWRmtCtrlMode.setDescription("Center card's HW remote control mode (only valid for local card). the disable mode indicates that all SET operations must be prohibited") mcNtwSfpExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("inserted", 1), ("removed", 2), ("na", 3), ("not-support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcNtwSfpExist.setStatus('current') if mibBuilder.loadTexts: mcNtwSfpExist.setDescription("Center 1G card's Network SFP indication") mcAccSfpExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("inserted", 1), ("removed", 2), ("na", 3), ("not-support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcAccSfpExist.setStatus('current') if mibBuilder.loadTexts: mcAccSfpExist.setDescription("Center 1G card's Access SFP indication, applicable only for O2O type") mcUtility = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("idle", 1), ("reset", 2), ("default", 3), ("set2hw", 4), ("not-support", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcUtility.setStatus('current') if mibBuilder.loadTexts: mcUtility.setDescription('reset, default to factory, set to HW word, etc...') mcRmtDetect = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("no-remote", 0), ("yes", 1), ("not-support", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtDetect.setStatus('current') if mibBuilder.loadTexts: mcRmtDetect.setDescription('An identifier to indicate if there is a remote MC currently connecting to system or not') mcRmtType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26))).clone(namedValues=NamedValues(("no-card", 0), ("ip113sr", 1), ("ip113f", 2), ("mc-1g-e2or", 3), ("mc-1g-o2or", 4), ("mc-4-25g-oeor", 5), ("mc-ip175dr", 6), ("mc-10g-oeor", 7), ("mc-10g-oeer", 8), ("mc-FANr", 9), ("mc-10g-oeo-1rr", 10), ("mc-2-5gr", 11), ("mc-40g-oeor", 12), ("mc-2-5g-tr", 13), ("mc-2-5g-fr", 14), ("mc-2-5g-mux-tr", 15), ("mc-2-5g-mux-fr", 16), ("mc-1g-e2o-backupr", 17), ("mc-e1-1sfpr", 18), ("mc-e1-2sfpr", 19), ("mc-100m-sfpr", 20), ("mc-1g-o2o-backupr", 21), ("mc-cwdmr-4", 22), ("mc-cwdmr-8", 23), ("mc-10g-oeo-2rr", 24), ("mc-qca8334r", 25), ("mc-e1t1r", 26)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtType.setStatus('current') if mibBuilder.loadTexts: mcRmtType.setDescription("Remote card's type") mcRmtTransmitMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("no-card", 0), ("cut-through", 1), ("store-forward", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmtTransmitMode.setStatus('current') if mibBuilder.loadTexts: mcRmtTransmitMode.setDescription("Remote card's transmmit mode") mcRmtCurWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("no-card", 0), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtCurWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcRmtCurWorkMode.setDescription("Remote card's current work mode") mcRmtCfgWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("no-card", 0), ("mAuto", 1), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmtCfgWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcRmtCfgWorkMode.setDescription("Remote card's configurable work mode") mcRmtLFP = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 27), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("no-card", 0), ("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmtLFP.setStatus('current') if mibBuilder.loadTexts: mcRmtLFP.setDescription("Remote card's LFP lamp state") mcRmtTxlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("no-card", 0), ("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtTxlink.setStatus('current') if mibBuilder.loadTexts: mcRmtTxlink.setDescription("Remote card's electrial port status") mcRmtHWLFP = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("no-card", 0), ("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtHWLFP.setStatus('current') if mibBuilder.loadTexts: mcRmtHWLFP.setDescription("Remote card's HW LFP, not applicable for 1G card") mcRmtHWTransmitMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("no-card", 0), ("cut-through", 1), ("store-forward", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtHWTransmitMode.setStatus('current') if mibBuilder.loadTexts: mcRmtHWTransmitMode.setDescription("Remote card's HW transmit mode, not applicable for 1G card") mcRmtHWWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("no-card", 0), ("mAuto", 1), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtHWWorkMode.setStatus('current') if mibBuilder.loadTexts: mcRmtHWWorkMode.setDescription("Remote card's HW work mode, not applicable for 1G card") mcRmtLoopback = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("no-card", 0), ("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmtLoopback.setStatus('current') if mibBuilder.loadTexts: mcRmtLoopback.setDescription("Remote card's HW Loopback state") mcRmtPwrDown = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("no-card", 0), ("powerdown", 1), ("normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtPwrDown.setStatus('current') if mibBuilder.loadTexts: mcRmtPwrDown.setDescription("Remote card's power down state") mcRmtAccSfpExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("no-card", 0), ("inserted", 1), ("removed", 2), ("na", 3), ("support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtAccSfpExist.setStatus('current') if mibBuilder.loadTexts: mcRmtAccSfpExist.setDescription("Remote 1G card's Access SFP indication, applicable only for O2O type") mcRmtUtility = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 1, 1, 35), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("no-card", 0), ("idle", 1), ("reset", 2), ("default", 3), ("set2hw", 4), ("not-support", 5)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmtUtility.setStatus('current') if mibBuilder.loadTexts: mcRmtUtility.setDescription("Rmote cards's reset, default to factory, set to HW word, etc...") mcCm1gSpecificObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2)) mcCm1gIpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 1)) mcCm1gIpTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 1, 1), ) if mibBuilder.loadTexts: mcCm1gIpTable.setStatus('current') if mibBuilder.loadTexts: mcCm1gIpTable.setDescription('MC 1G Ip address table') mcCm1gIpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx"), (0, "XXX-MIB", "mcLoOrRmtFg")) if mibBuilder.loadTexts: mcCm1gIpEntry.setStatus('current') if mibBuilder.loadTexts: mcCm1gIpEntry.setDescription('MC 1G Ip address entry definition') mcLoOrRmtFg = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("local", 1), ("remote", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcLoOrRmtFg.setStatus('current') if mibBuilder.loadTexts: mcLoOrRmtFg.setDescription('location index, local or remote') mcIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 1, 1, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcIpAddr.setStatus('current') if mibBuilder.loadTexts: mcIpAddr.setDescription('The Ip address of the node') mcCm1gSfpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2)) mcCm1gSfpTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1), ) if mibBuilder.loadTexts: mcCm1gSfpTable.setStatus('current') if mibBuilder.loadTexts: mcCm1gSfpTable.setDescription('MC 1G SFP table') mcCm1gSfpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx"), (0, "XXX-MIB", "mcLoOrRmtFg")) if mibBuilder.loadTexts: mcCm1gSfpEntry.setStatus('current') if mibBuilder.loadTexts: mcCm1gSfpEntry.setDescription('MC 1G SFP entry definition') getSfpCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("local", 1), ("remote", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: getSfpCmd.setStatus('current') if mibBuilder.loadTexts: getSfpCmd.setDescription('This command will get the updated sfp information. Please send this command prior to getting the following params, otherwise the history sfp information will be sent back.') sfpCompliance = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpCompliance.setStatus('current') if mibBuilder.loadTexts: sfpCompliance.setDescription('SFP compliance (one byte) if 0 then the attributs of sfpTemperature/sfpTranPower/sfpRecvPower should be ignored') sfpConnector = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpConnector.setStatus('current') if mibBuilder.loadTexts: sfpConnector.setDescription('SFP connector type (one byte) 0x01: SC 0x07: LC 0x22: RJ45 others: unsupported') sfpTransCode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpTransCode.setStatus('current') if mibBuilder.loadTexts: sfpTransCode.setDescription('SFP transceiver code (one byte) bit0: SingleMode bit1: Copper Module bit2: MultiMode bit3: MultiMode others: unsupported') sfpSmLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpSmLength.setStatus('current') if mibBuilder.loadTexts: sfpSmLength.setDescription('SFP link length for SingleMode, units of km. (one byte) applicable only when sfpTransCode is SingleMode') sfpMmLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpMmLength.setStatus('current') if mibBuilder.loadTexts: sfpMmLength.setDescription('SFP link length for MultiMode, units of 10m (one byte) applicable only when sfpTransCode is MultiMode') sfpCopperLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpCopperLength.setStatus('current') if mibBuilder.loadTexts: sfpCopperLength.setDescription('SFP link length for Copper, units of m (one byte) applicable only when sfpConnector is RJ45') sfpBrSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpBrSpeed.setStatus('current') if mibBuilder.loadTexts: sfpBrSpeed.setDescription('SFP nominal signalling rate, units of 100Mbit/s (one byte)') sfpWavelength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpWavelength.setStatus('current') if mibBuilder.loadTexts: sfpWavelength.setDescription('SFP laser wavelength (one word)') sfpTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpTemperature.setStatus('current') if mibBuilder.loadTexts: sfpTemperature.setDescription('SFP temperature (one type, signed)') sfpTranPower = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpTranPower.setStatus('current') if mibBuilder.loadTexts: sfpTranPower.setDescription('SFP tx power (one type, signed)') sfpRecvPower = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpRecvPower.setStatus('current') if mibBuilder.loadTexts: sfpRecvPower.setDescription('SFP rx power (one type, signed)') sfpVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 2, 1, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: sfpVoltage.setStatus('current') if mibBuilder.loadTexts: sfpVoltage.setDescription('SFP voltage, units of 0.1mV (one word)') mcCm1gAccSfpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3)) mcCm1gAccSfpTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1), ) if mibBuilder.loadTexts: mcCm1gAccSfpTable.setStatus('current') if mibBuilder.loadTexts: mcCm1gAccSfpTable.setDescription('MC 1G Access SFP table') mcCm1gAccSfpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx"), (0, "XXX-MIB", "mcLoOrRmtFg")) if mibBuilder.loadTexts: mcCm1gAccSfpEntry.setStatus('current') if mibBuilder.loadTexts: mcCm1gAccSfpEntry.setDescription('MC 1G Access SFP entry definition') getAccSfpCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("local", 1), ("remote", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: getAccSfpCmd.setStatus('current') if mibBuilder.loadTexts: getAccSfpCmd.setDescription('This command will get the updated sfp information. Please send this command prior to getting the following params, otherwise the history sfp information will be sent back.') accsfpCompliance = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpCompliance.setStatus('current') if mibBuilder.loadTexts: accsfpCompliance.setDescription('SFP compliance (one byte) if 0 then the attributs of sfpTemperature/sfpTranPower/sfpRecvPower should be ignored') accsfpConnector = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpConnector.setStatus('current') if mibBuilder.loadTexts: accsfpConnector.setDescription('SFP connector type (one byte) 0x01: SC 0x07: LC 0x22: RJ45 others: unsupported') accsfpTransCode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpTransCode.setStatus('current') if mibBuilder.loadTexts: accsfpTransCode.setDescription('SFP transceiver code (one byte) bit0: SingleMode bit2: MultiMode bit3: MultiMode others: unsupported') accsfpSmLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpSmLength.setStatus('current') if mibBuilder.loadTexts: accsfpSmLength.setDescription('SFP link length for SingleMode, units of km. (one byte) applicable only when sfpTransCode is SingleMode') accsfpMmLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpMmLength.setStatus('current') if mibBuilder.loadTexts: accsfpMmLength.setDescription('SFP link length for MultiMode, units of 10m (one byte) applicable only when sfpTransCode is MultiMode') accsfpCopperLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpCopperLength.setStatus('current') if mibBuilder.loadTexts: accsfpCopperLength.setDescription('SFP link length for Copper, units of m (one byte) applicable only when sfpConnector is RJ45') accsfpBrSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpBrSpeed.setStatus('current') if mibBuilder.loadTexts: accsfpBrSpeed.setDescription('SFP nominal signalling rate, units of 100Mbit/s (one byte)') accsfpWavelength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpWavelength.setStatus('current') if mibBuilder.loadTexts: accsfpWavelength.setDescription('SFP laser wavelength (one word)') accsfpTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpTemperature.setStatus('current') if mibBuilder.loadTexts: accsfpTemperature.setDescription('SFP temperature (one type, signed)') accsfpTranPower = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpTranPower.setStatus('current') if mibBuilder.loadTexts: accsfpTranPower.setDescription('SFP tx power (one type, signed)') accsfpRecvPower = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpRecvPower.setStatus('current') if mibBuilder.loadTexts: accsfpRecvPower.setDescription('SFP rx power (one type, signed)') accsfpVoltage = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 2, 3, 1, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: accsfpVoltage.setStatus('current') if mibBuilder.loadTexts: accsfpVoltage.setDescription('SFP voltage, units of 0.1mV (one word)') mcIP175DObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3)) mcIP175DCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 1)) mcIP175DCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 1, 1), ) if mibBuilder.loadTexts: mcIP175DCardTable.setStatus('current') if mibBuilder.loadTexts: mcIP175DCardTable.setDescription('MC IP175D Configuration table') mcIP175DCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcIP175DCardEntry.setStatus('current') if mibBuilder.loadTexts: mcIP175DCardEntry.setDescription('MC Configuration entry definition') mcIP175DVlanMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("Normal", 1), ("mode1", 2), ("mode2", 3), ("not-support", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcIP175DVlanMode.setStatus('current') if mibBuilder.loadTexts: mcIP175DVlanMode.setDescription("Center card's vlan mode") mcIP175DPortObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2)) mcIP175DPortTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1), ) if mibBuilder.loadTexts: mcIP175DPortTable.setStatus('current') if mibBuilder.loadTexts: mcIP175DPortTable.setDescription('MC IP175D Configuration table') mcIP175DPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx"), (0, "XXX-MIB", "mcIP175DPortIdx")) if mibBuilder.loadTexts: mcIP175DPortEntry.setStatus('current') if mibBuilder.loadTexts: mcIP175DPortEntry.setDescription('MC Configuration entry definition') mcIP175DPortIdx = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("port1", 1), ("port2", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcIP175DPortIdx.setStatus('current') if mibBuilder.loadTexts: mcIP175DPortIdx.setDescription('Port index') mcIP175DCurWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcIP175DCurWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcIP175DCurWorkMode.setDescription("Center card's port current work mode") mcIP175DCfgWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("mAuto", 1), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcIP175DCfgWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcIP175DCfgWorkMode.setDescription("Center card's port configurable work mode") mcIP175DUpStream = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1, 4), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(64, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcIP175DUpStream.setStatus('current') if mibBuilder.loadTexts: mcIP175DUpStream.setDescription("Center card's port up stream of MC") mcIP175DDownStream = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1, 5), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(64, 100000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcIP175DDownStream.setStatus('current') if mibBuilder.loadTexts: mcIP175DDownStream.setDescription("Center card's port down stream of MC") mcIP175DTxlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcIP175DTxlink.setStatus('current') if mibBuilder.loadTexts: mcIP175DTxlink.setDescription("Center card's port 1 electrical port's link status") mcIP175DRmtCurWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("no-card", 0), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcIP175DRmtCurWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcIP175DRmtCurWorkMode.setDescription("Remote card's port 1 current work mode") mcIP175DRmtCfgWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("no-card", 0), ("mAuto", 1), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcIP175DRmtCfgWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcIP175DRmtCfgWorkMode.setDescription("Remote card's port1 configurable work mode") mcIP175DRmtTxlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 3, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("no-card", 0), ("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcIP175DRmtTxlink.setStatus('current') if mibBuilder.loadTexts: mcIP175DRmtTxlink.setDescription("Remote card's port electrial port status") mc4_25G_OEOObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4)).setLabel("mc4-25G-OEOObjects") mc4_25G_OEOCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1)).setLabel("mc4-25G-OEOCardObjects") mc4_25G_OEOCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1), ).setLabel("mc4-25G-OEOCardTable") if mibBuilder.loadTexts: mc4_25G_OEOCardTable.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEOCardTable.setDescription('MC 4.25G OEO Configuration table') mc4_25G_OEOCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1), ).setLabel("mc4-25G-OEOCardEntry").setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc4_25G_OEOCardEntry.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEOCardEntry.setDescription('MC Configuration entry definition') mc4_25G_OEOCurSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("Infini", 1), ("STM16", 2), ("STM4", 3), ("STM1", 4), ("FCx4", 5), ("FCx2", 6), ("FCx1", 7), ("GE", 8), ("FE", 9), ("ESCOM", 10), ("not-support", 11)))).setLabel("mc4-25G-OEOCurSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEOCurSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mc4_25G_OEOCurSpdMode.setDescription("Center card's config speed mode") mc4_25G_OEOCfgSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("Infini", 1), ("STM16", 2), ("STM4", 3), ("STM1", 4), ("FCx4", 5), ("FCx2", 6), ("FCx1", 7), ("GE", 8), ("FE", 9), ("ESCOM", 10), ("not-support", 11)))).setLabel("mc4-25G-OEOCfgSpdMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc4_25G_OEOCfgSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mc4_25G_OEOCfgSpdMode.setDescription("Center card's current speed mode") mc4_25G_OEOLoopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc4-25G-OEOLoopback").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc4_25G_OEOLoopback.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEOLoopback.setDescription("card's Loopback state") mc4_25G_OEOWorkMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("repeater", 1), ("retimer", 2), ("not-support", 3)))).setLabel("mc4-25G-OEOWorkMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc4_25G_OEOWorkMode.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEOWorkMode.setDescription("card's Work Mode") mc4_25G_OEONtwPD = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc4-25G-OEONtwPD").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEONtwPD.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEONtwPD.setDescription("Center card's network side PD status") mc4_25G_OEOAccPD = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc4-25G-OEOAccPD").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEOAccPD.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEOAccPD.setDescription("Center card's access side PD status") mc4_25G_OEOHWSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("Infini", 1), ("STM16", 2), ("STM4", 3), ("STM1", 4), ("FCx4", 5), ("FCx2", 6), ("FCx1", 7), ("GE", 8), ("FE", 9), ("ESCOM", 10), ("not-support", 11)))).setLabel("mc4-25G-OEOHWSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEOHWSpdMode.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEOHWSpdMode.setDescription("Center card's HW speed mode") mc4_25G_OEOHWLoopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc4-25G-OEOHWLoopback").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEOHWLoopback.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEOHWLoopback.setDescription("card's HW Loopback state") mc4_25G_OEOHWWorkMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("repeater", 1), ("retimer", 2), ("not-support", 3)))).setLabel("mc4-25G-OEOHWWorkMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEOHWWorkMode.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEOHWWorkMode.setDescription("card's HW Work Mode") mc4_25G_OEO_Test_Lock = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("Lock", 1), ("Unlock", 2)))).setLabel("mc4-25G-OEO-Test-Lock").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEO_Test_Lock.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEO_Test_Lock.setDescription('test result lock or unlock') mc4_25G_OEO_Test_Error_Counter = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 11), Integer32()).setLabel("mc4-25G-OEO-Test-Error-Counter").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEO_Test_Error_Counter.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEO_Test_Error_Counter.setDescription('test result error counter') mc4_25G_OEO_Test_Continue_Time = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 12), Integer32()).setLabel("mc4-25G-OEO-Test-Continue-Time").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEO_Test_Continue_Time.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEO_Test_Continue_Time.setDescription('test continue time unit is second') mc4_25G_OEO_Test_Result = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("Pass", 1), ("Error", 2)))).setLabel("mc4-25G-OEO-Test-Result").setMaxAccess("readonly") if mibBuilder.loadTexts: mc4_25G_OEO_Test_Result.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEO_Test_Result.setDescription('test result') mc4_25G_OEO_Start_Test = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("Start", 1), ("Stop", 2)))).setLabel("mc4-25G-OEO-Start-Test").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc4_25G_OEO_Start_Test.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEO_Start_Test.setDescription('start test and stop test') mc4_25G_OEO_Get_Test_Rst = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("Get", 1)))).setLabel("mc4-25G-OEO-Get-Test-Rst").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc4_25G_OEO_Get_Test_Rst.setStatus('current') if mibBuilder.loadTexts: mc4_25G_OEO_Get_Test_Rst.setDescription('get test result') mcRmt4_25G_OEOCurSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("Infini", 1), ("STM16", 2), ("STM4", 3), ("STM1", 4), ("FCx4", 5), ("FCx2", 6), ("FCx1", 7), ("GE", 8), ("FE", 9), ("ESCOM", 10), ("not-support", 11)))).setLabel("mcRmt4-25G-OEOCurSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt4_25G_OEOCurSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mcRmt4_25G_OEOCurSpdMode.setDescription("Center card's config speed mode") mcRmt4_25G_OEOCfgSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("Infini", 1), ("STM16", 2), ("STM4", 3), ("STM1", 4), ("FCx4", 5), ("FCx2", 6), ("FCx1", 7), ("GE", 8), ("FE", 9), ("ESCOM", 10), ("not-support", 11)))).setLabel("mcRmt4-25G-OEOCfgSpdMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmt4_25G_OEOCfgSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mcRmt4_25G_OEOCfgSpdMode.setDescription("Center card's current speed mode") mcRmt4_25G_OEOLoopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mcRmt4-25G-OEOLoopback").setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmt4_25G_OEOLoopback.setStatus('current') if mibBuilder.loadTexts: mcRmt4_25G_OEOLoopback.setDescription("card's Loopback state") mcRmt4_25G_OEOWorkMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("repeater", 1), ("retimer", 2), ("not-support", 3)))).setLabel("mcRmt4-25G-OEOWorkMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmt4_25G_OEOWorkMode.setStatus('current') if mibBuilder.loadTexts: mcRmt4_25G_OEOWorkMode.setDescription("card's Work Mode") mcRmt4_25G_OEOHWSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("Infini", 1), ("STM16", 2), ("STM4", 3), ("STM1", 4), ("FCx4", 5), ("FCx2", 6), ("FCx1", 7), ("GE", 8), ("FE", 9), ("ESCOM", 10), ("not-support", 11)))).setLabel("mcRmt4-25G-OEOHWSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt4_25G_OEOHWSpdMode.setStatus('current') if mibBuilder.loadTexts: mcRmt4_25G_OEOHWSpdMode.setDescription("Center card's HW speed mode") mcRmt4_25G_OEOHWLoopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mcRmt4-25G-OEOHWLoopback").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt4_25G_OEOHWLoopback.setStatus('current') if mibBuilder.loadTexts: mcRmt4_25G_OEOHWLoopback.setDescription("card's HW Loopback state") mcRmt4_25G_OEOHWWorkMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 4, 1, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("repeater", 1), ("retimer", 2), ("not-support", 3)))).setLabel("mcRmt4-25G-OEOHWWorkMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt4_25G_OEOHWWorkMode.setStatus('current') if mibBuilder.loadTexts: mcRmt4_25G_OEOHWWorkMode.setDescription("card's HW Work Mode") mc10G_OEOObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5)).setLabel("mc10G-OEOObjects") mc10G_OEOCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1)).setLabel("mc10G-OEOCardObjects") mc10G_OEOCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1), ).setLabel("mc10G-OEOCardTable") if mibBuilder.loadTexts: mc10G_OEOCardTable.setStatus('current') if mibBuilder.loadTexts: mc10G_OEOCardTable.setDescription('MC 10G OEO Configuration table') mc10G_OEOCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1), ).setLabel("mc10G-OEOCardEntry").setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc10G_OEOCardEntry.setStatus('current') if mibBuilder.loadTexts: mc10G_OEOCardEntry.setDescription('MC Configuration entry definition') mc10G_OEOCurSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4))).clone(namedValues=NamedValues(("LAN", 1), ("WAN", 2), ("not-support", 4)))).setLabel("mc10G-OEOCurSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEOCurSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEOCurSpdMode.setDescription("Center card's current speed mode 10G LAN(10.3125G) and 10G WAN(9.95328G)") mc10G_OEOCfgSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4))).clone(namedValues=NamedValues(("LAN", 1), ("WAN", 2), ("not-support", 4)))).setLabel("mc10G-OEOCfgSpdMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10G_OEOCfgSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEOCfgSpdMode.setDescription("Center card's config speed mode 10G LAN(10.3125G) and 10G WAN(9.95328G)") mc10G_OEOLoopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc10G-OEOLoopback").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10G_OEOLoopback.setStatus('current') if mibBuilder.loadTexts: mc10G_OEOLoopback.setDescription("card's Loopback state") mc10G_OEOSFP1 = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc10G-OEOSFP1").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEOSFP1.setStatus('current') if mibBuilder.loadTexts: mc10G_OEOSFP1.setDescription("Center card's SFP1 link status") mc10G_OEOSFP2 = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc10G-OEOSFP2").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEOSFP2.setStatus('current') if mibBuilder.loadTexts: mc10G_OEOSFP2.setDescription("Center card's SFP2 link status") mc10G_OEOHWSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4))).clone(namedValues=NamedValues(("LAN", 1), ("WAN", 2), ("not-support", 4)))).setLabel("mc10G-OEOHWSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEOHWSpdMode.setStatus('current') if mibBuilder.loadTexts: mc10G_OEOHWSpdMode.setDescription("Center card's HW speed mode") mc10G_OEOHWLoopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc10G-OEOHWLoopback").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEOHWLoopback.setStatus('current') if mibBuilder.loadTexts: mc10G_OEOHWLoopback.setDescription("card's HW Loopback state") mc10G_OEO_Test_Lock = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("Lock", 1), ("Unlock", 2)))).setLabel("mc10G-OEO-Test-Lock").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO_Test_Lock.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO_Test_Lock.setDescription('test result lock or unlock') mc10G_OEO_Test_Error_Counter = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 9), Integer32()).setLabel("mc10G-OEO-Test-Error-Counter").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO_Test_Error_Counter.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO_Test_Error_Counter.setDescription('test result error counter') mc10G_OEO_Test_Continue_Time = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 10), Integer32()).setLabel("mc10G-OEO-Test-Continue-Time").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO_Test_Continue_Time.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO_Test_Continue_Time.setDescription('test continue time unit is second') mc10G_OEO_Test_Result = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("Pass", 1), ("Error", 2)))).setLabel("mc10G-OEO-Test-Result").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO_Test_Result.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO_Test_Result.setDescription('test result') mc10G_OEO_Start_Test = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("Start", 1), ("Stop", 2)))).setLabel("mc10G-OEO-Start-Test").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10G_OEO_Start_Test.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO_Start_Test.setDescription('start test and stop test') mc10G_OEO_Get_Test_Rst = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1))).clone(namedValues=NamedValues(("Get", 1)))).setLabel("mc10G-OEO-Get-Test-Rst").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10G_OEO_Get_Test_Rst.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO_Get_Test_Rst.setDescription('get test result') mcRmt10G_OEOCurSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4))).clone(namedValues=NamedValues(("LAN", 1), ("WAN", 2), ("not-support", 4)))).setLabel("mcRmt10G-OEOCurSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt10G_OEOCurSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mcRmt10G_OEOCurSpdMode.setDescription("Center card's current speed mode 10G LAN(10.3125G) and 10G WAN(9.95328G)") mcRmt10G_OEOCfgSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4))).clone(namedValues=NamedValues(("LAN", 1), ("WAN", 2), ("not-support", 4)))).setLabel("mcRmt10G-OEOCfgSpdMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmt10G_OEOCfgSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mcRmt10G_OEOCfgSpdMode.setDescription("Center card's config speed mode 10G LAN(10.3125G) and 10G WAN(9.95328G)") mcRmt10G_OEOLoopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mcRmt10G-OEOLoopback").setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmt10G_OEOLoopback.setStatus('current') if mibBuilder.loadTexts: mcRmt10G_OEOLoopback.setDescription("card's Loopback state") mcRmt10G_OEOHWSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4))).clone(namedValues=NamedValues(("LAN", 1), ("WAN", 2), ("not-support", 4)))).setLabel("mcRmt10G-OEOHWSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt10G_OEOHWSpdMode.setStatus('current') if mibBuilder.loadTexts: mcRmt10G_OEOHWSpdMode.setDescription("Center card's HW speed mode 10G LAN(10.3125G) and 10G WAN(9.95328G)") mcRmt10G_OEOHWLoopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mcRmt10G-OEOHWLoopback").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt10G_OEOHWLoopback.setStatus('current') if mibBuilder.loadTexts: mcRmt10G_OEOHWLoopback.setDescription("card's HW Loopback state") mcRmt10G_OEOSFP1 = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mcRmt10G-OEOSFP1").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt10G_OEOSFP1.setStatus('current') if mibBuilder.loadTexts: mcRmt10G_OEOSFP1.setDescription("card's SFP1 link status") mc10G_OEO_accType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("XFP", 1), ("SFP", 2), ("unknow", 3)))).setLabel("mc10G-OEO-accType").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO_accType.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO_accType.setDescription('') mc10G_OEO_ntwType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("XFP", 1), ("SFP", 2), ("unknow", 3)))).setLabel("mc10G-OEO-ntwType").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO_ntwType.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO_ntwType.setDescription('') mcRmt10G_OEO_accType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("XFP", 1), ("SFP", 2), ("unknow", 3)))).setLabel("mcRmt10G-OEO-accType").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt10G_OEO_accType.setStatus('current') if mibBuilder.loadTexts: mcRmt10G_OEO_accType.setDescription('') mcRmt10G_OEO_ntwType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 5, 1, 1, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("XFP", 1), ("SFP", 2), ("unknow", 3)))).setLabel("mcRmt10G-OEO-ntwType").setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmt10G_OEO_ntwType.setStatus('current') if mibBuilder.loadTexts: mcRmt10G_OEO_ntwType.setDescription('') mc10G_OEEObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6)).setLabel("mc10G-OEEObjects") mc10G_OEECardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1)).setLabel("mc10G-OEECardObjects") mc10G_OEECardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1), ).setLabel("mc10G-OEECardTable") if mibBuilder.loadTexts: mc10G_OEECardTable.setStatus('current') if mibBuilder.loadTexts: mc10G_OEECardTable.setDescription('MC 10G OEE Configuration table') mc10G_OEECardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1, 1), ).setLabel("mc10G-OEECardEntry").setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc10G_OEECardEntry.setStatus('current') if mibBuilder.loadTexts: mc10G_OEECardEntry.setDescription('MC Configuration entry definition') mc10G_OEETxlink = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc10G-OEETxlink").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEETxlink.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEETxlink.setDescription("Center card's electrical port's link status") mc10G_OEEFxlink = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc10G-OEEFxlink").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEEFxlink.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEEFxlink.setDescription("Center card's optical port's link status") mc10G_OEECurSpd = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9))).clone(namedValues=NamedValues(("no-card", 0), ("mAuto", 1), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("m10G-Master", 7), ("m10G-Slave", 8), ("not-support", 9)))).setLabel("mc10G-OEECurSpd").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEECurSpd.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEECurSpd.setDescription("Local card's current spd") mc10G_OEELoopMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc10G-OEELoopMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10G_OEELoopMode.setStatus('current') if mibBuilder.loadTexts: mc10G_OEELoopMode.setDescription("card's Loopback state") mc10G_OEESpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 7, 8))).clone(namedValues=NamedValues(("auto", 1), ("m10G-Master", 7), ("m10G-Slave", 8)))).setLabel("mc10G-OEESpdMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10G_OEESpdMode.setStatus('current') if mibBuilder.loadTexts: mc10G_OEESpdMode.setDescription("card's speed mode") mc10G_OEEHWLoopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc10G-OEEHWLoopback").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEEHWLoopback.setStatus('current') if mibBuilder.loadTexts: mc10G_OEEHWLoopback.setDescription("card's Loopback state") mc10G_OEE_ntwType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("XFP", 1), ("SFP", 2), ("unknow", 3)))).setLabel("mc10G-OEE-ntwType").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEE_ntwType.setStatus('current') if mibBuilder.loadTexts: mc10G_OEE_ntwType.setDescription('') mc10G_OEE_checkResult = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 6, 1, 1, 1, 8), Integer32()).setLabel("mc10G-OEE-checkResult").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEE_checkResult.setStatus('current') if mibBuilder.loadTexts: mc10G_OEE_checkResult.setDescription('test result') mcFanObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 7)) mcFanCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 7, 1)) mcFanCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 7, 1, 1), ) if mibBuilder.loadTexts: mcFanCardTable.setStatus('current') if mibBuilder.loadTexts: mcFanCardTable.setDescription('MC fan card table') mcFanCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 7, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcFanCardEntry.setStatus('current') if mibBuilder.loadTexts: mcFanCardEntry.setDescription('MC Configuration entry definition') mcFanStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 7, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Normal", 1), ("Abnormal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcFanStatus.setStatus('mandatory') if mibBuilder.loadTexts: mcFanStatus.setDescription("Center card's fan status") mc40G_OEOObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8)).setLabel("mc40G-OEOObjects") mc40G_OEOCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1)).setLabel("mc40G-OEOCardObjects") mc40G_OEOCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1), ).setLabel("mc40G-OEOCardTable") if mibBuilder.loadTexts: mc40G_OEOCardTable.setStatus('current') if mibBuilder.loadTexts: mc40G_OEOCardTable.setDescription('MC 40G OEO Configuration table') mc40G_OEOCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1), ).setLabel("mc40G-OEOCardEntry").setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc40G_OEOCardEntry.setStatus('current') if mibBuilder.loadTexts: mc40G_OEOCardEntry.setDescription('MC Configuration entry definition') mc40G_OEOQsfp1Lane1_link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc40G-OEOQsfp1Lane1-link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOQsfp1Lane1_link.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOQsfp1Lane1_link.setDescription("Center card's Qsfp1 Lane1 link status") mc40G_OEOQsfp1Lane2_link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc40G-OEOQsfp1Lane2-link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOQsfp1Lane2_link.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOQsfp1Lane2_link.setDescription("Center card's Qsfp1 Lane2 link status") mc40G_OEOQsfp1Lane3_link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc40G-OEOQsfp1Lane3-link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOQsfp1Lane3_link.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOQsfp1Lane3_link.setDescription("Center card's Qsfp1 Lane3 link status") mc40G_OEOQsfp1Lane4_link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc40G-OEOQsfp1Lane4-link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOQsfp1Lane4_link.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOQsfp1Lane4_link.setDescription("Center card's Qsfp1 Lane4 link status") mc40G_OEOQsfp2Lane1_link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc40G-OEOQsfp2Lane1-link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOQsfp2Lane1_link.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOQsfp2Lane1_link.setDescription("Center card's Qsfp2 Lane1 link status") mc40G_OEOQsfp2Lane2_link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc40G-OEOQsfp2Lane2-link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOQsfp2Lane2_link.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOQsfp2Lane2_link.setDescription("Center card's Qsfp2 Lane2 link status") mc40G_OEOQsfp2Lane3_link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc40G-OEOQsfp2Lane3-link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOQsfp2Lane3_link.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOQsfp2Lane3_link.setDescription("Center card's Qsfp2 Lane3 link status") mc40G_OEOQsfp2Lane4_link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc40G-OEOQsfp2Lane4-link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOQsfp2Lane4_link.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOQsfp2Lane4_link.setDescription("Center card's Qsfp2 Lane4 link status") mc40G_OEOLane1LoopMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("line-side-enable", 1), ("host-side-enable", 2), ("disable", 3), ("not-support", 4)))).setLabel("mc40G-OEOLane1LoopMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc40G_OEOLane1LoopMode.setStatus('current') if mibBuilder.loadTexts: mc40G_OEOLane1LoopMode.setDescription("card's Lane1 Loopback state") mc40G_OEOLane2LoopMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("line-side-enable", 1), ("host-side-enable", 2), ("disable", 3), ("not-support", 4)))).setLabel("mc40G-OEOLane2LoopMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc40G_OEOLane2LoopMode.setStatus('current') if mibBuilder.loadTexts: mc40G_OEOLane2LoopMode.setDescription("card's Lane2 Loopback state") mc40G_OEOLane3LoopMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("line-side-enable", 1), ("host-side-enable", 2), ("disable", 3), ("not-support", 4)))).setLabel("mc40G-OEOLane3LoopMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc40G_OEOLane3LoopMode.setStatus('current') if mibBuilder.loadTexts: mc40G_OEOLane3LoopMode.setDescription("card's Lane3 Loopback state") mc40G_OEOLane4LoopMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("line-side-enable", 1), ("host-side-enable", 2), ("disable", 3), ("not-support", 4)))).setLabel("mc40G-OEOLane4LoopMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc40G_OEOLane4LoopMode.setStatus('current') if mibBuilder.loadTexts: mc40G_OEOLane4LoopMode.setDescription("card's Lane4 Loopback state") mc40G_OEOLoopMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("all", 1), ("line-side-enable", 2), ("host-side-enable", 3), ("disable", 4), ("not-support", 5)))).setLabel("mc40G-OEOLoopMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc40G_OEOLoopMode.setStatus('current') if mibBuilder.loadTexts: mc40G_OEOLoopMode.setDescription("card's Loopback state") mc40G_OEOSpeedMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14))).clone(namedValues=NamedValues(("no-card", 0), ("mc40GSpeed-1", 1), ("mc40GSpeed-2", 2), ("mc40GSpeed-3", 3), ("mc40GSpeed-4", 4), ("mc40GSpeed-5", 5), ("mc40GSpeed-6", 6), ("mc40GSpeed-7", 7), ("mc40GSpeed-8", 8), ("mc40GSpeed-9", 9), ("mc40GSpeed-10", 10), ("mc40GSpeed-11", 11), ("mc40GSpeed-12", 12), ("mc40GSpeed-13", 13), ("not-support", 14)))).setLabel("mc40G-OEOSpeedMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc40G_OEOSpeedMode.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOSpeedMode.setDescription('speed1: 1X40G: 10G LAN(10312.5Mbps) speed2: 1X40G: OTU3(10754.60325Mbps) speed3: 1X40G: OTU3e2(11145.83875Mbps) speed4: 4X10G: 10G LAN(10312.5Mbps) speed5: 4X10G: CPRI(9830.4 Mbps) speed6: 4X10G: OC-192/STM-64(9953.28Mbps) speed7: 4X10G: OC-192/STM-64(10664.228571427Mbps) speed8: 4X10G: OC-192/STM-64(10709.225316455Mbps) speed9: 4X10G: 10G Ethernet(11049.107142857Mbps) speed10: 4X10G: 10GFibreChannel(10518.750Mbps) speed11: 4X10G: 10GFibreChannel(11270.089285714Mbps) speed12: 4X10G: 10GFibreChannel(11317.642405063Mbps) speed13: 4X10G: 10GInfiniband(10000.00Mbps)') mc40G_OEOHWLoopMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("line-side-enable", 1), ("host-side-enable", 2), ("disable", 3), ("not-support", 4)))).setLabel("mc40G-OEOHWLoopMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOHWLoopMode.setStatus('current') if mibBuilder.loadTexts: mc40G_OEOHWLoopMode.setDescription("card's HW Loopback state") mc40G_OEOHWSpeedMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 8, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))).clone(namedValues=NamedValues(("no-card", 0), ("mc40GSpeed-1", 1), ("mc40GSpeed-2", 2), ("mc40GSpeed-3", 3), ("mc40GSpeed-4", 4), ("mc40GSpeed-5", 5), ("mc40GSpeed-6", 6), ("mc40GSpeed-7", 7), ("mc40GSpeed-8", 8), ("mc40GSpeed-9", 9), ("mc40GSpeed-10", 10), ("mc40GSpeed-11", 11), ("mc40GSpeed-12", 12), ("not-support", 13)))).setLabel("mc40G-OEOHWSpeedMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc40G_OEOHWSpeedMode.setStatus('mandatory') if mibBuilder.loadTexts: mc40G_OEOHWSpeedMode.setDescription('speed1: 1X40G: 10G LAN(10312.5Mbps) speed2: 1X40G: OTU3(10754.60325Mbps) speed3: 1X40G: OTU3e2(11145.83875Mbps) speed4: 4X10G: 10G LAN(10312.5Mbps) speed5: 4X10G: CPRI(9830.4 Mbps) speed6: 4X10G: OC-192/STM-64(9953.28Mbps) speed7: 4X10G: OC-192/STM-64(10664.228571427Mbps) speed8: 4X10G: OC-192/STM-64(10709.225316455Mbps) speed9: 4X10G: 10G Ethernet(11049.107142857Mbps) speed10: 4X10G: 10GFibreChannel(10518.750Mbps) speed11: 4X10G: 10GFibreChannel(11270.089285714Mbps) speed12: 4X10G: 10GFibreChannel(11317.642405063Mbps)') mcQsfpSpecificObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9)) mcNtwQSfpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1)) mcNtwQSfpTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1), ) if mibBuilder.loadTexts: mcNtwQSfpTable.setStatus('current') if mibBuilder.loadTexts: mcNtwQSfpTable.setDescription('MC Ntw QSFP table') mcNtwQSfpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcNtwQSfpEntry.setStatus('current') if mibBuilder.loadTexts: mcNtwQSfpEntry.setDescription('MC Ntw QSFP entry definition') getNtwQSfpCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("local", 1), ("remote", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: getNtwQSfpCmd.setStatus('current') if mibBuilder.loadTexts: getNtwQSfpCmd.setDescription('This command will get the updated sfp information. Please send this command prior to getting the following params, otherwise the history sfp information will be sent back.') qsfpNtwConnector = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwConnector.setStatus('current') if mibBuilder.loadTexts: qsfpNtwConnector.setDescription('SFP connector type (one byte) 0x07: LC 0x0B: Optical Pigtail 0x0C: MPO 0x21: Copper Pigtail others: unsupported') qsfpNtwTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwTemperature.setStatus('current') if mibBuilder.loadTexts: qsfpNtwTemperature.setDescription('SFP temperature (one type, signed)') qsfpNtwTxPower1 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwTxPower1.setStatus('current') if mibBuilder.loadTexts: qsfpNtwTxPower1.setDescription('SFP tx power (one type, signed)') qsfpNtwTxPower2 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwTxPower2.setStatus('current') if mibBuilder.loadTexts: qsfpNtwTxPower2.setDescription('SFP tx power (one type, signed)') qsfpNtwTxPower3 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwTxPower3.setStatus('current') if mibBuilder.loadTexts: qsfpNtwTxPower3.setDescription('SFP tx power (one type, signed)') qsfpNtwTxPower4 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwTxPower4.setStatus('current') if mibBuilder.loadTexts: qsfpNtwTxPower4.setDescription('SFP tx power (one type, signed)') qsfpNtwRxPower1 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwRxPower1.setStatus('current') if mibBuilder.loadTexts: qsfpNtwRxPower1.setDescription('SFP rx power (one type, signed)') qsfpNtwRxPower2 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwRxPower2.setStatus('current') if mibBuilder.loadTexts: qsfpNtwRxPower2.setDescription('SFP rx power (one type, signed)') qsfpNtwRxPower3 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwRxPower3.setStatus('current') if mibBuilder.loadTexts: qsfpNtwRxPower3.setDescription('SFP rx power (one type, signed)') qsfpNtwRxPower4 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 1, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpNtwRxPower4.setStatus('current') if mibBuilder.loadTexts: qsfpNtwRxPower4.setDescription('SFP rx power (one type, signed)') mcAccQSfpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2)) mcAccQSfpTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1), ) if mibBuilder.loadTexts: mcAccQSfpTable.setStatus('current') if mibBuilder.loadTexts: mcAccQSfpTable.setDescription('MC Acc QSFP table') mcAccQSfpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcAccQSfpEntry.setStatus('current') if mibBuilder.loadTexts: mcAccQSfpEntry.setDescription('MC Acc QSFP entry definition') getAccQSfpCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("local", 1), ("remote", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: getAccQSfpCmd.setStatus('current') if mibBuilder.loadTexts: getAccQSfpCmd.setDescription('This command will get the updated sfp information. Please send this command prior to getting the following params, otherwise the history sfp information will be sent back.') qsfpAccConnector = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccConnector.setStatus('current') if mibBuilder.loadTexts: qsfpAccConnector.setDescription('SFP connector type (one byte) 0x07: LC 0x0B: Optical Pigtail 0x0C: MPO 0x21: Copper Pigtail others: unsupported') qsfpAccTemperature = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccTemperature.setStatus('current') if mibBuilder.loadTexts: qsfpAccTemperature.setDescription('SFP temperature (one type, signed)') qsfpAccTxPower1 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccTxPower1.setStatus('current') if mibBuilder.loadTexts: qsfpAccTxPower1.setDescription('SFP tx power (one type, signed)') qsfpAccTxPower2 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccTxPower2.setStatus('current') if mibBuilder.loadTexts: qsfpAccTxPower2.setDescription('SFP tx power (one type, signed)') qsfpAccTxPower3 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccTxPower3.setStatus('current') if mibBuilder.loadTexts: qsfpAccTxPower3.setDescription('SFP tx power (one type, signed)') qsfpAccTxPower4 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccTxPower4.setStatus('current') if mibBuilder.loadTexts: qsfpAccTxPower4.setDescription('SFP tx power (one type, signed)') qsfpAccRxPower1 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccRxPower1.setStatus('current') if mibBuilder.loadTexts: qsfpAccRxPower1.setDescription('SFP rx power (one type, signed)') qsfpAccRxPower2 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccRxPower2.setStatus('current') if mibBuilder.loadTexts: qsfpAccRxPower2.setDescription('SFP rx power (one type, signed)') qsfpAccRxPower3 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccRxPower3.setStatus('current') if mibBuilder.loadTexts: qsfpAccRxPower3.setDescription('SFP rx power (one type, signed)') qsfpAccRxPower4 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 9, 2, 1, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: qsfpAccRxPower4.setStatus('current') if mibBuilder.loadTexts: qsfpAccRxPower4.setDescription('SFP rx power (one type, signed)') mc2_5GMCObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10)).setLabel("mc2-5GMCObjects") mc2_5GMCSFP3Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1)).setLabel("mc2-5GMCSFP3Objects") mc2_5Cm1gSfpTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1), ).setLabel("mc2-5Cm1gSfpTable") if mibBuilder.loadTexts: mc2_5Cm1gSfpTable.setStatus('current') if mibBuilder.loadTexts: mc2_5Cm1gSfpTable.setDescription('MC 1G SFP table') mc2_5Cm1gSfpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1), ).setLabel("mc2-5Cm1gSfpEntry").setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx"), (0, "XXX-MIB", "mcLoOrRmtFg")) if mibBuilder.loadTexts: mc2_5Cm1gSfpEntry.setStatus('current') if mibBuilder.loadTexts: mc2_5Cm1gSfpEntry.setDescription('MC 1G SFP entry definition') mc2_5g_getSfpCmd = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("local", 1), ("remote", 2)))).setLabel("mc2-5g-getSfpCmd").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc2_5g_getSfpCmd.setStatus('current') if mibBuilder.loadTexts: mc2_5g_getSfpCmd.setDescription('This command will get the updated sfp information. Please send this command prior to getting the following params, otherwise the history sfp information will be sent back.') mc2_5g_sfpCompliance = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 2), Integer32()).setLabel("mc2-5g-sfpCompliance").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpCompliance.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpCompliance.setDescription('SFP compliance (one byte) if 0 then the attributs of sfpTemperature/sfpTranPower/sfpRecvPower should be ignored') mc2_5g_sfpConnector = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 3), Integer32()).setLabel("mc2-5g-sfpConnector").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpConnector.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpConnector.setDescription('SFP connector type (one byte) 0x01: SC 0x07: LC 0x22: RJ45 others: unsupported') mc2_5g_sfpTransCode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 4), Integer32()).setLabel("mc2-5g-sfpTransCode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpTransCode.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpTransCode.setDescription('SFP transceiver code (one byte) bit0: SingleMode bit2: MultiMode bit3: MultiMode others: unsupported') mc2_5g_sfpSmLength = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 5), Integer32()).setLabel("mc2-5g-sfpSmLength").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpSmLength.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpSmLength.setDescription('SFP link length for SingleMode, units of km. (one byte) applicable only when sfpTransCode is SingleMode') mc2_5g_sfpMmLength = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 6), Integer32()).setLabel("mc2-5g-sfpMmLength").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpMmLength.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpMmLength.setDescription('SFP link length for MultiMode, units of 10m (one byte) applicable only when sfpTransCode is MultiMode') mc2_5g_sfpCopperLength = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 7), Integer32()).setLabel("mc2-5g-sfpCopperLength").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpCopperLength.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpCopperLength.setDescription('SFP link length for Copper, units of m (one byte) applicable only when sfpConnector is RJ45') mc2_5g_sfpBrSpeed = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 8), Integer32()).setLabel("mc2-5g-sfpBrSpeed").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpBrSpeed.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpBrSpeed.setDescription('SFP nominal signalling rate, units of 100Mbit/s (one byte)') mc2_5g_sfpWavelength = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 9), Integer32()).setLabel("mc2-5g-sfpWavelength").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpWavelength.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpWavelength.setDescription('SFP laser wavelength (one word)') mc2_5g_sfpTemperature = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 10), Integer32()).setLabel("mc2-5g-sfpTemperature").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpTemperature.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpTemperature.setDescription('SFP temperature (one type, signed)') mc2_5g_sfpTranPower = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 11), Integer32()).setLabel("mc2-5g-sfpTranPower").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpTranPower.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpTranPower.setDescription('SFP tx power (one type, signed)') mc2_5g_sfpRecvPower = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 12), Integer32()).setLabel("mc2-5g-sfpRecvPower").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpRecvPower.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpRecvPower.setDescription('SFP rx power (one type, signed)') mc2_5g_sfpVoltage = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 1, 1, 1, 13), Integer32()).setLabel("mc2-5g-sfpVoltage").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5g_sfpVoltage.setStatus('current') if mibBuilder.loadTexts: mc2_5g_sfpVoltage.setDescription('SFP voltage, units of 0.1mV (one word)') mc2_5GMCCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 2)).setLabel("mc2-5GMCCardObjects") mc2_5GMCCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 2, 1), ).setLabel("mc2-5GMCCardTable") if mibBuilder.loadTexts: mc2_5GMCCardTable.setStatus('current') if mibBuilder.loadTexts: mc2_5GMCCardTable.setDescription('MC 2-5GMC Configuration table') mc2_5GMCCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 2, 1, 1), ).setLabel("mc2-5GMCCardEntry").setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc2_5GMCCardEntry.setStatus('current') if mibBuilder.loadTexts: mc2_5GMCCardEntry.setDescription('MC Configuration entry definition') mc2_5GMCSfp3Exist = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("inserted", 1), ("removed", 2), ("na", 3), ("not-support", 4)))).setLabel("mc2-5GMCSfp3Exist").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5GMCSfp3Exist.setStatus('current') if mibBuilder.loadTexts: mc2_5GMCSfp3Exist.setDescription("Center 1G card's SFP3 indication") mc2_5GMCPort1link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc2-5GMCPort1link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5GMCPort1link.setStatus('current') if mibBuilder.loadTexts: mc2_5GMCPort1link.setDescription("Center card's electrical port1's link status") mc2_5GMCPort2link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc2-5GMCPort2link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5GMCPort2link.setStatus('current') if mibBuilder.loadTexts: mc2_5GMCPort2link.setDescription("Center card's electrical port2's link status") mc2_5GMCPort3link = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 10, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc2-5GMCPort3link").setMaxAccess("readonly") if mibBuilder.loadTexts: mc2_5GMCPort3link.setStatus('current') if mibBuilder.loadTexts: mc2_5GMCPort3link.setDescription("Center card's electrical port3's link status") mcE1Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11)) mcE1CardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1)) mcE1CardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1), ) if mibBuilder.loadTexts: mcE1CardTable.setStatus('current') if mibBuilder.loadTexts: mcE1CardTable.setDescription('MC E1 + Eth Configuration table') mcE1CardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcE1CardEntry.setStatus('current') if mibBuilder.loadTexts: mcE1CardEntry.setDescription('MC Configuration entry definition') mcE1Txlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1Txlink.setStatus('mandatory') if mibBuilder.loadTexts: mcE1Txlink.setDescription("Center card's electrical port's link status") mcE1TxCurWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1TxCurWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcE1TxCurWorkMode.setDescription("Center card's current work mode") mcE1SFP1Link = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1SFP1Link.setStatus('mandatory') if mibBuilder.loadTexts: mcE1SFP1Link.setDescription("Center card's SFP1 port's link status") mcE1Port1LOS = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1Port1LOS.setStatus('current') if mibBuilder.loadTexts: mcE1Port1LOS.setDescription("card's E1 Port1 Los state") mcE1Port1AIS = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1Port1AIS.setStatus('current') if mibBuilder.loadTexts: mcE1Port1AIS.setDescription("card's E1 Port1 AIS state") mcE1Port1CV = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1Port1CV.setStatus('current') if mibBuilder.loadTexts: mcE1Port1CV.setDescription("card's E1 Port1 CV state") mcE1Port2LOS = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1Port2LOS.setStatus('current') if mibBuilder.loadTexts: mcE1Port2LOS.setDescription("card's E1 Port2 Los state") mcE1Port2AIS = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1Port2AIS.setStatus('current') if mibBuilder.loadTexts: mcE1Port2AIS.setDescription("card's E1 Port2 AIS state") mcE1Port2CV = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1Port2CV.setStatus('current') if mibBuilder.loadTexts: mcE1Port2CV.setDescription("card's E1 Port2 CV state") mcE1Port1Loop = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("external", 1), ("internal", 2), ("disabled", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcE1Port1Loop.setStatus('current') if mibBuilder.loadTexts: mcE1Port1Loop.setDescription("card's Port1 Loopback state") mcE1Port2Loop = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("external", 1), ("internal", 2), ("disabled", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcE1Port2Loop.setStatus('current') if mibBuilder.loadTexts: mcE1Port2Loop.setDescription("card's Port2 Loopback state") mcRmtE1Txlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtE1Txlink.setStatus('mandatory') if mibBuilder.loadTexts: mcRmtE1Txlink.setDescription("Remote card's electrical port's link status") mcRmtE1TxCurWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtE1TxCurWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcRmtE1TxCurWorkMode.setDescription("Remote card's current work mode") mcRmtE1SFP1Link = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtE1SFP1Link.setStatus('mandatory') if mibBuilder.loadTexts: mcRmtE1SFP1Link.setDescription("Remote card's SFP1 port's link status") mcRmtE1Port1LOS = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtE1Port1LOS.setStatus('current') if mibBuilder.loadTexts: mcRmtE1Port1LOS.setDescription("Remote card's E1 Port1 Los state") mcRmtE1Port1AIS = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtE1Port1AIS.setStatus('current') if mibBuilder.loadTexts: mcRmtE1Port1AIS.setDescription("Remote card's E1 Port1 AIS state") mcRmtE1Port1CV = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtE1Port1CV.setStatus('current') if mibBuilder.loadTexts: mcRmtE1Port1CV.setDescription("Remote card's E1 Port1 CV state") mcRmtE1Port2LOS = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtE1Port2LOS.setStatus('current') if mibBuilder.loadTexts: mcRmtE1Port2LOS.setDescription("Remote card's E1 Port2 Los state") mcRmtE1Port2AIS = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtE1Port2AIS.setStatus('current') if mibBuilder.loadTexts: mcRmtE1Port2AIS.setDescription("Remote card's E1 Port2 AIS state") mcRmtE1Port2CV = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("alarm", 1), ("e1normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRmtE1Port2CV.setStatus('current') if mibBuilder.loadTexts: mcRmtE1Port2CV.setDescription("Remote card's E1 Port2 CV state") mcRmtE1Port1Loop = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("external", 1), ("internal", 2), ("disabled", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmtE1Port1Loop.setStatus('current') if mibBuilder.loadTexts: mcRmtE1Port1Loop.setDescription("Remote card's Port1 Loopback state") mcRmtE1Port2Loop = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 11, 1, 1, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("external", 1), ("internal", 2), ("disabled", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcRmtE1Port2Loop.setStatus('current') if mibBuilder.loadTexts: mcRmtE1Port2Loop.setDescription("Remote card's Port2 Loopback state") mc1GE2OObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12)) mc1GE2OCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1)) mc1GE2OCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1), ) if mibBuilder.loadTexts: mc1GE2OCardTable.setStatus('current') if mibBuilder.loadTexts: mc1GE2OCardTable.setDescription('MC E2O Fiber backup Configuration table') mc1GE2OCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc1GE2OCardEntry.setStatus('current') if mibBuilder.loadTexts: mc1GE2OCardEntry.setDescription('MC Configuration entry definition') mc1GE2OPort1SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2OPort1SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GE2OPort1SFPlink.setDescription("Center card's port1 SFP's link status") mc1GE2OPort2SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2OPort2SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GE2OPort2SFPlink.setDescription("Center card's port2 SFP's link status") mc1GE2OTxlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2OTxlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GE2OTxlink.setDescription("Center card's electrical port's link status") mc1GE2OPortPri = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Port1", 1), ("Port2", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mc1GE2OPortPri.setStatus('current') if mibBuilder.loadTexts: mc1GE2OPortPri.setDescription("Center card's Port Pri state") mc1GE2OPort1SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("no-card", 0), ("inserted", 1), ("removed", 2), ("na", 3), ("support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2OPort1SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GE2OPort1SFPExist.setDescription('E2O Port1 SFP indication') mc1GE2OPort2SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("no-card", 0), ("inserted", 1), ("removed", 2), ("na", 3), ("support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2OPort2SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GE2OPort2SFPExist.setDescription('E2O Port2 SFP indication') mc1GE2OPortHWPri = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Port1", 1), ("Port2", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2OPortHWPri.setStatus('current') if mibBuilder.loadTexts: mc1GE2OPortHWPri.setDescription("Center card's Port Hardward Pri state") mc1GE2ORmtPort1SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2ORmtPort1SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GE2ORmtPort1SFPlink.setDescription("Remote card's port1 SFP's link status") mc1GE2ORmtPort2SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2ORmtPort2SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GE2ORmtPort2SFPlink.setDescription("Remote card's port2 SFP's link status") mc1GE2ORmtTxlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2ORmtTxlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GE2ORmtTxlink.setDescription("Remote card's electrical port's link status") mc1GE2ORmtPort1SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("no-card", 0), ("inserted", 1), ("removed", 2), ("na", 3), ("support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2ORmtPort1SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GE2ORmtPort1SFPExist.setDescription('E2O Port1 SFP indication') mc1GE2ORmtPort2SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("no-card", 0), ("inserted", 1), ("removed", 2), ("na", 3), ("support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2ORmtPort2SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GE2ORmtPort2SFPExist.setDescription('E2O Port2 SFP indication') mc1GE2ORmtPortHWPri = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 12, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Port1", 1), ("Port2", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GE2ORmtPortHWPri.setStatus('current') if mibBuilder.loadTexts: mc1GE2ORmtPortHWPri.setDescription("Remote card's Port Hardward Pri state") mc1GO2OObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13)) mc1GO2OCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1)) mc1GO2OCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1), ) if mibBuilder.loadTexts: mc1GO2OCardTable.setStatus('current') if mibBuilder.loadTexts: mc1GO2OCardTable.setDescription('MC O2O Fiber backup Configuration table') mc1GO2OCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc1GO2OCardEntry.setStatus('current') if mibBuilder.loadTexts: mc1GO2OCardEntry.setDescription('MC Configuration entry definition') mc1GO2OPort1SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2OPort1SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GO2OPort1SFPlink.setDescription("Center card's port1 SFP's link status") mc1GO2OPort2SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2OPort2SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GO2OPort2SFPlink.setDescription("Center card's port2 SFP's link status") mc1GO2OPort3SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2OPort3SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GO2OPort3SFPlink.setDescription("Center card's port3 SFP's link status") mc1GO2OPortPri = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Port1", 1), ("Port2", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mc1GO2OPortPri.setStatus('current') if mibBuilder.loadTexts: mc1GO2OPortPri.setDescription("Center card's Port Pri state") mc1GO2OPort1SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("no-card", 0), ("inserted", 1), ("removed", 2), ("na", 3), ("support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2OPort1SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GO2OPort1SFPExist.setDescription('O2O Port1 SFP indication') mc1GO2OPort2SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("no-card", 0), ("inserted", 1), ("removed", 2), ("na", 3), ("support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2OPort2SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GO2OPort2SFPExist.setDescription('O2O Port2 SFP indication') mc1GO2OPort3SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("inserted", 1), ("removed", 2), ("na", 3), ("not-support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2OPort3SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GO2OPort3SFPExist.setDescription('O2O Port3 SFP indication') mc1GO2OPortHWPri = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Port1", 1), ("Port2", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2OPortHWPri.setStatus('current') if mibBuilder.loadTexts: mc1GO2OPortHWPri.setDescription("Local card's Port Hardward Pri state") mc1GO2OPort3HWSpd = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("M100", 1), ("M1000", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2OPort3HWSpd.setStatus('current') if mibBuilder.loadTexts: mc1GO2OPort3HWSpd.setDescription("Local card's Port3 Hardward Speed state") mc1GO2ORmtPort1SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2ORmtPort1SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GO2ORmtPort1SFPlink.setDescription("Remote card's port1 SFP's link status") mc1GO2ORmtPort2SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2ORmtPort2SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GO2ORmtPort2SFPlink.setDescription("Remote card's port2 SFP's link status") mc1GO2ORmtPort3SFPlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2ORmtPort3SFPlink.setStatus('mandatory') if mibBuilder.loadTexts: mc1GO2ORmtPort3SFPlink.setDescription("Remote card's port3 SFP's link status") mc1GO2ORmtPort1SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("no-card", 0), ("inserted", 1), ("removed", 2), ("na", 3), ("support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2ORmtPort1SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GO2ORmtPort1SFPExist.setDescription('O2O Port1 SFP indication') mc1GO2ORmtPort2SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4))).clone(namedValues=NamedValues(("no-card", 0), ("inserted", 1), ("removed", 2), ("na", 3), ("support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2ORmtPort2SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GO2ORmtPort2SFPExist.setDescription('O2O Port2 SFP indication') mc1GO2ORmtPort3SFPExist = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("inserted", 1), ("removed", 2), ("na", 3), ("not-support", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2ORmtPort3SFPExist.setStatus('current') if mibBuilder.loadTexts: mc1GO2ORmtPort3SFPExist.setDescription("Remote card's SFP3 indication") mc1GO2ORmtPortHWPri = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Port1", 1), ("Port2", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2ORmtPortHWPri.setStatus('current') if mibBuilder.loadTexts: mc1GO2ORmtPortHWPri.setDescription("Remot card's Port Hardward Pri state") mc1GO2ORmtPort3HWSpd = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("M100", 1), ("M1000", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc1GO2ORmtPort3HWSpd.setStatus('current') if mibBuilder.loadTexts: mc1GO2ORmtPort3HWSpd.setDescription("Remot card's Port3 Hardward Speed state") mc1GO2OSFP3Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2)) mc1GO2OSfp3Table = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1), ) if mibBuilder.loadTexts: mc1GO2OSfp3Table.setStatus('current') if mibBuilder.loadTexts: mc1GO2OSfp3Table.setDescription('MC 1G SFP table') mc1GO2OSfp3Entry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx"), (0, "XXX-MIB", "mcLoOrRmtFg")) if mibBuilder.loadTexts: mc1GO2OSfp3Entry.setStatus('current') if mibBuilder.loadTexts: mc1GO2OSfp3Entry.setDescription('MC 1G O2O SFP3 entry definition') mc1go2o_getSfpCmd = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("na", 0), ("local", 1), ("remote", 2)))).setLabel("mc1go2o-getSfpCmd").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc1go2o_getSfpCmd.setStatus('current') if mibBuilder.loadTexts: mc1go2o_getSfpCmd.setDescription('This command will get the updated sfp information. Please send this command prior to getting the following params, otherwise the history sfp information will be sent back.') mc1go2o_sfpCompliance = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 2), Integer32()).setLabel("mc1go2o-sfpCompliance").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpCompliance.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpCompliance.setDescription('SFP compliance (one byte) if 0 then the attributs of sfpTemperature/sfpTranPower/sfpRecvPower should be ignored') mc1go2o_sfpConnector = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 3), Integer32()).setLabel("mc1go2o-sfpConnector").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpConnector.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpConnector.setDescription('SFP connector type (one byte) 0x01: SC 0x07: LC 0x22: RJ45 others: unsupported') mc1go2o_sfpTransCode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 4), Integer32()).setLabel("mc1go2o-sfpTransCode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpTransCode.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpTransCode.setDescription('SFP transceiver code (one byte) bit0: SingleMode bit2: MultiMode bit3: MultiMode others: unsupported') mc1go2o_sfpSmLength = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 5), Integer32()).setLabel("mc1go2o-sfpSmLength").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpSmLength.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpSmLength.setDescription('SFP link length for SingleMode, units of km. (one byte) applicable only when sfpTransCode is SingleMode') mc1go2o_sfpMmLength = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 6), Integer32()).setLabel("mc1go2o-sfpMmLength").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpMmLength.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpMmLength.setDescription('SFP link length for MultiMode, units of 10m (one byte) applicable only when sfpTransCode is MultiMode') mc1go2o_sfpCopperLength = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 7), Integer32()).setLabel("mc1go2o-sfpCopperLength").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpCopperLength.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpCopperLength.setDescription('SFP link length for Copper, units of m (one byte) applicable only when sfpConnector is RJ45') mc1go2o_sfpBrSpeed = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 8), Integer32()).setLabel("mc1go2o-sfpBrSpeed").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpBrSpeed.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpBrSpeed.setDescription('SFP nominal signalling rate, units of 100Mbit/s (one byte)') mc1go2o_sfpWavelength = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 9), Integer32()).setLabel("mc1go2o-sfpWavelength").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpWavelength.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpWavelength.setDescription('SFP laser wavelength (one word)') mc1go2o_sfpTemperature = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 10), Integer32()).setLabel("mc1go2o-sfpTemperature").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpTemperature.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpTemperature.setDescription('SFP temperature (one type, signed)') mc1go2o_sfpTranPower = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 11), Integer32()).setLabel("mc1go2o-sfpTranPower").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpTranPower.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpTranPower.setDescription('SFP tx power (one type, signed)') mc1go2o_sfpRecvPower = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 12), Integer32()).setLabel("mc1go2o-sfpRecvPower").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpRecvPower.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpRecvPower.setDescription('SFP rx power (one type, signed)') mc1go2o_sfpVoltage = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 13, 2, 1, 1, 13), Integer32()).setLabel("mc1go2o-sfpVoltage").setMaxAccess("readonly") if mibBuilder.loadTexts: mc1go2o_sfpVoltage.setStatus('current') if mibBuilder.loadTexts: mc1go2o_sfpVoltage.setDescription('SFP voltage, units of 0.1mV (one word)') mc10GOEO1RObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14)) mc10GOEO1RCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1)) mc10GOEO1RCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1), ) if mibBuilder.loadTexts: mc10GOEO1RCardTable.setStatus('current') if mibBuilder.loadTexts: mc10GOEO1RCardTable.setDescription('MC 10G OEO 1R Configuration table') mc10GOEO1RCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc10GOEO1RCardEntry.setStatus('current') if mibBuilder.loadTexts: mc10GOEO1RCardEntry.setDescription('MC Configuration entry definition') mcAccXFP1WaveLengthTunability = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Supported", 1), ("Unsupported", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcAccXFP1WaveLengthTunability.setStatus('mandatory') if mibBuilder.loadTexts: mcAccXFP1WaveLengthTunability.setDescription("XFP1's wavelength tunability") mcAccXFP1WaveLengthTunable = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Doing", 1), ("Completed", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcAccXFP1WaveLengthTunable.setStatus('mandatory') if mibBuilder.loadTexts: mcAccXFP1WaveLengthTunable.setDescription("XFP1's wavelength tunable status") mcAccXFP1WaveLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcAccXFP1WaveLength.setStatus('mandatory') if mibBuilder.loadTexts: mcAccXFP1WaveLength.setDescription("XFP1's wavelength") mcNtwXFP2WaveLengthTunability = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Supported", 1), ("Unsupported", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcNtwXFP2WaveLengthTunability.setStatus('mandatory') if mibBuilder.loadTexts: mcNtwXFP2WaveLengthTunability.setDescription("XFP2's wavelength tunability") mcNtwXFP2WaveLengthTunable = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Doing", 1), ("Completed", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcNtwXFP2WaveLengthTunable.setStatus('mandatory') if mibBuilder.loadTexts: mcNtwXFP2WaveLengthTunable.setDescription("XFP2's wavelength tunable status") mcNtwXFP2WaveLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcNtwXFP2WaveLength.setStatus('mandatory') if mibBuilder.loadTexts: mcNtwXFP2WaveLength.setDescription("XFP2's wavelength") mcAccXFP1TunableType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("channel", 1), ("wavelength", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcAccXFP1TunableType.setStatus('mandatory') if mibBuilder.loadTexts: mcAccXFP1TunableType.setDescription("XFP1's wavelength tunable type") mcNtwXFP2TunableType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 14, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("channel", 1), ("wavelength", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcNtwXFP2TunableType.setStatus('mandatory') if mibBuilder.loadTexts: mcNtwXFP2TunableType.setDescription("XFP2's wavelength tunable type") mc10GOEO3RObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15)) mc10GOEO3RCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1)) mc10GOEO3RCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1), ) if mibBuilder.loadTexts: mc10GOEO3RCardTable.setStatus('current') if mibBuilder.loadTexts: mc10GOEO3RCardTable.setDescription('MC 10G OEO 3R tunable wavelength Configuration table') mc10GOEO3RCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc10GOEO3RCardEntry.setStatus('current') if mibBuilder.loadTexts: mc10GOEO3RCardEntry.setDescription('MC Configuration entry definition') accXFP1WaveLengthTunability = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Supported", 1), ("Unsupported", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: accXFP1WaveLengthTunability.setStatus('mandatory') if mibBuilder.loadTexts: accXFP1WaveLengthTunability.setDescription("XFP1's wavelength tunability") accXFP1WaveLengthTunable = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Doing", 1), ("Completed", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: accXFP1WaveLengthTunable.setStatus('mandatory') if mibBuilder.loadTexts: accXFP1WaveLengthTunable.setDescription("XFP1's wavelength tunable status") accXFP1WaveLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: accXFP1WaveLength.setStatus('mandatory') if mibBuilder.loadTexts: accXFP1WaveLength.setDescription("XFP1's wavelength") ntwXFP2WaveLengthTunability = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Supported", 1), ("Unsupported", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwXFP2WaveLengthTunability.setStatus('mandatory') if mibBuilder.loadTexts: ntwXFP2WaveLengthTunability.setDescription("XFP2's wavelength tunability") ntwXFP2WaveLengthTunable = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Doing", 1), ("Completed", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwXFP2WaveLengthTunable.setStatus('mandatory') if mibBuilder.loadTexts: ntwXFP2WaveLengthTunable.setDescription("XFP2's wavelength tunable status") ntwXFP2WaveLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: ntwXFP2WaveLength.setStatus('mandatory') if mibBuilder.loadTexts: ntwXFP2WaveLength.setDescription("XFP2's wavelength") accXFP1TunableType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("channel", 1), ("wavelength", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: accXFP1TunableType.setStatus('mandatory') if mibBuilder.loadTexts: accXFP1TunableType.setDescription("XFP1's wavelength tunable type") ntwXFP2TunableType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 15, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("channel", 1), ("wavelength", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntwXFP2TunableType.setStatus('mandatory') if mibBuilder.loadTexts: ntwXFP2TunableType.setDescription("XFP2's wavelength tunable type") mcCWDMObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16)) mcCWDMCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1)) mcCWDMCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1), ) if mibBuilder.loadTexts: mcCWDMCardTable.setStatus('current') if mibBuilder.loadTexts: mcCWDMCardTable.setDescription('MC CWDM table') mcCWDMCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcCWDMCardEntry.setStatus('current') if mibBuilder.loadTexts: mcCWDMCardEntry.setDescription('MC Configuration entry definition') cwdmWavelengthCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cwdmWavelengthCount.setStatus('mandatory') if mibBuilder.loadTexts: cwdmWavelengthCount.setDescription('wavelength count') cwdmWavelength1 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cwdmWavelength1.setStatus('mandatory') if mibBuilder.loadTexts: cwdmWavelength1.setDescription('CWDM Card wavelenth 1') cwdmWavelength2 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cwdmWavelength2.setStatus('mandatory') if mibBuilder.loadTexts: cwdmWavelength2.setDescription('CWDM Card wavelenth 2') cwdmWavelength3 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cwdmWavelength3.setStatus('mandatory') if mibBuilder.loadTexts: cwdmWavelength3.setDescription('CWDM Card wavelenth 3') cwdmWavelength4 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cwdmWavelength4.setStatus('mandatory') if mibBuilder.loadTexts: cwdmWavelength4.setDescription('CWDM Card wavelenth 4') cwdmWavelength5 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cwdmWavelength5.setStatus('mandatory') if mibBuilder.loadTexts: cwdmWavelength5.setDescription('CWDM Card wavelenth 5') cwdmWavelength6 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cwdmWavelength6.setStatus('mandatory') if mibBuilder.loadTexts: cwdmWavelength6.setDescription('CWDM Card wavelenth 6') cwdmWavelength7 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cwdmWavelength7.setStatus('mandatory') if mibBuilder.loadTexts: cwdmWavelength7.setDescription('CWDM Card wavelenth 7') cwdmWavelength8 = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 16, 1, 1, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cwdmWavelength8.setStatus('mandatory') if mibBuilder.loadTexts: cwdmWavelength8.setDescription('CWDM Card wavelenth 8') mc10G_OEO2RObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17)).setLabel("mc10G-OEO2RObjects") mc10G_OEO2RCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1)).setLabel("mc10G-OEO2RCardObjects") mc10G_OEO2RCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1), ).setLabel("mc10G-OEO2RCardTable") if mibBuilder.loadTexts: mc10G_OEO2RCardTable.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2RCardTable.setDescription('MC 10G OEO 2R Configuration table') mc10G_OEO2RCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1), ).setLabel("mc10G-OEO2RCardEntry").setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc10G_OEO2RCardEntry.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2RCardEntry.setDescription('MC Configuration entry definition') mc10G_OEO2RCurSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("Speed85", 1), ("Speed103to117", 2), ("Speed995to113", 3), ("not-support", 4)))).setLabel("mc10G-OEO2RCurSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2RCurSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEO2RCurSpdMode.setDescription("Center card's current speed mode 1: 8.5G 2: 10.3G-11.7G 3: 9.95G-11.3G ") mc10G_OEO2RCfgSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("Speed85", 1), ("Speed103to117", 2), ("Speed995to113", 3), ("not-support", 4)))).setLabel("mc10G-OEO2RCfgSpdMode").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10G_OEO2RCfgSpdMode.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEO2RCfgSpdMode.setDescription("Center card's current speed mode 1: 8.5G 2: 10.3G-11.7G 3: 9.95G-11.3G ") mc10G_OEO2RSFP1Loopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc10G-OEO2RSFP1Loopback").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10G_OEO2RSFP1Loopback.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2RSFP1Loopback.setDescription("card's SFP1 Loopback state") mc10G_OEO2RSFP2Loopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc10G-OEO2RSFP2Loopback").setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10G_OEO2RSFP2Loopback.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2RSFP2Loopback.setDescription("card's SFP2 Loopback state") mc10G_OEO2RSFP1 = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc10G-OEO2RSFP1").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2RSFP1.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2RSFP1.setDescription("Center card's SFP1 link status") mc10G_OEO2RSFP2 = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setLabel("mc10G-OEO2RSFP2").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2RSFP2.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2RSFP2.setDescription("Center card's SFP2 link status") mc10G_OEO2RHWSpdMode = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("Speed85", 1), ("Speed103to117", 2), ("Speed995to113", 3), ("not-support", 4)))).setLabel("mc10G-OEO2RHWSpdMode").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2RHWSpdMode.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2RHWSpdMode.setDescription("Center card's current speed mode 1: 8.5G 2: 10.3G-11.7G 3: 9.95G-11.3G ") mc10G_OEO2RHWSFP1Loopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc10G-OEO2RHWSFP1Loopback").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2RHWSFP1Loopback.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2RHWSFP1Loopback.setDescription("card's HW Loopback state") mc10G_OEO2RHWSFP2Loopback = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setLabel("mc10G-OEO2RHWSFP2Loopback").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2RHWSFP2Loopback.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2RHWSFP2Loopback.setDescription("card's HW Loopback state") mc10G_OEO2RVersion = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 10), DisplayString()).setLabel("mc10G-OEO2RVersion").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2RVersion.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEO2RVersion.setDescription('MC version') mc10GXFP1WaveLengthTunability = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Supported", 1), ("Unsupported", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc10GXFP1WaveLengthTunability.setStatus('mandatory') if mibBuilder.loadTexts: mc10GXFP1WaveLengthTunability.setDescription("XFP1's wavelength tunability") mc10GXFP1WaveLengthTunable = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Doing", 1), ("Completed", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc10GXFP1WaveLengthTunable.setStatus('mandatory') if mibBuilder.loadTexts: mc10GXFP1WaveLengthTunable.setDescription("XFP1's wavelength tunable status") mc10GXFP1WaveLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 13), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10GXFP1WaveLength.setStatus('mandatory') if mibBuilder.loadTexts: mc10GXFP1WaveLength.setDescription("XFP1's wavelength") mc10GXFP2WaveLengthTunability = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Supported", 1), ("Unsupported", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc10GXFP2WaveLengthTunability.setStatus('mandatory') if mibBuilder.loadTexts: mc10GXFP2WaveLengthTunability.setDescription("XFP2's wavelength tunability") mc10GXFP2WaveLengthTunable = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Doing", 1), ("Completed", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mc10GXFP2WaveLengthTunable.setStatus('mandatory') if mibBuilder.loadTexts: mc10GXFP2WaveLengthTunable.setDescription("XFP2's wavelength tunable status") mc10GXFP2WaveLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 16), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: mc10GXFP2WaveLength.setStatus('mandatory') if mibBuilder.loadTexts: mc10GXFP2WaveLength.setDescription("XFP2's wavelength") mc10G_OEO2R_accType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("XFP", 1), ("SFP", 2), ("unknow", 3)))).setLabel("mc10G-OEO2R-accType").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2R_accType.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2R_accType.setDescription('') mc10G_OEO2R_ntwType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("XFP", 1), ("SFP", 2), ("unknow", 3)))).setLabel("mc10G-OEO2R-ntwType").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2R_ntwType.setStatus('current') if mibBuilder.loadTexts: mc10G_OEO2R_ntwType.setDescription('') mc10G_OEO2R_accTunableType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("channel", 1), ("wavelength", 2), ("not-support", 3)))).setLabel("mc10G-OEO2R-accTunableType").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2R_accTunableType.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEO2R_accTunableType.setDescription("XFP1's wavelength tunable type") mc10G_OEO2R_ntwTunableType = MibScalar((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 17, 1, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("channel", 1), ("wavelength", 2), ("not-support", 3)))).setLabel("mc10G-OEO2R-ntwTunableType").setMaxAccess("readonly") if mibBuilder.loadTexts: mc10G_OEO2R_ntwTunableType.setStatus('mandatory') if mibBuilder.loadTexts: mc10G_OEO2R_ntwTunableType.setDescription("XFP2's wavelength tunable type") mcQCA8334Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18)) mcQCA8334CardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 1)) mcQCA8334CardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 1, 1), ) if mibBuilder.loadTexts: mcQCA8334CardTable.setStatus('current') if mibBuilder.loadTexts: mcQCA8334CardTable.setDescription('MC QCA8334 Configuration table') mcQCA8334CardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcQCA8334CardEntry.setStatus('current') if mibBuilder.loadTexts: mcQCA8334CardEntry.setDescription('MC Configuration entry definition') mcQCA8334VlanMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("Normal", 1), ("mode1", 2), ("mode2", 3), ("not-support", 4)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcQCA8334VlanMode.setStatus('current') if mibBuilder.loadTexts: mcQCA8334VlanMode.setDescription("Center card's vlan mode") mcQCA8334PortObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2)) mcQCA8334PortTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1), ) if mibBuilder.loadTexts: mcQCA8334PortTable.setStatus('current') if mibBuilder.loadTexts: mcQCA8334PortTable.setDescription('MC QCA8334 Configuration table') mcQCA8334PortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx"), (0, "XXX-MIB", "mcQCA8334PortIdx")) if mibBuilder.loadTexts: mcQCA8334PortEntry.setStatus('current') if mibBuilder.loadTexts: mcQCA8334PortEntry.setDescription('MC Configuration entry definition') mcQCA8334PortIdx = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("port1", 1), ("port2", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcQCA8334PortIdx.setStatus('current') if mibBuilder.loadTexts: mcQCA8334PortIdx.setDescription('Port index') mcQCA8334CurWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcQCA8334CurWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcQCA8334CurWorkMode.setDescription("Center card's port current work mode") mcQCA8334CfgWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("mAuto", 1), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcQCA8334CfgWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcQCA8334CfgWorkMode.setDescription("Center card's port configurable work mode") mcQCA8334UpStream = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1, 4), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(32, 1000000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcQCA8334UpStream.setStatus('current') if mibBuilder.loadTexts: mcQCA8334UpStream.setDescription("Center card's port up stream of MC") mcQCA8334DownStream = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1, 5), Gauge32().subtype(subtypeSpec=ValueRangeConstraint(32, 1000000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcQCA8334DownStream.setStatus('current') if mibBuilder.loadTexts: mcQCA8334DownStream.setDescription("Center card's port down stream of MC") mcQCA8334Txlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcQCA8334Txlink.setStatus('current') if mibBuilder.loadTexts: mcQCA8334Txlink.setDescription("Center card's port 1 electrical port's link status") mcQCA8334RmtCurWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("no-card", 0), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcQCA8334RmtCurWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcQCA8334RmtCurWorkMode.setDescription("Remote card's port 1 current work mode") mcQCA8334RmtCfgWorkMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7))).clone(namedValues=NamedValues(("no-card", 0), ("mAuto", 1), ("m100-full", 2), ("m100-half", 3), ("m10-full", 4), ("m10-half", 5), ("m1G-full", 6), ("not-support", 7)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcQCA8334RmtCfgWorkMode.setStatus('mandatory') if mibBuilder.loadTexts: mcQCA8334RmtCfgWorkMode.setDescription("Remote card's port1 configurable work mode") mcQCA8334RmtTxlink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 18, 2, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3))).clone(namedValues=NamedValues(("no-card", 0), ("up", 1), ("down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcQCA8334RmtTxlink.setStatus('current') if mibBuilder.loadTexts: mcQCA8334RmtTxlink.setDescription("Remote card's port electrial port status") mcE1T1Objects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19)) mcE1T1CardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1)) mcE1T1CardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1), ) if mibBuilder.loadTexts: mcE1T1CardTable.setStatus('current') if mibBuilder.loadTexts: mcE1T1CardTable.setDescription('MC E1T1 Configuration table') mcE1T1CardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcE1T1CardEntry.setStatus('current') if mibBuilder.loadTexts: mcE1T1CardEntry.setDescription('MC Configuration entry definition') mcE1T1Type = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("E1", 1), ("T1", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1Type.setStatus('mandatory') if mibBuilder.loadTexts: mcE1T1Type.setDescription("Center card's current type") mcE1T1FLink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Up", 1), ("Down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1FLink.setStatus('mandatory') if mibBuilder.loadTexts: mcE1T1FLink.setDescription("Center card's current link") mcE1T1FLossAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Alarm", 1), ("Normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1FLossAlarm.setStatus('current') if mibBuilder.loadTexts: mcE1T1FLossAlarm.setDescription('') mcE1T1TLossAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Alarm", 1), ("Normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1TLossAlarm.setStatus('current') if mibBuilder.loadTexts: mcE1T1TLossAlarm.setDescription('') mcE1T1AISAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Alarm", 1), ("Normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1AISAlarm.setStatus('current') if mibBuilder.loadTexts: mcE1T1AISAlarm.setDescription('') mcE1T1TLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcE1T1TLoop.setStatus('current') if mibBuilder.loadTexts: mcE1T1TLoop.setDescription('Tx Loopback state') mcE1T1FLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcE1T1FLoop.setStatus('current') if mibBuilder.loadTexts: mcE1T1FLoop.setDescription('Fx Loopback state') mcE1T1CodeType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("E1-HDB3-Or-T1-B8ZS", 1), ("AMI", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcE1T1CodeType.setStatus('current') if mibBuilder.loadTexts: mcE1T1CodeType.setDescription('coding type') mcE1T1Version = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1Version.setStatus('mandatory') if mibBuilder.loadTexts: mcE1T1Version.setDescription('MC version') mcE1T1RmtFLink = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Up", 1), ("Down", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1RmtFLink.setStatus('mandatory') if mibBuilder.loadTexts: mcE1T1RmtFLink.setDescription("Center card's current link") mcE1T1RmtFLossAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Alarm", 1), ("Normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1RmtFLossAlarm.setStatus('current') if mibBuilder.loadTexts: mcE1T1RmtFLossAlarm.setDescription('') mcE1T1RmtTLossAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Alarm", 1), ("Normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1RmtTLossAlarm.setStatus('current') if mibBuilder.loadTexts: mcE1T1RmtTLossAlarm.setDescription('') mcE1T1RmtAISAlarm = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Alarm", 1), ("Normal", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: mcE1T1RmtAISAlarm.setStatus('current') if mibBuilder.loadTexts: mcE1T1RmtAISAlarm.setDescription('') mcE1T1RmtTLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcE1T1RmtTLoop.setStatus('current') if mibBuilder.loadTexts: mcE1T1RmtTLoop.setDescription('Tx Loopback state') mcE1T1RmtFLoop = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcE1T1RmtFLoop.setStatus('current') if mibBuilder.loadTexts: mcE1T1RmtFLoop.setDescription('Fx Loopback state') mcE1T1RmtCodeType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 19, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("E1-HDB3-Or-T1-B8ZS", 1), ("AMI", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcE1T1RmtCodeType.setStatus('current') if mibBuilder.loadTexts: mcE1T1RmtCodeType.setDescription('coding type') mc10GOEEXFPTunableObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 20)) mc10GOEEXFPTunableCardObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 20, 1)) mc10GOEEXFPTunableCardTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 20, 1, 1), ) if mibBuilder.loadTexts: mc10GOEEXFPTunableCardTable.setStatus('current') if mibBuilder.loadTexts: mc10GOEEXFPTunableCardTable.setDescription('MC 10G OEE tunable wavelength Configuration table') mc10GOEEXFPTunableCardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 20, 1, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mc10GOEEXFPTunableCardEntry.setStatus('current') if mibBuilder.loadTexts: mc10GOEEXFPTunableCardEntry.setDescription('MC Configuration entry definition') xfpWaveLengthTunability = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 20, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Supported", 1), ("Unsupported", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: xfpWaveLengthTunability.setStatus('mandatory') if mibBuilder.loadTexts: xfpWaveLengthTunability.setDescription("XFP's wavelength tunability") xfpWaveLengthTunable = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 20, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("Doing", 1), ("Completed", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: xfpWaveLengthTunable.setStatus('mandatory') if mibBuilder.loadTexts: xfpWaveLengthTunable.setDescription("XFP's wavelength tunable status") xfpWaveLength = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 20, 1, 1, 1, 3), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: xfpWaveLength.setStatus('mandatory') if mibBuilder.loadTexts: xfpWaveLength.setDescription("XFP's wavelength") xfpTunableType = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 2, 20, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("channel", 1), ("wavelength", 2), ("not-support", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: xfpTunableType.setStatus('mandatory') if mibBuilder.loadTexts: xfpTunableType.setDescription("XFP's wavelength tunable type") mcPmObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 3)) mcPmTable = MibTable((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 3, 1), ) if mibBuilder.loadTexts: mcPmTable.setStatus('current') if mibBuilder.loadTexts: mcPmTable.setDescription('MC Performance table') mcPmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 3, 1, 1), ).setIndexNames((0, "XXX-MIB", "mcShelfIdx"), (0, "XXX-MIB", "mcCardIdx")) if mibBuilder.loadTexts: mcPmEntry.setStatus('current') if mibBuilder.loadTexts: mcPmEntry.setDescription('MC Performance entry definition') mcRxByteHi = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 3, 1, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRxByteHi.setStatus('current') if mibBuilder.loadTexts: mcRxByteHi.setDescription('The total number of reveive bytes (high)') mcRxByteLo = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcRxByteLo.setStatus('current') if mibBuilder.loadTexts: mcRxByteLo.setDescription('The total number of reveive bytes (low)') mcTxByteHi = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 3, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcTxByteHi.setStatus('current') if mibBuilder.loadTexts: mcTxByteHi.setDescription('The total number of transmit bytes (high)') mcTxByteLo = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mcTxByteLo.setStatus('current') if mibBuilder.loadTexts: mcTxByteLo.setDescription('The total number of transmit bytes (low)') mcPmRest = MibTableColumn((1, 3, 6, 1, 4, 1, 6688, 1, 1, 1, 4, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("idle", 1), ("reset", 2), ("not-support", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: mcPmRest.setStatus('current') if mibBuilder.loadTexts: mcPmRest.setDescription('reset counter') shelf_Detected = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 1)).setLabel("shelf-Detected").setObjects(("XXX-MIB", "shelfIdx")) if mibBuilder.loadTexts: shelf_Detected.setStatus('current') if mibBuilder.loadTexts: shelf_Detected.setDescription('A slave shelf is detected (1~19)') shelf_Lost = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 2)).setLabel("shelf-Lost").setObjects(("XXX-MIB", "shelfIdx")) if mibBuilder.loadTexts: shelf_Lost.setStatus('current') if mibBuilder.loadTexts: shelf_Lost.setDescription('A shelf is lost') shelf_psuA_On = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 3)).setLabel("shelf-psuA-On").setObjects(("XXX-MIB", "shelfIdx")) if mibBuilder.loadTexts: shelf_psuA_On.setStatus('current') if mibBuilder.loadTexts: shelf_psuA_On.setDescription('PSU A is detected') shelf_psuA_Off = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 4)).setLabel("shelf-psuA-Off").setObjects(("XXX-MIB", "shelfIdx")) if mibBuilder.loadTexts: shelf_psuA_Off.setStatus('current') if mibBuilder.loadTexts: shelf_psuA_Off.setDescription('PSU A is lost') shelf_psuB_On = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 5)).setLabel("shelf-psuB-On").setObjects(("XXX-MIB", "shelfIdx")) if mibBuilder.loadTexts: shelf_psuB_On.setStatus('current') if mibBuilder.loadTexts: shelf_psuB_On.setDescription('PSU B is detected') shelf_psuB_Off = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 6)).setLabel("shelf-psuB-Off").setObjects(("XXX-MIB", "shelfIdx")) if mibBuilder.loadTexts: shelf_psuB_Off.setStatus('current') if mibBuilder.loadTexts: shelf_psuB_Off.setDescription('PSU B is lost') shelf_fan_On = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 7)).setLabel("shelf-fan-On").setObjects(("XXX-MIB", "shelfIdx")) if mibBuilder.loadTexts: shelf_fan_On.setStatus('current') if mibBuilder.loadTexts: shelf_fan_On.setDescription('Fan A is detected') shelf_fan_Off = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 8)).setLabel("shelf-fan-Off").setObjects(("XXX-MIB", "shelfIdx")) if mibBuilder.loadTexts: shelf_fan_Off.setStatus('current') if mibBuilder.loadTexts: shelf_fan_Off.setDescription('Fan A is lost') card_Detected = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 20)).setLabel("card-Detected").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_Detected.setStatus('current') if mibBuilder.loadTexts: card_Detected.setDescription('A card is detected (20~29)') card_Lost = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 21)).setLabel("card-Lost").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_Lost.setStatus('current') if mibBuilder.loadTexts: card_Lost.setDescription('A card is lost') card_MC_Co_Tx_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 30)).setLabel("card-MC-Co-Tx-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Tx_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Tx_Up.setDescription('The tx link of mc in center side is up (above 30)') card_MC_Co_Tx_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 31)).setLabel("card-MC-Co-Tx-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Tx_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Tx_Down.setDescription('The tx link of mc in center side is broken') card_MC_Co_Fx_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 32)).setLabel("card-MC-Co-Fx-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Fx_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Fx_Up.setDescription('The fx link of mc in center side is up') card_MC_Co_Fx_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 33)).setLabel("card-MC-Co-Fx-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Fx_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Fx_Down.setDescription('The fx link of mc in center side is broken') card_MC_Rmt_Tx_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 34)).setLabel("card-MC-Rmt-Tx-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_Tx_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_Tx_Up.setDescription('The tx link of mc in customer side is up') card_MC_Rmt_Tx_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 35)).setLabel("card-MC-Rmt-Tx-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_Tx_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_Tx_Down.setDescription('The tx link of mc in customer side is broken') card_MC_Rmt_PwrDown = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 36)).setLabel("card-MC-Rmt-PwrDown").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_PwrDown.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_PwrDown.setDescription('Remote mc power down detected') card_MC_Co_Ntw_SFP_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 37)).setLabel("card-MC-Co-Ntw-SFP-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Ntw_SFP_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Ntw_SFP_Inserted.setDescription('Local network port SFP inserted') card_MC_Co_Ntw_SFP_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 38)).setLabel("card-MC-Co-Ntw-SFP-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Ntw_SFP_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Ntw_SFP_Removed.setDescription('Local network port SFP removed') card_MC_Co_Acc_SFP_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 39)).setLabel("card-MC-Co-Acc-SFP-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Acc_SFP_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Acc_SFP_Inserted.setDescription('Local access port SFP inserted') card_MC_Co_Acc_SFP_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 40)).setLabel("card-MC-Co-Acc-SFP-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Acc_SFP_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Acc_SFP_Removed.setDescription('Local access port SFP removed') card_MC_Rmt_Acc_SFP_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 41)).setLabel("card-MC-Rmt-Acc-SFP-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_Acc_SFP_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_Acc_SFP_Inserted.setDescription('Remote access port SFP inserted') card_MC_Rmt_Acc_SFP_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 42)).setLabel("card-MC-Rmt-Acc-SFP-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_Acc_SFP_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_Acc_SFP_Removed.setDescription('Remote access port SFP removed') card_MC_Co_Tx_Up1 = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 43)).setLabel("card-MC-Co-Tx-Up1").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Tx_Up1.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Tx_Up1.setDescription('The tx1 link of mc in center side is up') card_MC_Co_Tx_Down1 = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 44)).setLabel("card-MC-Co-Tx-Down1").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Tx_Down1.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Tx_Down1.setDescription('The tx1 link of mc in center side is broken') card_MC_Co_Tx_Up2 = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 45)).setLabel("card-MC-Co-Tx-Up2").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Tx_Up2.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Tx_Up2.setDescription('The tx2 link of mc in center side is up') card_MC_Co_Tx_Down2 = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 46)).setLabel("card-MC-Co-Tx-Down2").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Tx_Down2.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Tx_Down2.setDescription('The tx2 link of mc in center side is broken') card_MC_Rmt_Tx_Up1 = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 47)).setLabel("card-MC-Rmt-Tx-Up1").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_Tx_Up1.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_Tx_Up1.setDescription('The tx1 link of mc in customer side is up') card_MC_Rmt_Tx_Down1 = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 48)).setLabel("card-MC-Rmt-Tx-Down1").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_Tx_Down1.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_Tx_Down1.setDescription('The tx1 link of mc in customer side is broken') card_MC_Rmt_Tx_Up2 = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 49)).setLabel("card-MC-Rmt-Tx-Up2").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_Tx_Up2.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_Tx_Up2.setDescription('The tx2 link of mc in customer side is up') card_MC_Rmt_Tx_Down2 = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 50)).setLabel("card-MC-Rmt-Tx-Down2").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_Tx_Down2.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_Tx_Down2.setDescription('The tx2 link of mc in customer side is broken') card_MC_Co_SFP1_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 51)).setLabel("card-MC-Co-SFP1-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP1_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP1_Inserted.setDescription('Local SFP1 inserted') card_MC_Co_SFP1_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 52)).setLabel("card-MC-Co-SFP1-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP1_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP1_Removed.setDescription('Local SFP1 removed') card_MC_Co_SFP2_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 53)).setLabel("card-MC-Co-SFP2-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP2_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP2_Inserted.setDescription('Local SFP2 inserted') card_MC_Co_SFP2_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 54)).setLabel("card-MC-Co-SFP2-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP2_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP2_Removed.setDescription('Local SFP2 removed') card_MC_Co_SFP1_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 55)).setLabel("card-MC-Co-SFP1-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP1_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP1_Up.setDescription('The SFP1 link of mc in center side is up') card_MC_Co_SFP1_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 56)).setLabel("card-MC-Co-SFP1-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP1_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP1_Down.setDescription('The SFP1 link of mc in center side is broken') card_MC_Co_SFP2_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 57)).setLabel("card-MC-Co-SFP2-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP2_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP2_Up.setDescription('The SFP2 link of mc in center side is up') card_MC_Co_SFP2_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 58)).setLabel("card-MC-Co-SFP2-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP2_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP2_Down.setDescription('The SFP2 link of mc in center side is broken') card_MC_Rmt_SFP1_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 59)).setLabel("card-MC-Rmt-SFP1-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP1_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP1_Inserted.setDescription('Remote SFP1 inserted') card_MC_Rmt_SFP1_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 60)).setLabel("card-MC-Rmt-SFP1-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP1_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP1_Removed.setDescription('Remote SFP1 removed') card_MC_Rmt_SFP1_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 61)).setLabel("card-MC-Rmt-SFP1-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP1_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP1_Up.setDescription('The SFP1 link of mc in customer side is up') card_MC_Rmt_SFP1_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 62)).setLabel("card-MC-Rmt-SFP1-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP1_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP1_Down.setDescription('The SFP1 link of mc in customer side is broken') card_MC_Co_SFPSFP1_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 63)).setLabel("card-MC-Co-SFPSFP1-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFPSFP1_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFPSFP1_Inserted.setDescription('Local SFP+1 inserted') card_MC_Co_SFPSFP1_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 64)).setLabel("card-MC-Co-SFPSFP1-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFPSFP1_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFPSFP1_Removed.setDescription('Local SFP+1 removed') card_MC_Co_SFPSFP2_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 65)).setLabel("card-MC-Co-SFPSFP2-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFPSFP2_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFPSFP2_Inserted.setDescription('Local SFPSFP2 inserted') card_MC_Co_SFPSFP2_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 66)).setLabel("card-MC-Co-SFPSFP2-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFPSFP2_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFPSFP2_Removed.setDescription('Local SFP+2 removed') card_MC_Rmt_SFPSFP1_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 67)).setLabel("card-MC-Rmt-SFPSFP1-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFPSFP1_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFPSFP1_Inserted.setDescription('Remote SFP+1 inserted') card_MC_Rmt_SFPSFP1_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 68)).setLabel("card-MC-Rmt-SFPSFP1-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFPSFP1_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFPSFP1_Removed.setDescription('Remote SFP+1 removed') card_MC_Co_XFP1_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 69)).setLabel("card-MC-Co-XFP1-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_XFP1_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_XFP1_Inserted.setDescription('Local XFP+1 inserted') card_MC_Co_XFP1_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 70)).setLabel("card-MC-Co-XFP1-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_XFP1_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_XFP1_Removed.setDescription('Local XFP+1 removed') card_MC_Co_XFP2_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 71)).setLabel("card-MC-Co-XFP2-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_XFP2_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_XFP2_Inserted.setDescription('Local XFP2 inserted') card_MC_Co_XFP2_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 72)).setLabel("card-MC-Co-XFP2-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_XFP2_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_XFP2_Removed.setDescription('Local XFP+2 removed') card_MC_Rmt_XFP1_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 73)).setLabel("card-MC-Rmt-XFP1-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_XFP1_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_XFP1_Inserted.setDescription('Remote XFP+1 inserted') card_MC_Rmt_XFP1_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 74)).setLabel("card-MC-Rmt-XFP1-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_XFP1_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_XFP1_Removed.setDescription('Remote XFP+1 removed') card_MC_Co_SFPSFP1_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 75)).setLabel("card-MC-Co-SFPSFP1-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFPSFP1_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFPSFP1_Up.setDescription('The SFP+1 link of mc in center side is up') card_MC_Co_SFPSFP1_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 76)).setLabel("card-MC-Co-SFPSFP1-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFPSFP1_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFPSFP1_Down.setDescription('The SFP+1 link of mc in center side is broken') card_MC_Co_SFPSFP2_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 77)).setLabel("card-MC-Co-SFPSFP2-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFPSFP2_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFPSFP2_Up.setDescription('The SFP+2 link of mc in center side is up') card_MC_Co_SFPSFP2_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 78)).setLabel("card-MC-Co-SFPSFP2-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFPSFP2_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFPSFP2_Down.setDescription('The SFP+2 link of mc in center side is broken') card_MC_Rmt_SFPSFP1_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 79)).setLabel("card-MC-Rmt-SFPSFP1-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFPSFP1_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFPSFP1_Up.setDescription('The SFPSFP1 link of mc in customer side is up') card_MC_Rmt_SFPSFP1_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 80)).setLabel("card-MC-Rmt-SFPSFP1-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFPSFP1_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFPSFP1_Down.setDescription('The SFP+1 link of mc in customer side is broken') card_MC_Co_XFP1_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 81)).setLabel("card-MC-Co-XFP1-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_XFP1_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_XFP1_Up.setDescription('The XFP1 link of mc in center side is up') card_MC_Co_XFP1_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 82)).setLabel("card-MC-Co-XFP1-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_XFP1_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_XFP1_Down.setDescription('The XFP1 link of mc in center side is broken') card_MC_Co_XFP2_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 83)).setLabel("card-MC-Co-XFP2-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_XFP2_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_XFP2_Up.setDescription('The XFP2 link of mc in center side is up') card_MC_Co_XFP2_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 84)).setLabel("card-MC-Co-XFP2-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_XFP2_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_XFP2_Down.setDescription('The XFP2 link of mc in center side is broken') card_MC_Rmt_XFP1_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 85)).setLabel("card-MC-Rmt-XFP1-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_XFP1_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_XFP1_Up.setDescription('The XFP1 link of mc in customer side is up') card_MC_Rmt_XFP1_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 86)).setLabel("card-MC-Rmt-XFP1-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_XFP1_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_XFP1_Down.setDescription('The XFP link of mc in customer side is broken') card_MC_Co_SFP3_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 87)).setLabel("card-MC-Co-SFP3-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP3_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP3_Inserted.setDescription('Local SFP3 inserted') card_MC_Co_SFP3_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 88)).setLabel("card-MC-Co-SFP3-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP3_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP3_Removed.setDescription('Local SFP3 removed') card_MC_Co_Port1_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 89)).setLabel("card-MC-Co-Port1-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Port1_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Port1_Up.setDescription('The Port1 link of mc in center side is up') card_MC_Co_Port1_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 90)).setLabel("card-MC-Co-Port1-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Port1_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Port1_Down.setDescription('The Port1 link of mc in center side is broken') card_MC_Co_Port2_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 91)).setLabel("card-MC-Co-Port2-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Port2_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Port2_Up.setDescription('The Port2 link of mc in center side is up') card_MC_Co_Port2_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 92)).setLabel("card-MC-Co-Port2-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Port2_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Port2_Down.setDescription('The Port2 link of mc in center side is broken') card_MC_Co_Port3_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 93)).setLabel("card-MC-Co-Port3-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Port3_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Port3_Up.setDescription('The Port3 link of mc in center side is up') card_MC_Co_Port3_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 94)).setLabel("card-MC-Co-Port3-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_Port3_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_Port3_Down.setDescription('The Port3 link of mc in center side is broken') card_MC_FAN_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 100)).setLabel("card-MC-FAN-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_FAN_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_FAN_Normal.setDescription('Fan card work normally') card_MC_FAN_Abnormal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 101)).setLabel("card-MC-FAN-Abnormal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_FAN_Abnormal.setStatus('current') if mibBuilder.loadTexts: card_MC_FAN_Abnormal.setDescription('Fan card work abnormally') card_MC_Co_QSFP1_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 102)).setLabel("card-MC-Co-QSFP1-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Inserted.setDescription('Local QSFP1 inserted') card_MC_Co_QSFP1_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 103)).setLabel("card-MC-Co-QSFP1-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Removed.setDescription('Local QSFP1 removed') card_MC_Co_QSFP2_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 104)).setLabel("card-MC-Co-QSFP2-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Inserted.setDescription('Local QSFP2 inserted') card_MC_Co_QSFP2_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 105)).setLabel("card-MC-Co-QSFP2-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Removed.setDescription('Local QSFP2 removed') card_MC_Co_QSFP1_Lane1_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 106)).setLabel("card-MC-Co-QSFP1-Lane1-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane1_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane1_Up.setDescription('The QSFP1 Lane1 link of mc in center side is up') card_MC_Co_QSFP1_Lane1_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 107)).setLabel("card-MC-Co-QSFP1-Lane1-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane1_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane1_Down.setDescription('The QSFP1 lane1 link of mc in center side is broken') card_MC_Co_QSFP1_Lane2_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 108)).setLabel("card-MC-Co-QSFP1-Lane2-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane2_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane2_Up.setDescription('The QSFP1 Lane2 link of mc in center side is up') card_MC_Co_QSFP1_Lane2_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 109)).setLabel("card-MC-Co-QSFP1-Lane2-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane2_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane2_Down.setDescription('The QSFP1 lane2 link of mc in center side is broken') card_MC_Co_QSFP1_Lane3_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 110)).setLabel("card-MC-Co-QSFP1-Lane3-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane3_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane3_Up.setDescription('The QSFP1 Lane3 link of mc in center side is up') card_MC_Co_QSFP1_Lane3_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 111)).setLabel("card-MC-Co-QSFP1-Lane3-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane3_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane3_Down.setDescription('The QSFP1 lane3 link of mc in center side is broken') card_MC_Co_QSFP1_Lane4_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 112)).setLabel("card-MC-Co-QSFP1-Lane4-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane4_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane4_Up.setDescription('The QSFP1 Lane4 link of mc in center side is up') card_MC_Co_QSFP1_Lane4_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 113)).setLabel("card-MC-Co-QSFP1-Lane4-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane4_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP1_Lane4_Down.setDescription('The QSFP1 lane4 link of mc in center side is broken') card_MC_Co_QSFP2_Lane1_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 114)).setLabel("card-MC-Co-QSFP2-Lane1-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane1_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane1_Up.setDescription('The QSFP2 Lane1 link of mc in center side is up') card_MC_Co_QSFP2_Lane1_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 115)).setLabel("card-MC-Co-QSFP2-Lane1-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane1_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane1_Down.setDescription('The QSFP2 lane1 link of mc in center side is broken') card_MC_Co_QSFP2_Lane2_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 116)).setLabel("card-MC-Co-QSFP2-Lane2-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane2_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane2_Up.setDescription('The QSFP2 Lane2 link of mc in center side is up') card_MC_Co_QSFP2_Lane2_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 117)).setLabel("card-MC-Co-QSFP2-Lane2-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane2_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane2_Down.setDescription('The QSFP2 lane2 link of mc in center side is broken') card_MC_Co_QSFP2_Lane3_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 118)).setLabel("card-MC-Co-QSFP2-Lane3-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane3_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane3_Up.setDescription('The QSFP2 Lane3 link of mc in center side is up') card_MC_Co_QSFP2_Lane3_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 119)).setLabel("card-MC-Co-QSFP2-Lane3-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane3_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane3_Down.setDescription('The QSFP2 lane3 link of mc in center side is broken') card_MC_Co_QSFP2_Lane4_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 120)).setLabel("card-MC-Co-QSFP2-Lane4-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane4_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane4_Up.setDescription('The QSFP2 Lane4 link of mc in center side is up') card_MC_Co_QSFP2_Lane4_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 121)).setLabel("card-MC-Co-QSFP2-Lane4-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane4_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_QSFP2_Lane4_Down.setDescription('The QSFP2 lane4 link of mc in center side is broken') card_MC_Rmt_SFP2_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 122)).setLabel("card-MC-Rmt-SFP2-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP2_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP2_Inserted.setDescription('Remote SFP2 inserted') card_MC_Rmt_SFP2_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 123)).setLabel("card-MC-Rmt-SFP2-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP2_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP2_Removed.setDescription('Remote SFP2 removed') card_MC_Rmt_SFP3_Inserted = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 124)).setLabel("card-MC-Rmt-SFP3-Inserted").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP3_Inserted.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP3_Inserted.setDescription('Remote SFP3 inserted') card_MC_Rmt_SFP3_Removed = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 125)).setLabel("card-MC-Rmt-SFP3-Removed").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP3_Removed.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP3_Removed.setDescription('Remote SFP3 removed') card_MC_Rmt_SFP2_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 126)).setLabel("card-MC-Rmt-SFP2-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP2_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP2_Up.setDescription('The SFP2 link of mc in customer side is up') card_MC_Rmt_SFP2_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 127)).setLabel("card-MC-Rmt-SFP2-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP2_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP2_Down.setDescription('The SFP2 link of mc in customer side is broken') card_MC_Rmt_SFP3_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 128)).setLabel("card-MC-Rmt-SFP3-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP3_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP3_Up.setDescription('The SFP3 link of mc in customer side is up') card_MC_Rmt_SFP3_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 129)).setLabel("card-MC-Rmt-SFP3-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Rmt_SFP3_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Rmt_SFP3_Down.setDescription('The SFP3 link of mc in customer side is broken') card_MC_E1_Co_Port1_LOS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 130)).setLabel("card-MC-E1-Co-Port1-LOS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port1_LOS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port1_LOS_Alarm.setDescription('Port1 LOS alarm in center side') card_MC_E1_Co_Port1_LOS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 131)).setLabel("card-MC-E1-Co-Port1-LOS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port1_LOS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port1_LOS_Normal.setDescription('Port1 LOS normal in center side') card_MC_E1_Co_Port1_AIS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 132)).setLabel("card-MC-E1-Co-Port1-AIS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port1_AIS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port1_AIS_Alarm.setDescription('Port1 AIS alarm in center side') card_MC_E1_Co_Port1_AIS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 133)).setLabel("card-MC-E1-Co-Port1-AIS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port1_AIS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port1_AIS_Normal.setDescription('Port1 AIS normal in center side') card_MC_E1_Co_Port1_CV_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 134)).setLabel("card-MC-E1-Co-Port1-CV-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port1_CV_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port1_CV_Alarm.setDescription('Port1 CV alarm in center side') card_MC_E1_Co_Port1_CV_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 135)).setLabel("card-MC-E1-Co-Port1-CV-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port1_CV_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port1_CV_Normal.setDescription('Port1 CV normal in center side') card_MC_E1_Co_Port2_LOS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 136)).setLabel("card-MC-E1-Co-Port2-LOS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port2_LOS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port2_LOS_Alarm.setDescription('Port2 LOS alarm in center side') card_MC_E1_Co_Port2_LOS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 137)).setLabel("card-MC-E1-Co-Port2-LOS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port2_LOS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port2_LOS_Normal.setDescription('Port2 LOS normal in center side') card_MC_E1_Co_Port2_AIS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 138)).setLabel("card-MC-E1-Co-Port2-AIS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port2_AIS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port2_AIS_Alarm.setDescription('Port2 AIS alarm in center side') card_MC_E1_Co_Port2_AIS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 139)).setLabel("card-MC-E1-Co-Port2-AIS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port2_AIS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port2_AIS_Normal.setDescription('Port2 AIS normal in center side') card_MC_E1_Co_Port2_CV_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 140)).setLabel("card-MC-E1-Co-Port2-CV-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port2_CV_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port2_CV_Alarm.setDescription('Port2 CV alarm in center side') card_MC_E1_Co_Port2_CV_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 141)).setLabel("card-MC-E1-Co-Port2-CV-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Co_Port2_CV_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Co_Port2_CV_Normal.setDescription('Port2 CV normal in center side') card_MC_E1_Rmt_Port1_LOS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 142)).setLabel("card-MC-E1-Rmt-Port1-LOS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_LOS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_LOS_Alarm.setDescription('Port1 LOS alarm in customer side') card_MC_E1_Rmt_Port1_LOS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 143)).setLabel("card-MC-E1-Rmt-Port1-LOS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_LOS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_LOS_Normal.setDescription('Port1 LOS normal in customer side') card_MC_E1_Rmt_Port1_AIS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 144)).setLabel("card-MC-E1-Rmt-Port1-AIS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_AIS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_AIS_Alarm.setDescription('Port1 AIS alarm in customer side') card_MC_E1_Rmt_Port1_AIS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 145)).setLabel("card-MC-E1-Rmt-Port1-AIS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_AIS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_AIS_Normal.setDescription('Port1 AIS normal in customer side') card_MC_E1_Rmt_Port1_CV_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 146)).setLabel("card-MC-E1-Rmt-Port1-CV-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_CV_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_CV_Alarm.setDescription('Port1 CV alarm in customer side') card_MC_E1_Rmt_Port1_CV_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 147)).setLabel("card-MC-E1-Rmt-Port1-CV-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_CV_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port1_CV_Normal.setDescription('Port1 CV normal in customer side') card_MC_E1_Rmt_Port2_LOS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 148)).setLabel("card-MC-E1-Rmt-Port2-LOS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_LOS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_LOS_Alarm.setDescription('Port2 LOS alarm in customer side') card_MC_E1_Rmt_Port2_LOS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 149)).setLabel("card-MC-E1-Rmt-Port2-LOS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_LOS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_LOS_Normal.setDescription('Port2 LOS normal in customer side') card_MC_E1_Rmt_Port2_AIS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 150)).setLabel("card-MC-E1-Rmt-Port2-AIS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_AIS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_AIS_Alarm.setDescription('Port2 AIS alarm in customer side') card_MC_E1_Rmt_Port2_AIS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 151)).setLabel("card-MC-E1-Rmt-Port2-AIS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_AIS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_AIS_Normal.setDescription('Port2 AIS normal in customer side') card_MC_E1_Rmt_Port2_CV_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 152)).setLabel("card-MC-E1-Rmt-Port2-CV-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_CV_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_CV_Alarm.setDescription('Port2 CV alarm in customer side') card_MC_E1_Rmt_Port2_CV_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 153)).setLabel("card-MC-E1-Rmt-Port2-CV-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_CV_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1_Rmt_Port2_CV_Normal.setDescription('Port2 CV normal in customer side') card_MC_Co_SFP3_Up = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 154)).setLabel("card-MC-Co-SFP3-Up").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP3_Up.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP3_Up.setDescription('The SFP3 link of mc in center side is up') card_MC_Co_SFP3_Down = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 155)).setLabel("card-MC-Co-SFP3-Down").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_Co_SFP3_Down.setStatus('current') if mibBuilder.loadTexts: card_MC_Co_SFP3_Down.setDescription('The SFP3 link of mc in center side is broken') card_MC_E1T1_Co_TXLOS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 156)).setLabel("card-MC-E1T1-Co-TXLOS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Co_TXLOS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Co_TXLOS_Alarm.setDescription('Tx LOS alarm in center side') card_MC_E1T1_Co_TXLOS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 157)).setLabel("card-MC-E1T1-Co-TXLOS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Co_TXLOS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Co_TXLOS_Normal.setDescription('Tx LOS normal in center side') card_MC_E1T1_Co_FXLOS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 158)).setLabel("card-MC-E1T1-Co-FXLOS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Co_FXLOS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Co_FXLOS_Alarm.setDescription('Fx LOS alarm in center side') card_MC_E1T1_Co_FXLOS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 159)).setLabel("card-MC-E1T1-Co-FXLOS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Co_FXLOS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Co_FXLOS_Normal.setDescription('Fx LOS normal in center side') card_MC_E1T1_Co_AIS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 160)).setLabel("card-MC-E1T1-Co-AIS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Co_AIS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Co_AIS_Alarm.setDescription('AIS alarm in center side') card_MC_E1T1_Co_AIS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 161)).setLabel("card-MC-E1T1-Co-AIS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Co_AIS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Co_AIS_Normal.setDescription('AIS normal in center side') card_MC_E1T1_Rmt_TXLOS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 162)).setLabel("card-MC-E1T1-Rmt-TXLOS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Rmt_TXLOS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Rmt_TXLOS_Alarm.setDescription('Tx LOS alarm in customer side') card_MC_E1T1_Rmt_TXLOS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 163)).setLabel("card-MC-E1T1-Rmt-TXLOS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Rmt_TXLOS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Rmt_TXLOS_Normal.setDescription('Tx LOS normal in customer side') card_MC_E1T1_Rmt_FXLOS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 164)).setLabel("card-MC-E1T1-Rmt-FXLOS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Rmt_FXLOS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Rmt_FXLOS_Alarm.setDescription('Fx LOS alarm in customer side') card_MC_E1T1_Rmt_FXLOS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 165)).setLabel("card-MC-E1T1-Rmt-FXLOS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Rmt_FXLOS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Rmt_FXLOS_Normal.setDescription('Fx LOS normal in customer side') card_MC_E1T1_Rmt_AIS_Alarm = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 166)).setLabel("card-MC-E1T1-Rmt-AIS-Alarm").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Rmt_AIS_Alarm.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Rmt_AIS_Alarm.setDescription('AIS alarm in customer side') card_MC_E1T1_Rmt_AIS_Normal = NotificationType((1, 3, 6, 1, 4, 1, 6688, 1, 1, 2, 167)).setLabel("card-MC-E1T1-Rmt-AIS-Normal").setObjects(("XXX-MIB", "shelfIdx"), ("XXX-MIB", "slotIdx")) if mibBuilder.loadTexts: card_MC_E1T1_Rmt_AIS_Normal.setStatus('current') if mibBuilder.loadTexts: card_MC_E1T1_Rmt_AIS_Normal.setDescription('AIS normal in customer side') mibBuilder.exportSymbols("XXX-MIB", mc40G_OEOLane2LoopMode=mc40G_OEOLane2LoopMode, company=company, mcFanCardObjects=mcFanCardObjects, mc10G_OEECurSpd=mc10G_OEECurSpd, card_MC_Co_QSFP1_Lane2_Up=card_MC_Co_QSFP1_Lane2_Up, mc4_25G_OEONtwPD=mc4_25G_OEONtwPD, mcCm1gSfpEntry=mcCm1gSfpEntry, card_MC_Co_QSFP1_Lane1_Down=card_MC_Co_QSFP1_Lane1_Down, mc10G_OEO2RObjects=mc10G_OEO2RObjects, mcTransceiverDist=mcTransceiverDist, mc2_5GMCCardObjects=mc2_5GMCCardObjects, mcPortState=mcPortState, mc1GE2OPort2SFPExist=mc1GE2OPort2SFPExist, shelfNum=shelfNum, mcIP175DCurWorkMode=mcIP175DCurWorkMode, card_MC_Rmt_Tx_Up1=card_MC_Rmt_Tx_Up1, mc1go2o_sfpTransCode=mc1go2o_sfpTransCode, sysName=sysName, psuB=psuB, ntwXFP2WaveLength=ntwXFP2WaveLength, mcAccXFP1WaveLengthTunability=mcAccXFP1WaveLengthTunability, mc10G_OEO_Test_Error_Counter=mc10G_OEO_Test_Error_Counter, mc2_5g_sfpWavelength=mc2_5g_sfpWavelength, mc2_5g_sfpCompliance=mc2_5g_sfpCompliance, card_MC_E1_Co_Port1_CV_Alarm=card_MC_E1_Co_Port1_CV_Alarm, mcIP175DCardTable=mcIP175DCardTable, mc4_25G_OEO_Test_Result=mc4_25G_OEO_Test_Result, mc40G_OEOHWLoopMode=mc40G_OEOHWLoopMode, mcE1T1RmtFLink=mcE1T1RmtFLink, ntwXFP2WaveLengthTunability=ntwXFP2WaveLengthTunability, card_MC_E1T1_Co_TXLOS_Normal=card_MC_E1T1_Co_TXLOS_Normal, mcCmEntry=mcCmEntry, mc1go2o_sfpCompliance=mc1go2o_sfpCompliance, shelfIdx=shelfIdx, trapHost1=trapHost1, mcCm1gSfpObjects=mcCm1gSfpObjects, volA=volA, getNtwQSfpCmd=getNtwQSfpCmd, mc1GO2OPortHWPri=mc1GO2OPortHWPri, card_MC_Co_SFP3_Up=card_MC_Co_SFP3_Up, mcE1Port2Loop=mcE1Port2Loop, xfpWaveLengthTunable=xfpWaveLengthTunable, rmtCardNum=rmtCardNum, shelf_fan_Off=shelf_fan_Off, mcDownStream=mcDownStream, mcE1SFP1Link=mcE1SFP1Link, mc10G_OEOCardEntry=mc10G_OEOCardEntry, mcAccXFP1WaveLengthTunable=mcAccXFP1WaveLengthTunable, nmuType=nmuType, mc10G_OEO_Get_Test_Rst=mc10G_OEO_Get_Test_Rst, mc1GE2ORmtPort1SFPlink=mc1GE2ORmtPort1SFPlink, slotObjects=slotObjects, mcIP175DObjects=mcIP175DObjects, card_MC_Co_Tx_Up1=card_MC_Co_Tx_Up1, mcRmtE1Port1CV=mcRmtE1Port1CV, mcRmtHWTransmitMode=mcRmtHWTransmitMode, mcIP175DTxlink=mcIP175DTxlink, mc10G_OEOCurSpdMode=mc10G_OEOCurSpdMode, mc10G_OEELoopMode=mc10G_OEELoopMode, mcE1T1FLossAlarm=mcE1T1FLossAlarm, shelf_psuA_On=shelf_psuA_On, mcQCA8334RmtCfgWorkMode=mcQCA8334RmtCfgWorkMode, shelfTable=shelfTable, ipaddr=ipaddr, mc1GE2OPort1SFPlink=mc1GE2OPort1SFPlink, mc10G_OEO_accType=mc10G_OEO_accType, card_MC_E1_Rmt_Port1_AIS_Normal=card_MC_E1_Rmt_Port1_AIS_Normal, sfpVoltage=sfpVoltage, mc10GOEO1RCardTable=mc10GOEO1RCardTable, mc10GXFP2WaveLengthTunable=mc10GXFP2WaveLengthTunable, mcRmtE1Port1Loop=mcRmtE1Port1Loop, mc4_25G_OEOCardEntry=mc4_25G_OEOCardEntry, card_MC_E1_Rmt_Port1_AIS_Alarm=card_MC_E1_Rmt_Port1_AIS_Alarm, mcRmt4_25G_OEOHWWorkMode=mcRmt4_25G_OEOHWWorkMode, mcCm1gIpEntry=mcCm1gIpEntry, cwdmWavelength5=cwdmWavelength5, mcE1Port1AIS=mcE1Port1AIS, accXFP1TunableType=accXFP1TunableType, mcRmtPwrDown=mcRmtPwrDown, mc10G_OEOObjects=mc10G_OEOObjects, card_MC_Rmt_Tx_Down=card_MC_Rmt_Tx_Down, mc10G_OEEHWLoopback=mc10G_OEEHWLoopback, card_MC_Co_Port3_Down=card_MC_Co_Port3_Down, card_MC_Co_SFP3_Down=card_MC_Co_SFP3_Down, mcQCA8334RmtTxlink=mcQCA8334RmtTxlink, card_MC_E1T1_Co_AIS_Normal=card_MC_E1T1_Co_AIS_Normal, mcRmtE1TxCurWorkMode=mcRmtE1TxCurWorkMode, qsfpAccRxPower4=qsfpAccRxPower4, mcRmt10G_OEOLoopback=mcRmt10G_OEOLoopback, card_MC_E1_Rmt_Port2_CV_Normal=card_MC_E1_Rmt_Port2_CV_Normal, card_MC_E1_Co_Port2_CV_Normal=card_MC_E1_Co_Port2_CV_Normal, mcTxByteLo=mcTxByteLo, mcCardIdx=mcCardIdx, card_MC_Rmt_SFP3_Up=card_MC_Rmt_SFP3_Up, card_MC_E1T1_Co_FXLOS_Alarm=card_MC_E1T1_Co_FXLOS_Alarm, mcRmt4_25G_OEOHWSpdMode=mcRmt4_25G_OEOHWSpdMode, card_MC_Co_QSFP1_Lane4_Up=card_MC_Co_QSFP1_Lane4_Up, mcUtility=mcUtility, mc4_25G_OEOObjects=mc4_25G_OEOObjects, mc10GOEO1RCardEntry=mc10GOEO1RCardEntry, getAccSfpCmd=getAccSfpCmd, mc1GO2OPort3SFPExist=mc1GO2OPort3SFPExist, mcRmtCfgWorkMode=mcRmtCfgWorkMode, mcNtwQSfpObjects=mcNtwQSfpObjects, mcShelfIdx=mcShelfIdx, mc40G_OEOCardEntry=mc40G_OEOCardEntry, mcE1T1CardTable=mcE1T1CardTable, accsfpRecvPower=accsfpRecvPower, mc10GXFP1WaveLengthTunability=mc10GXFP1WaveLengthTunability, cwdmWavelength7=cwdmWavelength7, cwdmWavelength1=cwdmWavelength1, mc40G_OEOQsfp2Lane3_link=mc40G_OEOQsfp2Lane3_link, mcE1Port2CV=mcE1Port2CV, mcAccQSfpObjects=mcAccQSfpObjects, mcRmtE1Port1AIS=mcRmtE1Port1AIS, mcIP175DCardEntry=mcIP175DCardEntry, accsfpTemperature=accsfpTemperature, mc10G_OEO2R_accTunableType=mc10G_OEO2R_accTunableType, card_MC_Co_QSFP2_Lane2_Up=card_MC_Co_QSFP2_Lane2_Up, mc4_25G_OEO_Test_Lock=mc4_25G_OEO_Test_Lock, mcRmtUtility=mcRmtUtility, mc2_5GMCSfp3Exist=mc2_5GMCSfp3Exist, mc4_25G_OEO_Start_Test=mc4_25G_OEO_Start_Test, qsfpAccTemperature=qsfpAccTemperature, card_MC_Rmt_Tx_Down2=card_MC_Rmt_Tx_Down2, sfpConnector=sfpConnector, mcFanObjects=mcFanObjects, card_MC_Co_SFP2_Inserted=card_MC_Co_SFP2_Inserted, mc1GE2OPortPri=mc1GE2OPortPri, mc1GO2OPort1SFPExist=mc1GO2OPort1SFPExist, card_MC_Rmt_SFP3_Down=card_MC_Rmt_SFP3_Down, mcRmt10G_OEOCfgSpdMode=mcRmt10G_OEOCfgSpdMode, mc1go2o_sfpWavelength=mc1go2o_sfpWavelength, card_MC_Co_SFP1_Removed=card_MC_Co_SFP1_Removed, mc40G_OEOQsfp1Lane1_link=mc40G_OEOQsfp1Lane1_link, card_MC_Rmt_XFP1_Up=card_MC_Rmt_XFP1_Up, card_MC_E1T1_Co_TXLOS_Alarm=card_MC_E1T1_Co_TXLOS_Alarm, sfpCopperLength=sfpCopperLength, mc2_5GMCCardTable=mc2_5GMCCardTable, mc2_5g_getSfpCmd=mc2_5g_getSfpCmd, mcE1T1RmtTLossAlarm=mcE1T1RmtTLossAlarm, trapHost3=trapHost3, mcRmtE1Port2LOS=mcRmtE1Port2LOS, card_MC_Co_SFPSFP1_Removed=card_MC_Co_SFPSFP1_Removed, card_MC_E1T1_Co_FXLOS_Normal=card_MC_E1T1_Co_FXLOS_Normal, mc1GO2OPort3SFPlink=mc1GO2OPort3SFPlink, mc1go2o_getSfpCmd=mc1go2o_getSfpCmd, sfpCompliance=sfpCompliance, card_MC_Co_QSFP2_Lane2_Down=card_MC_Co_QSFP2_Lane2_Down, mc10GXFP1WaveLength=mc10GXFP1WaveLength, mc10GOEO3RCardTable=mc10GOEO3RCardTable, mc1GO2ORmtPortHWPri=mc1GO2ORmtPortHWPri, card_MC_Rmt_Tx_Up2=card_MC_Rmt_Tx_Up2, mcRmtHWLFP=mcRmtHWLFP, card_MC_Co_QSFP1_Lane1_Up=card_MC_Co_QSFP1_Lane1_Up, accsfpSmLength=accsfpSmLength, mcIP175DPortObjects=mcIP175DPortObjects, mcType=mcType, accXFP1WaveLength=accXFP1WaveLength, mc40G_OEOQsfp1Lane3_link=mc40G_OEOQsfp1Lane3_link, mc10GXFP2WaveLengthTunability=mc10GXFP2WaveLengthTunability, card_MC_E1T1_Rmt_TXLOS_Normal=card_MC_E1T1_Rmt_TXLOS_Normal, mcRmtHWWorkMode=mcRmtHWWorkMode, mcQCA8334UpStream=mcQCA8334UpStream, card_MC_Rmt_SFP1_Down=card_MC_Rmt_SFP1_Down, mc4_25G_OEOHWLoopback=mc4_25G_OEOHWLoopback, mc10G_OEEFxlink=mc10G_OEEFxlink, mcE1Port1LOS=mcE1Port1LOS, mc2_5GMCPort1link=mc2_5GMCPort1link, qsfpAccRxPower3=qsfpAccRxPower3, mcNtwSfpExist=mcNtwSfpExist, mcNtwXFP2WaveLength=mcNtwXFP2WaveLength, mcRmt10G_OEOHWSpdMode=mcRmt10G_OEOHWSpdMode, cwdmWavelengthCount=cwdmWavelengthCount, card_MC_Rmt_SFPSFP1_Up=card_MC_Rmt_SFPSFP1_Up, mc10G_OEOHWSpdMode=mc10G_OEOHWSpdMode, mc40G_OEOQsfp2Lane4_link=mc40G_OEOQsfp2Lane4_link, mcNtwXFP2WaveLengthTunable=mcNtwXFP2WaveLengthTunable, mc2_5GMCSFP3Objects=mc2_5GMCSFP3Objects, mcHWTransmitMode=mcHWTransmitMode, slotIdx=slotIdx, qsfpNtwTxPower1=qsfpNtwTxPower1, mcHWLFP=mcHWLFP, mcE1T1RmtAISAlarm=mcE1T1RmtAISAlarm, volB=volB, mcRmtCurWorkMode=mcRmtCurWorkMode, mc1GE2OCardTable=mc1GE2OCardTable, accsfpWavelength=accsfpWavelength, mcAccQSfpEntry=mcAccQSfpEntry, mcTxByteHi=mcTxByteHi, mc10G_OEO2RHWSFP1Loopback=mc10G_OEO2RHWSFP1Loopback, sysContact=sysContact, slotEntry=slotEntry, mcCurWorkMode=mcCurWorkMode, card_MC_E1_Rmt_Port2_AIS_Alarm=card_MC_E1_Rmt_Port2_AIS_Alarm, mcIP175DUpStream=mcIP175DUpStream, mcRmtDetect=mcRmtDetect, mc10G_OEO_Test_Lock=mc10G_OEO_Test_Lock, mc2_5g_sfpTranPower=mc2_5g_sfpTranPower, mc2_5g_sfpBrSpeed=mc2_5g_sfpBrSpeed, mc40G_OEOSpeedMode=mc40G_OEOSpeedMode, mc1GO2OSfp3Table=mc1GO2OSfp3Table, mc1GE2ORmtPort2SFPlink=mc1GE2ORmtPort2SFPlink, mcCm1gAccSfpObjects=mcCm1gAccSfpObjects, rmtCardType=rmtCardType, card_MC_Co_SFP2_Removed=card_MC_Co_SFP2_Removed, card_MC_Co_Tx_Down1=card_MC_Co_Tx_Down1, card_MC_Co_QSFP1_Lane2_Down=card_MC_Co_QSFP1_Lane2_Down, card_MC_Co_QSFP2_Lane4_Down=card_MC_Co_QSFP2_Lane4_Down, mcRxByteHi=mcRxByteHi, card_MC_Rmt_SFP3_Inserted=card_MC_Rmt_SFP3_Inserted, mcE1CardEntry=mcE1CardEntry, card_Detected=card_Detected, card_MC_Co_XFP2_Up=card_MC_Co_XFP2_Up, card_MC_Rmt_SFP2_Up=card_MC_Rmt_SFP2_Up, trapHost2=trapHost2, mc2_5Cm1gSfpTable=mc2_5Cm1gSfpTable, mcCWDMCardEntry=mcCWDMCardEntry, mcE1T1TLoop=mcE1T1TLoop, mc1GO2OPortPri=mc1GO2OPortPri, mcLFPCfg=mcLFPCfg, qsfpAccRxPower1=qsfpAccRxPower1, temperature=temperature, qsfpAccTxPower3=qsfpAccTxPower3, card_MC_Co_SFP1_Down=card_MC_Co_SFP1_Down, mc4_25G_OEOCurSpdMode=mc4_25G_OEOCurSpdMode, mc10G_OEECardEntry=mc10G_OEECardEntry, mcFanStatus=mcFanStatus, mc2_5GMCPort3link=mc2_5GMCPort3link, systemMIB=systemMIB, mcTxlink=mcTxlink, mcCmTable=mcCmTable, mcRmtTxlink=mcRmtTxlink, mc40G_OEOQsfp1Lane4_link=mc40G_OEOQsfp1Lane4_link, sfpTranPower=sfpTranPower, coCardType=coCardType, mcFanCardEntry=mcFanCardEntry, cwdmWavelength3=cwdmWavelength3, card_MC_E1_Co_Port1_AIS_Normal=card_MC_E1_Co_Port1_AIS_Normal, mc1GE2OPortHWPri=mc1GE2OPortHWPri, mcE1T1TLossAlarm=mcE1T1TLossAlarm, mcQCA8334DownStream=mcQCA8334DownStream, mcIP175DPortEntry=mcIP175DPortEntry, mcE1T1Version=mcE1T1Version, card_MC_Co_QSFP1_Lane3_Down=card_MC_Co_QSFP1_Lane3_Down, card_MC_E1_Rmt_Port1_CV_Normal=card_MC_E1_Rmt_Port1_CV_Normal, card_MC_Rmt_SFP2_Removed=card_MC_Rmt_SFP2_Removed, card_MC_Co_SFPSFP1_Down=card_MC_Co_SFPSFP1_Down, accsfpBrSpeed=accsfpBrSpeed, cwdmWavelength8=cwdmWavelength8, mcRmt10G_OEOCurSpdMode=mcRmt10G_OEOCurSpdMode, mc10GOEEXFPTunableCardObjects=mc10GOEEXFPTunableCardObjects, mc1GE2ORmtPortHWPri=mc1GE2ORmtPortHWPri, mc10G_OEO_Test_Continue_Time=mc10G_OEO_Test_Continue_Time) mibBuilder.exportSymbols("XXX-MIB", mc4_25G_OEO_Test_Error_Counter=mc4_25G_OEO_Test_Error_Counter, mc1GO2OPort1SFPlink=mc1GO2OPort1SFPlink, card_MC_E1_Rmt_Port1_LOS_Normal=card_MC_E1_Rmt_Port1_LOS_Normal, mc1GO2OSFP3Objects=mc1GO2OSFP3Objects, xfpWaveLength=xfpWaveLength, card_MC_Co_XFP1_Removed=card_MC_Co_XFP1_Removed, card_MC_Rmt_SFP2_Inserted=card_MC_Rmt_SFP2_Inserted, mc4_25G_OEOWorkMode=mc4_25G_OEOWorkMode, card_MC_Co_XFP2_Inserted=card_MC_Co_XFP2_Inserted, mc2_5g_sfpSmLength=mc2_5g_sfpSmLength, card_MC_Co_Port2_Down=card_MC_Co_Port2_Down, card_MC_Rmt_Acc_SFP_Removed=card_MC_Rmt_Acc_SFP_Removed, card_MC_Co_QSFP2_Removed=card_MC_Co_QSFP2_Removed, mc10GOEEXFPTunableCardTable=mc10GOEEXFPTunableCardTable, card_MC_Co_SFPSFP2_Down=card_MC_Co_SFPSFP2_Down, mcQCA8334PortIdx=mcQCA8334PortIdx, card_MC_E1T1_Rmt_AIS_Alarm=card_MC_E1T1_Rmt_AIS_Alarm, mcIP175DPortTable=mcIP175DPortTable, mc1go2o_sfpRecvPower=mc1go2o_sfpRecvPower, mc10G_OEO2R_ntwType=mc10G_OEO2R_ntwType, card_MC_Rmt_Tx_Up=card_MC_Rmt_Tx_Up, mcCm1gAccSfpTable=mcCm1gAccSfpTable, mcE1T1RmtFLoop=mcE1T1RmtFLoop, card_MC_E1_Co_Port1_CV_Normal=card_MC_E1_Co_Port1_CV_Normal, mc10GXFP1WaveLengthTunable=mc10GXFP1WaveLengthTunable, card_MC_Co_Tx_Up2=card_MC_Co_Tx_Up2, mcRmt10G_OEOHWLoopback=mcRmt10G_OEOHWLoopback, mc10G_OEECardObjects=mc10G_OEECardObjects, mcRmt4_25G_OEOWorkMode=mcRmt4_25G_OEOWorkMode, card_MC_Co_Port1_Up=card_MC_Co_Port1_Up, mc10GXFP2WaveLength=mc10GXFP2WaveLength, mc10G_OEOCardTable=mc10G_OEOCardTable, mc10G_OEE_ntwType=mc10G_OEE_ntwType, mcRmt10G_OEO_ntwType=mcRmt10G_OEO_ntwType, card_MC_Co_SFPSFP1_Up=card_MC_Co_SFPSFP1_Up, mc1GO2OPort2SFPlink=mc1GO2OPort2SFPlink, mcE1T1AISAlarm=mcE1T1AISAlarm, mcLoOrRmtFg=mcLoOrRmtFg, mc10G_OEOCfgSpdMode=mc10G_OEOCfgSpdMode, mcE1T1CardObjects=mcE1T1CardObjects, card_MC_Co_SFP3_Removed=card_MC_Co_SFP3_Removed, mcE1T1FLink=mcE1T1FLink, nmuObjects=nmuObjects, mc1go2o_sfpCopperLength=mc1go2o_sfpCopperLength, mc1GO2OPort3HWSpd=mc1GO2OPort3HWSpd, mc1GO2ORmtPort3SFPExist=mc1GO2ORmtPort3SFPExist, mc10G_OEO2R_ntwTunableType=mc10G_OEO2R_ntwTunableType, shelf_psuB_On=shelf_psuB_On, mcPmTable=mcPmTable, mcCm1gSpecificObjects=mcCm1gSpecificObjects, mc4_25G_OEO_Get_Test_Rst=mc4_25G_OEO_Get_Test_Rst, mcE1T1CardEntry=mcE1T1CardEntry, mc4_25G_OEO_Test_Continue_Time=mc4_25G_OEO_Test_Continue_Time, mcQsfpSpecificObjects=mcQsfpSpecificObjects, mc10GOEO3RCardObjects=mc10GOEO3RCardObjects, card_MC_E1_Co_Port2_AIS_Alarm=card_MC_E1_Co_Port2_AIS_Alarm, mc1GE2OCardObjects=mc1GE2OCardObjects, mc2_5g_sfpRecvPower=mc2_5g_sfpRecvPower, height2HU=height2HU, mc2_5g_sfpMmLength=mc2_5g_sfpMmLength, mc1GE2OObjects=mc1GE2OObjects, mc1GO2OObjects=mc1GO2OObjects, mcCm1gIpTable=mcCm1gIpTable, mcNtwQSfpEntry=mcNtwQSfpEntry, mc40G_OEOLane1LoopMode=mc40G_OEOLane1LoopMode, mc1go2o_sfpConnector=mc1go2o_sfpConnector, card_MC_Co_SFPSFP2_Up=card_MC_Co_SFPSFP2_Up, mcE1Port1CV=mcE1Port1CV, shelfEntry=shelfEntry, sfpBrSpeed=sfpBrSpeed, mcRmtE1SFP1Link=mcRmtE1SFP1Link, card_MC_Co_Acc_SFP_Removed=card_MC_Co_Acc_SFP_Removed, mc10G_OEOSFP2=mc10G_OEOSFP2, card_MC_E1_Co_Port2_LOS_Normal=card_MC_E1_Co_Port2_LOS_Normal, mcUpStream=mcUpStream, mc4_25G_OEOCardObjects=mc4_25G_OEOCardObjects, card_MC_Co_SFP2_Up=card_MC_Co_SFP2_Up, mc2_5g_sfpTransCode=mc2_5g_sfpTransCode, card_MC_E1_Rmt_Port2_LOS_Normal=card_MC_E1_Rmt_Port2_LOS_Normal, mc10G_OEO_Start_Test=mc10G_OEO_Start_Test, accXFP1WaveLengthTunable=accXFP1WaveLengthTunable, mcIpAddr=mcIpAddr, mc40G_OEOCardTable=mc40G_OEOCardTable, mc1GO2ORmtPort3SFPlink=mc1GO2ORmtPort3SFPlink, mcRmt4_25G_OEOLoopback=mcRmt4_25G_OEOLoopback, mcE1T1Type=mcE1T1Type, qsfpNtwRxPower3=qsfpNtwRxPower3, mc10G_OEOCardObjects=mc10G_OEOCardObjects, shelfName=shelfName, card_Lost=card_Lost, accsfpCopperLength=accsfpCopperLength, card_MC_E1_Co_Port1_LOS_Alarm=card_MC_E1_Co_Port1_LOS_Alarm, mcIP175DVlanMode=mcIP175DVlanMode, card_MC_E1T1_Rmt_TXLOS_Alarm=card_MC_E1T1_Rmt_TXLOS_Alarm, mc10G_OEESpdMode=mc10G_OEESpdMode, card_MC_Co_Fx_Up=card_MC_Co_Fx_Up, rmtCardDesc=rmtCardDesc, mcAccXFP1TunableType=mcAccXFP1TunableType, card_MC_Rmt_SFPSFP1_Removed=card_MC_Rmt_SFPSFP1_Removed, mcNtwXFP2WaveLengthTunability=mcNtwXFP2WaveLengthTunability, card_MC_Co_QSFP1_Removed=card_MC_Co_QSFP1_Removed, card_MC_Co_Ntw_SFP_Removed=card_MC_Co_Ntw_SFP_Removed, mcPmRest=mcPmRest, card_MC_Co_Acc_SFP_Inserted=card_MC_Co_Acc_SFP_Inserted, mcE1T1RmtFLossAlarm=mcE1T1RmtFLossAlarm, mc10G_OEO2RCardTable=mc10G_OEO2RCardTable, card_MC_E1_Rmt_Port2_CV_Alarm=card_MC_E1_Rmt_Port2_CV_Alarm, card_MC_Co_Port3_Up=card_MC_Co_Port3_Up, mc1GE2OPort2SFPlink=mc1GE2OPort2SFPlink, mc10GOEO3RObjects=mc10GOEO3RObjects, card_MC_E1_Co_Port1_AIS_Alarm=card_MC_E1_Co_Port1_AIS_Alarm, mc10G_OEO_Test_Result=mc10G_OEO_Test_Result, card_MC_Co_SFPSFP1_Inserted=card_MC_Co_SFPSFP1_Inserted, mc4_25G_OEOHWWorkMode=mc4_25G_OEOHWWorkMode, card_MC_Co_Tx_Down=card_MC_Co_Tx_Down, mcCWDMObjects=mcCWDMObjects, mcHWRmtCtrlMode=mcHWRmtCtrlMode, mcCfgWorkMode=mcCfgWorkMode, mcQCA8334PortEntry=mcQCA8334PortEntry, mcE1CardTable=mcE1CardTable, mc40G_OEOQsfp1Lane2_link=mc40G_OEOQsfp1Lane2_link, mc10G_OEO2RCurSpdMode=mc10G_OEO2RCurSpdMode, PYSNMP_MODULE_ID=company, mc10G_OEOLoopback=mc10G_OEOLoopback, mcE1T1FLoop=mcE1T1FLoop, card_MC_Rmt_SFP1_Up=card_MC_Rmt_SFP1_Up, mcRmt4_25G_OEOCfgSpdMode=mcRmt4_25G_OEOCfgSpdMode, card_MC_Rmt_PwrDown=card_MC_Rmt_PwrDown, mc1go2o_sfpMmLength=mc1go2o_sfpMmLength, mcQCA8334CfgWorkMode=mcQCA8334CfgWorkMode, mcRmtType=mcRmtType, mcQCA8334VlanMode=mcQCA8334VlanMode, mc4_25G_OEOHWSpdMode=mc4_25G_OEOHWSpdMode, card_MC_Co_QSFP2_Lane1_Up=card_MC_Co_QSFP2_Lane1_Up, mcE1Port2LOS=mcE1Port2LOS, mc1GO2OCardObjects=mc1GO2OCardObjects, mcRmt4_25G_OEOHWLoopback=mcRmt4_25G_OEOHWLoopback, mcRmt10G_OEO_accType=mcRmt10G_OEO_accType, mc2_5GMCObjects=mc2_5GMCObjects, mcTransceiverMode=mcTransceiverMode, mc40G_OEOObjects=mc40G_OEOObjects, mcCm1gAccSfpEntry=mcCm1gAccSfpEntry, mcIP175DCfgWorkMode=mcIP175DCfgWorkMode, mc1GE2ORmtTxlink=mc1GE2ORmtTxlink, mcE1T1RmtTLoop=mcE1T1RmtTLoop, qsfpNtwTxPower2=qsfpNtwTxPower2, mc1GO2OPort2SFPExist=mc1GO2OPort2SFPExist, ntwXFP2WaveLengthTunable=ntwXFP2WaveLengthTunable, qsfpNtwRxPower2=qsfpNtwRxPower2, card_MC_Co_XFP1_Inserted=card_MC_Co_XFP1_Inserted, mc10G_OEOSFP1=mc10G_OEOSFP1, mcQCA8334CardObjects=mcQCA8334CardObjects, card_MC_Co_QSFP1_Lane3_Up=card_MC_Co_QSFP1_Lane3_Up, mcAccQSfpTable=mcAccQSfpTable, mc10G_OEO_ntwType=mc10G_OEO_ntwType, mc40G_OEOLane3LoopMode=mc40G_OEOLane3LoopMode, card_MC_Rmt_SFP3_Removed=card_MC_Rmt_SFP3_Removed, card_MC_Co_QSFP2_Lane3_Down=card_MC_Co_QSFP2_Lane3_Down, psuA=psuA, ipProduct=ipProduct, mcFanCardTable=mcFanCardTable, mcRmtE1Port2CV=mcRmtE1Port2CV, mc40G_OEOQsfp2Lane2_link=mc40G_OEOQsfp2Lane2_link, qsfpAccRxPower2=qsfpAccRxPower2, mc10G_OEO2RCfgSpdMode=mc10G_OEO2RCfgSpdMode, card_MC_E1_Rmt_Port2_LOS_Alarm=card_MC_E1_Rmt_Port2_LOS_Alarm, card_MC_E1T1_Rmt_FXLOS_Normal=card_MC_E1T1_Rmt_FXLOS_Normal, mc2_5g_sfpCopperLength=mc2_5g_sfpCopperLength, mcCmObjects=mcCmObjects, mc10GOEEXFPTunableObjects=mc10GOEEXFPTunableObjects, mc10GOEO1RObjects=mc10GOEO1RObjects, mc40G_OEOHWSpeedMode=mc40G_OEOHWSpeedMode, getAccQSfpCmd=getAccQSfpCmd, mcQCA8334CardTable=mcQCA8334CardTable, mc10G_OEO2R_accType=mc10G_OEO2R_accType, card_MC_E1_Co_Port1_LOS_Normal=card_MC_E1_Co_Port1_LOS_Normal, card_MC_Rmt_SFPSFP1_Inserted=card_MC_Rmt_SFPSFP1_Inserted, mc2_5g_sfpTemperature=mc2_5g_sfpTemperature, mcRmtE1Txlink=mcRmtE1Txlink, accsfpTranPower=accsfpTranPower, mcE1T1CodeType=mcE1T1CodeType, sfpRecvPower=sfpRecvPower, card_MC_Co_Fx_Down=card_MC_Co_Fx_Down, card_MC_Co_QSFP2_Inserted=card_MC_Co_QSFP2_Inserted, mcRmtLFP=mcRmtLFP, card_MC_Rmt_SFP1_Inserted=card_MC_Rmt_SFP1_Inserted, accsfpTransCode=accsfpTransCode, sysLocation=sysLocation, qsfpNtwRxPower4=qsfpNtwRxPower4, card_MC_E1_Rmt_Port1_LOS_Alarm=card_MC_E1_Rmt_Port1_LOS_Alarm, sfpSmLength=sfpSmLength, cwdmWavelength6=cwdmWavelength6, mcE1TxCurWorkMode=mcE1TxCurWorkMode, mc1GE2ORmtPort1SFPExist=mc1GE2ORmtPort1SFPExist, mcCm1gIpObjects=mcCm1gIpObjects, mcRmtE1Port2Loop=mcRmtE1Port2Loop, mc10G_OEO2RCardEntry=mc10G_OEO2RCardEntry, card_MC_Co_SFP1_Up=card_MC_Co_SFP1_Up, qsfpAccTxPower2=qsfpAccTxPower2, card_MC_Rmt_XFP1_Removed=card_MC_Rmt_XFP1_Removed, qsfpAccTxPower1=qsfpAccTxPower1, qsfpAccConnector=qsfpAccConnector, mcRmtE1Port2AIS=mcRmtE1Port2AIS, card_MC_E1T1_Rmt_FXLOS_Alarm=card_MC_E1T1_Rmt_FXLOS_Alarm, card_MC_Co_QSFP1_Inserted=card_MC_Co_QSFP1_Inserted, card_MC_FAN_Normal=card_MC_FAN_Normal, mcNtwQSfpTable=mcNtwQSfpTable, mc10G_OEE_checkResult=mc10G_OEE_checkResult, card_MC_E1T1_Rmt_AIS_Normal=card_MC_E1T1_Rmt_AIS_Normal, mc2_5GMCCardEntry=mc2_5GMCCardEntry, mcE1Txlink=mcE1Txlink, mcQCA8334CardEntry=mcQCA8334CardEntry, mcRmtLoopback=mcRmtLoopback, mcQCA8334CurWorkMode=mcQCA8334CurWorkMode, card_MC_Rmt_SFP2_Down=card_MC_Rmt_SFP2_Down, card_MC_Rmt_SFP1_Removed=card_MC_Rmt_SFP1_Removed, mcRmtE1Port1LOS=mcRmtE1Port1LOS, card_MC_Co_SFP1_Inserted=card_MC_Co_SFP1_Inserted, qsfpNtwRxPower1=qsfpNtwRxPower1, mc10G_OEO2RSFP2=mc10G_OEO2RSFP2, slotTable=slotTable, mc10G_OEECardTable=mc10G_OEECardTable, mc40G_OEOLoopMode=mc40G_OEOLoopMode, mc1go2o_sfpTranPower=mc1go2o_sfpTranPower, mc1GO2ORmtPort2SFPlink=mc1GO2ORmtPort2SFPlink, mc10G_OEO2RCardObjects=mc10G_OEO2RCardObjects, mcCm1gSfpTable=mcCm1gSfpTable, mc1go2o_sfpTemperature=mc1go2o_sfpTemperature, mc1GO2ORmtPort2SFPExist=mc1GO2ORmtPort2SFPExist, card_MC_E1_Co_Port2_CV_Alarm=card_MC_E1_Co_Port2_CV_Alarm, mc1GE2OPort1SFPExist=mc1GE2OPort1SFPExist, accsfpConnector=accsfpConnector, coCardNum=coCardNum, mc1GO2OCardTable=mc1GO2OCardTable, gateway=gateway, qsfpNtwTemperature=qsfpNtwTemperature, card_MC_Rmt_XFP1_Inserted=card_MC_Rmt_XFP1_Inserted, mcIP175DRmtCurWorkMode=mcIP175DRmtCurWorkMode, mc2_5g_sfpConnector=mc2_5g_sfpConnector, mcE1T1RmtCodeType=mcE1T1RmtCodeType, mc1GO2ORmtPort1SFPExist=mc1GO2ORmtPort1SFPExist, mc4_25G_OEOCfgSpdMode=mc4_25G_OEOCfgSpdMode, card_MC_Co_SFP2_Down=card_MC_Co_SFP2_Down, sfpMmLength=sfpMmLength, mc10GOEEXFPTunableCardEntry=mc10GOEEXFPTunableCardEntry, mcIP175DPortIdx=mcIP175DPortIdx, sfpWavelength=sfpWavelength, shelf_psuA_Off=shelf_psuA_Off, card_MC_Co_Port1_Down=card_MC_Co_Port1_Down, mcRmtAccSfpExist=mcRmtAccSfpExist, mcAccXFP1WaveLength=mcAccXFP1WaveLength, card_MC_Co_QSFP2_Lane4_Up=card_MC_Co_QSFP2_Lane4_Up, card_MC_Co_QSFP2_Lane3_Up=card_MC_Co_QSFP2_Lane3_Up, mcE1CardObjects=mcE1CardObjects) mibBuilder.exportSymbols("XXX-MIB", ntwXFP2TunableType=ntwXFP2TunableType, card_MC_Co_Ntw_SFP_Inserted=card_MC_Co_Ntw_SFP_Inserted, card_MC_E1_Rmt_Port2_AIS_Normal=card_MC_E1_Rmt_Port2_AIS_Normal, mc2_5GMCPort2link=mc2_5GMCPort2link, mc1GE2ORmtPort2SFPExist=mc1GE2ORmtPort2SFPExist, getSfpCmd=getSfpCmd, mc10G_OEO2RSFP1=mc10G_OEO2RSFP1, card_MC_Co_SFPSFP2_Removed=card_MC_Co_SFPSFP2_Removed, mc1GO2ORmtPort1SFPlink=mc1GO2ORmtPort1SFPlink, mcPmObjects=mcPmObjects, card_MC_Co_Tx_Up=card_MC_Co_Tx_Up, qsfpAccTxPower4=qsfpAccTxPower4, shelf_Lost=shelf_Lost, mcPmEntry=mcPmEntry, mc2_5Cm1gSfpEntry=mc2_5Cm1gSfpEntry, mc1GO2OSfp3Entry=mc1GO2OSfp3Entry, cwdmWavelength4=cwdmWavelength4, xfpWaveLengthTunability=xfpWaveLengthTunability, card_MC_FAN_Abnormal=card_MC_FAN_Abnormal, mc10G_OEO2RSFP2Loopback=mc10G_OEO2RSFP2Loopback, subnet=subnet, card_MC_Co_Port2_Up=card_MC_Co_Port2_Up, card_MC_Co_XFP2_Removed=card_MC_Co_XFP2_Removed, shelf_fan_On=shelf_fan_On, mcQCA8334PortObjects=mcQCA8334PortObjects, mcE1Port1Loop=mcE1Port1Loop, mc10G_OEETxlink=mc10G_OEETxlink, mc10G_OEOHWLoopback=mc10G_OEOHWLoopback, mcRmt4_25G_OEOCurSpdMode=mcRmt4_25G_OEOCurSpdMode, coCardDesc=coCardDesc, nmuConfig=nmuConfig, mc1GO2OCardEntry=mc1GO2OCardEntry, mc1go2o_sfpBrSpeed=mc1go2o_sfpBrSpeed, fan=fan, mc10GOEO3RCardEntry=mc10GOEO3RCardEntry, card_MC_Co_XFP1_Down=card_MC_Co_XFP1_Down, card_MC_Rmt_XFP1_Down=card_MC_Rmt_XFP1_Down, mcE1Objects=mcE1Objects, card_MC_Rmt_Tx_Down1=card_MC_Rmt_Tx_Down1, mcHWWorkMode=mcHWWorkMode, card_MC_Rmt_SFPSFP1_Down=card_MC_Rmt_SFPSFP1_Down, card_MC_Co_QSFP2_Lane1_Down=card_MC_Co_QSFP2_Lane1_Down, mc4_25G_OEOAccPD=mc4_25G_OEOAccPD, cwdmWavelength2=cwdmWavelength2, trapHost4=trapHost4, mcQCA8334PortTable=mcQCA8334PortTable, mcCWDMCardObjects=mcCWDMCardObjects, mcTransmitMode=mcTransmitMode, sfpTemperature=sfpTemperature, qsfpNtwConnector=qsfpNtwConnector, mc4_25G_OEOCardTable=mc4_25G_OEOCardTable, mc40G_OEOLane4LoopMode=mc40G_OEOLane4LoopMode, mcQCA8334Objects=mcQCA8334Objects, mc40G_OEOCardObjects=mc40G_OEOCardObjects, shelf_psuB_Off=shelf_psuB_Off, mcIP175DRmtTxlink=mcIP175DRmtTxlink, mc2_5g_sfpVoltage=mc2_5g_sfpVoltage, mcCWDMCardTable=mcCWDMCardTable, mcRmtTransmitMode=mcRmtTransmitMode, mcFxlink=mcFxlink, mcRxByteLo=mcRxByteLo, mc1GE2OTxlink=mc1GE2OTxlink, mc1go2o_sfpVoltage=mc1go2o_sfpVoltage, mc10GOEO1RCardObjects=mc10GOEO1RCardObjects, card_MC_E1_Rmt_Port1_CV_Alarm=card_MC_E1_Rmt_Port1_CV_Alarm, card_MC_Co_XFP1_Up=card_MC_Co_XFP1_Up, mc10G_OEEObjects=mc10G_OEEObjects, card_MC_E1T1_Co_AIS_Alarm=card_MC_E1T1_Co_AIS_Alarm, mc1go2o_sfpSmLength=mc1go2o_sfpSmLength, shelf_Detected=shelf_Detected, card_MC_Co_SFPSFP2_Inserted=card_MC_Co_SFPSFP2_Inserted, card_MC_Rmt_Acc_SFP_Inserted=card_MC_Rmt_Acc_SFP_Inserted, mcIP175DCardObjects=mcIP175DCardObjects, card_MC_Co_XFP2_Down=card_MC_Co_XFP2_Down, mcQCA8334Txlink=mcQCA8334Txlink, mcE1Port2AIS=mcE1Port2AIS, card_MC_Co_Tx_Down2=card_MC_Co_Tx_Down2, sfpTransCode=sfpTransCode, mc4_25G_OEOLoopback=mc4_25G_OEOLoopback, mcNtwXFP2TunableType=mcNtwXFP2TunableType, accsfpVoltage=accsfpVoltage, mcRmt10G_OEOSFP1=mcRmt10G_OEOSFP1, mc1GO2ORmtPort3HWSpd=mc1GO2ORmtPort3HWSpd, mc10G_OEO2RHWSFP2Loopback=mc10G_OEO2RHWSFP2Loopback, qsfpNtwTxPower3=qsfpNtwTxPower3, mc10G_OEO2RVersion=mc10G_OEO2RVersion, accsfpMmLength=accsfpMmLength, mc10G_OEO2RHWSpdMode=mc10G_OEO2RHWSpdMode, mc10G_OEO2RSFP1Loopback=mc10G_OEO2RSFP1Loopback, mc1GE2OCardEntry=mc1GE2OCardEntry, mcQCA8334RmtCurWorkMode=mcQCA8334RmtCurWorkMode, xfpTunableType=xfpTunableType, card_MC_Co_QSFP1_Lane4_Down=card_MC_Co_QSFP1_Lane4_Down, mcIP175DDownStream=mcIP175DDownStream, cardObjects=cardObjects, alarmMIB=alarmMIB, accXFP1WaveLengthTunability=accXFP1WaveLengthTunability, qsfpNtwTxPower4=qsfpNtwTxPower4, mcE1T1Objects=mcE1T1Objects, mcAccSfpExist=mcAccSfpExist, card_MC_E1_Co_Port2_AIS_Normal=card_MC_E1_Co_Port2_AIS_Normal, card_MC_E1_Co_Port2_LOS_Alarm=card_MC_E1_Co_Port2_LOS_Alarm, mcIP175DRmtCfgWorkMode=mcIP175DRmtCfgWorkMode, mc40G_OEOQsfp2Lane1_link=mc40G_OEOQsfp2Lane1_link, accsfpCompliance=accsfpCompliance, card_MC_Co_SFP3_Inserted=card_MC_Co_SFP3_Inserted)
141.884835
10,350
0.750826
35,253
248,866
5.18007
0.032933
0.019035
0.128912
0.013427
0.785557
0.679399
0.599393
0.548658
0.529563
0.47282
0
0.093998
0.084889
248,866
1,753
10,351
141.965773
0.707851
0.001238
0
0
0
0.014327
0.195744
0.018616
0
0
0.000322
0
0
1
0
false
0.001146
0.003438
0
0.003438
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d9e78859b4482aaef1db18210493138799d91b2f
1,969
py
Python
MIDI Remote Scripts/Push2/mode_collector.py
aarkwright/ableton_devices
fe5df3bbd64ccbc136bba722ba1e131a02969798
[ "MIT" ]
null
null
null
MIDI Remote Scripts/Push2/mode_collector.py
aarkwright/ableton_devices
fe5df3bbd64ccbc136bba722ba1e131a02969798
[ "MIT" ]
null
null
null
MIDI Remote Scripts/Push2/mode_collector.py
aarkwright/ableton_devices
fe5df3bbd64ccbc136bba722ba1e131a02969798
[ "MIT" ]
null
null
null
# uncompyle6 version 3.3.5 # Python bytecode 2.7 (62211) # Decompiled from: Python 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)] # Embedded file name: c:\Jenkins\live\output\win_64_static\Release\python-bundle\MIDI Remote Scripts\Push2\mode_collector.py # Compiled at: 2018-11-30 15:48:11 from __future__ import absolute_import, print_function, unicode_literals from ableton.v2.base import listenable_property, listens, EventObject class ModeCollector(EventObject): def __init__(self, main_modes=None, mix_modes=None, global_mix_modes=None, device_modes=None, *a, **k): super(ModeCollector, self).__init__(*a, **k) self._main_modes = main_modes self._mix_modes = mix_modes self._global_mix_modes = global_mix_modes self._device_modes = device_modes self._on_selected_main_mode_changed.subject = main_modes self._on_selected_mix_mode_changed.subject = mix_modes self._on_selected_global_mix_mode_changed.subject = global_mix_modes self._on_selected_device_mode_changed.subject = device_modes @listenable_property def main_mode(self): return self._main_modes.selected_mode @listens(b'selected_mode') def _on_selected_main_mode_changed(self, mode): self.notify_main_mode() @listenable_property def mix_mode(self): return self._mix_modes.selected_mode @listens(b'selected_mode') def _on_selected_mix_mode_changed(self, mode): self.notify_mix_mode() @listenable_property def global_mix_mode(self): return self._global_mix_modes.selected_mode @listens(b'selected_mode') def _on_selected_global_mix_mode_changed(self, mode): self.notify_global_mix_mode() @listenable_property def device_mode(self): return self._device_modes.selected_mode @listens(b'selected_mode') def _on_selected_device_mode_changed(self, mode): self.notify_device_mode()
37.865385
124
0.742509
278
1,969
4.827338
0.298561
0.059613
0.052161
0.056632
0.42623
0.271237
0.201192
0.153502
0.153502
0.153502
0
0.031882
0.171661
1,969
52
125
37.865385
0.790926
0.151854
0
0.216216
0
0
0.031231
0
0
0
0
0
0
1
0.243243
false
0
0.054054
0.108108
0.432432
0.027027
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
d9e7a46d631c672aae25d04f18b75876427b787e
817
py
Python
src/topicModel.py
daidaotong/SingleView
db3249ca5afba97f750495cccbc185de88bf2287
[ "MIT" ]
null
null
null
src/topicModel.py
daidaotong/SingleView
db3249ca5afba97f750495cccbc185de88bf2287
[ "MIT" ]
null
null
null
src/topicModel.py
daidaotong/SingleView
db3249ca5afba97f750495cccbc185de88bf2287
[ "MIT" ]
null
null
null
from gensim import corpora, models, similarities, matutils,utils from gensim.models import KeyedVectors import numpy as np #Word2vec Experiment testString = ['PAST_MEDICAL_HISTORY','PAST_SURGICAL_HISTORY','PHYSICAL_EXAMINATION'] ''' word_vectors = KeyedVectors.load_word2vec_format('~/Downloads/GoogleNews-vectors-negative300.bin', binary=True) #model.save("file.txt") print word_vectors.most_similar(positive=['woman', 'king'], negative=['man']) print "******************************************************" print word_vectors.similarity('woman', 'man') #print word_vectors.most_similar(positive=['san_francisco']) print word_vectors.most_similar(positive=['SURGICAL']) #word_vectors.similarity(testString[0],testString[1]) ''' a=[1,4,3,6,3,6] print a[:-1] #print zip(a[:-1],a[1:]) print np.random.randn(3, 2)
35.521739
111
0.71481
106
817
5.349057
0.528302
0.116402
0.112875
0.10582
0.185185
0.185185
0
0
0
0
0
0.023591
0.066095
817
22
112
37.136364
0.719528
0.051408
0
0
0
0
0.226766
0.078067
0
0
0
0
0
0
null
null
0
0.428571
null
null
0.285714
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
2
d9eb0ee449a6b916e969b15c42a07550484f36ad
959
py
Python
djangocms_baseplugins/spacer/cms_plugins.py
benzkji/djangocms-baseplugins
7f041a030ed93dcdec70e4ca777b841846b8f2f2
[ "MIT" ]
2
2019-04-14T01:31:22.000Z
2020-03-05T13:06:57.000Z
djangocms_baseplugins/spacer/cms_plugins.py
benzkji/djangocms-baseplugins
7f041a030ed93dcdec70e4ca777b841846b8f2f2
[ "MIT" ]
32
2017-04-04T09:28:06.000Z
2021-08-18T16:23:02.000Z
djangocms_baseplugins/spacer/cms_plugins.py
bnzk/djangocms-baseplugins
7f041a030ed93dcdec70e4ca777b841846b8f2f2
[ "MIT" ]
null
null
null
# coding: utf-8 from cms.plugin_base import CMSPluginBase from cms.plugin_pool import plugin_pool from django import forms from django.utils.translation import ugettext_lazy as _ from djangocms_baseplugins.baseplugin import defaults from djangocms_baseplugins.baseplugin.cms_plugins import BasePluginMixin from djangocms_baseplugins.baseplugin.utils import get_fields_from_fieldsets, get_baseplugin_widgets from . import conf from .models import Spacer class SpacerPluginForm(forms.ModelForm): class Meta: model = Spacer fields = get_fields_from_fieldsets(conf.FIELDSETS) # exclude = [] widgets = get_baseplugin_widgets(conf) class SpacerPlugin(BasePluginMixin, CMSPluginBase): model = Spacer form = SpacerPluginForm module = defaults.SPECIAL_LABEL name = _(u'Spacer') render_template = "djangocms_baseplugins/spacer.html" fieldsets = conf.FIELDSETS plugin_pool.register_plugin(SpacerPlugin)
29.96875
100
0.788321
112
959
6.526786
0.419643
0.109439
0.098495
0.139535
0
0
0
0
0
0
0
0.001233
0.154327
959
31
101
30.935484
0.900123
0.027112
0
0.090909
0
0
0.041935
0.035484
0
0
0
0
0
1
0
false
0
0.409091
0
0.818182
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
d9f9595b5ef66170be57096ea8261b3da13883ac
132
py
Python
functional_tests.py
gustavomazevedo/tbackup-client
eb2fdf75eff7abf17c9bce12920de793ba760f61
[ "MIT" ]
null
null
null
functional_tests.py
gustavomazevedo/tbackup-client
eb2fdf75eff7abf17c9bce12920de793ba760f61
[ "MIT" ]
null
null
null
functional_tests.py
gustavomazevedo/tbackup-client
eb2fdf75eff7abf17c9bce12920de793ba760f61
[ "MIT" ]
null
null
null
from selenium import webdriver browser = webdriver.Firefox() browser.get('http://localhost:8000') assert 'Django' in browser.title
22
36
0.780303
17
132
6.058824
0.823529
0
0
0
0
0
0
0
0
0
0
0.033613
0.098485
132
6
37
22
0.831933
0
0
0
0
0
0.203008
0
0
0
0
0
0.25
1
0
false
0
0.25
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
d9ff0e5cd63921d7a1a7f3f682d268671ab38688
834
py
Python
main.py
Yash-s-Code-Camp/Python-Day-4
887c4e172905b2b0dea493a3c9c1f61e403556fc
[ "MIT" ]
null
null
null
main.py
Yash-s-Code-Camp/Python-Day-4
887c4e172905b2b0dea493a3c9c1f61e403556fc
[ "MIT" ]
null
null
null
main.py
Yash-s-Code-Camp/Python-Day-4
887c4e172905b2b0dea493a3c9c1f61e403556fc
[ "MIT" ]
null
null
null
# def mul(a): # return lambda b:b*a # singler = mul(1) # addition = lambda b:b*1 # doubler = mul(2) # addition = lambda b:b*2 # tripler = mul(3) # addition = lambda b:b*3 # print(doubler(7)) # 7*2 = 14 # print(tripler(7)) # 7*3 = 21 # print(singler(7)) # 7*1 = 7 class Student: def __init__(self, fname): self.fname = fname def greet(self, fname): return f"Hello, {fname}" class BatchA(Student): def __init__(self, lname): self.lname = lname #Student.__init__(self, "Nikunj") super().__init__("Nikunj") def printName(self): return f"{self.fname} {self.lname}" stud = BatchA("Thakor") print(stud.printName()) rgb(255, 255, 255) # White rgb(255, 0, 0) # Red rgb(0, 0, 0) # Black rgb(0, 255, 255) # Cyan rgb(255, 255, 0) # Yellow #00ff00 //green #1e90ff //dodgerblue
17.020408
47
0.603118
128
834
3.804688
0.34375
0.057495
0.065708
0.098563
0
0
0
0
0
0
0
0.089368
0.221823
834
48
48
17.375
0.661017
0.423261
0
0
0
0
0.111597
0
0
0
0
0
0
1
0.222222
false
0
0
0.111111
0.444444
0.111111
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
8a0ab3edf5559c9bdaa844115d82ed95f2b065a1
63,787
py
Python
nova/virt/driver.py
larsbutler/nova
fb190f30a911658d8b0c4deaf43cbb8c9e35b672
[ "Apache-2.0" ]
null
null
null
nova/virt/driver.py
larsbutler/nova
fb190f30a911658d8b0c4deaf43cbb8c9e35b672
[ "Apache-2.0" ]
null
null
null
nova/virt/driver.py
larsbutler/nova
fb190f30a911658d8b0c4deaf43cbb8c9e35b672
[ "Apache-2.0" ]
null
null
null
# Copyright 2011 Justin Santa Barbara # 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. """ Driver base-classes: (Beginning of) the contract that compute drivers must follow, and shared types that support that contract """ import sys from oslo_log import log as logging from oslo_utils import importutils import nova.conf from nova.i18n import _, _LE, _LI from nova import utils from nova.virt import event as virtevent CONF = nova.conf.CONF LOG = logging.getLogger(__name__) def driver_dict_from_config(named_driver_config, *args, **kwargs): driver_registry = dict() for driver_str in named_driver_config: driver_type, _sep, driver = driver_str.partition('=') driver_class = importutils.import_class(driver) driver_registry[driver_type] = driver_class(*args, **kwargs) return driver_registry def get_block_device_info(instance, block_device_mapping): """Converts block device mappings for an instance to driver format. Virt drivers expect block device mapping to be presented in the format of a dict containing the following keys: - root_device_name: device name of the root disk - ephemerals: a (potentially empty) list of DriverEphemeralBlockDevice instances - swap: An instance of DriverSwapBlockDevice or None - block_device_mapping: a (potentially empty) list of DriverVolumeBlockDevice or any of it's more specialized subclasses. """ from nova.virt import block_device as virt_block_device block_device_info = { 'root_device_name': instance.root_device_name, 'ephemerals': virt_block_device.convert_ephemerals( block_device_mapping), 'block_device_mapping': virt_block_device.convert_all_volumes(*block_device_mapping) } swap_list = virt_block_device.convert_swap(block_device_mapping) block_device_info['swap'] = virt_block_device.get_swap(swap_list) return block_device_info def block_device_info_get_root(block_device_info): block_device_info = block_device_info or {} return block_device_info.get('root_device_name') def block_device_info_get_swap(block_device_info): block_device_info = block_device_info or {} return block_device_info.get('swap') or {'device_name': None, 'swap_size': 0} def swap_is_usable(swap): return swap and swap['device_name'] and swap['swap_size'] > 0 def block_device_info_get_ephemerals(block_device_info): block_device_info = block_device_info or {} ephemerals = block_device_info.get('ephemerals') or [] return ephemerals def block_device_info_get_mapping(block_device_info): block_device_info = block_device_info or {} block_device_mapping = block_device_info.get('block_device_mapping') or [] return block_device_mapping class ComputeDriver(object): """Base class for compute drivers. The interface to this class talks in terms of 'instances' (Amazon EC2 and internal Nova terminology), by which we mean 'running virtual machine' (XenAPI terminology) or domain (Xen or libvirt terminology). An instance has an ID, which is the identifier chosen by Nova to represent the instance further up the stack. This is unfortunately also called a 'name' elsewhere. As far as this layer is concerned, 'instance ID' and 'instance name' are synonyms. Note that the instance ID or name is not human-readable or customer-controlled -- it's an internal ID chosen by Nova. At the nova.virt layer, instances do not have human-readable names at all -- such things are only known higher up the stack. Most virtualization platforms will also have their own identity schemes, to uniquely identify a VM or domain. These IDs must stay internal to the platform-specific layer, and never escape the connection interface. The platform-specific layer is responsible for keeping track of which instance ID maps to which platform-specific ID, and vice versa. Some methods here take an instance of nova.compute.service.Instance. This is the data structure used by nova.compute to store details regarding an instance, and pass them into this layer. This layer is responsible for translating that generic data structure into terms that are specific to the virtualization platform. """ capabilities = { "has_imagecache": False, "supports_recreate": False, "supports_migrate_to_same_host": False, "supports_attach_interface": False, "supports_device_tagging": False, } def __init__(self, virtapi): self.virtapi = virtapi self._compute_event_callback = None def init_host(self, host): """Initialize anything that is necessary for the driver to function, including catching up with currently running VM's on the given host. """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def cleanup_host(self, host): """Clean up anything that is necessary for the driver gracefully stop, including ending remote sessions. This is optional. """ pass def get_info(self, instance): """Get the current status of an instance, by name (not ID!) :param instance: nova.objects.instance.Instance object Returns a InstanceInfo object """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def get_num_instances(self): """Return the total number of virtual machines. Return the number of virtual machines that the hypervisor knows about. .. note:: This implementation works for all drivers, but it is not particularly efficient. Maintainers of the virt drivers are encouraged to override this method with something more efficient. """ return len(self.list_instances()) def instance_exists(self, instance): """Checks existence of an instance on the host. :param instance: The instance to lookup Returns True if an instance with the supplied ID exists on the host, False otherwise. .. note:: This implementation works for all drivers, but it is not particularly efficient. Maintainers of the virt drivers are encouraged to override this method with something more efficient. """ try: return instance.uuid in self.list_instance_uuids() except NotImplementedError: return instance.name in self.list_instances() def estimate_instance_overhead(self, instance_info): """Estimate the virtualization overhead required to build an instance of the given flavor. Defaults to zero, drivers should override if per-instance overhead calculations are desired. :param instance_info: Instance/flavor to calculate overhead for. :returns: Dict of estimated overhead values. """ return {'memory_mb': 0, 'disk_gb': 0} def list_instances(self): """Return the names of all the instances known to the virtualization layer, as a list. """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def list_instance_uuids(self): """Return the UUIDS of all the instances known to the virtualization layer, as a list. """ raise NotImplementedError() def rebuild(self, context, instance, image_meta, injected_files, admin_password, bdms, detach_block_devices, attach_block_devices, network_info=None, recreate=False, block_device_info=None, preserve_ephemeral=False): """Destroy and re-make this instance. A 'rebuild' effectively purges all existing data from the system and remakes the VM with given 'metadata' and 'personalities'. This base class method shuts down the VM, detaches all block devices, then spins up the new VM afterwards. It may be overridden by hypervisors that need to - e.g. for optimisations, or when the 'VM' is actually proxied and needs to be held across the shutdown + spin up steps. :param context: security context :param instance: nova.objects.instance.Instance This function should use the data there to guide the creation of the new instance. :param nova.objects.ImageMeta image_meta: The metadata of the image of the instance. :param injected_files: User files to inject into instance. :param admin_password: Administrator password to set in instance. :param bdms: block-device-mappings to use for rebuild :param detach_block_devices: function to detach block devices. See nova.compute.manager.ComputeManager:_rebuild_default_impl for usage. :param attach_block_devices: function to attach block devices. See nova.compute.manager.ComputeManager:_rebuild_default_impl for usage. :param network_info: instance network information :param recreate: True if the instance is being recreated on a new hypervisor - all the cleanup of old state is skipped. :param block_device_info: Information about block devices to be attached to the instance. :param preserve_ephemeral: True if the default ephemeral storage partition must be preserved on rebuild """ raise NotImplementedError() def spawn(self, context, instance, image_meta, injected_files, admin_password, network_info=None, block_device_info=None): """Create a new instance/VM/domain on the virtualization platform. Once this successfully completes, the instance should be running (power_state.RUNNING). If this fails, any partial instance should be completely cleaned up, and the virtualization platform should be in the state that it was before this call began. :param context: security context :param instance: nova.objects.instance.Instance This function should use the data there to guide the creation of the new instance. :param nova.objects.ImageMeta image_meta: The metadata of the image of the instance. :param injected_files: User files to inject into instance. :param admin_password: Administrator password to set in instance. :param network_info: instance network information :param block_device_info: Information about block devices to be attached to the instance. """ raise NotImplementedError() def destroy(self, context, instance, network_info, block_device_info=None, destroy_disks=True, migrate_data=None): """Destroy the specified instance from the Hypervisor. If the instance is not found (for example if networking failed), this function should still succeed. It's probably a good idea to log a warning in that case. :param context: security context :param instance: Instance object as returned by DB layer. :param network_info: instance network information :param block_device_info: Information about block devices that should be detached from the instance. :param destroy_disks: Indicates if disks should be destroyed :param migrate_data: implementation specific params """ raise NotImplementedError() def cleanup(self, context, instance, network_info, block_device_info=None, destroy_disks=True, migrate_data=None, destroy_vifs=True): """Cleanup the instance resources . Instance should have been destroyed from the Hypervisor before calling this method. :param context: security context :param instance: Instance object as returned by DB layer. :param network_info: instance network information :param block_device_info: Information about block devices that should be detached from the instance. :param destroy_disks: Indicates if disks should be destroyed :param migrate_data: implementation specific params """ raise NotImplementedError() def reboot(self, context, instance, network_info, reboot_type, block_device_info=None, bad_volumes_callback=None): """Reboot the specified instance. After this is called successfully, the instance's state goes back to power_state.RUNNING. The virtualization platform should ensure that the reboot action has completed successfully even in cases in which the underlying domain/vm is paused or halted/stopped. :param instance: nova.objects.instance.Instance :param network_info: instance network information :param reboot_type: Either a HARD or SOFT reboot :param block_device_info: Info pertaining to attached volumes :param bad_volumes_callback: Function to handle any bad volumes encountered """ raise NotImplementedError() def get_console_pool_info(self, console_type): # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def get_console_output(self, context, instance): """Get console output for an instance :param context: security context :param instance: nova.objects.instance.Instance """ raise NotImplementedError() def get_vnc_console(self, context, instance): """Get connection info for a vnc console. :param context: security context :param instance: nova.objects.instance.Instance :returns an instance of console.type.ConsoleVNC """ raise NotImplementedError() def get_spice_console(self, context, instance): """Get connection info for a spice console. :param context: security context :param instance: nova.objects.instance.Instance :returns an instance of console.type.ConsoleSpice """ raise NotImplementedError() def get_rdp_console(self, context, instance): """Get connection info for a rdp console. :param context: security context :param instance: nova.objects.instance.Instance :returns an instance of console.type.ConsoleRDP """ raise NotImplementedError() def get_serial_console(self, context, instance): """Get connection info for a serial console. :param context: security context :param instance: nova.objects.instance.Instance :returns an instance of console.type.ConsoleSerial """ raise NotImplementedError() def get_mks_console(self, context, instance): """Get connection info for a MKS console. :param context: security context :param instance: nova.objects.instance.Instance :returns an instance of console.type.ConsoleMKS """ raise NotImplementedError() def get_diagnostics(self, instance): """Return diagnostics data about the given instance. :param nova.objects.instance.Instance instance: The instance to which the diagnostic data should be returned. :return: Has a big overlap to the return value of the newer interface :func:`get_instance_diagnostics` :rtype: dict """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def get_instance_diagnostics(self, instance): """Return diagnostics data about the given instance. :param nova.objects.instance.Instance instance: The instance to which the diagnostic data should be returned. :return: Has a big overlap to the return value of the older interface :func:`get_diagnostics` :rtype: nova.virt.diagnostics.Diagnostics """ raise NotImplementedError() def get_all_bw_counters(self, instances): """Return bandwidth usage counters for each interface on each running VM. :param instances: nova.objects.instance.InstanceList """ raise NotImplementedError() def get_all_volume_usage(self, context, compute_host_bdms): """Return usage info for volumes attached to vms on a given host.- """ raise NotImplementedError() def get_host_ip_addr(self): """Retrieves the IP address of the dom0 """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def attach_volume(self, context, connection_info, instance, mountpoint, disk_bus=None, device_type=None, encryption=None): """Attach the disk to the instance at mountpoint using info.""" raise NotImplementedError() def detach_volume(self, connection_info, instance, mountpoint, encryption=None): """Detach the disk attached to the instance.""" raise NotImplementedError() def swap_volume(self, old_connection_info, new_connection_info, instance, mountpoint, resize_to): """Replace the volume attached to the given `instance`. :param dict old_connection_info: The volume for this connection gets detached from the given `instance`. :param dict new_connection_info: The volume for this connection gets attached to the given 'instance'. :param nova.objects.instance.Instance instance: The instance whose volume gets replaced by another one. :param str mountpoint: The mountpoint in the instance where the volume for `old_connection_info` is attached to. :param int resize_to: If the new volume is larger than the old volume, it gets resized to the given size (in Gigabyte) of `resize_to`. :return: None """ raise NotImplementedError() def attach_interface(self, instance, image_meta, vif): """Use hotplug to add a network interface to a running instance. The counter action to this is :func:`detach_interface`. :param nova.objects.instance.Instance instance: The instance which will get an additional network interface. :param nova.objects.ImageMeta image_meta: The metadata of the image of the instance. :param nova.network.model.NetworkInfo vif: The object which has the information about the interface to attach. :raise nova.exception.NovaException: If the attach fails. :return: None """ raise NotImplementedError() def detach_interface(self, instance, vif): """Use hotunplug to remove a network interface from a running instance. The counter action to this is :func:`attach_interface`. :param nova.objects.instance.Instance instance: The instance which gets a network interface removed. :param nova.network.model.NetworkInfo vif: The object which has the information about the interface to detach. :raise nova.exception.NovaException: If the detach fails. :return: None """ raise NotImplementedError() def migrate_disk_and_power_off(self, context, instance, dest, flavor, network_info, block_device_info=None, timeout=0, retry_interval=0): """Transfers the disk of a running instance in multiple phases, turning off the instance before the end. :param nova.objects.instance.Instance instance: The instance whose disk should be migrated. :param str dest: The IP address of the destination host. :param nova.objects.flavor.Flavor flavor: The flavor of the instance whose disk get migrated. :param nova.network.model.NetworkInfo network_info: The network information of the given `instance`. :param dict block_device_info: Information about the block devices. :param int timeout: The time in seconds to wait for the guest OS to shutdown. :param int retry_interval: How often to signal guest while waiting for it to shutdown. :return: A list of disk information dicts in JSON format. :rtype: str """ raise NotImplementedError() def snapshot(self, context, instance, image_id, update_task_state): """Snapshots the specified instance. :param context: security context :param instance: nova.objects.instance.Instance :param image_id: Reference to a pre-created image that will hold the snapshot. """ raise NotImplementedError() def post_interrupted_snapshot_cleanup(self, context, instance): """Cleans up any resources left after an interrupted snapshot. :param context: security context :param instance: nova.objects.instance.Instance """ pass def finish_migration(self, context, migration, instance, disk_info, network_info, image_meta, resize_instance, block_device_info=None, power_on=True): """Completes a resize/migration. :param context: the context for the migration/resize :param migration: the migrate/resize information :param instance: nova.objects.instance.Instance being migrated/resized :param disk_info: the newly transferred disk information :param network_info: instance network information :param nova.objects.ImageMeta image_meta: The metadata of the image of the instance. :param resize_instance: True if the instance is being resized, False otherwise :param block_device_info: instance volume block device info :param power_on: True if the instance should be powered on, False otherwise """ raise NotImplementedError() def confirm_migration(self, migration, instance, network_info): """Confirms a resize/migration, destroying the source VM. :param instance: nova.objects.instance.Instance """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def finish_revert_migration(self, context, instance, network_info, block_device_info=None, power_on=True): """Finish reverting a resize/migration. :param context: the context for the finish_revert_migration :param instance: nova.objects.instance.Instance being migrated/resized :param network_info: instance network information :param block_device_info: instance volume block device info :param power_on: True if the instance should be powered on, False otherwise """ raise NotImplementedError() def pause(self, instance): """Pause the given instance. A paused instance doesn't use CPU cycles of the host anymore. The state of the VM could be stored in the memory or storage space of the host, depending on the underlying hypervisor technology. A "stronger" version of `pause` is :func:'suspend'. The counter action for `pause` is :func:`unpause`. :param nova.objects.instance.Instance instance: The instance which should be paused. :return: None """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def unpause(self, instance): """Unpause the given paused instance. The paused instance gets unpaused and will use CPU cycles of the host again. The counter action for 'unpause' is :func:`pause`. Depending on the underlying hypervisor technology, the guest has the same state as before the 'pause'. :param nova.objects.instance.Instance instance: The instance which should be unpaused. :return: None """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def suspend(self, context, instance): """Suspend the specified instance. A suspended instance doesn't use CPU cycles or memory of the host anymore. The state of the instance could be persisted on the host and allocate storage space this way. A "softer" way of `suspend` is :func:`pause`. The counter action for `suspend` is :func:`resume`. :param nova.context.RequestContext context: The context for the suspend. :param nova.objects.instance.Instance instance: The instance to suspend. :return: None """ raise NotImplementedError() def resume(self, context, instance, network_info, block_device_info=None): """resume the specified suspended instance. The suspended instance gets resumed and will use CPU cycles and memory of the host again. The counter action for 'resume' is :func:`suspend`. Depending on the underlying hypervisor technology, the guest has the same state as before the 'suspend'. :param nova.context.RequestContext context: The context for the resume. :param nova.objects.instance.Instance instance: The suspended instance to resume. :param nova.network.model.NetworkInfo network_info: Necessary network information for the resume. :param dict block_device_info: Instance volume block device info. :return: None """ raise NotImplementedError() def resume_state_on_host_boot(self, context, instance, network_info, block_device_info=None): """resume guest state when a host is booted. :param instance: nova.objects.instance.Instance """ raise NotImplementedError() def rescue(self, context, instance, network_info, image_meta, rescue_password): """Rescue the specified instance. :param nova.context.RequestContext context: The context for the rescue. :param nova.objects.instance.Instance instance: The instance being rescued. :param nova.network.model.NetworkInfo network_info: Necessary network information for the resume. :param nova.objects.ImageMeta image_meta: The metadata of the image of the instance. :param rescue_password: new root password to set for rescue. """ raise NotImplementedError() def set_bootable(self, instance, is_bootable): """Set the ability to power on/off an instance. :param instance: nova.objects.instance.Instance """ raise NotImplementedError() def unrescue(self, instance, network_info): """Unrescue the specified instance. :param instance: nova.objects.instance.Instance """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def power_off(self, instance, timeout=0, retry_interval=0): """Power off the specified instance. :param instance: nova.objects.instance.Instance :param timeout: time to wait for GuestOS to shutdown :param retry_interval: How often to signal guest while waiting for it to shutdown """ raise NotImplementedError() def power_on(self, context, instance, network_info, block_device_info=None): """Power on the specified instance. :param instance: nova.objects.instance.Instance """ raise NotImplementedError() def trigger_crash_dump(self, instance): """Trigger crash dump mechanism on the given instance. Stalling instances can be triggered to dump the crash data. How the guest OS reacts in details, depends on the configuration of it. :param nova.objects.instance.Instance instance: The instance where the crash dump should be triggered. :return: None """ raise NotImplementedError() def soft_delete(self, instance): """Soft delete the specified instance. A soft-deleted instance doesn't allocate any resources anymore, but is still available as a database entry. The counter action :func:`restore` uses the database entry to create a new instance based on that. :param nova.objects.instance.Instance instance: The instance to soft-delete. :return: None """ raise NotImplementedError() def restore(self, instance): """Restore the specified soft-deleted instance. The restored instance will be automatically booted. The counter action for `restore` is :func:`soft_delete`. :param nova.objects.instance.Instance instance: The soft-deleted instance which should be restored from the soft-deleted data. :return: None """ raise NotImplementedError() def get_available_resource(self, nodename): """Retrieve resource information. This method is called when nova-compute launches, and as part of a periodic task that records the results in the DB. :param nodename: node which the caller want to get resources from a driver that manages only one node can safely ignore this :returns: Dictionary describing resources """ raise NotImplementedError() def pre_live_migration(self, context, instance, block_device_info, network_info, disk_info, migrate_data=None): """Prepare an instance for live migration :param context: security context :param instance: nova.objects.instance.Instance object :param block_device_info: instance block device information :param network_info: instance network information :param disk_info: instance disk information :param migrate_data: a LiveMigrateData object """ raise NotImplementedError() def live_migration(self, context, instance, dest, post_method, recover_method, block_migration=False, migrate_data=None): """Live migration of an instance to another host. :param context: security context :param instance: nova.db.sqlalchemy.models.Instance object instance object that is migrated. :param dest: destination host :param post_method: post operation method. expected nova.compute.manager._post_live_migration. :param recover_method: recovery method when any exception occurs. expected nova.compute.manager._rollback_live_migration. :param block_migration: if true, migrate VM disk. :param migrate_data: a LiveMigrateData object """ raise NotImplementedError() def live_migration_force_complete(self, instance): """Force live migration to complete :param instance: Instance being live migrated """ raise NotImplementedError() def live_migration_abort(self, instance): """Abort an in-progress live migration. :param instance: instance that is live migrating """ raise NotImplementedError() def rollback_live_migration_at_destination(self, context, instance, network_info, block_device_info, destroy_disks=True, migrate_data=None): """Clean up destination node after a failed live migration. :param context: security context :param instance: instance object that was being migrated :param network_info: instance network information :param block_device_info: instance block device information :param destroy_disks: if true, destroy disks at destination during cleanup :param migrate_data: a LiveMigrateData object """ raise NotImplementedError() def post_live_migration(self, context, instance, block_device_info, migrate_data=None): """Post operation of live migration at source host. :param context: security context :instance: instance object that was migrated :block_device_info: instance block device information :param migrate_data: a LiveMigrateData object """ pass def post_live_migration_at_source(self, context, instance, network_info): """Unplug VIFs from networks at source. :param context: security context :param instance: instance object reference :param network_info: instance network information """ raise NotImplementedError(_("Hypervisor driver does not support " "post_live_migration_at_source method")) def post_live_migration_at_destination(self, context, instance, network_info, block_migration=False, block_device_info=None): """Post operation of live migration at destination host. :param context: security context :param instance: instance object that is migrated :param network_info: instance network information :param block_migration: if true, post operation of block_migration. """ raise NotImplementedError() def check_instance_shared_storage_local(self, context, instance): """Check if instance files located on shared storage. This runs check on the destination host, and then calls back to the source host to check the results. :param context: security context :param instance: nova.objects.instance.Instance object """ raise NotImplementedError() def check_instance_shared_storage_remote(self, context, data): """Check if instance files located on shared storage. :param context: security context :param data: result of check_instance_shared_storage_local """ raise NotImplementedError() def check_instance_shared_storage_cleanup(self, context, data): """Do cleanup on host after check_instance_shared_storage calls :param context: security context :param data: result of check_instance_shared_storage_local """ pass def check_can_live_migrate_destination(self, context, instance, src_compute_info, dst_compute_info, block_migration=False, disk_over_commit=False): """Check if it is possible to execute live migration. This runs checks on the destination host, and then calls back to the source host to check the results. :param context: security context :param instance: nova.db.sqlalchemy.models.Instance :param src_compute_info: Info about the sending machine :param dst_compute_info: Info about the receiving machine :param block_migration: if true, prepare for block migration :param disk_over_commit: if true, allow disk over commit :returns: a LiveMigrateData object (hypervisor-dependent) """ raise NotImplementedError() def cleanup_live_migration_destination_check(self, context, dest_check_data): """Do required cleanup on dest host after check_can_live_migrate calls :param context: security context :param dest_check_data: result of check_can_live_migrate_destination """ raise NotImplementedError() def check_can_live_migrate_source(self, context, instance, dest_check_data, block_device_info=None): """Check if it is possible to execute live migration. This checks if the live migration can succeed, based on the results from check_can_live_migrate_destination. :param context: security context :param instance: nova.db.sqlalchemy.models.Instance :param dest_check_data: result of check_can_live_migrate_destination :param block_device_info: result of _get_instance_block_device_info :returns: a LiveMigrateData object """ raise NotImplementedError() def get_instance_disk_info(self, instance, block_device_info=None): """Retrieve information about actual disk sizes of an instance. :param instance: nova.objects.Instance :param block_device_info: Optional; Can be used to filter out devices which are actually volumes. :return: json strings with below format:: "[{'path':'disk', 'type':'raw', 'virt_disk_size':'10737418240', 'backing_file':'backing_file', 'disk_size':'83886080' 'over_committed_disk_size':'10737418240'}, ...]" """ raise NotImplementedError() def refresh_security_group_rules(self, security_group_id): """This method is called after a change to security groups. All security groups and their associated rules live in the datastore, and calling this method should apply the updated rules to instances running the specified security group. An error should be raised if the operation cannot complete. """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def refresh_instance_security_rules(self, instance): """Refresh security group rules Gets called when an instance gets added to or removed from the security group the instance is a member of or if the group gains or loses a rule. """ raise NotImplementedError() def reset_network(self, instance): """reset networking for specified instance.""" # TODO(Vek): Need to pass context in for access to auth_token pass def ensure_filtering_rules_for_instance(self, instance, network_info): """Setting up filtering rules and waiting for its completion. To migrate an instance, filtering rules to hypervisors and firewalls are inevitable on destination host. ( Waiting only for filtering rules to hypervisor, since filtering rules to firewall rules can be set faster). Concretely, the below method must be called. - setup_basic_filtering (for nova-basic, etc.) - prepare_instance_filter(for nova-instance-instance-xxx, etc.) to_xml may have to be called since it defines PROJNET, PROJMASK. but libvirt migrates those value through migrateToURI(), so , no need to be called. Don't use thread for this method since migration should not be started when setting-up filtering rules operations are not completed. :param instance: nova.objects.instance.Instance object """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def filter_defer_apply_on(self): """Defer application of IPTables rules.""" pass def filter_defer_apply_off(self): """Turn off deferral of IPTables rules and apply the rules now.""" pass def unfilter_instance(self, instance, network_info): """Stop filtering instance.""" # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def set_admin_password(self, instance, new_pass): """Set the root password on the specified instance. :param instance: nova.objects.instance.Instance :param new_pass: the new password """ raise NotImplementedError() def inject_file(self, instance, b64_path, b64_contents): """Writes a file on the specified instance. The first parameter is an instance of nova.compute.service.Instance, and so the instance is being specified as instance.name. The second parameter is the base64-encoded path to which the file is to be written on the instance; the third is the contents of the file, also base64-encoded. NOTE(russellb) This method is deprecated and will be removed once it can be removed from nova.compute.manager. """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def change_instance_metadata(self, context, instance, diff): """Applies a diff to the instance metadata. This is an optional driver method which is used to publish changes to the instance's metadata to the hypervisor. If the hypervisor has no means of publishing the instance metadata to the instance, then this method should not be implemented. :param context: security context :param instance: nova.objects.instance.Instance """ pass def inject_network_info(self, instance, nw_info): """inject network info for specified instance.""" # TODO(Vek): Need to pass context in for access to auth_token pass def poll_rebooting_instances(self, timeout, instances): """Perform a reboot on all given 'instances'. Reboots the given `instances` which are longer in the rebooting state than `timeout` seconds. :param int timeout: The timeout (in seconds) for considering rebooting instances to be stuck. :param list instances: A list of nova.objects.instance.Instance objects that have been in rebooting state longer than the configured timeout. :return: None """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def host_power_action(self, action): """Reboots, shuts down or powers up the host. :param str action: The action the host should perform. The valid actions are: ""startup", "shutdown" and "reboot". :return: The result of the power action :rtype: : str """ raise NotImplementedError() def host_maintenance_mode(self, host, mode): """Start/Stop host maintenance window. On start, it triggers the migration of all instances to other hosts. Consider the combination with :func:`set_host_enabled`. :param str host: The name of the host whose maintenance mode should be changed. :param bool mode: If `True`, go into maintenance mode. If `False`, leave the maintenance mode. :return: "on_maintenance" if switched to maintenance mode or "off_maintenance" if maintenance mode got left. :rtype: str """ raise NotImplementedError() def set_host_enabled(self, enabled): """Sets the ability of this host to accept new instances. :param bool enabled: If this is `True`, the host will accept new instances. If it is `False`, the host won't accept new instances. :return: If the host can accept further instances, return "enabled", if further instances shouldn't be scheduled to this host, return "disabled". :rtype: str """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def get_host_uptime(self): """Returns the result of calling the Linux command `uptime` on this host. :return: A text which contains the uptime of this host since the last boot. :rtype: str """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def plug_vifs(self, instance, network_info): """Plug virtual interfaces (VIFs) into the given `instance` at instance boot time. The counter action is :func:`unplug_vifs`. :param nova.objects.instance.Instance instance: The instance which gets VIFs plugged. :param nova.network.model.NetworkInfo network_info: The object which contains information about the VIFs to plug. :return: None """ # TODO(Vek): Need to pass context in for access to auth_token raise NotImplementedError() def unplug_vifs(self, instance, network_info): # NOTE(markus_z): 2015-08-18 # The compute manager doesn't use this interface, which seems odd # since the manager should be the controlling thing here. """Unplug virtual interfaces (VIFs) from networks. The counter action is :func:`plug_vifs`. :param nova.objects.instance.Instance instance: The instance which gets VIFs unplugged. :param nova.network.model.NetworkInfo network_info: The object which contains information about the VIFs to unplug. :return: None """ raise NotImplementedError() def get_host_cpu_stats(self): """Get the currently known host CPU stats. :returns: a dict containing the CPU stat info, eg: | {'kernel': kern, | 'idle': idle, | 'user': user, | 'iowait': wait, | 'frequency': freq}, where kern and user indicate the cumulative CPU time (nanoseconds) spent by kernel and user processes respectively, idle indicates the cumulative idle CPU time (nanoseconds), wait indicates the cumulative I/O wait CPU time (nanoseconds), since the host is booting up; freq indicates the current CPU frequency (MHz). All values are long integers. """ raise NotImplementedError() def block_stats(self, instance, disk_id): """Return performance counters associated with the given disk_id on the given instance. These are returned as [rd_req, rd_bytes, wr_req, wr_bytes, errs], where rd indicates read, wr indicates write, req is the total number of I/O requests made, bytes is the total number of bytes transferred, and errs is the number of requests held up due to a full pipeline. All counters are long integers. This method is optional. On some platforms (e.g. XenAPI) performance statistics can be retrieved directly in aggregate form, without Nova having to do the aggregation. On those platforms, this method is unused. Note that this function takes an instance ID. """ raise NotImplementedError() def deallocate_networks_on_reschedule(self, instance): """Does the driver want networks deallocated on reschedule?""" return False def macs_for_instance(self, instance): """What MAC addresses must this instance have? Some hypervisors (such as bare metal) cannot do freeform virtualization of MAC addresses. This method allows drivers to return a set of MAC addresses that the instance is to have. allocate_for_instance will take this into consideration when provisioning networking for the instance. Mapping of MAC addresses to actual networks (or permitting them to be freeform) is up to the network implementation layer. For instance, with openflow switches, fixed MAC addresses can still be virtualized onto any L2 domain, with arbitrary VLANs etc, but regular switches require pre-configured MAC->network mappings that will match the actual configuration. Most hypervisors can use the default implementation which returns None. Hypervisors with MAC limits should return a set of MAC addresses, which will be supplied to the allocate_for_instance call by the compute manager, and it is up to that call to ensure that all assigned network details are compatible with the set of MAC addresses. This is called during spawn_instance by the compute manager. :return: None, or a set of MAC ids (e.g. set(['12:34:56:78:90:ab'])). None means 'no constraints', a set means 'these and only these MAC addresses'. """ return None def dhcp_options_for_instance(self, instance): """Get DHCP options for this instance. Some hypervisors (such as bare metal) require that instances boot from the network, and manage their own TFTP service. This requires passing the appropriate options out to the DHCP service. Most hypervisors can use the default implementation which returns None. This is called during spawn_instance by the compute manager. Note that the format of the return value is specific to the Neutron client API. :return: None, or a set of DHCP options, eg: | [{'opt_name': 'bootfile-name', | 'opt_value': '/tftpboot/path/to/config'}, | {'opt_name': 'server-ip-address', | 'opt_value': '1.2.3.4'}, | {'opt_name': 'tftp-server', | 'opt_value': '1.2.3.4'} | ] """ return None def manage_image_cache(self, context, all_instances): """Manage the driver's local image cache. Some drivers chose to cache images for instances on disk. This method is an opportunity to do management of that cache which isn't directly related to other calls into the driver. The prime example is to clean the cache and remove images which are no longer of interest. :param all_instances: nova.objects.instance.InstanceList """ pass def add_to_aggregate(self, context, aggregate, host, **kwargs): """Add a compute host to an aggregate. The counter action to this is :func:`remove_from_aggregate` :param nova.context.RequestContext context: The security context. :param nova.objects.aggregate.Aggregate aggregate: The aggregate which should add the given `host` :param str host: The name of the host to add to the given `aggregate`. :param dict kwargs: A free-form thingy... :return: None """ # NOTE(jogo) Currently only used for XenAPI-Pool raise NotImplementedError() def remove_from_aggregate(self, context, aggregate, host, **kwargs): """Remove a compute host from an aggregate. The counter action to this is :func:`add_to_aggregate` :param nova.context.RequestContext context: The security context. :param nova.objects.aggregate.Aggregate aggregate: The aggregate which should remove the given `host` :param str host: The name of the host to remove from the given `aggregate`. :param dict kwargs: A free-form thingy... :return: None """ raise NotImplementedError() def undo_aggregate_operation(self, context, op, aggregate, host, set_error=True): """Undo for Resource Pools.""" raise NotImplementedError() def get_volume_connector(self, instance): """Get connector information for the instance for attaching to volumes. Connector information is a dictionary representing the ip of the machine that will be making the connection, the name of the iscsi initiator and the hostname of the machine as follows:: { 'ip': ip, 'initiator': initiator, 'host': hostname } """ raise NotImplementedError() def get_available_nodes(self, refresh=False): """Returns nodenames of all nodes managed by the compute service. This method is for multi compute-nodes support. If a driver supports multi compute-nodes, this method returns a list of nodenames managed by the service. Otherwise, this method should return [hypervisor_hostname]. """ raise NotImplementedError() def node_is_available(self, nodename): """Return whether this compute service manages a particular node.""" if nodename in self.get_available_nodes(): return True # Refresh and check again. return nodename in self.get_available_nodes(refresh=True) def get_per_instance_usage(self): """Get information about instance resource usage. :returns: dict of nova uuid => dict of usage info """ return {} def instance_on_disk(self, instance): """Checks access of instance files on the host. :param instance: nova.objects.instance.Instance to lookup Returns True if files of an instance with the supplied ID accessible on the host, False otherwise. .. note:: Used in rebuild for HA implementation and required for validation of access to instance shared disk files """ return False def register_event_listener(self, callback): """Register a callback to receive events. Register a callback to receive asynchronous event notifications from hypervisors. The callback will be invoked with a single parameter, which will be an instance of the nova.virt.event.Event class. """ self._compute_event_callback = callback def emit_event(self, event): """Dispatches an event to the compute manager. Invokes the event callback registered by the compute manager to dispatch the event. This must only be invoked from a green thread. """ if not self._compute_event_callback: LOG.debug("Discarding event %s", str(event)) return if not isinstance(event, virtevent.Event): raise ValueError( _("Event must be an instance of nova.virt.event.Event")) try: LOG.debug("Emitting event %s", str(event)) self._compute_event_callback(event) except Exception as ex: LOG.error(_LE("Exception dispatching event %(event)s: %(ex)s"), {'event': event, 'ex': ex}) def delete_instance_files(self, instance): """Delete any lingering instance files for an instance. :param instance: nova.objects.instance.Instance :returns: True if the instance was deleted from disk, False otherwise. """ return True @property def need_legacy_block_device_info(self): """Tell the caller if the driver requires legacy block device info. Tell the caller whether we expect the legacy format of block device info to be passed in to methods that expect it. """ return True def volume_snapshot_create(self, context, instance, volume_id, create_info): """Snapshots volumes attached to a specified instance. The counter action to this is :func:`volume_snapshot_delete` :param nova.context.RequestContext context: The security context. :param nova.objects.instance.Instance instance: The instance that has the volume attached :param uuid volume_id: Volume to be snapshotted :param create_info: The data needed for nova to be able to attach to the volume. This is the same data format returned by Cinder's initialize_connection() API call. In the case of doing a snapshot, it is the image file Cinder expects to be used as the active disk after the snapshot operation has completed. There may be other data included as well that is needed for creating the snapshot. """ raise NotImplementedError() def volume_snapshot_delete(self, context, instance, volume_id, snapshot_id, delete_info): """Deletes a snapshot of a volume attached to a specified instance. The counter action to this is :func:`volume_snapshot_create` :param nova.context.RequestContext context: The security context. :param nova.objects.instance.Instance instance: The instance that has the volume attached. :param uuid volume_id: Attached volume associated with the snapshot :param uuid snapshot_id: The snapshot to delete. :param dict delete_info: Volume backend technology specific data needed to be able to complete the snapshot. For example, in the case of qcow2 backed snapshots, this would include the file being merged, and the file being merged into (if appropriate). :return: None """ raise NotImplementedError() def default_root_device_name(self, instance, image_meta, root_bdm): """Provide a default root device name for the driver. :param nova.objects.instance.Instance instance: The instance to get the root device for. :param nova.objects.ImageMeta image_meta: The metadata of the image of the instance. :param nova.objects.BlockDeviceMapping root_bdm: The description of the root device. """ raise NotImplementedError() def default_device_names_for_instance(self, instance, root_device_name, *block_device_lists): """Default the missing device names in the block device mapping.""" raise NotImplementedError() def get_device_name_for_instance(self, instance, bdms, block_device_obj): """Get the next device name based on the block device mapping. :param instance: nova.objects.instance.Instance that volume is requesting a device name :param bdms: a nova.objects.BlockDeviceMappingList for the instance :param block_device_obj: A nova.objects.BlockDeviceMapping instance with all info about the requested block device. device_name does not need to be set, and should be decided by the driver implementation if not set. :returns: The chosen device name. """ raise NotImplementedError() def is_supported_fs_format(self, fs_type): """Check whether the file format is supported by this driver :param fs_type: the file system type to be checked, the validate values are defined at disk API module. """ # NOTE(jichenjc): Return False here so that every hypervisor # need to define their supported file system # type and implement this function at their # virt layer. return False def quiesce(self, context, instance, image_meta): """Quiesce the specified instance to prepare for snapshots. If the specified instance doesn't support quiescing, InstanceQuiesceNotSupported is raised. When it fails to quiesce by other errors (e.g. agent timeout), NovaException is raised. :param context: request context :param instance: nova.objects.instance.Instance to be quiesced :param nova.objects.ImageMeta image_meta: The metadata of the image of the instance. """ raise NotImplementedError() def unquiesce(self, context, instance, image_meta): """Unquiesce the specified instance after snapshots. If the specified instance doesn't support quiescing, InstanceQuiesceNotSupported is raised. When it fails to quiesce by other errors (e.g. agent timeout), NovaException is raised. :param context: request context :param instance: nova.objects.instance.Instance to be unquiesced :param nova.objects.ImageMeta image_meta: The metadata of the image of the instance. """ raise NotImplementedError() def network_binding_host_id(self, context, instance): """Get host ID to associate with network ports. :param context: request context :param instance: nova.objects.instance.Instance that the network ports will be associated with :returns: a string representing the host ID """ return instance.get('host') def load_compute_driver(virtapi, compute_driver=None): """Load a compute driver module. Load the compute driver module specified by the compute_driver configuration option or, if supplied, the driver name supplied as an argument. Compute drivers constructors take a VirtAPI object as their first object and this must be supplied. :param virtapi: a VirtAPI instance :param compute_driver: a compute driver name to override the config opt :returns: a ComputeDriver instance """ if not compute_driver: compute_driver = CONF.compute_driver if not compute_driver: LOG.error(_LE("Compute driver option required, but not specified")) sys.exit(1) LOG.info(_LI("Loading compute driver '%s'"), compute_driver) try: driver = importutils.import_object( 'nova.virt.%s' % compute_driver, virtapi) return utils.check_isinstance(driver, ComputeDriver) except ImportError: LOG.exception(_LE("Unable to load the virtualization driver")) sys.exit(1) def is_xenapi(): return CONF.compute_driver == 'xenapi.XenAPIDriver'
39.205286
79
0.651246
7,669
63,787
5.313079
0.132351
0.024027
0.055662
0.033795
0.427109
0.378712
0.345727
0.32305
0.299686
0.266971
0
0.00194
0.289024
63,787
1,626
80
39.229397
0.896518
0.61986
0
0.355932
0
0
0.035461
0.007206
0
0
0
0.011685
0
1
0.338983
false
0.039548
0.031073
0.00565
0.446328
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
0
0
0
2
8a13fa0bd9273ba0ef6fc5a2231a5c8269835d8e
280
py
Python
nanoepiseg/main_list_chunks.py
snajder-r/nanoepiseg
2fe36a82e5b899330da5db6559eb45fe12cad37c
[ "MIT" ]
null
null
null
nanoepiseg/main_list_chunks.py
snajder-r/nanoepiseg
2fe36a82e5b899330da5db6559eb45fe12cad37c
[ "MIT" ]
null
null
null
nanoepiseg/main_list_chunks.py
snajder-r/nanoepiseg
2fe36a82e5b899330da5db6559eb45fe12cad37c
[ "MIT" ]
null
null
null
from pathlib import Path from meth5.meth5 import MetH5File def main(m5file:Path, chunk_size:int, quiet:bool): with MetH5File(m5file, "r", chunk_size=chunk_size) as f: for chrom in f.get_chromosomes(): print(f"{chrom}: {f[chrom].get_number_of_chunks()}")
31.111111
64
0.696429
43
280
4.372093
0.627907
0.143617
0
0
0
0
0
0
0
0
0
0.026087
0.178571
280
8
65
35
0.791304
0
0
0
0
0
0.153571
0.117857
0
0
0
0
0
1
0.166667
false
0
0.333333
0
0.5
0.166667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
8a1ac6639a0c1cc52dd72036d5f1b225c44d7b2f
4,363
py
Python
vectors2.py
shivam13verma/judge-embeddings
9b861319a1240529d25c15799952e32dde2e894e
[ "MIT" ]
null
null
null
vectors2.py
shivam13verma/judge-embeddings
9b861319a1240529d25c15799952e32dde2e894e
[ "MIT" ]
null
null
null
vectors2.py
shivam13verma/judge-embeddings
9b861319a1240529d25c15799952e32dde2e894e
[ "MIT" ]
null
null
null
import locale import glob import os import os.path import requests import tarfile import sys import re import gensim from gensim.models.doc2vec import TaggedDocument from collections import namedtuple from gensim.models import Doc2Vec import gensim.models.doc2vec from collections import OrderedDict import multiprocessing from gensim.test.test_doc2vec import ConcatenatedDoc2Vec import pickle reload(sys) sys.setdefaultencoding("utf-8") #dirname = '/scratch/ap4608/judge_data' #locale.setlocale(locale.LC_ALL, 'C') # # ## Convert text to lower-case and strip punctuation/symbols from words #def normalize_text(text): # norm_text = text.lower() # # # Replace breaks with spaces # norm_text = norm_text.replace('<br />', ' ') # # # Pad punctuation with spaces on both sides # for char in ['.', '"', ',', '(', ')', '!', '?', ';', ':']: # norm_text = norm_text.replace(char, ' ' + char + ' ') # # return norm_text # # ## Concat and normalize test/train data #folders = os.listdir(dirname) #alldata = '' # #for fol in folders: # temp = '' # output = fol.replace('/', '-') + '.txt' # # # Is there a better pattern to use? # txt_files = glob.glob('/'.join([dirname, fol, '*.txt'])) # # for txt in txt_files: # with open(txt, 'r') as t: # control_chars = [chr(0x85)] # t_clean = t.read() # # t_clean = t_clean.replace('\n', ' ') # t_clean = re.sub(r'[^\x00-\x7F]+',' ', t_clean) # # for c in control_chars: # t_clean = t_clean.replace(c, ' ') # # temp += t_clean # # temp += "\n" # # temp_norm = normalize_text(temp) # # if len(temp_norm) == 1: # continue # # with open('/'.join([dirname, output]), 'w') as n: # n.write(temp_norm) # # alldata += temp_norm # #with open('/'.join([dirname, 'alldata-id.txt']), 'w') as f: # for idx, line in enumerate(alldata.splitlines()): # num_line = "_*{0} {1}\n".format(idx, line) # f.write(num_line) # #SentimentDocument = namedtuple('SentimentDocument', 'words tags split sentiment') # #alldocs = [] # will hold all docs in original order #with open(os.path.join(dirname, 'alldata-id.txt')) as alldata: # for line_no, line in enumerate(alldata): # tokens = gensim.utils.to_unicode(line).split() # words = tokens[1:] # tags = [line_no] # `tags = [tokens[0]]` would also work at extra memory cost # split = ['train','test','extra','extra'][line_no//25000] # 25k train, 25k test, 25k extra # sentiment = [1.0, 0.0, 1.0, 0.0, None, None, None, None][line_no//12500] # [12.5K pos, 12.5K neg]*2 then unknown # alldocs.append(SentimentDocument(words, tags, split, sentiment)) # #train_docs = [doc for doc in alldocs if doc.split == 'train'] #test_docs = [doc for doc in alldocs if doc.split == 'test'] #doc_list = alldocs[:] # for reshuffling per pass # #cores = multiprocessing.cpu_count() #assert gensim.models.doc2vec.FAST_VERSION > -1, "this will be painfully slow otherwise" # #simple_models = [ # # PV-DM w/concatenation - window=5 (both sides) approximates paper's 10-word total window size # Doc2Vec(dm=1, dm_concat=1, size=100, window=5, negative=5, hs=0, min_count=2, workers=cores), # # PV-DBOW # Doc2Vec(dm=0, size=100, negative=5, hs=0, min_count=2, workers=cores), # # PV-DM w/average # Doc2Vec(dm=1, dm_mean=1, size=100, window=10, negative=5, hs=0, min_count=2, workers=cores), #] # ## speed setup by sharing results of 1st model's vocabulary scan #simple_models[0].build_vocab(alldocs) # PV-DM/concat requires one special NULL word so it serves as template #for model in simple_models[1:]: # model.reset_from(simple_models[0]) # #models_by_name = OrderedDict((str(model), model) for model in simple_models) # #models_by_name['dbow+dmm'] = ConcatenatedDoc2Vec([simple_models[1], simple_models[2]]) #models_by_name['dbow+dmc'] = ConcatenatedDoc2Vec([simple_models[1], simple_models[0]]) # ## Create a document vector list and save it #doc_vec_list = [x.docvecs for x in simple_models] docvecs = pickle.load(open('docvecs.p', 'rb')) print len(docvecs) print len(docvecs[0]) print docvecs[0] for i,x in enumerate(docvecs): with open('docvecs_'+str(i)+'.txt','w') as f: for vec in x: f.write(vec) f.write("\n") # pickle.dump(models_by_name, open('model.p', 'wb'))
31.388489
121
0.651845
630
4,363
4.406349
0.34127
0.043228
0.017291
0.012968
0.189481
0.091859
0.060159
0.060159
0.060159
0.025216
0
0.027606
0.18634
4,363
138
122
31.615942
0.754366
0.794637
0
0
0
0
0.039744
0
0
0
0
0
0
0
null
null
0
0.607143
null
null
0.107143
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
2
8a1ff54283494d2484e0c67f1c0d0ff7dcc46387
1,165
py
Python
met/metadataparser/models/entity_type.py
z1digitalstudio/met
7840e7520bb4c3cb0328d5988468eefe6639f950
[ "BSD-2-Clause" ]
11
2016-06-30T13:20:39.000Z
2021-01-14T20:53:15.000Z
met/metadataparser/models/entity_type.py
z1digitalstudio/met
7840e7520bb4c3cb0328d5988468eefe6639f950
[ "BSD-2-Clause" ]
50
2016-02-03T14:49:06.000Z
2022-02-24T01:35:50.000Z
met/metadataparser/models/entity_type.py
z1digitalstudio/met
7840e7520bb4c3cb0328d5988468eefe6639f950
[ "BSD-2-Clause" ]
9
2016-04-22T19:24:36.000Z
2022-01-11T10:30:54.000Z
################################################################# # MET v2 Metadate Explorer Tool # # This Software is Open Source. See License: https://github.com/TERENA/met/blob/master/LICENSE.md # Copyright (c) 2012, TERENA All rights reserved. # # This Software is based on MET v1 developed for TERENA by Yaco Sistemas, http://www.yaco.es/ # MET v2 was developed for TERENA by Tamim Ziai, DAASI International GmbH, http://www.daasi.de # Current version of MET has been revised for performance improvements by Andrea Biancini, # Consortium GARR, http://www.garr.it ########################################################################## from django.db import models from django.utils.translation import ugettext_lazy as _ class EntityType(models.Model): """ Model describing the type of an entity. """ name = models.CharField(blank=False, max_length=20, unique=True, verbose_name=_(u'Name'), db_index=True) xmlname = models.CharField(blank=False, max_length=20, unique=True, verbose_name=_(u'Name in XML'), db_index=True) def __unicode__(self): return self.name
38.833333
97
0.614592
146
1,165
4.808219
0.636986
0.029915
0.039886
0.05698
0.176638
0.176638
0.176638
0.176638
0.176638
0.176638
0
0.011543
0.181974
1,165
29
98
40.172414
0.725079
0.449785
0
0
0
0
0.031381
0
0
0
0
0
0
1
0.111111
false
0
0.222222
0.111111
0.777778
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
8a20b188a03474ef2ca2b4263906e89597ed6c86
6,029
py
Python
src/economy/migrations/0027_zettlebalance_zettlereceipt.py
bornhack/bornhack-website
40ed0875f5129a4c8ae1887e33e7dedb4981dadc
[ "BSD-3-Clause" ]
7
2017-04-14T15:28:29.000Z
2021-09-10T09:45:38.000Z
src/economy/migrations/0027_zettlebalance_zettlereceipt.py
bornhack/bornhack-website
40ed0875f5129a4c8ae1887e33e7dedb4981dadc
[ "BSD-3-Clause" ]
799
2016-04-28T09:31:50.000Z
2022-03-29T09:05:02.000Z
src/economy/migrations/0027_zettlebalance_zettlereceipt.py
bornhack/bornhack-website
40ed0875f5129a4c8ae1887e33e7dedb4981dadc
[ "BSD-3-Clause" ]
35
2016-04-28T09:23:53.000Z
2021-05-02T12:36:01.000Z
# Generated by Django 3.2.7 on 2021-09-13 03:52 import uuid from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("economy", "0026_alter_clearhaussettlement_options"), ] operations = [ migrations.CreateModel( name="ZettleBalance", fields=[ ( "uuid", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("created", models.DateTimeField(auto_now_add=True)), ("updated", models.DateTimeField(auto_now=True)), ( "statement_time", models.DateTimeField( help_text="The date and time this movement was added to the account statement." ), ), ( "payment_time", models.DateTimeField( blank=True, help_text="The date and time this payment was made. Can be empty if this transaction is not a customer payment.", null=True, ), ), ( "payment_reference", models.IntegerField( blank=True, help_text="The reference for this payment. Can be empty if this transaction is not a customer payment.", null=True, ), ), ( "description", models.CharField( help_text="The description of this transaction.", max_length=100 ), ), ( "amount", models.DecimalField( decimal_places=2, help_text="The amount of this transaction", max_digits=12, ), ), ( "balance", models.DecimalField( decimal_places=2, help_text="Our balance in Zettles systems after this transaction.", max_digits=12, ), ), ], options={ "ordering": ["-statement_time"], "get_latest_by": ["statement_time"], }, ), migrations.CreateModel( name="ZettleReceipt", fields=[ ( "uuid", models.UUIDField( default=uuid.uuid4, editable=False, primary_key=True, serialize=False, ), ), ("created", models.DateTimeField(auto_now_add=True)), ("updated", models.DateTimeField(auto_now=True)), ( "zettle_created", models.DateTimeField( help_text="The date and time this receipt was created in Zettles end" ), ), ( "receipt_number", models.IntegerField(help_text="The Zettle receipt number."), ), ( "vat", models.DecimalField( decimal_places=2, help_text="The part of the total amount which is VAT", max_digits=12, ), ), ( "total", models.DecimalField( decimal_places=2, help_text="The total amount the customer paid", max_digits=12, ), ), ( "fee", models.DecimalField( decimal_places=2, help_text="The payment fee BornHack has to pay to receive this payment", max_digits=12, ), ), ( "net", models.DecimalField( decimal_places=2, help_text="The part of the payment which goes to BornHack after fees have been substracted.", max_digits=12, ), ), ( "payment_method", models.CharField(help_text="The payment method", max_length=100), ), ( "card_issuer", models.CharField( blank=True, help_text="The card issuer. Can be empty if this was not a card payment.", max_length=100, null=True, ), ), ( "staff", models.CharField( help_text="The Zettle account which was used to make this sale.", max_length=100, ), ), ( "description", models.CharField( help_text="The description of this transaction.", max_length=255 ), ), ("sold_via", models.CharField(help_text="Always POS?", max_length=100)), ], options={ "ordering": ["-zettle_created"], "get_latest_by": ["zettle_created"], }, ), ]
35.674556
137
0.379499
423
6,029
5.262411
0.304965
0.061096
0.074124
0.083558
0.510332
0.434412
0.434412
0.404762
0.34681
0.306379
0
0.020727
0.543871
6,029
168
138
35.886905
0.788727
0.007464
0
0.590062
1
0.006211
0.203611
0.006352
0
0
0
0
0
1
0
false
0
0.012422
0
0.031056
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
8a2e82e1a97d54e2d6df29004c910ab7dc7dda4f
344
py
Python
src/ros_comm/rosmsg/setup.py
jungleni/ros_code_reading
499e98c0b0d309da78060b19b55c420c22110d65
[ "Apache-2.0" ]
742
2017-07-05T02:49:36.000Z
2022-03-30T12:55:43.000Z
src/ros_comm/rosmsg/setup.py
jungleni/ros_code_reading
499e98c0b0d309da78060b19b55c420c22110d65
[ "Apache-2.0" ]
73
2017-07-06T12:50:51.000Z
2022-03-07T08:07:07.000Z
src/ros_comm/rosmsg/setup.py
jungleni/ros_code_reading
499e98c0b0d309da78060b19b55c420c22110d65
[ "Apache-2.0" ]
425
2017-07-04T22:03:29.000Z
2022-03-29T06:59:06.000Z
#!/usr/bin/env python from distutils.core import setup from catkin_pkg.python_setup import generate_distutils_setup d = generate_distutils_setup( packages=['rosmsg'], package_dir={'': 'src'}, scripts=['scripts/rosmsg', 'scripts/rosmsg-proto', 'scripts/rossrv'], requires=['genmsg', 'rosbag', 'roslib', 'rospkg'] ) setup(**d)
24.571429
73
0.700581
42
344
5.571429
0.619048
0.145299
0.188034
0
0
0
0
0
0
0
0
0
0.127907
344
13
74
26.461538
0.78
0.05814
0
0
1
0
0.250774
0
0
0
0
0
0
1
0
false
0
0.222222
0
0.222222
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
8a30c3ee79ce2efcb14fdc2c9e26c3ab71e499c1
671
py
Python
tests/test_i18n.py
vthriller/flask-kajiki
eadaa0aa45d23507066758b9e74091bddbc943c4
[ "BSD-3-Clause" ]
null
null
null
tests/test_i18n.py
vthriller/flask-kajiki
eadaa0aa45d23507066758b9e74091bddbc943c4
[ "BSD-3-Clause" ]
null
null
null
tests/test_i18n.py
vthriller/flask-kajiki
eadaa0aa45d23507066758b9e74091bddbc943c4
[ "BSD-3-Clause" ]
null
null
null
from kajiki import i18n from flask import request from flask_kajiki import render_template # N. B. settting i18n.gettext would affect tests from all modules, # so we test for request path that only functions from this module could set def gettext(s): if request.path == '/test_i18n': return s.upper() return s i18n.gettext = gettext def test_does_translations(app): """Callback interface is able to inject Translator filter""" with app.test_request_context(path='/test_i18n'): rendered = render_template('i18n.html') # TODO DOCTYPE; see also render_args expected = '<p>HELLO!</p>' assert rendered == expected
27.958333
76
0.704918
94
671
4.925532
0.617021
0.051836
0.051836
0
0
0
0
0
0
0
0
0.022642
0.210134
671
23
77
29.173913
0.850943
0.342772
0
0
0
0
0.096998
0
0
0
0
0.043478
0.076923
1
0.153846
false
0
0.230769
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
8a3cab0b0c29dee41665f61e10da5e23f85da48c
670
py
Python
paneldata_dash/backend/schemas/johnson_scanner_data.py
clarencejlee/jdp
d3d31db0138ff06f2f5ec592d85317941af4f280
[ "MIT" ]
null
null
null
paneldata_dash/backend/schemas/johnson_scanner_data.py
clarencejlee/jdp
d3d31db0138ff06f2f5ec592d85317941af4f280
[ "MIT" ]
null
null
null
paneldata_dash/backend/schemas/johnson_scanner_data.py
clarencejlee/jdp
d3d31db0138ff06f2f5ec592d85317941af4f280
[ "MIT" ]
null
null
null
from ma import ma from models.johnson_scanner_data import JohnsonScannerDataModel from schemas.brand import BrandSchema from schemas.category import CategorySchema from schemas.facts_in_data import FactsInDataSchema from schemas.market import MarketSchema from schemas.period import PeriodSchema class JohnsonScannerDataSchema(ma.SQLAlchemySchema): market = ma.Nested(MarketSchema) brand = ma.Nested(BrandSchema) category = ma.Nested(CategorySchema) period = ma.Nested(PeriodSchema) facts = ma.Nested(FactsInDataSchema, many=True) class Meta: model = JohnsonScannerDataModel dump_only = ("id",) # include_fk = False
27.916667
63
0.770149
74
670
6.891892
0.459459
0.107843
0
0
0
0
0
0
0
0
0
0
0.167164
670
23
64
29.130435
0.913978
0.026866
0
0
0
0
0.003091
0
0
0
0
0
0
1
0
false
0
0.4375
0
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
8a43f4805ca2bfbefacf005fd91befea7f1c3e71
492
py
Python
gen-cfg.py
magetron/secure-flow-prototype
c683939620fec889f882ea095d2b27e3e4bb98fe
[ "Apache-2.0" ]
null
null
null
gen-cfg.py
magetron/secure-flow-prototype
c683939620fec889f882ea095d2b27e3e4bb98fe
[ "Apache-2.0" ]
null
null
null
gen-cfg.py
magetron/secure-flow-prototype
c683939620fec889f882ea095d2b27e3e4bb98fe
[ "Apache-2.0" ]
null
null
null
from staticfg import CFGBuilder userCfg = CFGBuilder().build_from_file('user.py', './auction/user.py') bidCfg = CFGBuilder().build_from_file('bid.py', './auction/bid.py') auctionCfg = CFGBuilder().build_from_file('auction.py','./auction/auction.py') #auctionEventCfg = CFGBuilder().build_from_file('auction_event.py','./auction/auction_event.py') bidCfg.build_visual('bidCfg', 'pdf') auctionCfg.build_visual('auctionCfg', 'pdf') #auctionEventCfg.build_visual('auctionEventCfg.pdf', 'pdf')
41
96
0.760163
62
492
5.822581
0.274194
0.166205
0.210526
0.254848
0.166205
0
0
0
0
0
0
0
0.054878
492
11
97
44.727273
0.776344
0.310976
0
0
0
0
0.290801
0
0
0
0
0
0
1
0
false
0
0.166667
0
0.166667
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
8a5ab5ed3f3ad80694d11c3e4b2aca3d095ca892
2,400
py
Python
python/ray/rllib/ddpg2/ddpg_evaluator.py
songqing/ray
166000b089ee15d44635ebca00f12320f51ce587
[ "Apache-2.0" ]
1
2018-06-25T08:00:51.000Z
2018-06-25T08:00:51.000Z
python/ray/rllib/ddpg2/ddpg_evaluator.py
songqing/ray
166000b089ee15d44635ebca00f12320f51ce587
[ "Apache-2.0" ]
1
2018-01-26T05:11:04.000Z
2018-01-26T05:11:04.000Z
python/ray/rllib/ddpg2/ddpg_evaluator.py
songqing/ray
166000b089ee15d44635ebca00f12320f51ce587
[ "Apache-2.0" ]
1
2020-10-16T08:42:32.000Z
2020-10-16T08:42:32.000Z
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import ray from ray.rllib.ddpg2.models import DDPGModel from ray.rllib.models.catalog import ModelCatalog from ray.rllib.optimizers import PolicyEvaluator from ray.rllib.utils.filter import NoFilter from ray.rllib.utils.process_rollout import process_rollout from ray.rllib.utils.sampler import SyncSampler class DDPGEvaluator(PolicyEvaluator): def __init__(self, registry, env_creator, config): self.env = ModelCatalog.get_preprocessor_as_wrapper( registry, env_creator(config["env_config"])) # contains model, target_model self.model = DDPGModel(registry, self.env, config) self.sampler = SyncSampler( self.env, self.model.model, NoFilter(), config["num_local_steps"], horizon=config["horizon"]) def sample(self): """Returns a batch of samples.""" rollout = self.sampler.get_data() rollout.data["weights"] = np.ones_like(rollout.data["rewards"]) # since each sample is one step, no discounting needs to be applied; # this does not involve config["gamma"] samples = process_rollout( rollout, NoFilter(), gamma=1.0, use_gae=False) return samples def update_target(self): """Updates target critic and target actor.""" self.model.update_target() def compute_gradients(self, samples): """Returns critic, actor gradients.""" return self.model.compute_gradients(samples) def apply_gradients(self, grads): """Applies gradients to evaluator weights.""" self.model.apply_gradients(grads) def compute_apply(self, samples): grads, _ = self.compute_gradients(samples) self.apply_gradients(grads) def get_weights(self): """Returns model weights.""" return self.model.get_weights() def set_weights(self, weights): """Sets model weights.""" self.model.set_weights(weights) def get_completed_rollout_metrics(self): """Returns metrics on previously completed rollouts. Calling this clears the queue of completed rollout metrics. """ return self.sampler.get_metrics() RemoteDDPGEvaluator = ray.remote(DDPGEvaluator)
31.578947
77
0.675417
279
2,400
5.62724
0.365591
0.040127
0.04586
0.032484
0
0
0
0
0
0
0
0.001628
0.232083
2,400
75
78
32
0.850244
0.17875
0
0
0
0
0.024008
0
0
0
0
0
0
1
0.214286
false
0
0.261905
0
0.595238
0.02381
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
8a6044d55abd530531d11b4f87fb12061cb65199
370
py
Python
app/logic/httpcommon/Page.py
imvu/bluesteel
ab52133249a693b3cd2d8593c5d47408a3b0fce6
[ "MIT" ]
10
2017-01-13T06:28:04.000Z
2020-11-18T13:00:26.000Z
app/logic/httpcommon/Page.py
imvu/bluesteel
ab52133249a693b3cd2d8593c5d47408a3b0fce6
[ "MIT" ]
null
null
null
app/logic/httpcommon/Page.py
imvu/bluesteel
ab52133249a693b3cd2d8593c5d47408a3b0fce6
[ "MIT" ]
2
2018-03-29T14:10:53.000Z
2019-11-20T08:21:57.000Z
""" Page object file """ class Page(): """ Page object, it contains information about the pare we are refering, index, items per page, etc. """ page_index = 0 items_per_page = 0 def __init__(self, items_per_page, page_index): """ Creates the page """ self.page_index = int(page_index) self.items_per_page = int(items_per_page)
28.461538
108
0.648649
53
370
4.226415
0.433962
0.178571
0.267857
0.142857
0
0
0
0
0
0
0
0.007117
0.240541
370
12
109
30.833333
0.790036
0.356757
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0
0
0.666667
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
8a60852354e6415290eaf2e5371028a21ee46376
1,004
py
Python
models/AI-Model-Zoo/VAI-1.3-Model-Zoo-Code/PyTorch/pt_personreid-res18_market1501_176_80_1.1G_1.3/code/core/data_manager.py
guochunhe/Vitis-AI
e86b6efae11f8703ee647e4a99004dc980b84989
[ "Apache-2.0" ]
1
2020-12-18T14:49:19.000Z
2020-12-18T14:49:19.000Z
models/AI-Model-Zoo/VAI-1.3-Model-Zoo-Code/PyTorch/pt_personreid-res50_market1501_256_128_5.4G_1.3/code/core/data_manager.py
guochunhe/Vitis-AI
e86b6efae11f8703ee647e4a99004dc980b84989
[ "Apache-2.0" ]
null
null
null
models/AI-Model-Zoo/VAI-1.3-Model-Zoo-Code/PyTorch/pt_personreid-res50_market1501_256_128_5.4G_1.3/code/core/data_manager.py
guochunhe/Vitis-AI
e86b6efae11f8703ee647e4a99004dc980b84989
[ "Apache-2.0" ]
null
null
null
# Copyright 2019 Xilinx Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from __future__ import print_function, absolute_import import glob import re from os import path as osp from .market1501 import Market1501 __factory = { 'market1501': Market1501 } def get_names(): return list(__factory.keys()) def init_dataset(name, *args, **kwargs): if name not in __factory.keys(): raise KeyError("Unknown datasets: {}".format(name)) return __factory[name](*args, **kwargs)
27.888889
74
0.737052
144
1,004
5.027778
0.645833
0.082873
0.035912
0.044199
0
0
0
0
0
0
0
0.029126
0.179283
1,004
35
75
28.685714
0.849515
0.545817
0
0
0
0
0.067873
0
0
0
0
0
0
1
0.142857
false
0
0.357143
0.071429
0.642857
0.071429
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
8a62e622419e3b5175ed6a324e076188b956be4c
2,313
py
Python
azure-devops/azext_devops/vstsCompressed/service_hooks/v4_0/models/__init__.py
vijayraavi/azure-devops-cli-extension
88f1420c5815cb09bea15b050f4c553e0f326dad
[ "MIT" ]
null
null
null
azure-devops/azext_devops/vstsCompressed/service_hooks/v4_0/models/__init__.py
vijayraavi/azure-devops-cli-extension
88f1420c5815cb09bea15b050f4c553e0f326dad
[ "MIT" ]
37
2020-04-27T07:45:19.000Z
2021-04-05T07:27:15.000Z
azure-devops/azext_devops/vstsCompressed/service_hooks/v4_0/models/__init__.py
vijayraavi/azure-devops-cli-extension
88f1420c5815cb09bea15b050f4c553e0f326dad
[ "MIT" ]
null
null
null
# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import Consumer from .models import ConsumerAction from .models import Event from .models import EventTypeDescriptor from .models import ExternalConfigurationDescriptor from .models import FormattedEventMessage from .models import IdentityRef from .models import InputDescriptor from .models import InputFilter from .models import InputFilterCondition from .models import InputValidation from .models import InputValue from .models import InputValues from .models import InputValuesError from .models import InputValuesQuery from .models import Notification from .models import NotificationDetails from .models import NotificationResultsSummaryDetail from .models import NotificationsQuery from .models import NotificationSummary from .models import Publisher from .models import PublisherEvent from .models import PublishersQuery from .models import ReferenceLinks from .models import ResourceContainer from .models import SessionToken from .models import Subscription from .models import SubscriptionsQuery from .models import VersionedResource __all__ = [ 'Consumer', 'ConsumerAction', 'Event', 'EventTypeDescriptor', 'ExternalConfigurationDescriptor', 'FormattedEventMessage', 'IdentityRef', 'InputDescriptor', 'InputFilter', 'InputFilterCondition', 'InputValidation', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'Notification', 'NotificationDetails', 'NotificationResultsSummaryDetail', 'NotificationsQuery', 'NotificationSummary', 'Publisher', 'PublisherEvent', 'PublishersQuery', 'ReferenceLinks', 'ResourceContainer', 'SessionToken', 'Subscription', 'SubscriptionsQuery', 'VersionedResource', ]
33.042857
94
0.685257
187
2,313
8.454545
0.368984
0.183428
0.293485
0
0
0
0
0
0
0
0
0
0.137051
2,313
69
95
33.521739
0.792084
0.233031
0
0
0
0
0.255379
0.047565
0
0
0
0
0
1
0
false
0
0.483333
0
0.483333
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
8a643abfeb244244f7979e846782a5b379e9f35e
935
py
Python
pizdyuk/pzd_logging.py
DeathAdder1999/Pizdyuk
3fd7c71508c79b36e3cc801d78cd1a87eee5aa0b
[ "Apache-2.0" ]
1
2021-05-06T20:23:08.000Z
2021-05-06T20:23:08.000Z
pizdyuk/pzd_logging.py
aufdnb/Pizdyuk
75096ffa54df831eb05360d7b39f49000d466f80
[ "Apache-2.0" ]
null
null
null
pizdyuk/pzd_logging.py
aufdnb/Pizdyuk
75096ffa54df831eb05360d7b39f49000d466f80
[ "Apache-2.0" ]
null
null
null
import datetime as date from pzd_utils import datetime_to_str class PizdyukLogger: __logger = None def __init__(self): global __logger if self.__logger: raise RuntimeError("Logger instance already exists") @staticmethod def get_logger(): global __logger if not PizdyukLogger._PizdyukLogger__logger: PizdyukLogger._PizdyukLogger__logger = PizdyukLogger() return PizdyukLogger._PizdyukLogger__logger def log_info(self, msg): self.__log(msg, "INFO") def log_warning(self, warning): self.__log(warning, "WARNING") def log_error(self, error): self.__log(error, "ERROR") def log_fatal(self, fatal): self.__log(fatal, "FATAL") def __log(self, msg, lvl): date_str = datetime_to_str(date.datetime.now()) log = "[{0}] [{1}] {2}".format(lvl, date_str, msg) print(log)
25.27027
66
0.632086
108
935
5.074074
0.37037
0.054745
0.175182
0.164234
0
0
0
0
0
0
0
0.00438
0.26738
935
37
67
25.27027
0.79562
0
0
0.076923
0
0
0.070513
0
0
0
0
0
0
1
0.269231
false
0
0.076923
0
0.461538
0.038462
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
8a65b0ad04c9a2a75abc3c11ac9fc679788fe298
4,318
py
Python
app/api/v1/views/auth_views.py
emdeechege/Questionaire-API
1dd05dc25f96ea8ecdce82fe28449ea684991251
[ "MIT" ]
null
null
null
app/api/v1/views/auth_views.py
emdeechege/Questionaire-API
1dd05dc25f96ea8ecdce82fe28449ea684991251
[ "MIT" ]
20
2019-01-08T19:16:45.000Z
2019-08-22T10:21:43.000Z
app/api/v1/views/auth_views.py
emdeechege/Questioner-API
1dd05dc25f96ea8ecdce82fe28449ea684991251
[ "MIT" ]
1
2019-01-11T10:13:42.000Z
2019-01-11T10:13:42.000Z
from flask import jsonify, Blueprint, request, json, make_response from werkzeug.security import generate_password_hash, check_password_hash from datetime import datetime from ..utils.validators import Validation from ..models.auth_models import Users v1_auth_blueprint = Blueprint('auth', __name__, url_prefix='/api/v1') USER = Users() VALIDATOR = Validation() @v1_auth_blueprint.route('/signup', methods=['POST']) def signup(): """View that controls creation of new users""" try: data = request.get_json() except: return jsonify({ "status": 400, "message": "Invalid input" }), 400 firstname = data.get('firstname') lastname = data.get('lastname') othername = data.get('othername') email = data.get('email') phone_number = data.get('phone_number') username = data.get('username') is_admin = data.get('is_admin') password = data.get('password') if not firstname or not firstname.split(): return make_response(jsonify({ "status": 400, "message": "Firstname is required" })), 400 if not lastname or not lastname.split(): return make_response(jsonify({ "status": 400, "message": "Lastname is required" })), 400 if not email or not email.split(): return make_response(jsonify({ "status": 400, "message": "Email is required" })), 400 if not phone_number: return make_response(jsonify({ "status": 400, "message": "Phone number is required" })), 400 if not username or not username.split(): return make_response(jsonify({ "status": 400, "message": "Username is required" })), 400 if not password or not password.split(): return make_response(jsonify({ "status": 400, "message": "Password is required" })), 400 if not VALIDATOR.validate_phone_number(phone_number): return jsonify({ "status": 400, "message": "Please input valid phone number" }), 400 if VALIDATOR.validate_password(password): return jsonify({ "status": 400, "message": "Password not valid" }), 400 if not VALIDATOR.validate_email(email): return jsonify({ "status": 400, "message": "Invalid email" }), 400 if VALIDATOR.username_exists(username): return jsonify({ "status": 400, "message": "Username exists" }), 400 if VALIDATOR.email_exists(email): return jsonify({ "status": 400, "message": "Email exists" }), 400 password = generate_password_hash( password, method='pbkdf2:sha256', salt_length=8) res = USER.signup( firstname, lastname, othername, email, phone_number, username, is_admin, password) return jsonify({ "status": 201, "data": [{ "firstname": firstname, "lastname": lastname, "othername": othername, "email": email, "phone_number": phone_number, "username": username, "is_admin": is_admin }] }), 201 @v1_auth_blueprint.route('/login', methods=['POST']) def login(): """ A view to control users login """ try: data = request.get_json() except: return make_response(jsonify({ "status": 400, "message": "Wrong input" })), 400 username = data.get('username') password = data.get('password') if not username: return make_response(jsonify({ "status": 400, "message": "Username is required" })), 400 if not password: return make_response(jsonify({ "status": 400, "message": "Password is required" })), 400 if not VALIDATOR.username_exists(username): return jsonify({ "status": 404, "message": "User does not exist" }), 404 auth_token = user.generate_auth_token(username) return make_response(jsonify({ "status": 200, "message": 'Logged in successfuly', "token": auth_token })), 200
28.596026
90
0.568782
445
4,318
5.395506
0.2
0.097459
0.099958
0.14369
0.453978
0.371095
0.284465
0.187422
0.125781
0.125781
0
0.039275
0.310097
4,318
150
91
28.786667
0.7667
0.016443
0
0.484375
1
0
0.174262
0
0
0
0
0
0
1
0.015625
false
0.09375
0.039063
0
0.195313
0.03125
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
8a69d4b012c5607f3bca22996d7b21d1f2aed261
2,049
py
Python
demos/netmiko_textfsm.py
ryanaa08/NPA
45173efa60713858bb8b1d884fe12c50fe69920c
[ "BSD-Source-Code" ]
4
2019-01-15T16:15:26.000Z
2021-12-05T16:03:15.000Z
demos/netmiko_textfsm.py
krishnakadiyala/NPAcourse
74f097107839d990b44adcee69d4f949696a332c
[ "BSD-Source-Code" ]
null
null
null
demos/netmiko_textfsm.py
krishnakadiyala/NPAcourse
74f097107839d990b44adcee69d4f949696a332c
[ "BSD-Source-Code" ]
2
2019-07-04T16:38:19.000Z
2020-01-31T15:38:27.000Z
# make sure templates are present and netmiko knows about them # git clone https://github.com/networktocode/ntc-templates # export NET_TEXTFSM=/home/ntc/ntc-templates/templates/ # see https://github.com/networktocode/ntc-templates/tree/master/templates # for list of templates from netmiko import ConnectHandler import json user = 'ntc' pwd = 'ntc123' d_type = 'cisco_ios' csr1 = ConnectHandler(ip='csr1', username=user, password=pwd, device_type=d_type) sh_ip_int_br = csr1.send_command("show ip int brief", use_textfsm=True) # [{'status': 'up', 'intf': 'GigabitEthernet1', 'ipaddr': '10.0.0.51', 'proto': 'up'}, {'status': 'up', 'intf': 'GigabitEthernet2', 'ipaddr': 'unassigned', 'proto': 'up'}, {'status': 'up', 'intf': 'GigabitEthernet3', 'ipaddr': 'unassigned', 'proto': 'up'}, {'status': 'up', 'intf': 'GigabitEthernet4', 'ipaddr': '5.12.1.1', 'proto': 'up'}, {'status': 'up', 'intf': 'Loopback100', 'ipaddr': '10.200.1.20', 'proto': 'up'}] # is type list print (type(sh_ip_int_br)) # list of dicts print (type(sh_ip_int_br[0])) for each_dict in sh_ip_int_br: print "\n" for key in each_dict.keys(): print key for each_dict in sh_ip_int_br: print "\n" for key, value in each_dict.items(): print key + " is " + value sh_ver_ios = csr1.send_command("show version", use_textfsm=True) # [{'running_image': 'packages.conf', 'hostname': 'csr1', 'uptime': '6 hours, 59 minutes', 'config_register': '0x2102', 'hardware': ['CSR1000V'], 'version': '16.6.2', 'serial': ['9KIBQAQ3OPE'], 'rommon': 'IOS-XE'}] # print the json nicely print (json.dumps(sh_ver_ios, indent=4)) print sh_ver_ios # list print type(sh_ver_ios) # each item is a dict print type(sh_ver_ios[0]) # list of dicts with some nested lists with the dicts for each_dict in sh_ver_ios: print "\n" for key, value in each_dict.items(): if type(value) is list: print key + " is " for list_entry in value: print list_entry if type(value) is str: print key + " is " + value
35.947368
420
0.660322
307
2,049
4.257329
0.387622
0.022953
0.036725
0.03443
0.309105
0.232594
0.145371
0.091813
0.091813
0.052028
0
0.032468
0.173255
2,049
56
421
36.589286
0.739079
0.499756
0
0.290323
0
0
0.068249
0
0
0
0
0
0
0
null
null
0.032258
0.064516
null
null
0.451613
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
2
8a746baf4af656a91220d07018cb78e6eb2e1b1f
119
py
Python
xortool/__init__.py
runapp/xortool
9dac27387e7883775936a31e67598eaba182e053
[ "MIT" ]
14
2017-06-14T06:10:07.000Z
2019-02-22T03:21:15.000Z
Cryptography/tools/xortool-master/xortool/__init__.py
rookie-12/My-Gray-Hacker-Resources
e9b10ac7b0e557a9e624a5a6e761f9af4488d777
[ "MIT" ]
1
2021-04-30T21:19:32.000Z
2021-04-30T21:19:32.000Z
Cryptography/tools/xortool-master/xortool/__init__.py
rookie-12/My-Gray-Hacker-Resources
e9b10ac7b0e557a9e624a5a6e761f9af4488d777
[ "MIT" ]
7
2015-10-01T09:47:05.000Z
2022-01-21T14:25:37.000Z
#!/usr/bin/env python #-*- coding:utf-8 -*- __all__ = ["args", "colors", "libcolors", "routine"] __version__ = "0.96"
19.833333
52
0.605042
15
119
4.266667
1
0
0
0
0
0
0
0
0
0
0
0.038462
0.12605
119
5
53
23.8
0.576923
0.336134
0
0
0
0
0.38961
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
8a86ee599744eb8c45294e523b8309fa29706768
261
py
Python
python/EXERCICIO 96 - FUNCAO QUE CALCULA A AREA.py
debor4h/exerciciosPython
a18d88c6e98bc49005bfcb8badeb712007c16d69
[ "MIT" ]
1
2022-03-15T02:25:17.000Z
2022-03-15T02:25:17.000Z
python/EXERCICIO 96 - FUNCAO QUE CALCULA A AREA.py
debor4h/exerciciosPython
a18d88c6e98bc49005bfcb8badeb712007c16d69
[ "MIT" ]
null
null
null
python/EXERCICIO 96 - FUNCAO QUE CALCULA A AREA.py
debor4h/exerciciosPython
a18d88c6e98bc49005bfcb8badeb712007c16d69
[ "MIT" ]
null
null
null
def area(msg):#declaracao da funcao com o parametro msg print(msg)#aqui msg e a area print('Controle de Terrenos') print('-' * 20) l = float(input('Largura (m): ')) c = float(input('Comprimento (m): ')) area(f'A área do seu terreno {l}X{c} é de {l*c}m².')
26.1
55
0.64751
48
261
3.520833
0.666667
0.118343
0
0
0
0
0
0
0
0
0
0.013761
0.164751
261
9
56
29
0.761468
0.218391
0
0
0
0.142857
0.465347
0
0
0
0
0
0
1
0.142857
false
0
0
0
0.142857
0.428571
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
8a8789db154d951e04619fad043530fa0eb6fd39
935
py
Python
amazon/model_api/migrations/0005_remove_order_datetimecreated_alter_order__id_and_more.py
gabrielkarras/SOEN341
da7241abd894bda4d5f7465b3de70e51afacf3f5
[ "MIT" ]
3
2022-01-16T19:12:37.000Z
2022-01-25T18:50:15.000Z
amazon/model_api/migrations/0005_remove_order_datetimecreated_alter_order__id_and_more.py
gabrielkarras/SOEN341
da7241abd894bda4d5f7465b3de70e51afacf3f5
[ "MIT" ]
83
2022-01-16T18:57:50.000Z
2022-03-30T00:44:35.000Z
amazon/model_api/migrations/0005_remove_order_datetimecreated_alter_order__id_and_more.py
gabrielkarras/SOEN341
da7241abd894bda4d5f7465b3de70e51afacf3f5
[ "MIT" ]
null
null
null
# Generated by Django 4.0.1 on 2022-04-07 01:20 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('model_api', '0004_remove_order_created_remove_order_id_and_more'), ] operations = [ migrations.RemoveField( model_name='order', name='dateTimeCreated', ), migrations.AlterField( model_name='order', name='_id', field=models.AutoField(editable=False, primary_key=True, serialize=False), ), migrations.AlterField( model_name='orderedproduct', name='_id', field=models.AutoField(editable=False, primary_key=True, serialize=False), ), migrations.AlterField( model_name='orderedproduct', name='price', field=models.CharField(blank=True, max_length=20, null=True), ), ]
28.333333
86
0.594652
93
935
5.784946
0.526882
0.066915
0.139405
0.16171
0.416357
0.416357
0.416357
0.416357
0.416357
0.416357
0
0.031818
0.294118
935
32
87
29.21875
0.783333
0.048128
0
0.576923
1
0
0.138514
0.056306
0
0
0
0
0
1
0
false
0
0.038462
0
0.153846
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
8a9030707f61608d50658393cbb2098e6e4bfbb7
300
py
Python
stubs/_pytest/_code.py
questioneer-ltd/scrut
8cb914c9c35eee0d9e17a6051683c970db2649b5
[ "MIT" ]
null
null
null
stubs/_pytest/_code.py
questioneer-ltd/scrut
8cb914c9c35eee0d9e17a6051683c970db2649b5
[ "MIT" ]
null
null
null
stubs/_pytest/_code.py
questioneer-ltd/scrut
8cb914c9c35eee0d9e17a6051683c970db2649b5
[ "MIT" ]
null
null
null
"""Type stubs for _pytest._code.""" # This class actually has more functions than are specified here. # We don't use these features, so I don't think its worth including # them in our type stub. We can always change it later. class ExceptionInfo: @property def value(self) -> Exception: ...
33.333333
67
0.72
47
300
4.553191
0.893617
0.037383
0
0
0
0
0
0
0
0
0
0
0.19
300
8
68
37.5
0.880658
0.713333
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
8a9705a2e78a0cfbf1bbd48dd0bfdf9b979f2917
3,751
py
Python
emission/clients/choice/choice.py
Andrew-Tan/e-mission-server
91d59bee86e63d803e401f10f4b6a2502effedda
[ "BSD-3-Clause" ]
null
null
null
emission/clients/choice/choice.py
Andrew-Tan/e-mission-server
91d59bee86e63d803e401f10f4b6a2502effedda
[ "BSD-3-Clause" ]
1
2017-08-31T19:54:16.000Z
2017-08-31T19:54:16.000Z
emission/clients/choice/choice.py
Andrew-Tan/e-mission-server
91d59bee86e63d803e401f10f4b6a2502effedda
[ "BSD-3-Clause" ]
null
null
null
# Standard imports import logging import math import json from uuid import UUID from datetime import datetime, timedelta import time # Our imports from emission.core.get_database import get_trip_db, get_section_db import emission.analysis.result.carbon as carbon import emission.core.common as common import emission.net.api.stats as stats from emission.core.wrapper.user import User from emission.clients.leaderboard import leaderboard from emission.clients.gamified import gamified from emission.clients.recommendation import recommendation from emission.clients.commontrips import commontrips from emission.clients.data import data # TODO: Consider subclassing to provide client specific user functions def setCurrView(uuid, newView): user = User.fromUUID(uuid) user.setClientSpecificProfileFields({'curr_view': newView}) stats.storeResultEntry(uuid, stats.STAT_VIEW_CHOICE, time.time(), newView) def getCurrView(uuid): user = User.fromUUID(uuid) profile = user.getProfile() if profile is None: logging.debug("profile is None, returning data") return "data" logging.debug("profile.get('curr_view', 'dummy') is %s" % profile.get("curr_view", "data")) return profile.get("curr_view", "data") def switchResultDisplay(params): logging.debug("params = %s" % (params)) print "params = %s" % (params['uuid']) try: uuid = UUID(params['uuid']) except: uuid = "temp" ## For testing purposes newView = params['new_view'] logging.debug("Changing choice for user %s to %s" % (uuid, newView)) setCurrView(uuid, newView) # TODO: Add stats about the switch as part of the final stats-adding pass return {'curr_view': newView } def getResult(user_uuid): # This is in here, as opposed to the top level as recommended by the PEP # because then we don't have to worry about loading bottle in the unit tests from bottle import template import base64 from dao.user import User from dao.client import Client user = User.fromUUID(user_uuid) renderedTemplate = template("clients/choice/result_template.html", variables = json.dumps({'curr_view': getCurrView(user_uuid), 'uuid': str(user_uuid), 'client_key': Client("choice").getClientKey()}), gameResult = base64.b64encode(gamified.getResult(user_uuid)), leaderboardResult = base64.b64encode(leaderboard.getResult(user_uuid)), dataResult = base64.b64encode(data.getResult(user_uuid)), commonTripsResult = base64.b64encode(commontrips.getResult(user_uuid)), recommendationResult = base64.b64encode(recommendation.getResult(user_uuid))) return renderedTemplate # These are copy/pasted from our first client, the carshare study def getSectionFilter(uuid): # We are not planning to do any filtering for this study. Bring on the worst! return [] def clientSpecificSetters(uuid, sectionId, predictedModeMap): return None def getClientConfirmedModeField(): return None # TODO: Simplify this. runBackgroundTasks are currently only invoked from the # result precomputation code. We could change that code to pass in the day, and # remove this interface. Extra credit: should we pass in the day, or a date # range? Passing in the date range could make it possible for us to run the # scripts more than once a day... def runBackgroundTasks(uuid): today = datetime.now().date() runBackgroundTasksForDay(uuid, today) def runBackgroundTasksForDay(uuid, today): leaderboard.runBackgroundTasksForDay(uuid, today) gamified.runBackgroundTasksForDay(uuid, today) data.runBackgroundTasksForDay(uuid, today)
39.484211
103
0.724607
467
3,751
5.766595
0.374732
0.026736
0.037876
0.020052
0.016339
0
0
0
0
0
0
0.00723
0.18875
3,751
94
104
39.904255
0.877752
0.216476
0
0.058824
0
0
0.087923
0.020185
0
0
0
0.010638
0
0
null
null
0
0.294118
null
null
0.014706
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
1
0
0
0
0
0
0
0
0
2
8a98a3e8f4fe8ffe2c483dbdada681b7ff1782e2
490
py
Python
stubs/micropython-esp32-1_12/urequests.py
RonaldHiemstra/micropython-stubs
d97f879b01f6687baaebef1c7e26a80909c3cff3
[ "MIT" ]
38
2020-10-18T21:59:44.000Z
2022-03-17T03:03:28.000Z
stubs/micropython-esp32-1_12/urequests.py
RonaldHiemstra/micropython-stubs
d97f879b01f6687baaebef1c7e26a80909c3cff3
[ "MIT" ]
176
2020-10-18T14:31:03.000Z
2022-03-30T23:22:39.000Z
stubs/micropython-esp32-1_12/urequests.py
RonaldHiemstra/micropython-stubs
d97f879b01f6687baaebef1c7e26a80909c3cff3
[ "MIT" ]
6
2020-12-28T21:11:12.000Z
2022-02-06T04:07:50.000Z
""" Module: 'urequests' on esp32 1.12.0 """ # MCU: (sysname='esp32', nodename='esp32', release='1.12.0', version='v1.12 on 2019-12-20', machine='ESP32 module (spiram) with ESP32') # Stubber: 1.3.2 class Response: '' def close(): pass content = None def json(): pass text = None def delete(): pass def get(): pass def head(): pass def patch(): pass def post(): pass def put(): pass def request(): pass usocket = None
12.564103
135
0.563265
68
490
4.058824
0.558824
0.152174
0.028986
0
0
0
0
0
0
0
0
0.090395
0.277551
490
38
136
12.894737
0.689266
0.377551
0
0.391304
0
0
0
0
0
0
0
0
0
1
0.391304
false
0.391304
0
0
0.521739
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
8aa779160503c74402f97032140e39891a948a62
1,279
py
Python
tests/test_toggle.py
ConnectionMaster/robotpy-wpilib-utilities
b62e563c7df113e9e513a36b9039f47f34157be1
[ "BSD-3-Clause" ]
14
2015-10-20T02:56:17.000Z
2020-03-17T04:44:12.000Z
tests/test_toggle.py
robotpy/robotpy-wpilib-utilities
80f753a1d315d234d6ecdd79be544ec01ca091ae
[ "BSD-3-Clause" ]
107
2015-01-26T23:47:10.000Z
2022-03-16T13:57:36.000Z
tests/test_toggle.py
ConnectionMaster/robotpy-wpilib-utilities
b62e563c7df113e9e513a36b9039f47f34157be1
[ "BSD-3-Clause" ]
21
2016-01-01T01:44:40.000Z
2022-03-15T18:00:35.000Z
from robotpy_ext.control.toggle import Toggle from robotpy_ext.misc.precise_delay import NotifierDelay class FakeJoystick: def __init__(self): self._pressed = [False] * 2 def getRawButton(self, num): return self._pressed[num] def press(self, num): self._pressed[num] = True def release(self, num): self._pressed[num] = False def test_toggle(): joystick = FakeJoystick() toggleButton = Toggle(joystick, 0) toggleButton2 = Toggle(joystick, 1) assert toggleButton.off joystick.press(0) assert toggleButton.on assert toggleButton2.off joystick.release(0) assert toggleButton.on joystick.press(0) assert toggleButton.off joystick.release(0) assert toggleButton.off joystick.press(1) assert toggleButton.off assert toggleButton2.on def test_toggle_debounce(): # TODO: use simulated time delay = NotifierDelay(0.5) joystick = FakeJoystick() toggleButton = Toggle(joystick, 1, 0.1) assert toggleButton.off joystick.press(1) assert toggleButton.on joystick.release(1) joystick.press(1) joystick.release(1) assert toggleButton.on delay.wait() assert toggleButton.on joystick.press(1) assert toggleButton.off
23.685185
56
0.689601
152
1,279
5.710526
0.263158
0.228111
0.131336
0.101382
0.510369
0.271889
0.12212
0.12212
0
0
0
0.021084
0.221267
1,279
53
57
24.132075
0.850402
0.018765
0
0.534884
0
0
0
0
0
0
0
0.018868
0.302326
1
0.139535
false
0
0.046512
0.023256
0.232558
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
2
8aaee662db93c29bfc4e01c664b5f8c132a76382
1,331
py
Python
setup.py
richardARPANET/persistent-celery-beat-scheduler
d2cbdd12394eec282ccb97ac5ff894353c2e4ffd
[ "Apache-2.0" ]
4
2018-04-04T13:03:08.000Z
2018-04-16T18:50:45.000Z
setup.py
richardARPANET/persistent-celery-beat-scheduler
d2cbdd12394eec282ccb97ac5ff894353c2e4ffd
[ "Apache-2.0" ]
null
null
null
setup.py
richardARPANET/persistent-celery-beat-scheduler
d2cbdd12394eec282ccb97ac5ff894353c2e4ffd
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/env python # -*- coding: utf-8 -* import os from setuptools import find_packages, setup # allow setup.py to be run from any path os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) with open('requirements.txt') as f: install_requires = f.read().splitlines() setup( name='persistent-celery-beat-scheduler', version='0.1.1.dev0', packages=find_packages('src', exclude=('tests',)), package_dir={'': 'src'}, include_package_data=True, zip_safe=False, description=( 'Celery Beat Scheduler that stores the scheduler data in Redis.' ), author='Richard O\'Dwyer', author_email='[email protected]', license='Apache 2', long_description='https://github.com/richardasaurus/persistent-celery-beat-scheduler', install_requires=install_requires, classifiers=[ 'Intended Audience :: Developers', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Topic :: Internet :: WWW/HTTP', ], )
31.690476
90
0.643877
157
1,331
5.363057
0.598726
0.157957
0.207838
0.185273
0.064133
0
0
0
0
0
0
0.016083
0.20586
1,331
41
91
32.463415
0.780511
0.060105
0
0
0
0
0.46234
0.025641
0
0
0
0
0
1
0
false
0
0.060606
0
0.060606
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
8ab47b215dd213a094ad1c94dce6a5f882e00bd7
695
py
Python
examples/tellurium-files/linearChain.py
ShaikAsifullah/distributed-tellurium
007e9b3842b614edd34908c001119c6da1d41897
[ "Apache-2.0" ]
1
2019-06-19T04:40:33.000Z
2019-06-19T04:40:33.000Z
examples/tellurium-files/linearChain.py
ShaikAsifullah/distributed-tellurium
007e9b3842b614edd34908c001119c6da1d41897
[ "Apache-2.0" ]
null
null
null
examples/tellurium-files/linearChain.py
ShaikAsifullah/distributed-tellurium
007e9b3842b614edd34908c001119c6da1d41897
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- """ Linear chain of reactions. """ from __future__ import print_function, division import tellurium as te model = ''' model feedback() // Reactions: J0: $X0 -> S1; (VM1 * (X0 - S1/Keq1))/(1 + X0 + S1 + S4^h); J1: S1 -> S2; (10 * S1 - 2 * S2) / (1 + S1 + S2); J2: S2 -> S3; (10 * S2 - 2 * S3) / (1 + S2 + S3); J3: S3 -> S4; (10 * S3 - 2 * S4) / (1 + S3 + S4); J4: S4 -> $X1; (V4 * S4) / (KS4 + S4); // Species initializations: S1 = 0; S2 = 0; S3 = 0; S4 = 0; X0 = 10; X1 = 0; // Variable initialization: VM1 = 10; Keq1 = 10; h = 10; V4 = 2.5; KS4 = 0.5; end''' r = te.loada(model) result = r.simulate(0, 40, 500) r.plotWithLegend(result)
24.821429
64
0.515108
112
695
3.151786
0.455357
0.033994
0
0
0
0
0
0
0
0
0
0.167323
0.269065
695
27
65
25.740741
0.527559
0.070504
0
0
0
0.263158
0.738245
0
0
0
0
0
0
1
0
false
0
0.105263
0
0.105263
0.052632
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
8ac1dd9d7bf008d9dc5cac34b41e0856589877ec
358
py
Python
load/__init__.py
andrewp-as-is/load.py
6ad643d82379a63f9c79d0dd994101ff0b490183
[ "Unlicense" ]
null
null
null
load/__init__.py
andrewp-as-is/load.py
6ad643d82379a63f9c79d0dd994101ff0b490183
[ "Unlicense" ]
null
null
null
load/__init__.py
andrewp-as-is/load.py
6ad643d82379a63f9c79d0dd994101ff0b490183
[ "Unlicense" ]
null
null
null
__all__ = ["load"] import imp import importlib def load(name, path): """Load and initialize a module implemented as a Python source file and return its module object""" if hasattr(importlib, "machinery"): loader = importlib.machinery.SourceFileLoader(name, path) return loader.load_module() return imp.load_source(name, path)
25.571429
103
0.709497
46
358
5.391304
0.543478
0.096774
0
0
0
0
0
0
0
0
0
0
0.195531
358
13
104
27.538462
0.861111
0.259777
0
0
0
0
0.050193
0
0
0
0
0
0
1
0.125
false
0
0.5
0
0.875
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
8ac9d8732422cf52f01f2fd448863e8bbd5e7b4d
2,879
py
Python
sovrin/test/did/helper.py
sovrin-foundation/old-sovrin
d4e705054b7252c62fea00114060035c6eb314a4
[ "Apache-2.0" ]
3
2017-07-19T14:26:31.000Z
2020-05-16T16:09:37.000Z
sovrin/test/did/helper.py
sovrin-foundation/old-sovrin
d4e705054b7252c62fea00114060035c6eb314a4
[ "Apache-2.0" ]
null
null
null
sovrin/test/did/helper.py
sovrin-foundation/old-sovrin
d4e705054b7252c62fea00114060035c6eb314a4
[ "Apache-2.0" ]
3
2017-10-28T08:19:00.000Z
2021-06-06T10:48:55.000Z
import base58 from plenum.common.signer_did import DidSigner from plenum.common.verifier import DidVerifier from plenum.common.eventually import eventually from plenum.test.helper import assertEquality from sovrin.common.identity import Identity MsgForSigning = {'sender': 'Mario', 'msg': 'Lorem ipsum'} def signMsg(wallet, idr): return wallet.signMsg(MsgForSigning, identifier=idr) def verifyMsg(verifier, sig): sig = base58.b58decode(sig) return verifier.verifyMsg(sig, MsgForSigning) def chkVerifyForRetrievedIdentity(signerWallet, verifierWallet, idr): sig = signMsg(signerWallet, idr) verkey = verifierWallet.getIdentity(idr).verkey assert verifyMsg(DidVerifier(verkey, idr), sig) def updateWalletIdrWithFullKeySigner(wallet, idr): newSigner = DidSigner(identifier=idr) wallet.updateSigner(idr, newSigner) assertEquality(newSigner.verkey, wallet.getVerkey(idr)) checkFullVerkeySize(wallet.getVerkey(idr)) return newSigner.verkey def updateSovrinIdrWithFullKey(looper, senderWallet, senderClient, ownerWallet, idr, fullKey): idy = Identity(identifier=idr, verkey=fullKey) senderWallet.updateSponsoredIdentity(idy) # TODO: What if the request fails, there must be some rollback mechanism assert senderWallet.getSponsoredIdentity(idr).seqNo is None reqs = senderWallet.preparePending() senderClient.submitReqs(*reqs) def chk(): assert senderWallet.getSponsoredIdentity(idr).seqNo is not None looper.run(eventually(chk, retryWait=1, timeout=5)) return ownerWallet def fetchFullVerkeyFromSovrin(looper, senderWallet, senderClient, ownerWallet, idr): identity = Identity(identifier=idr) req = senderWallet.requestIdentity(identity, sender=senderWallet.defaultId) senderClient.submitReqs(req) def chk(): retrievedVerkey = senderWallet.getIdentity(idr).verkey assertEquality(retrievedVerkey, ownerWallet.getVerkey(idr)) checkFullVerkeySize(retrievedVerkey) looper.run(eventually(chk, retryWait=1, timeout=5)) def checkDidSize(did): # A base58 encoding of 32 bytes string can be either 44 bytes or 43 bytes, # since the did takes first 16 bytes, base58 of did is either # 21 or 22 characters assert len(did) == 21 or len(did) == 22 def checkAbbrVerkeySize(verkey): # A base58 encoding of 32 bytes string can be either 44 bytes or 43 bytes, # since the abbreviated verkey takes last 16 bytes, base58 of abbreviated # verkey is either 21 or 22 characters and since its prefixed by a `~` its # length will be either 23 or 22 assert len(verkey) == 23 or len(verkey) == 22 def checkFullVerkeySize(verkey): # A base58 encoding of 32 bytes string can be either 44 bytes or 43 bytes. assert len(verkey) == 44 or len(verkey) == 43
35.109756
79
0.733241
338
2,879
6.242604
0.328402
0.018957
0.022749
0.024171
0.24218
0.200474
0.132227
0.132227
0.094313
0.094313
0
0.028157
0.185828
2,879
81
80
35.54321
0.872014
0.189302
0
0.081633
0
0
0.010757
0
0
0
0
0.012346
0.183673
1
0.22449
false
0
0.122449
0.020408
0.428571
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
0
0
0
2
8ad221c93a5fce8d825d0b6b80fc2f401b373d9b
7,627
py
Python
gn/gn_to_bp.py
despairblue/esy-skia
1c81aac298602f8e872c1079db92868199b6394f
[ "BSD-3-Clause" ]
2,151
2020-04-18T07:31:17.000Z
2022-03-31T08:39:18.000Z
gn/gn_to_bp.py
despairblue/esy-skia
1c81aac298602f8e872c1079db92868199b6394f
[ "BSD-3-Clause" ]
395
2020-04-18T08:22:18.000Z
2021-12-08T13:04:49.000Z
gn/gn_to_bp.py
despairblue/esy-skia
1c81aac298602f8e872c1079db92868199b6394f
[ "BSD-3-Clause" ]
338
2020-04-18T08:03:10.000Z
2022-03-29T12:33:22.000Z
#!/usr/bin/env python # # Copyright 2016 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. # Generate Android.bp for Skia from GN configuration. import json import os import pprint import string import subprocess import tempfile import gn_to_bp_utils # First we start off with a template for Android.bp, # with holes for source lists and include directories. bp = string.Template('''// This file is autogenerated by gn_to_bp.py. cc_library_static { name: "libskia", cflags: [ $cflags ], cppflags:[ $cflags_cc ], export_include_dirs: [ $export_includes ], local_include_dirs: [ $local_includes ], srcs: [ $srcs ], arch: { arm: { srcs: [ $arm_srcs ], neon: { srcs: [ $arm_neon_srcs ], }, }, arm64: { srcs: [ $arm64_srcs ], }, mips: { srcs: [ $none_srcs ], }, mips64: { srcs: [ $none_srcs ], }, x86: { srcs: [ $x86_srcs ], cflags: [ // Clang seems to think new/malloc will only be 4-byte aligned // on x86 Android. We're pretty sure it's actually 8-byte // alignment. tests/OverAlignedTest.cpp has more information, // and should fail if we're wrong. "-Wno-over-aligned" ], }, x86_64: { srcs: [ $x86_srcs ], }, }, defaults: ["skia_deps", "skia_pgo", ], } // Build libskia with PGO by default. // Location of PGO profile data is defined in build/soong/cc/pgo.go // and is separate from skia. // To turn it off, set ANDROID_PGO_NO_PROFILE_USE environment variable // or set enable_profile_use property to false. cc_defaults { name: "skia_pgo", pgo: { instrumentation: true, profile_file: "hwui/hwui.profdata", benchmarks: ["hwui", "skia"], enable_profile_use: true, }, } // "defaults" property to disable profile use for Skia tools and benchmarks. cc_defaults { name: "skia_pgo_no_profile_use", defaults: [ "skia_pgo", ], pgo: { enable_profile_use: false, }, } cc_defaults { name: "skia_deps", shared_libs: [ "libEGL", "libGLESv2", "libdng_sdk", "libexpat", "libft2", "libheif", "libicui18n", "libicuuc", "libjpeg", "liblog", "libpiex", "libpng", "libvulkan", "libz", "libcutils", "libnativewindow", ], static_libs: [ "libarect", "libsfntly", "libwebp-decode", "libwebp-encode", ], group_static_libs: true, } cc_defaults { name: "skia_tool_deps", defaults: [ "skia_deps", "skia_pgo_no_profile_use" ], static_libs: [ "libjsoncpp", "libskia", ], cflags: [ "-Wno-unused-parameter", "-Wno-unused-variable", ], } cc_test { name: "skia_dm", defaults: [ "skia_tool_deps" ], local_include_dirs: [ $dm_includes ], srcs: [ $dm_srcs ], shared_libs: [ "libbinder", "libutils", ], } cc_test { name: "skia_nanobench", defaults: [ "skia_tool_deps" ], local_include_dirs: [ $nanobench_includes ], srcs: [ $nanobench_srcs ], data: [ "resources/*", ], }''') # We'll run GN to get the main source lists and include directories for Skia. gn_args = { 'is_official_build': 'true', 'skia_enable_tools': 'true', 'skia_enable_skottie': 'false', # requires rapidjson third-party 'skia_use_libheif': 'true', 'skia_use_vulkan': 'true', 'target_cpu': '"none"', 'target_os': '"android"', 'skia_vulkan_header': '"Skia_Vulkan_Android.h"', } js = gn_to_bp_utils.GenerateJSONFromGN(gn_args) def strip_slashes(lst): return {str(p.lstrip('/')) for p in lst} srcs = strip_slashes(js['targets']['//:skia']['sources']) cflags = strip_slashes(js['targets']['//:skia']['cflags']) cflags_cc = strip_slashes(js['targets']['//:skia']['cflags_cc']) local_includes = strip_slashes(js['targets']['//:skia']['include_dirs']) export_includes = strip_slashes(js['targets']['//:public']['include_dirs']) defines = [str(d) for d in js['targets']['//:skia']['defines']] dm_srcs = strip_slashes(js['targets']['//:dm']['sources']) dm_includes = strip_slashes(js['targets']['//:dm']['include_dirs']) nanobench_target = js['targets']['//:nanobench'] nanobench_srcs = strip_slashes(nanobench_target['sources']) nanobench_includes = strip_slashes(nanobench_target['include_dirs']) gn_to_bp_utils.GrabDependentValues(js, '//:skia', 'sources', srcs, None) gn_to_bp_utils.GrabDependentValues(js, '//:dm', 'sources', dm_srcs, 'skia') gn_to_bp_utils.GrabDependentValues(js, '//:nanobench', 'sources', nanobench_srcs, 'skia') # skcms is a little special, kind of a second-party library. srcs .add("third_party/skcms/skcms.c") local_includes.add("third_party/skcms") dm_includes .add("third_party/skcms") # No need to list headers. srcs = {s for s in srcs if not s.endswith('.h')} dm_srcs = {s for s in dm_srcs if not s.endswith('.h')} nanobench_srcs = {s for s in nanobench_srcs if not s.endswith('.h')} cflags = gn_to_bp_utils.CleanupCFlags(cflags) cflags_cc = gn_to_bp_utils.CleanupCCFlags(cflags_cc) # We need to add the include path to the vulkan defines and header file set in # then skia_vulkan_header gn arg that is used for framework builds. local_includes.add("platform_tools/android/vulkan") export_includes.add("platform_tools/android/vulkan") here = os.path.dirname(__file__) defs = gn_to_bp_utils.GetArchSources(os.path.join(here, 'opts.gni')) gn_to_bp_utils.WriteUserConfig('include/config/SkUserConfig.h', defines) # Turn a list of strings into the style bpfmt outputs. def bpfmt(indent, lst, sort=True): if sort: lst = sorted(lst) return ('\n' + ' '*indent).join('"%s",' % v for v in lst) # OK! We have everything to fill in Android.bp... with open('Android.bp', 'w') as f: print >>f, bp.substitute({ 'export_includes': bpfmt(8, export_includes), 'local_includes': bpfmt(8, local_includes), 'srcs': bpfmt(8, srcs), 'cflags': bpfmt(8, cflags, False), 'cflags_cc': bpfmt(8, cflags_cc), 'arm_srcs': bpfmt(16, defs['armv7']), 'arm_neon_srcs': bpfmt(20, defs['neon']), 'arm64_srcs': bpfmt(16, defs['arm64'] + defs['crc32']), 'none_srcs': bpfmt(16, defs['none']), 'x86_srcs': bpfmt(16, defs['sse2'] + defs['ssse3'] + defs['sse41'] + defs['sse42'] + defs['avx' ] + defs['hsw' ]), 'dm_includes' : bpfmt(8, dm_includes), 'dm_srcs' : bpfmt(8, dm_srcs), 'nanobench_includes' : bpfmt(8, nanobench_includes), 'nanobench_srcs' : bpfmt(8, nanobench_srcs), })
25.006557
78
0.556051
871
7,627
4.65442
0.3031
0.010853
0.0148
0.02442
0.197089
0.089048
0.01776
0
0
0
0
0.011762
0.308903
7,627
304
79
25.088816
0.757352
0.09663
0
0.284519
1
0
0.613415
0.047432
0
0
0
0
0
1
0.008368
false
0
0.029289
0.004184
0.046025
0.008368
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
76d272f048a94a1ab146a49618ff07c96686a509
3,364
py
Python
medi/inference/utils.py
yuan-xy/medi
ffa416b73eb2fbffbae7a27b6eccc267b061ed0f
[ "MIT" ]
3
2020-05-27T08:42:26.000Z
2021-12-04T08:54:08.000Z
medi/inference/utils.py
yuan-xy/medi
ffa416b73eb2fbffbae7a27b6eccc267b061ed0f
[ "MIT" ]
null
null
null
medi/inference/utils.py
yuan-xy/medi
ffa416b73eb2fbffbae7a27b6eccc267b061ed0f
[ "MIT" ]
null
null
null
""" A universal module with functions / classes without dependencies. """ import sys import contextlib import functools import re import os from medi._compatibility import reraise _sep = os.path.sep if os.path.altsep is not None: _sep += os.path.altsep _path_re = re.compile(r'(?:\.[^{0}]+|[{0}]__init__\.py)$'.format(re.escape(_sep))) del _sep def to_list(func): def wrapper(*args, **kwargs): return list(func(*args, **kwargs)) return wrapper def to_tuple(func): def wrapper(*args, **kwargs): return tuple(func(*args, **kwargs)) return wrapper def unite(iterable): """Turns a two dimensional array into a one dimensional.""" return set(typ for types in iterable for typ in types) class UncaughtAttributeError(Exception): """ Important, because `__getattr__` and `hasattr` catch AttributeErrors implicitly. This is really evil (mainly because of `__getattr__`). `hasattr` in Python 2 is even more evil, because it catches ALL exceptions. Therefore this class originally had to be derived from `BaseException` instead of `Exception`. But because I removed relevant `hasattr` from the code base, we can now switch back to `Exception`. :param base: return values of sys.exc_info(). """ def safe_property(func): return property(reraise_uncaught(func)) def reraise_uncaught(func): """ Re-throw uncaught `AttributeError`. Usage: Put ``@rethrow_uncaught`` in front of the function which does **not** suppose to raise `AttributeError`. AttributeError is easily get caught by `hasattr` and another ``except AttributeError`` clause. This becomes problem when you use a lot of "dynamic" attributes (e.g., using ``@property``) because you can't distinguish if the property does not exist for real or some code inside of the "dynamic" attribute through that error. In a well written code, such error should not exist but getting there is very difficult. This decorator is to help us getting there by changing `AttributeError` to `UncaughtAttributeError` to avoid unexpected catch. This helps us noticing bugs earlier and facilitates debugging. .. note:: Treating StopIteration here is easy. Add that feature when needed. """ @functools.wraps(func) def wrapper(*args, **kwds): try: return func(*args, **kwds) except AttributeError: exc_info = sys.exc_info() reraise(UncaughtAttributeError(exc_info[1]), exc_info[2]) return wrapper class PushBackIterator(object): def __init__(self, iterator): self.pushes = [] self.iterator = iterator self.current = None def push_back(self, value): self.pushes.append(value) def __iter__(self): return self def next(self): """ Python 2 Compatibility """ return self.__next__() def __next__(self): if self.pushes: self.current = self.pushes.pop() else: self.current = next(self.iterator) return self.current @contextlib.contextmanager def ignored(*exceptions): """ Value manager that ignores all of the specified exceptions. This will be in the standard library starting with Python 3.5. """ try: yield except exceptions: pass
29
82
0.671819
431
3,364
5.134571
0.470998
0.015816
0.02892
0.024401
0.054225
0.054225
0
0
0
0
0
0.003107
0.234542
3,364
115
83
29.252174
0.856311
0.465517
0
0.125
0
0
0.019347
0.019347
0
0
0
0
0
1
0.25
false
0.017857
0.107143
0.071429
0.589286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
76d6a858fdb2f760a40ddaceed8b3a0b06e85a87
14,566
py
Python
layouts/layout_simulation_procedure.py
KEHUIYAO/coral-sampling-tool
731cc22fbf5e4045e894b894547ad52c270e3fb1
[ "MIT" ]
5
2022-03-29T04:41:22.000Z
2022-03-29T12:17:35.000Z
layouts/layout_simulation_procedure.py
KEHUIYAO/coral-sampling-tool
731cc22fbf5e4045e894b894547ad52c270e3fb1
[ "MIT" ]
null
null
null
layouts/layout_simulation_procedure.py
KEHUIYAO/coral-sampling-tool
731cc22fbf5e4045e894b894547ad52c270e3fb1
[ "MIT" ]
null
null
null
import dash_core_components as dcc import dash_html_components as html import dash_bootstrap_components as dbc def generate_simulation_procedure(): return html.Div([ # instruction button to notify the user how to use the simulation tool dcc.Markdown(children='''There are three panels on the right: Survey, Transect Visualization and Power Calculation. The Survey tab contains a figure which shows all the DRM historical survey locations by year on the map. You can also use the **Select Files** button to select new survey data and update the figure. To begin with, you first click the **Start Simulation** button, then you will be asked to select a region to survey in the figure using the map selection tools on the top of the figure. Notice that the map selection tool bar will only appear when you hover your mouse over the figure. The selected region represents the location you want to conduct your new survey. After that, the app will help you estimate the proportion cover of the coral inside this region based on the historical survey data, and you are required to select a point process from which the coral will be simulated inside the region. If you have questions about how the data will be generated under different point processes, you can checkout the ** Point Process Introduction ** tab. After selecting a point process, you then need to specify the parameters that characterize this point process. Additionally, other parts such as the transect, disease prevalence, and coral size can also be customized.'''), html.Button('Start Simulation', id='button_select_region', n_clicks=0), # the instruction related to the above button dcc.Markdown(children=''' Select a region on the right figure. The map selection tool bar will only appear when you hover your mouse over the figure. Box Select and Lasso Select are mostly used. Click the Box Select or Lasso Select button, then drag and drop on the figure. ''', id='text_select_region', style={"display": "none"}), # show the rough prop_cover density estimate based on the selected sites html.Div([], id='prop_cover_estimate', style={'display': 'none'}), # the hidden div which stores the prop cover estimation dcc.Store(id='store_prop_cover_estimation'), # which process is used to generate data dcc.Markdown(id='text_dropdown_select_process', children='''Select which point process will the coral be simulated from.''', style={"display": "none"}), generate_dropdown_selection(), # based on selected process, let user specify the parameter of the process dcc.Markdown(id='text_input_process_parameters', children=''' Specify the parameters of the certain point process under which the coral is simulated. Also specify other inputs like disease prevalence, and the transect. For how different parameters change the look of a certain point process, you can checkout the **Point Process Introduction** section. There is a playground at the bottom. For a given point process, you can adjust the parameters to see how the simulation data changes spatially. Finally, if you find one simulation under a combination of parameters is quite realistic, you can use the **port** function to copy these parameters to here below.''', style={"display": "none"}), # user-input area # html.Div(id='input_process_parameters', style={"display": "none"}), generate_user_input(), # empty line html.Br(), # button to simulate the corals or calculate the power of the method html.Div([ html.Button('Simulate once', id='button_start_simulation', n_clicks=0, ), html.Button( 'Calculate power', id='button_power_calculation', n_clicks=0 ) ],id='show_two_buttons',style={'display':'none'}) , # dbc.Spinner(html.Div(id='loading-output'), color='primary'), # html.Div([dbc.Spinner(color='primary')]), # instruction for power calculation dcc.Markdown( id='text_power_calculation_instruction', children=''' Calculate power''', style={'display': 'none'} ), html.Br() ],className='col-sm-5') def generate_dropdown_selection(): "return a Div containing the dropdown selection box" return dcc.Dropdown( id='dropdown_select_process', style={"display": "none"}, options=[ {'label': 'Homogeneous Poisson process', 'value': 1}, {'label': 'Inhomogeneous Poisson process', 'value': 2}, {'label': 'Cluster process', 'value': 3}, # {'label': 'Strauss process', 'value': 4} ], # set the initial value=0 to hide the user input interface value=0) def generate_user_input(): "return a Div containing users' input interface" input_n_toolkits = html.Div(html.Div([html.A('Number of transects:', className='col-sm-4'), dcc.Input( type='number', placeholder=2, value = 2, id='input_n_toolkits', className='col-sm-4' ) ], className='row'), id='input_n_toolkits_container', style={'display': 'none'}) # slider # input_n_toolkits = html.Div(html.Div([ # html.A("Number of transects",className='col-sm-4'), # dcc.Slider(min=1, # max=5, # step=1, # value=2, # marks={i: '{}'.format(i) for i in range(1, 6)}, # id='input_n_toolkits', # className='col-sm-4') # ], className='row'), id='input_n_toolkits_container', # className='row', # style={'display': 'none'}) input_disease_prevalence = html.Div(html.Div([html.A('disease prevalence: ', id='input_disease_prevalence_tooltip', className='col-sm-4'), dcc.Input( type='number', placeholder=0.1, value = 0.1, step=0.1, min=0, max=1, id='input_disease_prevalence', className='col-sm-4' ) ], className='row'), id='input_disease_prevalence_container', style={'display': 'none'}) input_disease_prevalence_tooltip = dbc.Tooltip('the proportion of corals which get infected by a disease', target='input_disease_prevalence_tooltip') # text or number input input_fun_lambda = html.Div(html.Div([html.A('proportion cover function:', className='col-sm-4'), dcc.Input( id="input_fun_lambda", type='text', placeholder="1000 * np.exp(-(((x - 50) / 50) ** 2 + ((y - 50) / 50) ** 2) / 0.5 ** 2)", value="1000 * np.exp(-(((x - 50) / 50) ** 2 + ((y - 50) / 50) ** 2) / 0.5 ** 2)", className='col-sm-4' )],className='row'),id='show_input_fun_lambda',style={'display':'none'}) input_parent_prop = html.Div(html.Div([html.A('parent corals / total corals:', className='col-sm-4'), dcc.Input( id="input_parent_prop", type='number', placeholder=0.01, value=0.01, step=0.01, className='col-sm-4' )],className='row'),id='show_input_parent_prop',style={'display':'none'}) input_parent_range = html.Div(html.Div([html.A('parent range:', className='col-sm-4'), dcc.Input( id="input_parent_range", type='number', placeholder=5, value=5, className='col-sm-4' )],className='row'),id='show_input_parent_range',style={'display':'none'}) input_strauss_beta = dcc.Input( id="input_strauss_beta", type='number', placeholder="strauss_beta", style={'display': 'none'} ) input_strauss_gamma = dcc.Input( id="input_strauss_gamma", type='number', placeholder="strauss_gamma", style={'display': 'none'} ) input_strauss_R = dcc.Input( id="input_strauss_R", type='number', placeholder="strauss_R", style={'display': 'none'} ) input_transect_length = html.Div(html.Div([html.A('transect width (m): ', className='col-sm-4'), dcc.Input( type='number', placeholder=25, value=25, id='dcc_input_transect_length', className='col-sm-4' ) ], className='row'), id='input_transect_length', style={'display': 'none'}) input_transect_width = html.Div(html.Div([html.A('transect length (m): ', className='col-sm-4'), dcc.Input( type='number', placeholder=6, value = 6, id='dcc_input_transect_width', className='col-sm-4' ) ], className='row'), id='input_transect_width', style={'display': 'none'}) line_intercept_ratio = html.Div(html.Div([html.A('transect width / plot width', className='col-sm-4'), dcc.Input( type='number', placeholder=1/5, value = 1/5, step=0.1, id='dcc_line_intercept_ratio', className='col-sm-4') ],className='row'), id='line_intercept_ratio', style={'display': 'none'}) coral_size = html.Div(html.Div([html.A('coral size (m^2): ', id='coral_size_tooltip',className='col-sm-4'), dcc.Input( type='number', placeholder=0.0068, value = 0.0068, step=0.0001, id='coral_size', className='col-sm-4' ) ],className='row' ), id='coral_size_input', style={'display': 'none'}) coral_size_tooltip = dbc.Tooltip('the average size of an individual coral, measured in m^3', target='coral_size_tooltip') coral_size_std = html.Div(html.Div([html.A('coral size standard error: ', id='coral_size_std_tooltip', className='col-sm-4'), dcc.Input( type='number', placeholder=0.001, value = 0.001, step=0.001, id='coral_size_std', className='col-sm-4' )], className='row') , id='coral_size_std_input', style={'display': 'none'}) coral_size_std_tooltip = dbc.Tooltip('the standard deviation of the average size of an individual coral', target='coral_size_std_tooltip') prop_cover = html.Div(html.Div([html.A('proportion cover: ', className='col-sm-4', id='prop_cover_tooltip'), dcc.Input( type='number', placeholder=0, value = 0, step=0.1, min=0, max=1, id='prop_cover', className='col-sm-4' ) ],className='row'), id='prop_cover_input', style={'display': 'none'}) prop_cover_tooltip = dbc.Tooltip('Proportion cover of coral. If it equals 0, its estimation based on the historical data will be used in the simulation', target='prop_cover_tooltip') num_of_replications = html.Div(html.Div([html.A('number of replications', className='col-sm-4'), dcc.Input( type='number', placeholder=10, value = 10, step=1, min=1, id='num_of_replications', className='col-sm-4' ) ],className='row'), id='number_of_replications_input', style={'display': 'none'}) return html.Div([ input_n_toolkits, prop_cover, prop_cover_tooltip, input_fun_lambda, coral_size, coral_size_tooltip, coral_size_std, coral_size_std_tooltip, input_disease_prevalence, input_disease_prevalence_tooltip, input_parent_prop, input_parent_range, input_strauss_beta, input_strauss_gamma, input_strauss_R, input_transect_length, input_transect_width, line_intercept_ratio, num_of_replications ], id='input_process_parameters')
49.376271
1,301
0.506316
1,535
14,566
4.662541
0.183713
0.032276
0.041498
0.054492
0.33324
0.288948
0.251642
0.208048
0.164594
0.11094
0
0.017056
0.392215
14,566
295
1,302
49.376271
0.79137
0.106755
0
0.23445
1
0.028708
0.365263
0.045256
0
0
0
0
0
1
0.014354
false
0
0.014354
0.004785
0.043062
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
76de86f0d428be6f17b7c61c98178730bcc214cf
4,173
py
Python
backend-project/small_eod/autocomplete/tests/test_views.py
merito/small_eod
ab19b82f374cd7c4b21d8f9412657dbe7f7f03e2
[ "MIT" ]
64
2019-12-30T11:24:03.000Z
2021-06-24T01:04:56.000Z
backend-project/small_eod/autocomplete/tests/test_views.py
merito/small_eod
ab19b82f374cd7c4b21d8f9412657dbe7f7f03e2
[ "MIT" ]
465
2018-06-13T21:43:43.000Z
2022-01-04T23:33:56.000Z
backend-project/small_eod/autocomplete/tests/test_views.py
merito/small_eod
ab19b82f374cd7c4b21d8f9412657dbe7f7f03e2
[ "MIT" ]
72
2018-12-02T19:47:03.000Z
2022-01-04T22:54:49.000Z
from test_plus.test import TestCase from ...administrative_units.factories import AdministrativeUnitFactory from ...cases.factories import CaseFactory from ...channels.factories import ChannelFactory from ...events.factories import EventFactory from ...features.factories import FeatureFactory, FeatureOptionFactory from ...generic.tests.test_views import ReadOnlyViewSetMixin from ...institutions.factories import InstitutionFactory from ...letters.factories import DocumentTypeFactory, ReferenceNumberFactory from ...search.tests.mixins import SearchQueryMixin from ...tags.factories import TagFactory from ...users.factories import UserFactory class AdministrativeUnitAutocompleteViewSetTestCase( ReadOnlyViewSetMixin, SearchQueryMixin, TestCase ): basename = "autocomplete_administrative_unit" factory_class = AdministrativeUnitFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class CaseAutocompleteViewSetTestCase(ReadOnlyViewSetMixin, SearchQueryMixin, TestCase): basename = "autocomplete_case" factory_class = CaseFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class ChannelAutocompleteViewSetTestCase( ReadOnlyViewSetMixin, SearchQueryMixin, TestCase ): basename = "autocomplete_channel" factory_class = ChannelFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class DocumentTypeAutocompleteViewSetTestCase( ReadOnlyViewSetMixin, SearchQueryMixin, TestCase ): basename = "autocomplete_document_type" factory_class = DocumentTypeFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class ReferenceNumberAutocompleteViewSetTestCase( ReadOnlyViewSetMixin, SearchQueryMixin, TestCase ): basename = "autocomplete_reference_number" factory_class = ReferenceNumberFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class EventAutocompleteViewSetTestCase( ReadOnlyViewSetMixin, SearchQueryMixin, TestCase ): basename = "autocomplete_event" factory_class = EventFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class FeatureAutocompleteViewSetTestCase( ReadOnlyViewSetMixin, SearchQueryMixin, TestCase ): basename = "autocomplete_feature" factory_class = FeatureFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class FeatureOptionAutocompleteViewSetTestCase( ReadOnlyViewSetMixin, SearchQueryMixin, TestCase ): basename = "autocomplete_feature_option" factory_class = FeatureOptionFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class InstitutionAutocompleteViewSetTestCase( ReadOnlyViewSetMixin, SearchQueryMixin, TestCase ): basename = "autocomplete_institution" factory_class = InstitutionFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class TagAutocompleteViewSetTestCase(ReadOnlyViewSetMixin, SearchQueryMixin, TestCase): basename = "autocomplete_tag" factory_class = TagFactory def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["name"], self.obj.name) class UserAutocompleteViewSetTestCase(ReadOnlyViewSetMixin, SearchQueryMixin, TestCase): basename = "autocomplete_user" factory_class = UserFactory initial_count = 1 def validate_item(self, item): self.assertEqual(item["id"], self.obj.id) self.assertEqual(item["username"], self.obj.username)
32.1
88
0.749101
404
4,173
7.636139
0.183168
0.05705
0.135494
0.185413
0.554295
0.367585
0.321556
0.321556
0.321556
0.321556
0
0.000283
0.151929
4,173
129
89
32.348837
0.871433
0
0
0.505263
0
0
0.075725
0.03307
0
0
0
0
0.231579
1
0.115789
false
0
0.126316
0
0.6
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
76f3d0ad2bb9ab5227cf466b13a6b3829002cac1
800
py
Python
src/tests/stream.py
LakshyaaSoni/dropSQL
da07ad3edf2d55f0521a385ad10678fc353b4b2b
[ "MIT" ]
35
2017-11-27T22:24:46.000Z
2022-01-16T23:50:01.000Z
src/tests/stream.py
LakshyaaSoni/dropSQL
da07ad3edf2d55f0521a385ad10678fc353b4b2b
[ "MIT" ]
null
null
null
src/tests/stream.py
LakshyaaSoni/dropSQL
da07ad3edf2d55f0521a385ad10678fc353b4b2b
[ "MIT" ]
2
2018-02-20T06:06:12.000Z
2021-10-16T18:30:15.000Z
from io import StringIO from unittest import TestCase from dropSQL.parser.streams import * class StreamTestCase(TestCase): def test(self): s = '12' cs = Characters(StringIO(s)) ch = cs.peek().ok() self.assertEqual(ch, '1') ch = cs.peek().ok() self.assertEqual(ch, '1') ch = cs.next().ok() self.assertEqual(ch, '1') ch = cs.next().ok() self.assertEqual(ch, '2') r = cs.next() self.assertFalse(r) self.assertTrue(r.err()) r = cs.next() self.assertFalse(r) cs.back() r = cs.next() self.assertTrue(r) self.assertEqual(r.ok(), '2') cs.back(2) r = cs.next() self.assertTrue(r) self.assertEqual(r.ok(), '1')
20
37
0.51125
100
800
4.09
0.3
0.220049
0.166259
0.185819
0.584352
0.579462
0.466993
0.466993
0.466993
0.466993
0
0.016791
0.33
800
39
38
20.512821
0.746269
0
0
0.535714
0
0
0.01
0
0
0
0
0
0.392857
1
0.035714
false
0
0.107143
0
0.178571
0
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0a00e63d1006dbef16f6c53de45b2f52bfe52dea
7,268
py
Python
model/resnet.py
DrMMZ/RetinaNet
0b8491076f2ad344e101f724a2f5b8305adb2d52
[ "MIT" ]
7
2021-07-07T02:59:58.000Z
2021-12-09T04:48:49.000Z
model/resnet.py
DrMMZ/ResFPN
3acd6c629419a9f66da5386f3fd3deb9e8c929ff
[ "MIT" ]
3
2021-11-25T07:21:03.000Z
2022-01-17T18:56:29.000Z
model/resnet.py
DrMMZ/RetinaNet
0b8491076f2ad344e101f724a2f5b8305adb2d52
[ "MIT" ]
2
2021-12-09T01:48:36.000Z
2022-01-08T15:54:58.000Z
""" Residual Networks (ResNet) """ # adapted from # https://github.com/fchollet/deep-learning-models/blob/master/resnet50.py import tensorflow as tf def identity_block( input_tensor, filters, stage, block, train_bn=False ): """ Builds an identity shortcut in a bottleneck building block of a ResNet. Parameters ---------- input_tensor : tf tensor, [batch_size, height, width, channels] An input tensor. filters : list, positive integers The number of filters in 3 conv layers at the main path, where last number is equal to input_tensor's channels. stage : integer A number in [2,5] used for generating layer names. block : string A lowercase letter, used for generating layer names. train_bn : boolean, optional Whether one should normalize the layer input by the mean and variance over the current batch. The default is False, i.e., use the moving average of mean and variance to normalize the layer input. Returns ------- output_tensor : tf tensor, [batch_size, height, width, channels] The output tensor same shape as input_tensor. """ num_filters_1, num_filters_2, num_filters_3 = filters conv_prefix = 'res' + str(stage) + block + '_branch' bn_prefix = 'bn' + str(stage) + block + '_branch' x = tf.keras.layers.Conv2D( num_filters_1, (1,1), name=conv_prefix + '2a')(input_tensor) x = tf.keras.layers.BatchNormalization( name=bn_prefix + '2a')(x, training=train_bn) x = tf.keras.layers.Activation('relu')(x) x = tf.keras.layers.Conv2D( num_filters_2, (3,3), padding='same', name=conv_prefix + '2b')(x) x = tf.keras.layers.BatchNormalization( name=bn_prefix + '2b')(x, training=train_bn) x = tf.keras.layers.Activation('relu')(x) x = tf.keras.layers.Conv2D( num_filters_3, (1,1), name=conv_prefix + '2c')(x) x = tf.keras.layers.BatchNormalization( name=bn_prefix + '2c')(x, training=train_bn) x = tf.keras.layers.Add()([input_tensor, x]) output_tensor = tf.keras.layers.Activation( 'relu', name='res' + str(stage) + block + '_out')(x) return output_tensor def conv_block( input_tensor, filters, stage, block, strides=(2, 2), train_bn=False ): """ Builds a projection shortcut in a bottleneck block of a ResNet. Parameters ---------- input_tensor : tf tensor, [batch_size, height, width, channels] An input tensor. filters : list, positive integers The number of filters in 3 conv layers at the main path. stage : integer A number in [2,5] used for generating layer names. block : string A lowercase letter, used for generating layer names. strides : tuple, integers, optional The conv layer strides. The default is (2, 2). train_bn : boolean, optional Whether one should normalize the layer input by the mean and variance over the current batch. The default is False, i.e., use the moving average of mean and variance to normalize the layer input. Returns ------- output_tensor : tf tensor [batch_size, height//strides, width//strides, num_filters_3] where num_filters_3 is the last number in filters, the output tensor. """ num_filters_1, num_filters_2, num_filters_3 = filters conv_prefix = 'res' + str(stage) + block + '_branch' bn_prefix = 'bn' + str(stage) + block + '_branch' x = tf.keras.layers.Conv2D( num_filters_1, (1,1), strides, name=conv_prefix + '2a')(input_tensor) x = tf.keras.layers.BatchNormalization( name=bn_prefix + '2a')(x, training=train_bn) x = tf.keras.layers.Activation('relu')(x) x = tf.keras.layers.Conv2D( num_filters_2, (3,3), padding='same', name=conv_prefix + '2b')(x) x = tf.keras.layers.BatchNormalization( name=bn_prefix + '2b')(x, training=train_bn) x = tf.keras.layers.Activation('relu')(x) x = tf.keras.layers.Conv2D( num_filters_3, (1,1), name=conv_prefix + '2c')(x) x = tf.keras.layers.BatchNormalization( name=bn_prefix + '2c')(x, training=train_bn) shortcut = tf.keras.layers.Conv2D( num_filters_3, (1,1), strides, name=conv_prefix + '1')(input_tensor) shortcut = tf.keras.layers.BatchNormalization( name=bn_prefix + '1')(shortcut, training=train_bn) x = tf.keras.layers.Add()([shortcut, x]) output_tensor = tf.keras.layers.Activation( 'relu', name='res' + str(stage) + block + '_out')(x) return output_tensor def backbone_resnet(input_image, architecture, stage5=True, train_bn=False): """ Builds a backbone ResNet. Parameters ---------- input_image : tf tensor, [batch_size, height, width, channels] An input tensor. architecture : string The ResNet architecture in {'resnet50', 'resnet101'}. stage5 : boolean, optional Whether create stage5 of network. The default is True. train_bn : boolean, optional Whether one should normalize the layer input by the mean and variance over the current batch. The default is False, i.e., use the moving average of mean and variance to normalize the layer input. Returns ------- outputs : list Feature maps at each stage. """ assert architecture in ['resnet50', 'resnet101'], \ 'Only support ResNet50\101' # stage 1 x = tf.keras.layers.ZeroPadding2D((3,3))(input_image) x = tf.keras.layers.Conv2D(64, (7,7), (2,2), name='conv1')(x) x = tf.keras.layers.BatchNormalization(name='bn_conv1')(x, training=train_bn) x = tf.keras.layers.Activation('relu')(x) C1 = x = tf.keras.layers.MaxPooling2D((3,3), (2,2), padding='same')(x) # stage 2 x = conv_block( x, [64,64,256], stage=2, block='a', strides=(1,1), train_bn=train_bn) x = identity_block(x, [64,64,256], stage=2, block='b', train_bn=train_bn) C2 = x = identity_block( x, [64,64,256], stage=2, block='c', train_bn=train_bn) # stage 3 x = conv_block(x, [128,128,512], stage=3, block='a', train_bn=train_bn) x = identity_block(x, [128,128,512], stage=3, block='b', train_bn=train_bn) x = identity_block(x, [128,128,512], stage=3, block='c', train_bn=train_bn) C3 = x = identity_block( x, [128,128,512], stage=3, block='d', train_bn=train_bn) # stage 4 x = conv_block(x, [256,256,1024], stage=4, block='a', train_bn=train_bn) num_blocks = {'resnet50':5, 'resnet101':22}[architecture] for i in range(num_blocks): x = identity_block( x, [256,256,1024], stage=4, block=chr(98+i), train_bn=train_bn) C4 = x # stage 5 if stage5: x = conv_block(x, [512,512,2048], stage=5, block='a', train_bn=train_bn) x = identity_block( x, [512,512,2048], stage=5, block='b', train_bn=train_bn) C5 = x = identity_block( x, [512,512,2048], stage=5, block='c', train_bn=train_bn) else: C5 = None return [C1, C2, C3, C4, C5]
35.802956
81
0.624381
1,028
7,268
4.284047
0.156615
0.0604
0.0797
0.073115
0.755223
0.736603
0.694596
0.684832
0.631244
0.623978
0
0.04479
0.247386
7,268
202
82
35.980198
0.760329
0.346863
0
0.557895
0
0
0.045057
0
0
0
0
0
0.010526
1
0.031579
false
0
0.010526
0
0.073684
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0a0a44a50d18d71919437c3d704deabe9ca4ee0b
2,099
py
Python
utilities/classify_ensemble.py
Hazel1994/Paraphrase-detection-on-Quora-and-MSRP
bd464d0d16c57d5f95d91b78add6d9720128826a
[ "MIT" ]
2
2019-09-09T05:12:16.000Z
2019-11-25T06:02:13.000Z
utilities/classify_ensemble.py
Hazel1994/Paraphrase-detection-on-Quora-and-MSRP
bd464d0d16c57d5f95d91b78add6d9720128826a
[ "MIT" ]
null
null
null
utilities/classify_ensemble.py
Hazel1994/Paraphrase-detection-on-Quora-and-MSRP
bd464d0d16c57d5f95d91b78add6d9720128826a
[ "MIT" ]
1
2019-09-22T14:51:38.000Z
2019-09-22T14:51:38.000Z
from sklearn.metrics import f1_score,accuracy_score import numpy as np from utilities.tools import load_model import pandas as pd def predict_MSRP_test_data(n_models,nb_words,nlp_f,test_data_1,test_data_2,test_labels): models=[] n_h_features=nlp_f.shape[1] print('loading the models...') for i in range(n_models): models.append(load_model(i+1,nb_words,n_h_features)) preds=[] print('predicting the test data...\n') i=0 for m in models: i+=1 preds_prob=m.predict([test_data_1, test_data_2,nlp_f], batch_size=64, verbose=0) preds.append(preds_prob[:,1]) preds=np.asarray(preds) final_labels=np.zeros(len(test_data_1),dtype=int) #average the predicttion for i in range(len(test_data_1)): final_labels[i]=round(np.mean(preds[:,i])) if i%100==0: print(i ,' out of ',len(test_data_1)) print("test data accuracy: ", accuracy_score(final_labels,test_labels)) print("test data f_measure: ", f1_score(final_labels, test_labels)) submission = pd.DataFrame({"Quality": final_labels}) submission.to_csv("predictions/MSRP.tsv", index=True,index_label='test_id') def predict_Quora_test_data(n_models,nb_words,nlp_f,test_data_1,test_data_2): models=[] n_h_features=nlp_f.shape[1] print('loading the models...') for i in range(n_models): models.append(load_model(i+1,nb_words,n_h_features)) preds=[] print('predicting the test data...\n') i=0 for m in models: i+=1 preds_prob=m.predict([test_data_1, test_data_2,nlp_f], batch_size=125, verbose=0) preds.append(preds_prob[:,1]) preds=np.asarray(preds) final_labels=np.zeros(len(test_data_1),dtype=float) #average the predicttion for i in range(len(test_data_1)): final_labels[i]=np.mean(preds[:,i]) if i%10000==0: print(i ,' out of ',len(test_data_1)) print('making the sumbission file') submission = pd.DataFrame({"is_duplicate": final_labels}) submission.to_csv("predictions/Quora.tsv", index=True,index_label='test_id')
31.80303
88
0.685088
342
2,099
3.947368
0.248538
0.118519
0.066667
0.053333
0.768889
0.73037
0.653333
0.611852
0.611852
0.611852
0
0.024971
0.179609
2,099
66
89
31.80303
0.759001
0.021915
0
0.571429
0
0
0.125244
0.010234
0
0
0
0
0
1
0.040816
false
0
0.081633
0
0.122449
0.183673
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0a2b055f1a31031a96cc1310b503a9a15b43be19
4,176
py
Python
aqui_carattino/blog/migrations/0002_auto_20200424_1452.py
aquilesC/aquicarattino
b6d873aea6e3ec9d1b802ea13952746e4fcc22b6
[ "MIT" ]
null
null
null
aqui_carattino/blog/migrations/0002_auto_20200424_1452.py
aquilesC/aquicarattino
b6d873aea6e3ec9d1b802ea13952746e4fcc22b6
[ "MIT" ]
2
2020-05-08T04:30:26.000Z
2021-06-17T20:19:02.000Z
aqui_carattino/blog/migrations/0002_auto_20200424_1452.py
aquilesC/aquicarattino
b6d873aea6e3ec9d1b802ea13952746e4fcc22b6
[ "MIT" ]
null
null
null
# Generated by Django 3.0.5 on 2020-04-24 12:52 from django.db import migrations, models import django.db.models.deletion import modelcluster.contrib.taggit import modelcluster.fields import wagtail.core.blocks import wagtail.core.fields import wagtail.images.blocks class Migration(migrations.Migration): dependencies = [ ('wagtailimages', '0001_squashed_0021'), ('wagtailcore', '0045_assign_unlock_grouppagepermission'), ('taggit', '0003_taggeditem_add_unique_index'), ('blog', '0001_initial'), ] operations = [ migrations.CreateModel( name='ArticlePage', fields=[ ('page_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtailcore.Page')), ('body', wagtail.core.fields.StreamField([('text', wagtail.core.blocks.RichTextBlock(icon='fa fa-paragraph', template='blocks/paragraph_block.html')), ('alert_block', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.RichTextBlock(required=True))], required=False)), ('button_block', wagtail.core.blocks.StructBlock([('url', wagtail.core.blocks.URLBlock(required=True)), ('text', wagtail.core.blocks.CharBlock(required=True))], required=False)), ('carousel_block', wagtail.core.blocks.StructBlock([('image_items', wagtail.core.blocks.ListBlock(wagtail.images.blocks.ImageChooserBlock(required=True), label='Image Item'))])), ('testimonial', wagtail.core.blocks.StructBlock([('text', wagtail.core.blocks.TextBlock(required=True)), ('author', wagtail.core.blocks.CharBlock(label='Who said this?', required=True)), ('author_title', wagtail.core.blocks.CharBlock(label='Role of this person', required=False)), ('image', wagtail.images.blocks.ImageChooserBlock(required=False)), ('link', wagtail.core.blocks.URLBlock(label='Link to the person website', required=False))])), ('code_block', wagtail.core.blocks.StructBlock([('language', wagtail.core.blocks.CharBlock(help_text='In which language this is written', max_length=20, required=True)), ('code', wagtail.core.blocks.TextBlock(help_text='The actual code', required=True))]))])), ('header_image', models.ForeignKey(blank=True, help_text='Image to appear at the top of the page, before author information', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')), ], options={ 'abstract': False, }, bases=('wagtailcore.page',), ), migrations.CreateModel( name='Sidebar', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=50)), ('text', models.TextField()), ('cta', models.CharField(blank=True, max_length=15, null=True, verbose_name='Call to action text')), ('image', models.ForeignKey(blank=True, help_text='Image to appear at the top of the page, before author information', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='wagtailimages.Image')), ], ), migrations.CreateModel( name='BlogPageTag', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('content_object', modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='tagged_items', to='blog.ArticlePage')), ('tag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='blog_blogpagetag_items', to='taggit.Tag')), ], options={ 'abstract': False, }, ), migrations.AddField( model_name='articlepage', name='tags', field=modelcluster.contrib.taggit.ClusterTaggableManager(blank=True, help_text='A comma-separated list of tags.', through='blog.BlogPageTag', to='taggit.Tag', verbose_name='Tags'), ), ]
68.459016
1,357
0.670498
474
4,176
5.793249
0.320675
0.076111
0.105244
0.04807
0.386016
0.276402
0.264749
0.249818
0.21413
0.17917
0
0.011932
0.177203
4,176
60
1,358
69.6
0.787253
0.010776
0
0.351852
1
0
0.215064
0.028821
0.037037
0
0
0
0
1
0
false
0
0.12963
0
0.185185
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0a31df6f647d431831f887f61ef014c34b1a74e5
1,436
py
Python
code_tmpl/views.py
lovebirdegg/nnms-server
9fd4563ccca9f29add375d346cdd1c2dd636c512
[ "MIT" ]
null
null
null
code_tmpl/views.py
lovebirdegg/nnms-server
9fd4563ccca9f29add375d346cdd1c2dd636c512
[ "MIT" ]
null
null
null
code_tmpl/views.py
lovebirdegg/nnms-server
9fd4563ccca9f29add375d346cdd1c2dd636c512
[ "MIT" ]
null
null
null
# @Time : {time} # @Author : code_generator from rest_framework.viewsets import ModelViewSet from rest_framework.generics import ListAPIView from rest_framework.filters import SearchFilter, OrderingFilter from rest_framework.response import Response from rest_framework.decorators import api_view,authentication_classes,permission_classes,action from common.custom import CommonPagination, RbacPermission from django_filters.rest_framework import DjangoFilterBackend from django.http import HttpResponse,FileResponse,JsonResponse from rest_framework_jwt.authentication import JSONWebTokenAuthentication from rest_framework.permissions import IsAuthenticated from rest_xops.basic import XopsResponse from rest_xops.code import * from django.db.models import Q from django.apps import apps from ..models import {model_camel_case_name} from django.contrib.contenttypes.models import ContentType from ..serializers.{model_name}_serializers import * class {model_camel_case_name}View(ModelViewSet): queryset = {model_camel_case_name}.objects.all() serializer_class = {model_camel_case_name}Serializer filter_backends = (DjangoFilterBackend, SearchFilter,OrderingFilter) pagination_class = CommonPagination ordering_fields = ('id',) authentication_classes = (JSONWebTokenAuthentication,) permission_classes = (IsAuthenticated,) filter_fields = ({filter_fields}) search_fields = ({search_fields})
39.888889
95
0.83078
163
1,436
7.07362
0.392638
0.062446
0.103209
0.062446
0.039896
0
0
0
0
0
0
0
0.107242
1,436
36
96
39.888889
0.899376
0.029944
0
0
0
0
0.001438
0
0
0
0
0
0
0
null
null
0
0.62963
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
2
0a34f204369f984c96ff6e5a370ca5dd3ef2cd5a
128
py
Python
tibanna/_version.py
freezecoder/tibanna
89b02e95d04b9c630a9786f4d1eb8157c40098e0
[ "MIT" ]
null
null
null
tibanna/_version.py
freezecoder/tibanna
89b02e95d04b9c630a9786f4d1eb8157c40098e0
[ "MIT" ]
null
null
null
tibanna/_version.py
freezecoder/tibanna
89b02e95d04b9c630a9786f4d1eb8157c40098e0
[ "MIT" ]
null
null
null
"""Version information.""" # The following line *must* be the last in the module, exactly as formatted: __version__ = "0.16.1"
25.6
76
0.710938
19
128
4.578947
0.842105
0
0
0
0
0
0
0
0
0
0
0.037037
0.15625
128
4
77
32
0.768519
0.75
0
0
0
0
0.230769
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0a3e0181aa1152f21b25e174598bc71d6679ab76
986
py
Python
config.py
conradsuuna/uac-computer-competency
40f8b165e5432ca22ab97838f424e26650a3d300
[ "MIT" ]
null
null
null
config.py
conradsuuna/uac-computer-competency
40f8b165e5432ca22ab97838f424e26650a3d300
[ "MIT" ]
null
null
null
config.py
conradsuuna/uac-computer-competency
40f8b165e5432ca22ab97838f424e26650a3d300
[ "MIT" ]
null
null
null
from os import environ import psycopg2 from datetime import timedelta from dotenv import load_dotenv load_dotenv() class Config(object): """ app configuration class """ TESTING = False CSRF_ENABLED = True SECRET_KEY = environ.get('SECRET_KEY') USER = environ.get('DB_USER') PASSWORD = environ.get('DB_PASSWORD') DB_NAME = environ.get('DB_NAME') HOST = environ.get('DB_HOST') SQLALCHEMY_DATABASE_URI = f"postgresql://{USER}:{PASSWORD}@{HOST}/{DB_NAME}" SQLALCHEMY_TRACK_MODIFICATIONS = False # jwt configuarations for the user auth api JWT_SECRET_KEY = environ.get('SECRET_KEY') JWT_ACCESS_TOKEN_EXPIRES = timedelta(days=1) # pagination NUM_OF_ITEMS_PER_PAGE = 18 class DevelopmentConfig(Config): """ app development configuration class """ ENV = "development" DEBUG = True SQLALCHEMY_TRACK_MODIFICATIONS = True class ProductionConfig(Config): DEBUG = False SQLALCHEMY_TRACK_MODIFICATIONS = False
27.388889
80
0.720081
121
986
5.628099
0.471074
0.088106
0.070485
0.0558
0.082232
0.082232
0
0
0
0
0
0.004981
0.185598
986
35
81
28.171429
0.843088
0.116633
0
0.08
0
0
0.128355
0.054842
0
0
0
0
0
1
0
false
0.08
0.16
0
0.96
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
0a47a03d932bb0b243e96234078c92e60fb74516
891
py
Python
seamo/support/seamo_exceptions.py
amandalynne/Seattle-Mobility-Index
f21d2fa6913ce9474aedc298e9e4a6e7c9390e64
[ "MIT" ]
3
2018-08-20T18:34:03.000Z
2018-10-02T23:41:52.000Z
seamo/support/seamo_exceptions.py
amandalynne/Seattle-Mobility-Index
f21d2fa6913ce9474aedc298e9e4a6e7c9390e64
[ "MIT" ]
null
null
null
seamo/support/seamo_exceptions.py
amandalynne/Seattle-Mobility-Index
f21d2fa6913ce9474aedc298e9e4a6e7c9390e64
[ "MIT" ]
1
2018-10-02T23:42:24.000Z
2018-10-02T23:42:24.000Z
""" Class for all excpetions used in following scripts - geocoder.py - geocoder_input.py """ class OverlappingGeographyError(Exception): def __init__(self, message): self.message = message # msg: geodataframe has overlapping polygons representing geographic features # please how shapefiles are processed. class NoOverlapSpatialJoinError(Exception): def __init__(self, message): self.message = message # msg: geodataframe has overlapping polygons representing geographic features # please how shapefiles are processed. class NoParkingAvailableError(NoOverlapSpatialJoinError): def __init__(self, message): self.message = message class NoUrbanVillageError(Exception): def __init__(self, message): self.message = message class NotInSeattleError(Exception): def __init__(self, message): self.message = message
27
81
0.740741
89
891
7.179775
0.382022
0.172144
0.086072
0.140845
0.676056
0.676056
0.676056
0.676056
0.463224
0.463224
0
0
0.188552
891
33
82
27
0.883817
0.349046
0
0.666667
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
0a49a5caf98b95481017eff59d5dcd3666b0a6ef
1,318
py
Python
ddtrace/contrib/vertica/__init__.py
lightstep/dd-trace-py
9108cbf54ff31f803eac735507ae6d2a87b9b45f
[ "Apache-2.0", "BSD-3-Clause" ]
5
2020-03-07T01:12:29.000Z
2021-04-21T00:53:19.000Z
ddtrace/contrib/vertica/__init__.py
lightstep/dd-trace-py
9108cbf54ff31f803eac735507ae6d2a87b9b45f
[ "Apache-2.0", "BSD-3-Clause" ]
4
2019-11-22T20:58:01.000Z
2020-08-17T21:16:13.000Z
ddtrace/contrib/vertica/__init__.py
lightstep/dd-trace-py
9108cbf54ff31f803eac735507ae6d2a87b9b45f
[ "Apache-2.0", "BSD-3-Clause" ]
3
2020-03-18T16:29:20.000Z
2020-07-20T16:05:10.000Z
""" The Vertica integration will trace queries made using the vertica-python library. Vertica will be automatically instrumented with ``patch_all``, or when using the ``ls-trace-run`` command. Vertica is instrumented on import. To instrument Vertica manually use the ``patch`` function. Note the ordering of the following statements:: from ddtrace import patch patch(vertica=True) import vertica_python # use vertica_python like usual To configure the Vertica integration globally you can use the ``Config`` API:: from ddtrace import config, patch patch(vertica=True) config.vertica['service_name'] = 'my-vertica-database' To configure the Vertica integration on an instance-per-instance basis use the ``Pin`` API:: from ddtrace import Pin, patch, Tracer patch(vertica=True) import vertica_python custom_tracer = Tracer() conn = vertica_python.connect(**YOUR_VERTICA_CONFIG) # override the service and tracer to be used Pin.override(conn, service='myverticaservice', tracer=custom_tracer) """ from ...utils.importlib import require_modules required_modules = ['vertica_python'] with require_modules(required_modules) as missing_modules: if not missing_modules: from .patch import patch, unpatch __all__ = [patch, unpatch]
25.346154
78
0.741275
173
1,318
5.526012
0.421965
0.08159
0.0659
0.043933
0.140167
0.073222
0
0
0
0
0
0
0.180577
1,318
51
79
25.843137
0.885185
0.800455
0
0
0
0
0.054902
0
0
0
0
0
0
1
0
false
0
0.333333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
0a5476d41706f1feaac0aa6254b09258ce332025
1,700
py
Python
lib/rdflib-3.1.0/test/test_trix_serialize.py
suzuken/xbrlparser
d9309081b8d21113ebb7a0983c677bee971af0a1
[ "MIT" ]
3
2015-01-12T16:16:50.000Z
2020-03-20T03:22:36.000Z
lib/rdflib-3.1.0/test/test_trix_serialize.py
suzuken/xbrlparser
d9309081b8d21113ebb7a0983c677bee971af0a1
[ "MIT" ]
null
null
null
lib/rdflib-3.1.0/test/test_trix_serialize.py
suzuken/xbrlparser
d9309081b8d21113ebb7a0983c677bee971af0a1
[ "MIT" ]
null
null
null
#!/usr/bin/env python import unittest from rdflib.graph import ConjunctiveGraph from rdflib.term import URIRef, Literal from rdflib.graph import Graph class TestTrixSerialize(unittest.TestCase): def setUp(self): pass def tearDown(self): pass def testSerialize(self): s1 = URIRef('store:1') r1 = URIRef('resource:1') r2 = URIRef('resource:2') label = URIRef('predicate:label') g1 = Graph(identifier = s1) g1.add((r1, label, Literal("label 1", lang="en"))) g1.add((r1, label, Literal("label 2"))) s2 = URIRef('store:2') g2 = Graph(identifier = s2) g2.add((r2, label, Literal("label 3"))) g = ConjunctiveGraph() for s,p,o in g1.triples((None, None, None)): g.addN([(s,p,o,g1)]) for s,p,o in g2.triples((None, None, None)): g.addN([(s,p,o,g2)]) r3 = URIRef('resource:3') g.add((r3, label, Literal(4))) r = g.serialize(format='trix') g3 = ConjunctiveGraph() from StringIO import StringIO g3.parse(StringIO(r), format='trix') for q in g3.quads((None,None,None)): # TODO: Fix once getGraph/getContext is in conjunctive graph if isinstance(q[3].identifier, URIRef): tg=Graph(store=g.store, identifier=q[3].identifier) else: # BNode, this is a bit ugly # we cannot match the bnode to the right graph automagically # here I know there is only one anonymous graph, # and that is the default one, but this is not always the case tg=g.default_context self.assertTrue(q[0:3] in tg) if __name__=='__main__': unittest.main()
26.984127
72
0.597059
236
1,700
4.262712
0.427966
0.047714
0.011928
0.04175
0.117296
0.101392
0.053678
0.053678
0.053678
0
0
0.029009
0.27
1,700
62
73
27.419355
0.781628
0.160588
0
0.051282
0
0
0.068966
0
0
0
0
0.016129
0.025641
1
0.076923
false
0.051282
0.128205
0
0.230769
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
1
0
0
0
0
0
2
0a5717bafa0ff0998fa59136b620ff9a8093ee50
11,521
py
Python
tests/test_mr_uplift.py
Ibotta/mr_uplift
e1facd39a87683dfdeaf7b08336e0ce781ff87cf
[ "Apache-2.0" ]
48
2020-04-22T16:57:55.000Z
2022-02-02T00:21:13.000Z
tests/test_mr_uplift.py
Ibotta/mr_uplift
e1facd39a87683dfdeaf7b08336e0ce781ff87cf
[ "Apache-2.0" ]
6
2020-05-01T18:15:22.000Z
2022-02-21T07:26:18.000Z
tests/test_mr_uplift.py
Ibotta/mr_uplift
e1facd39a87683dfdeaf7b08336e0ce781ff87cf
[ "Apache-2.0" ]
4
2020-04-25T08:41:34.000Z
2022-01-08T11:21:23.000Z
import numpy as np import pytest from mr_uplift.dataset.data_simulation import get_no_noise_data, get_simple_uplift_data, get_observational_uplift_data_1 from mr_uplift.mr_uplift import MRUplift, get_t_data from mr_uplift.keras_model_functionality import prepare_data_optimized_loss import sys import pandas as pd class TestMRUplift(object): def test_get_t_data(self): num_obs_1 = 10 num_obs_2 = 3 test_1 = get_t_data(0, num_obs_1) test_2 = get_t_data(np.array([0, 1]), num_obs_2) test_1_values = np.zeros(num_obs_1).reshape(-1, 1) test_2_values = np.concatenate([np.zeros(num_obs_2).reshape(-1, 1), np.ones(num_obs_2).reshape(-1, 1)], axis=1) assert np.mean(test_1 == test_1_values) == 1 assert np.mean(test_2 == test_2_values) == 1 def test_model_mean_outputs(self): true_ATE = np.array([[0, 0], [1, .5]]) rmse_tolerance = .05 num_obs = 10000 y_no_noise, x_no_noise, tmt_no_noise = get_no_noise_data(num_obs) uplift_model = MRUplift() uplift_model.fit(x_no_noise, y_no_noise, tmt_no_noise.reshape(-1, 1), n_jobs=1) oos_ice = uplift_model.predict_ice(response_transformer = True) assert np.sqrt(np.mean((oos_ice.mean(axis=1) -true_ATE)**2)) < rmse_tolerance def test_model_pred_oos_shapes(self): num_obs = 1000 y, x, t = get_simple_uplift_data(num_obs) t = np.concatenate([t.reshape(-1, 1), np.random.binomial(1, .5, num_obs).reshape(-1, 1)], axis=1) param_grid = dict(num_nodes=[8], dropout=[.1], activation=[ 'relu'], num_layers=[1], epochs=[1], batch_size=[1000]) uplift_model = MRUplift() uplift_model.fit(x, y, t, param_grid = param_grid, n_jobs=1) x_1 = x.copy() x_1 = pd.DataFrame(x_1) x_1.columns = ['var_'+str(x) for x in range(x.shape[1])] y_1 = y.copy() y_1 = pd.DataFrame(y_1) y_1.columns = ['var_'+str(x) for x in range(y.shape[1])] uplift_model_named = MRUplift() uplift_model_named.fit(x_1, y_1, t, param_grid = param_grid, n_jobs=1) assert uplift_model.predict_ice().shape == ( np.unique(t, axis=0).shape[0], num_obs * .7, y.shape[1]) assert uplift_model.predict_ice(x=x).shape == (np.unique(t,axis=0).shape[0], num_obs, y.shape[1]) assert uplift_model.get_erupt_curves() assert uplift_model.get_erupt_curves(x = x, y = y, t = t) assert uplift_model_named.get_erupt_curves() def test_model_pred_oos_shapes_single_col_tmt(self): num_obs = 1000 y, x, t = get_simple_uplift_data(num_obs) t = t.reshape(-1, 1) param_grid = dict(num_nodes=[8], dropout=[.1], activation=[ 'relu'], num_layers=[1], epochs=[1], batch_size=[1000]) uplift_model = MRUplift() uplift_model.fit(x, y, t, param_grid = param_grid, n_jobs=1) assert uplift_model.predict_ice().shape == ( np.unique(t, axis=0).shape[0], num_obs * .7, y.shape[1]) assert uplift_model.predict_ice(x=x).shape == (np.unique(t,axis=0).shape[0], num_obs, y.shape[1]) assert uplift_model.get_erupt_curves() assert uplift_model.get_erupt_curves(x = x, y = y, t = t) def test_model_pred_oos_shapes_single_col_tmt_propensity(self): num_obs = 1000 y, x, t = get_simple_uplift_data(num_obs) t = t.reshape(-1, 1) param_grid = dict(num_nodes=[8], dropout=[.1], activation=['relu'], num_layers=[2], epochs=[1], batch_size=[100], alpha = [.5], copy_several_times = [1]) uplift_model = MRUplift() uplift_model.fit(x, y, t, param_grid = param_grid, n_jobs=1, optimized_loss = True, use_propensity = True) assert uplift_model.predict_ice().shape == ( np.unique(t, axis=0).shape[0], num_obs * .7, y.shape[1]) assert uplift_model.predict_ice(x=x).shape == (np.unique(t,axis=0).shape[0], num_obs, y.shape[1]) assert uplift_model.get_erupt_curves() assert uplift_model.get_erupt_curves(x = x, y = y, t = t) def test_prepare_data_optimized_loss_one_col_tmt(self): num_obs = 1000 y, x, t = get_simple_uplift_data(num_obs) t = t.reshape(len(t),1) unique_treatments = np.unique(t, axis = 0) masks = np.ones(num_obs).reshape(num_obs,1) x, utility_weights, missing_utility, missing_y_mat, masks, weights = prepare_data_optimized_loss(x,y,t, masks ,unique_treatments) assert(utility_weights.shape == (num_obs, y.shape[1])) assert(missing_y_mat.shape == (num_obs, unique_treatments.shape[0], y.shape[1])) for q in range(unique_treatments.shape[0]): assert( ((missing_utility[:,q]==0) == (missing_y_mat[:,q,0] == -999)).mean() ==1 ) def test_prepare_data_optimized_loss_two_col_tmt(self): num_obs = 1000 y, x, t = get_simple_uplift_data(num_obs) t = np.concatenate([t.reshape(-1, 1), np.random.binomial(1, .5, num_obs).reshape(-1, 1)], axis=1) unique_treatments = np.unique(t, axis = 0) masks = np.ones(num_obs*len(unique_treatments)).reshape(num_obs,len(unique_treatments)) x, utility_weights, missing_utility, missing_y_mat, masks, weights = prepare_data_optimized_loss(x,y,t,masks, unique_treatments) assert(utility_weights.shape == (num_obs, y.shape[1])) assert(missing_y_mat.shape == (num_obs, unique_treatments.shape[0], y.shape[1])) for q in range(unique_treatments.shape[0]): assert( ((missing_utility[:,q]==0) == (missing_y_mat[:,q,0] == -999)).mean() ==1 ) def test_model_optim_mean_outputs(self): true_ATE = np.array([[0, 0], [1, .5]]) rmse_tolerance = .05 num_obs = 10000 param_grid = dict(num_nodes=[8], dropout=[.1], activation=['relu'], num_layers=[2], epochs=[30], batch_size=[100]) y_no_noise, x_no_noise, tmt_no_noise = get_no_noise_data(num_obs) uplift_model = MRUplift() uplift_model.fit(x_no_noise, y_no_noise, tmt_no_noise.reshape(-1, 1), n_jobs=1, param_grid = param_grid, optimized_loss = False) oos_ice = uplift_model.predict_ice(response_transformer = True) assert np.sqrt(np.mean((oos_ice.mean(axis=1) - true_ATE)**2)) < rmse_tolerance def test_model_get_random_erupts(self): true_ATE = np.array([[0, 0], [1, .5]]) rmse_tolerance = .05 num_obs = 10000 param_grid = dict(num_nodes=[8], dropout=[.1], activation=['relu'], num_layers=[2], epochs=[30], batch_size=[100], alpha = [.5], copy_several_times = [2]) y_no_noise, x_no_noise, tmt_no_noise = get_no_noise_data(num_obs) uplift_model = MRUplift() uplift_model.fit(x_no_noise, y_no_noise, tmt_no_noise.reshape(-1, 1), n_jobs=1, param_grid = param_grid, optimized_loss = True) oos_re = uplift_model.get_random_erupts() uplift_model_propensity = MRUplift() uplift_model_propensity.fit(x_no_noise, y_no_noise, tmt_no_noise.reshape(-1, 1), n_jobs=1, param_grid = param_grid, optimized_loss = True, use_propensity = True) oos_re_propensity = uplift_model_propensity.get_random_erupts() assert oos_re['mean'].iloc[0] > 0 assert oos_re_propensity['mean'].iloc[0] > 0 def test_varimp(self): num_obs = 10000 param_grid = dict(num_nodes=[8], dropout=[.1], activation=['relu'], num_layers=[2], epochs=[30], batch_size=[100]) y, x, t = get_simple_uplift_data(num_obs) uplift_model = MRUplift() uplift_model.fit(x, y, t.reshape(-1, 1), n_jobs=1, param_grid = param_grid) varimp = uplift_model.permutation_varimp(objective_weights = np.array([.7,-.3,0]).reshape(1,-1)) param_grid = dict(num_nodes=[8], dropout=[.1], activation=['relu'], num_layers=[2], epochs=[30], batch_size=[100], alpha = [.5], copy_several_times = [2]) uplift_model_propensity = MRUplift() uplift_model_propensity.fit(x, y, t.reshape(-1, 1), n_jobs=1, param_grid = param_grid, optimized_loss = True, use_propensity = True) varimp_propensity = uplift_model_propensity.permutation_varimp(objective_weights = np.array([.7,-.3,0]).reshape(1,-1)) assert varimp['permutation_varimp_metric'].iloc[0]>varimp['permutation_varimp_metric'].iloc[1] assert varimp_propensity['permutation_varimp_metric'].iloc[0]>varimp_propensity['permutation_varimp_metric'].iloc[1] def test_model_propensity(self): num_obs = 10000 TOLERANCE = .98 y, x, t, rule_assignment = get_observational_uplift_data_1(num_obs) param_grid = dict(num_nodes=[8], dropout=[.1], activation=['relu'], num_layers=[1], epochs=[20], batch_size=[512], alpha = [.9999,.99], copy_several_times = [1]) uplift_model = MRUplift() uplift_model.fit(x, y[:,0].reshape(-1,1), t, param_grid = param_grid, n_jobs=1, optimized_loss = True, use_propensity = True, test_size = 0) uplift_model.best_params_net y_test, x_test, t_test, rule_assignment_test = get_observational_uplift_data_1(num_obs) experiment_groups = np.zeros(num_obs)+2 experiment_groups[np.where(x_test[:,-2]<.5)[0]] = 1 experiment_groups[np.where(x_test[:,-2]<.33)[0]] = 0 experiment_groups[np.where(x_test[:,-1]>.8)[0]] = 3 optim_treatments_no_cuttoff = uplift_model.predict_optimal_treatments(x = x_test, use_propensity_score_cutoff = False) optim_treatments_cuttoff = uplift_model.predict_optimal_treatments(x = x_test, use_propensity_score_cutoff = True) optim_treatments_cuttoff_cat = optim_treatments_cuttoff.argmax(axis = 1) optim_treatments_no_cuttoff_cat = optim_treatments_no_cuttoff.argmax(axis = 1) correct_tmts_1 = np.array([x in [0,1] for x in optim_treatments_cuttoff_cat[np.where(experiment_groups == 0)[0]] ]).mean() correct_tmts_2 = np.array([x in [1,2] for x in optim_treatments_cuttoff_cat[np.where(experiment_groups == 1)[0]] ]).mean() correct_tmts_3 = np.array([x in [0,2] for x in optim_treatments_cuttoff_cat[np.where(experiment_groups == 2)[0]] ]).mean() correct_tmts_4 = np.array([x in [0] for x in optim_treatments_cuttoff_cat[np.where(experiment_groups == 3)[0]] ]).mean() correct_tmts_experiment_groups_1 = ((optim_treatments_cuttoff_cat[np.where(experiment_groups == 1)[0]] == 1) == x_test[np.where(experiment_groups == 1)[0],0]).mean() correct_tmts_no_cutoff = np.mean((optim_treatments_no_cuttoff_cat==1 ) == x_test[:,0]) assert correct_tmts_1>TOLERANCE assert correct_tmts_2>TOLERANCE assert correct_tmts_3>TOLERANCE assert correct_tmts_4>TOLERANCE assert correct_tmts_experiment_groups_1>TOLERANCE assert np.array_equal(optim_treatments_cuttoff_cat,optim_treatments_no_cuttoff_cat) is False assert correct_tmts_no_cutoff>TOLERANCE
42.356618
174
0.63432
1,699
11,521
3.964685
0.090642
0.040083
0.02405
0.026722
0.790974
0.74139
0.683492
0.665083
0.662411
0.627969
0
0.0394
0.23557
11,521
271
175
42.512915
0.725446
0
0
0.524064
0
0
0.012846
0.00868
0
0
0
0
0.181818
1
0.058824
false
0
0.037433
0
0.101604
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0a66d37f0e15138eb333c83b7140c80ba5e24e15
284
py
Python
loops/for/for3.py
camipozas/python-exercises
c8c02d2b9ff77f21592c99038e10434aba08dbc7
[ "MIT" ]
null
null
null
loops/for/for3.py
camipozas/python-exercises
c8c02d2b9ff77f21592c99038e10434aba08dbc7
[ "MIT" ]
null
null
null
loops/for/for3.py
camipozas/python-exercises
c8c02d2b9ff77f21592c99038e10434aba08dbc7
[ "MIT" ]
null
null
null
# Escribir un programa que muestre la sumatoria de todos los múltiplos de 7 encontrados entre el 0 y el 100. # Summing all the multiples of 7 from 0 to 100. total = 0 for i in range(101): if i % 7 == 0: total = total+i print("Sumatoria de los múltiplos de 7:", total)
28.4
110
0.679577
52
284
3.711538
0.634615
0.11399
0.145078
0.15544
0
0
0
0
0
0
0
0.079812
0.25
284
9
111
31.555556
0.826291
0.535211
0
0
0
0
0.251969
0
0
0
0
0.111111
0
1
0
false
0
0
0
0
0.2
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
2
6a54175f824a3a8a92a61c38d426dd45948b4848
364
py
Python
Use.py
Codingprivacy/Multiple-Rename
486289e8158487dad058cd8f781ac27bc9a5fc02
[ "MIT" ]
2
2018-04-01T06:16:33.000Z
2018-05-04T18:57:50.000Z
Use.py
codingprivacy/Multiple-Rename
486289e8158487dad058cd8f781ac27bc9a5fc02
[ "MIT" ]
null
null
null
Use.py
codingprivacy/Multiple-Rename
486289e8158487dad058cd8f781ac27bc9a5fc02
[ "MIT" ]
null
null
null
import multiple multiple.rename("C:/Users/Username/Desktop",'new_name',33,'.exe') """this above lines renames all the files of the folder Desktop to 'new_name' and count starts from 33 to further (we can also provide 1 to start it from 1) and extension is given '.exe' hence the files will be renamed like : 1. new_name33.exe 2. new_name34.exe and so on """
28
81
0.739011
66
364
4.015152
0.69697
0.05283
0
0
0
0
0
0
0
0
0
0.039474
0.164835
364
13
82
28
0.832237
0
0
0
0
0
0.435294
0.294118
0
0
0
0
0
1
0
true
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
6a5edc2a9e4d4da78b37be28e1fdb8023841826f
2,215
py
Python
Sec_10_expr_lambdas_fun_integradas/f_generators.py
PauloAlexSilva/Python
690913cdcfd8bde52d9ddd15e3c838e6aef27730
[ "MIT" ]
null
null
null
Sec_10_expr_lambdas_fun_integradas/f_generators.py
PauloAlexSilva/Python
690913cdcfd8bde52d9ddd15e3c838e6aef27730
[ "MIT" ]
null
null
null
Sec_10_expr_lambdas_fun_integradas/f_generators.py
PauloAlexSilva/Python
690913cdcfd8bde52d9ddd15e3c838e6aef27730
[ "MIT" ]
null
null
null
"""" Generator Expression Em aulas anteriores foi abordado: - List Comprehension; - Dictionary Comprehension; - Set Comprehension. Não foi abordado: - Tuple Comprehension ... porque elas se chamam Generators nomes = ['Carlos', 'Camila', 'Carla', 'Cristiana', 'Cristina', 'Vanessa'] print(any8[nomes[0] == 'C' for nome in nomes]) # Poderia ter sido feito usando os Generators nomes = ['Carlos', 'Camila', 'Carla', 'Cristiana', 'Cristina', 'Vanessa'] print(any(nome[0] == 'C' for nome in nomes)) # List Comprehension res = [nome[0] == 'C' for nome in nomes] print(type(res)) print(res) # [True, True, True, True, True, False] # Generator - mais efeciente res2 = (nome[0] == 'C' for nome in nomes) print(type(res2)) print(res2) # O que faz a função de getsizeof()? -> retorna a quantidade de bytes em memória do elemento # passado como parâmetro from sys import getsizeof # Mostra quantos bytes a string 'Paulo' está ocupando em memória. # Quanto maior a string mais espaço ocupa. print(getsizeof('Paulo')) print(getsizeof('Quanto maior a string mais espaço ocupa.')) print(getsizeof(9)) print(getsizeof(91)) print(getsizeof(12345667890)) print(getsizeof(True)) from sys import getsizeof # Gerando uma lista de números com List Comprehension list_comp = getsizeof([x * 10 for x in range(1000)]) # Gerando uma lista de números com Set Comprehension set_comp = getsizeof({x * 10 for x in range(1000)}) # Gerando uma lista de números com Dictionary Comprehension dic_comp = getsizeof({x: x * 10 for x in range(1000)}) # Gerando uma lista de números com Generator gen = getsizeof(x * 10 for x in range(1000)) print('Para fazer a mesma gastamos em memória: ') print(f'List Comprehension: {list_comp} bytes!') print(f'Set Comprehension: {set_comp} bytes!') print(f'Dictionary Comprehension: {dic_comp} bytes!') print(f'Generator Expression: {gen} bytes!') Para fazer a mesma gastamos em memória: List Comprehension: 8856 bytes! Set Comprehension: 32984 bytes! Dictionary Comprehension: 36960 bytes! Generator Expression: 112 bytes! """ # Posso iterar no Generator Expression? Sim gen = (x * 10 for x in range(1000)) print(gen) print(type(gen)) for num in gen: print(num)
24.340659
92
0.719187
321
2,215
4.943925
0.323988
0.05293
0.018904
0.022054
0.388784
0.388784
0.361689
0.308759
0.274102
0.101449
0
0.037217
0.16298
2,215
90
93
24.611111
0.81877
0.950339
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.6
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
6a68e42c5242acff02618aac8ab6c6c44bb61d29
1,312
py
Python
polyaxon/event_manager/event_manager.py
elyase/polyaxon
1c19f059a010a6889e2b7ea340715b2bcfa382a0
[ "MIT" ]
null
null
null
polyaxon/event_manager/event_manager.py
elyase/polyaxon
1c19f059a010a6889e2b7ea340715b2bcfa382a0
[ "MIT" ]
null
null
null
polyaxon/event_manager/event_manager.py
elyase/polyaxon
1c19f059a010a6889e2b7ea340715b2bcfa382a0
[ "MIT" ]
null
null
null
from hestia.manager_interface import ManagerInterface from event_manager import event_actions class EventManager(ManagerInterface): def _get_state_data(self, event): # pylint:disable=arguments-differ return event.event_type, event def subscribe(self, event): # pylint:disable=arguments-differ """ >>> subscribe(SomeEvent) """ super().subscribe(obj=event) def knows(self, event_type): # pylint:disable=arguments-differ return super().knows(key=event_type) def get(self, event_type): # pylint:disable=arguments-differ return super().get(key=event_type) def user_write_events(self): """Return event types where use acted on an object. The write events are events with actions: * CREATED * UPDATED * DELETED * RESUMED * COPIED * CLONED * STOPPED """ return [event_type for event_type, event in self.items if event.get_event_action() in event_actions.WRITE_ACTIONS] def user_view_events(self): """Return event types where use viewed a main object.""" return [event_type for event_type, event in self.items if event.get_event_action() == event_actions.VIEWED]
31.238095
90
0.634909
154
1,312
5.24026
0.363636
0.100372
0.109046
0.138786
0.47088
0.463445
0.371747
0.287485
0.287485
0.158612
0
0
0.278963
1,312
41
91
32
0.853066
0.29878
0
0.117647
0
0
0
0
0
0
0
0
0
1
0.352941
false
0
0.117647
0.176471
0.823529
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
6a750b59d5869e7c84ae1fcca0d133a7dbf28cce
9,165
py
Python
eval/scripts/human/html_gen.py
chateval/chatevalv2
7ba96d81842db00427a6d6351d5cea76a8766450
[ "Apache-2.0" ]
5
2018-06-11T19:47:23.000Z
2020-03-04T01:29:15.000Z
eval/scripts/human/html_gen.py
chateval/app
7ba96d81842db00427a6d6351d5cea76a8766450
[ "Apache-2.0" ]
12
2018-07-11T18:50:13.000Z
2022-02-10T10:45:58.000Z
eval/scripts/human/html_gen.py
chateval/app
7ba96d81842db00427a6d6351d5cea76a8766450
[ "Apache-2.0" ]
1
2018-06-29T14:52:16.000Z
2018-06-29T14:52:16.000Z
"""Stores all the helper functions that generate html""" import random def generate_2choice_html(example): '''Makes html for ranking form for the specified row index. Returns the HTML for a table of radio buttons used for ranking, as well as a count of the total number of radio buttons. ''' # Check for duplicates. if example.target_lines[0] == example.target_lines[1]: return "", 0 # Find all the non-duplicate target indices. target_indices = [0, 1] # Randomize the order targets are shown in. random.shuffle(target_indices) num_targets = len(target_indices) source_html = '' speaker = 'A' for utterance in example.source_line_utterances(): source_html += '<h4>Speaker %s: %s</h4>' % (speaker, utterance) speaker = 'A' if speaker == 'B' else 'B' html = """ <br/> <div class="panel panel-default btn-group"> %s <br/> <table> """ % (source_html) html += """ <tr> <td>Speaker %s: %s</td>""" % (speaker, example.target_lines[target_indices[0]]) html += """ <td> <label class="btn"> <input type="radio" class="%s" name="%s-target-%s" data-col="1" value="1"/> </label> </td> </tr>""" % (example.key, example.key, target_indices[0]) html += """ <tr> <td>Speaker %s: %s</td>""" % (speaker, example.target_lines[target_indices[1]]) html += """ <td> <label class="btn"> <input type="radio" class="%s" name="%s-target-%s" data-col="1" value="1"/> </label> </td> </tr>""" % (example.key, example.key, target_indices[1]) html += """ <tr> <td>It's a tie.</td> <td> <label class="btn"> <input type="radio" class="%s" name="%s-target-tie" data-col="1" value="1"/> </label> </td> </tr>""" % (example.key, example.key) html += """ </table> </div> """ return html, 1 def generate_ranking_tables_html(example): '''Makes html for ranking form for the specified row index. Returns the HTML for a table of radio buttons used for ranking, as well as a count of the total number of radio buttons. ''' # Find all the non-duplicate target indices. target_indices = [] for idx in range(len(example.target_lines)): current = example.target_lines[idx] if current not in example.target_lines[0:idx] or idx == 0: target_indices.append(idx) # Randomize the order targets are shown in. random.shuffle(target_indices) num_targets = len(target_indices) html = """ <br/> <div class="panel panel-default btn-group"> <h4>Speaker A: %s</h4> <table> <tr> <th></th> """ % example.source_line for idx in range(num_targets): if idx == 0: tag = 'best' elif idx == num_targets - 1: tag = 'worst' else: tag = '' html += '<th align="center">%s<br>%s</th>' % (tag, idx+1) html += "</tr>" for idx in target_indices: html += """ <tr> <td>Speaker B: %s</td>""" % (example.target_lines[idx]) # Add a row of radio buttons whose length is the number of options. for jdx in range(num_targets): html += """ <td> <label class="btn"> <input type="radio" class="%s" name="%s-target-%s" data-col="%s" value="%s"/> </label> </td>""" % (example.key, example.key, idx, jdx, jdx) html += "</tr>" html += """ </table> </div> """ return html, num_targets def generate_2choice_instructions(): return """ <p>Consider the following exchange between two speakers.</p> <p>Your task is to decide which response sounds better given the previous things said.</p> <p>If both responses are equally good, click "It's a tie."<p> <p><b>Example:</b><br/>Speaker A: can i get you something from the cafe?</p> <table> <tr><td>Speaker B: coffee would be great</td></tr> <tr><td>Speaker B: I don't know what to say.</td></tr> </table> <br/> <p>In this case, the first response is better as it directly answers Speaker A's question, so you should click the bubble next to it.</p> <h3>You must click the Submit button when you are finished. You must complete every question before you can click Submit.</h3> """ def generate_multuchoice_instructions(): return """ <p>Consider the following Twitter exchanges between Speakers A and B.</p> <p>Your task is to rank the possible responses by Speaker B from best to worst, where the best response should get the lowest ranking.</p> <br/> <p><b>Example:</b><br/>Speaker A: can i get you something from the cafe?</p> <table> <tr><td>Speaker B: coffee would be great</td></tr> <tr><td>Speaker B: can you believe he missed the shot?</td></tr> <tr><td>Speaker B: I don't know what to say.</td></tr> </table> <br/> <p>In this case, the first response should be given rank 1, the second rank 2, and the third rank 3.</p> <h3>You must click the Submit button when you are finished. You must complete every question before you can click Submit.</h3> """ def generate_HIT_html(num_required, tables_html, instructions): question_html_value = """ <HTMLQuestion xmlns="http://mechanicalturk.amazonaws.com/AWSMechanicalTurkDataSchemas/2011-11-11/HTMLQuestion.xsd"> <HTMLContent><![CDATA[ <!DOCTYPE html> <html> <head> <link crossorigin="anonymous" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css" integrity="sha384-IS73LIqjtYesmURkDE9MXKbXqYA8rvKEp/ghicjem7Vc3mGRdQRptJSz60tvrB6+" rel="stylesheet" /><!-- The following snippet enables the 'responsive' behavior on smaller screens --> <style> table { border-collapse: collapse; display: block; } td, th { border: 1px solid #ccc; } th:empty { border: 0; } #collapseTrigger{ color:#fff; display: block; text-decoration: none; } * { margin: 0; padding: 0; } tr td:nth-child(1) { padding-left: 10px; padding-right: 10px; } .panel { padding: 10px } </style> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/> <script src='https://s3.amazonaws.com/mturk-public/externalHIT_v1.js' type='text/javascript'></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> $(function() { var col, el; $("input[type=radio]").click(function() { // Make sure only one radio button is enabled per column. el = $(this); col = el.data("col"); cl = el.attr("class"); //if cl.includes("ex-") { $("input." + cl + "[data-col=" + col + "]").prop("checked", false); //} el.prop("checked", true); console.log("Here!") // Only enable submit if enough radio buttons are checked. if ($('input:radio:checked').length >= """ + str(num_required) + """ ) { $("input[type=submit]").removeAttr("disabled"); } else { $("input[type=submit]").attr("disabled", "disabled"); } }); }); $(document).ready(function() { // Instructions expand/collapse var content = $('#instructionBody'); var trigger = $('#collapseTrigger'); content.show(); $('.collapse-text').text('(Click to collapse)'); trigger.click(function(){ content.toggle(); var isVisible = content.is(':visible'); if(isVisible){ $('.collapse-text').text('(Click to collapse)'); }else{ $('.collapse-text').text('(Click to expand)'); } }); // end expand/collapse }); </script> <title>Chatbot Evaluation Task</title> </head> <body> <div class="col-xs-12 col-md-12"><!-- Instructions --> <div class="panel panel-primary"> <!-- WARNING: the ids "collapseTrigger" and "instructionBody" are being used to enable expand/collapse feature --> <a class="panel-heading" href="javascript:void(0);" id="collapseTrigger"><strong>Rate the Chatbot's Responses</strong> <span class="collapse-text">(Click to expand)</span> </a> <div class="panel-body" id="instructionBody"> """ + instructions + """ </div> </div> </div> <!-- HTML to handle creating the HIT form --> <form name='mturk_form' method='post' id='mturk_form' action='https://workersandbox.mturk.com/mturk/externalSubmit'> <input type='hidden' value='' name='assignmentId' id='assignmentId'/> <!-- This is where you define your question(s) --> """ + tables_html + """ <!-- HTML to handle submitting the HIT --> <p><input type='submit' id='submitButton' value='Submit' /></p></form> <h4>You must fill out rankings for every question before you can submit.</h4> <script language='Javascript'>turkSetAssignmentID();</script> </body> </html> ]]> </HTMLContent> <FrameHeight>600</FrameHeight> </HTMLQuestion> """ return question_html_value
33.448905
295
0.59509
1,186
9,165
4.55312
0.279089
0.033704
0.026667
0.013333
0.359444
0.342407
0.311296
0.311296
0.311296
0.279074
0
0.012111
0.243208
9,165
274
296
33.448905
0.766436
0.072995
0
0.369565
1
0.1
0.773469
0.101561
0
0
0
0
0
1
0.021739
false
0
0.004348
0.008696
0.052174
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
6a75a5070f34939725c30b7941b46fda26295424
1,582
py
Python
python3_module_template/subproject/myexample.py
sdpython/python_project_template
e365b29ba9a7dfd2688f68eb7ff2b84a6a82cb57
[ "MIT" ]
null
null
null
python3_module_template/subproject/myexample.py
sdpython/python_project_template
e365b29ba9a7dfd2688f68eb7ff2b84a6a82cb57
[ "MIT" ]
null
null
null
python3_module_template/subproject/myexample.py
sdpython/python_project_template
e365b29ba9a7dfd2688f68eb7ff2b84a6a82cb57
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ @file @brief This the documentation of this module (myexampleb). """ class myclass: """ This is the documentation for this class. **example with a sphinx directives** It works everywhere in the documentation. .. exref:: :title: an example of use Just for documentation purpose. :: m = myclass(0) The old way: @example(an old example of use) This only works from the code, not inserted in a RST file. The source documentation is parsed and every such example is collected and placed in a page ``all_examples.rst`` (look at the source). @code m = myclass(0) @endcode @endexample **FAQ** .. faqref:: :title: How to add a question ? Just look a this section. Look also :ref:`l-FAQ2`. .. faqref:: :title: Add a label :lid: label1 Look also :ref:`l-FAQ2`. **BLOC** .. blocref:: :title: How to add a bloc :tag: aaaa Just look a this bloc. Look also :ref:`l-FAQ2`. An accent, é, to check it is working. A link to github source: :githublink:`source|py`. """ def __init__(self, pa): """ documentation for the constructor @param pa first parameter """ self.pa = pa def get_value(self, mul): """ returns the parameter multiplied by a value @param mul a float @return a float """ return self.pa * mul
18.611765
58
0.54488
199
1,582
4.301508
0.482412
0.056075
0.038551
0.042056
0.088785
0
0
0
0
0
0
0.006897
0.358407
1,582
84
59
18.833333
0.836453
0.755373
0
0
0
0
0
0
0
0
0
0
0
1
0.4
false
0
0
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
6a7ab579c54d59a8d5d95bf8ca299d1a0ccc36a3
10,384
py
Python
sdks/python/apache_beam/runners/portability/expansion_service_test.py
stephenoken/beam
4797f310b6671de6fd703502520f4b012b655c82
[ "Apache-2.0" ]
3
2020-08-28T17:47:26.000Z
2021-08-17T06:38:58.000Z
sdks/python/apache_beam/runners/portability/expansion_service_test.py
stephenoken/beam
4797f310b6671de6fd703502520f4b012b655c82
[ "Apache-2.0" ]
5
2020-11-13T19:06:10.000Z
2021-11-10T19:56:12.000Z
sdks/python/apache_beam/runners/portability/expansion_service_test.py
stephenoken/beam
4797f310b6671de6fd703502520f4b012b655c82
[ "Apache-2.0" ]
1
2018-09-30T05:34:06.000Z
2018-09-30T05:34:06.000Z
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You 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. # # pytype: skip-file from __future__ import absolute_import import argparse import logging import signal import sys import typing import grpc from past.builtins import unicode import apache_beam as beam import apache_beam.transforms.combiners as combine from apache_beam.coders import StrUtf8Coder from apache_beam.pipeline import PipelineOptions from apache_beam.portability.api import beam_expansion_api_pb2_grpc from apache_beam.portability.api.external_transforms_pb2 import ExternalConfigurationPayload from apache_beam.runners.portability import expansion_service from apache_beam.transforms import ptransform from apache_beam.transforms.external import ImplicitSchemaPayloadBuilder from apache_beam.utils.thread_pool_executor import UnboundedThreadPoolExecutor # This script provides an expansion service and example ptransforms for running # external transform test cases. See external_test.py for details. _LOGGER = logging.getLogger(__name__) TEST_PREFIX_URN = "beam:transforms:xlang:test:prefix" TEST_MULTI_URN = "beam:transforms:xlang:test:multi" TEST_GBK_URN = "beam:transforms:xlang:test:gbk" TEST_CGBK_URN = "beam:transforms:xlang:test:cgbk" TEST_COMGL_URN = "beam:transforms:xlang:test:comgl" TEST_COMPK_URN = "beam:transforms:xlang:test:compk" TEST_FLATTEN_URN = "beam:transforms:xlang:test:flatten" TEST_PARTITION_URN = "beam:transforms:xlang:test:partition" @ptransform.PTransform.register_urn('beam:transforms:xlang:count', None) class CountPerElementTransform(ptransform.PTransform): def expand(self, pcoll): return pcoll | combine.Count.PerElement() def to_runner_api_parameter(self, unused_context): return 'beam:transforms:xlang:count', None @staticmethod def from_runner_api_parameter( unused_ptransform, unused_parameter, unused_context): return CountPerElementTransform() @ptransform.PTransform.register_urn( 'beam:transforms:xlang:filter_less_than_eq', bytes) class FilterLessThanTransform(ptransform.PTransform): def __init__(self, payload): self._payload = payload def expand(self, pcoll): return ( pcoll | beam.Filter( lambda elem, target: elem <= target, int(ord(self._payload[0])))) def to_runner_api_parameter(self, unused_context): return ( 'beam:transforms:xlang:filter_less_than', self._payload.encode('utf8')) @staticmethod def from_runner_api_parameter(unused_ptransform, payload, unused_context): return FilterLessThanTransform(payload.decode('utf8')) @ptransform.PTransform.register_urn(TEST_PREFIX_URN, None) @beam.typehints.with_output_types(unicode) class PrefixTransform(ptransform.PTransform): def __init__(self, payload): self._payload = payload def expand(self, pcoll): return pcoll | 'TestLabel' >> beam.Map( lambda x: '{}{}'.format(self._payload, x)) def to_runner_api_parameter(self, unused_context): return TEST_PREFIX_URN, ImplicitSchemaPayloadBuilder( {'data': self._payload}).payload() @staticmethod def from_runner_api_parameter(unused_ptransform, payload, unused_context): return PrefixTransform(parse_string_payload(payload)['data']) @ptransform.PTransform.register_urn(TEST_MULTI_URN, None) class MutltiTransform(ptransform.PTransform): def expand(self, pcolls): return { 'main': (pcolls['main1'], pcolls['main2']) | beam.Flatten() | beam.Map(lambda x, s: x + s, beam.pvalue.AsSingleton( pcolls['side'])).with_output_types(unicode), 'side': pcolls['side'] | beam.Map(lambda x: x + x).with_output_types(unicode), } def to_runner_api_parameter(self, unused_context): return TEST_MULTI_URN, None @staticmethod def from_runner_api_parameter( unused_ptransform, unused_parameter, unused_context): return MutltiTransform() @ptransform.PTransform.register_urn(TEST_GBK_URN, None) class GBKTransform(ptransform.PTransform): def expand(self, pcoll): return pcoll | 'TestLabel' >> beam.GroupByKey() def to_runner_api_parameter(self, unused_context): return TEST_GBK_URN, None @staticmethod def from_runner_api_parameter( unused_ptransform, unused_parameter, unused_context): return GBKTransform() @ptransform.PTransform.register_urn(TEST_CGBK_URN, None) class CoGBKTransform(ptransform.PTransform): class ConcatFn(beam.DoFn): def process(self, element): (k, v) = element return [(k, v['col1'] + v['col2'])] def expand(self, pcoll): return pcoll \ | beam.CoGroupByKey() \ | beam.ParDo(self.ConcatFn()).with_output_types( typing.Tuple[int, typing.Iterable[unicode]]) def to_runner_api_parameter(self, unused_context): return TEST_CGBK_URN, None @staticmethod def from_runner_api_parameter( unused_ptransform, unused_parameter, unused_context): return CoGBKTransform() @ptransform.PTransform.register_urn(TEST_COMGL_URN, None) class CombineGloballyTransform(ptransform.PTransform): def expand(self, pcoll): return pcoll \ | beam.CombineGlobally(sum).with_output_types(int) def to_runner_api_parameter(self, unused_context): return TEST_COMGL_URN, None @staticmethod def from_runner_api_parameter( unused_ptransform, unused_parameter, unused_context): return CombineGloballyTransform() @ptransform.PTransform.register_urn(TEST_COMPK_URN, None) class CombinePerKeyTransform(ptransform.PTransform): def expand(self, pcoll): return pcoll \ | beam.CombinePerKey(sum).with_output_types( typing.Tuple[unicode, int]) def to_runner_api_parameter(self, unused_context): return TEST_COMPK_URN, None @staticmethod def from_runner_api_parameter( unused_ptransform, unused_parameter, unused_context): return CombinePerKeyTransform() @ptransform.PTransform.register_urn(TEST_FLATTEN_URN, None) class FlattenTransform(ptransform.PTransform): def expand(self, pcoll): return pcoll.values() | beam.Flatten().with_output_types(int) def to_runner_api_parameter(self, unused_context): return TEST_FLATTEN_URN, None @staticmethod def from_runner_api_parameter( unused_ptransform, unused_parameter, unused_context): return FlattenTransform() @ptransform.PTransform.register_urn(TEST_PARTITION_URN, None) class PartitionTransform(ptransform.PTransform): def expand(self, pcoll): col1, col2 = pcoll | beam.Partition( lambda elem, n: 0 if elem % 2 == 0 else 1, 2) typed_col1 = col1 | beam.Map(lambda x: x).with_output_types(int) typed_col2 = col2 | beam.Map(lambda x: x).with_output_types(int) return {'0': typed_col1, '1': typed_col2} def to_runner_api_parameter(self, unused_context): return TEST_PARTITION_URN, None @staticmethod def from_runner_api_parameter( unused_ptransform, unused_parameter, unused_context): return PartitionTransform() @ptransform.PTransform.register_urn('payload', bytes) class PayloadTransform(ptransform.PTransform): def __init__(self, payload): self._payload = payload def expand(self, pcoll): return pcoll | beam.Map(lambda x, s: x + s, self._payload) def to_runner_api_parameter(self, unused_context): return b'payload', self._payload.encode('ascii') @staticmethod def from_runner_api_parameter(unused_ptransform, payload, unused_context): return PayloadTransform(payload.decode('ascii')) @ptransform.PTransform.register_urn('fib', bytes) class FibTransform(ptransform.PTransform): def __init__(self, level): self._level = level def expand(self, p): if self._level <= 2: return p | beam.Create([1]) else: a = p | 'A' >> beam.ExternalTransform( 'fib', str(self._level - 1).encode('ascii'), expansion_service.ExpansionServiceServicer()) b = p | 'B' >> beam.ExternalTransform( 'fib', str(self._level - 2).encode('ascii'), expansion_service.ExpansionServiceServicer()) return ((a, b) | beam.Flatten() | beam.CombineGlobally(sum).without_defaults()) def to_runner_api_parameter(self, unused_context): return 'fib', str(self._level).encode('ascii') @staticmethod def from_runner_api_parameter(unused_ptransform, level, unused_context): return FibTransform(int(level.decode('ascii'))) def parse_string_payload(input_byte): payload = ExternalConfigurationPayload() payload.ParseFromString(input_byte) coder = StrUtf8Coder() return { k: coder.decode_nested(v.payload) for k, v in payload.configuration.items() } server = None def cleanup(unused_signum, unused_frame): _LOGGER.info('Shutting down expansion service.') server.stop(None) def main(unused_argv): parser = argparse.ArgumentParser() parser.add_argument( '-p', '--port', type=int, help='port on which to serve the job api') options = parser.parse_args() global server server = grpc.server(UnboundedThreadPoolExecutor()) beam_expansion_api_pb2_grpc.add_ExpansionServiceServicer_to_server( expansion_service.ExpansionServiceServicer( PipelineOptions( ["--experiments", "beam_fn_api", "--sdk_location", "container"])), server) server.add_insecure_port('localhost:{}'.format(options.port)) server.start() _LOGGER.info('Listening for expansion requests at %d', options.port) signal.signal(signal.SIGTERM, cleanup) signal.signal(signal.SIGINT, cleanup) # blocking main thread forever. signal.pause() if __name__ == '__main__': logging.getLogger().setLevel(logging.INFO) main(sys.argv)
32.654088
92
0.74557
1,276
10,384
5.831505
0.212382
0.064507
0.058057
0.049993
0.470098
0.355463
0.336917
0.315011
0.291762
0.256283
0
0.00399
0.155335
10,384
317
93
32.757098
0.844374
0.090716
0
0.318584
0
0
0.074727
0.041715
0
0
0
0
0
1
0.19469
false
0
0.079646
0.150442
0.504425
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
6a7c3c233cce04ab709c5ec217d50c3347a2a2a8
2,429
py
Python
calc/history/calculations.py
dhruvshah1996/Project3
d87ad37f6cf2de0d3402c71d21b25258946aad69
[ "MIT" ]
null
null
null
calc/history/calculations.py
dhruvshah1996/Project3
d87ad37f6cf2de0d3402c71d21b25258946aad69
[ "MIT" ]
null
null
null
calc/history/calculations.py
dhruvshah1996/Project3
d87ad37f6cf2de0d3402c71d21b25258946aad69
[ "MIT" ]
null
null
null
"""Calculation history Class""" from calc.calculations.addition import Addition from calc.calculations.subtraction import Subtraction from calc.calculations.multiplication import Multiplication from calc.calculations.division import Division class Calculations: """Calculations class manages the history of calculations""" history = [] # pylint: disable=too-few-public-methods @staticmethod def clear_history(): """clear the history of calculations""" Calculations.history.clear() return True @staticmethod def count_history(): """get number of items in history""" return len(Calculations.history) @staticmethod def get_last_calculation_object(): """get last calculation""" return Calculations.history[-1] @staticmethod def get_last_calculation_result_value(): """get last calculation""" calculation = Calculations.get_last_calculation_object() return calculation.get_result() @staticmethod def get_first_calculation(): """get first calculation""" return Calculations.history[0] @staticmethod def get_calculation(num): """ get a specific calculation from history""" return Calculations.history[num] @staticmethod def add_calculation(calculation): """ get a generic calculation from history""" return Calculations.history.append(calculation) @staticmethod def add_addition_calculation_to_history(values): """create an addition and add object to history using factory method create""" Calculations.add_calculation(Addition.create(values)) #Get the result of the calculation return True @staticmethod def add_subtraction_calculation_to_history(values): """create a subtraction object to history using factory method create""" Calculations.add_calculation(Subtraction.create(values)) return True @staticmethod def add_multiplication_calculation_to_history(values): """Add a multiplication object to history using factory method create""" Calculations.add_calculation(Multiplication.create(values)) return True @staticmethod def add_division_calculation_to_history(values): "Add a division object to history using factory method create" Calculations.add_calculation(Division.create(values)) return True
40.483333
86
0.712227
259
2,429
6.53668
0.200772
0.09746
0.05316
0.059067
0.385115
0.29179
0.200827
0.153574
0.153574
0.153574
0
0.001042
0.209963
2,429
60
87
40.483333
0.881188
0.258954
0
0.347826
0
0
0.03337
0
0
0
0
0
0
1
0.23913
false
0
0.086957
0
0.608696
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
6a863c2235ddfde035ee8193728b86e170dd1480
1,471
py
Python
costcalculator/forms.py
connor-c/Trip-Gas-Cost-Calculator
6101093ffd48b6cb6c4f847b8c1f40351617750b
[ "MIT" ]
null
null
null
costcalculator/forms.py
connor-c/Trip-Gas-Cost-Calculator
6101093ffd48b6cb6c4f847b8c1f40351617750b
[ "MIT" ]
8
2020-02-11T23:59:35.000Z
2022-02-10T07:16:43.000Z
costcalculator/forms.py
connor-c/Trip-Gas-Cost-Calculator
6101093ffd48b6cb6c4f847b8c1f40351617750b
[ "MIT" ]
null
null
null
from django import forms from django.core.validators import MinValueValidator, MinLengthValidator class OriginForm(forms.Form): origin_address = forms.CharField(validators=[MinLengthValidator(1)], widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'inlineFormInputGroup', 'placeholder': '123 Tech St, Silicon Valley, CA 00000'})) class DestinationForm(forms.Form): destination_address = forms.CharField(validators=[MinLengthValidator(1)], widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'inlineFormInputGroup', 'placeholder': '123 Tech St, Silicon Valley, CA 00000'})) class GasPriceForm(forms.Form): gas_price = forms.FloatField(validators=[MinValueValidator(0.01)], widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'inlineFormInputGroup', 'placeholder': '1.23'})) class MpgForm(forms.Form): mpg = forms.FloatField(validators=[MinValueValidator(0.01)], widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'inlineFormInputGroup', 'placeholder': '12'})) class NumPeopleForm(forms.Form): num_people = forms.IntegerField(validators=[MinValueValidator(1)], widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'inlineFormInputGroup', 'placeholder': '1 (default is 1 if left blank)'})) class DistanceForm(forms.Form): distance = forms.FloatField(validators=[MinValueValidator(0.01)], widget=forms.TextInput(attrs={'class': 'form-control', 'id': 'inlineFormInputGroup', 'placeholder': '15.2'}))
70.047619
220
0.747791
164
1,471
6.682927
0.329268
0.04927
0.109489
0.136861
0.684307
0.684307
0.684307
0.684307
0.684307
0.684307
0
0.02819
0.083617
1,471
20
221
73.55
0.784866
0
0
0
0
0
0.281441
0
0
0
0
0
0
1
0
false
0
0.142857
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
6a8bca56c22e3267d252604b1793381dda94c58e
626
py
Python
src/picome/hukeyboard.py
guibohnert91/picome
9b91c28f7e83a2b730cafbda1a97205672f3e676
[ "MIT" ]
null
null
null
src/picome/hukeyboard.py
guibohnert91/picome
9b91c28f7e83a2b730cafbda1a97205672f3e676
[ "MIT" ]
null
null
null
src/picome/hukeyboard.py
guibohnert91/picome
9b91c28f7e83a2b730cafbda1a97205672f3e676
[ "MIT" ]
null
null
null
from adafruit_hid.keyboard import Keyboard from adafruit_hid.keyboard_layout_us import KeyboardLayoutUS from adafruit_hid.keycode import Keycode import usb_hid import time class HumanKeyboard(object): def __init__(self): self.keyboard = Keyboard(usb_hid.devices) self.keyboardLayout = KeyboardLayoutUS(self.keyboard) def keyPress(self, keyCode): """Send a human like keypress. Keyword arguments: keyCode -- the real key to be pressed (example Keycode.SEVEN) """ self.keyboard.press(keyCode) time.sleep(0.1) self.keyboard.release(keyCode)
28.454545
73
0.702875
75
626
5.72
0.52
0.111888
0.104895
0.107226
0
0
0
0
0
0
0
0.004098
0.220447
626
22
74
28.454545
0.875
0.174121
0
0
0
0
0
0
0
0
0
0
0
1
0.153846
false
0
0.384615
0
0.615385
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
6a90540c04aa6d7b6d0419ad6f3c05ff1c4aa797
377
py
Python
scripts/field/Curbrock_Summon1.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
54
2019-04-16T23:24:48.000Z
2021-12-18T11:41:50.000Z
scripts/field/Curbrock_Summon1.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
3
2019-05-19T15:19:41.000Z
2020-04-27T16:29:16.000Z
scripts/field/Curbrock_Summon1.py
G00dBye/YYMS
1de816fc842b6598d5b4b7896b6ab0ee8f7cdcfb
[ "MIT" ]
49
2020-11-25T23:29:16.000Z
2022-03-26T16:20:24.000Z
# Curbrock Summon 2 CURBROCK2 = 9400930 # MOD ID CURBROCKS_ESCAPE_ROUTE_VER2 = 600050040 # MAP ID CURBROCKS_ESCAPE_ROUTE_VER3 = 600050050 # MAP ID 2 sm.spawnMob(CURBROCK2, 190, -208, False) sm.createClock(1800) sm.addEvent(sm.invokeAfterDelay(1800000, "warp", CURBROCKS_ESCAPE_ROUTE_VER3, 0)) sm.waitForMobDeath(CURBROCK2) sm.warp(CURBROCKS_ESCAPE_ROUTE_VER2) sm.stopEvents()
31.416667
81
0.806366
53
377
5.509434
0.54717
0.205479
0.273973
0.150685
0
0
0
0
0
0
0
0.152493
0.095491
377
12
82
31.416667
0.703812
0.106101
0
0
0
0
0.012012
0
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
6a9096da46f0e3f90b72b1a819bf62ce11ddc6bd
786
py
Python
trainloops/listeners/cluster_killswitch.py
Gerryflap/master_thesis
5dc16e21b23837fee8a4532679bb5cb961af0b7c
[ "MIT" ]
null
null
null
trainloops/listeners/cluster_killswitch.py
Gerryflap/master_thesis
5dc16e21b23837fee8a4532679bb5cb961af0b7c
[ "MIT" ]
null
null
null
trainloops/listeners/cluster_killswitch.py
Gerryflap/master_thesis
5dc16e21b23837fee8a4532679bb5cb961af0b7c
[ "MIT" ]
null
null
null
""" Cancelling jobs on the University cluster forces programs to instantly quit, which sometimes crashes cluster nodes. As a remedy, this killswitch listener will stop the experiment in a nicer way to prevent this from happening. The experiment will be stopped if a file named "stop" is encountered in the results folder of the experiment. The existence of this file is checked after each epoch. """ import os from trainloops.listeners.listener import Listener class KillSwitchListener(Listener): def __init__(self, experiment_path): super().__init__() self.path = os.path.join(experiment_path, "stop") def initialize(self): pass def report(self, state_dict): if os.path.exists(self.path): exit()
32.75
113
0.704835
106
786
5.122642
0.603774
0.071823
0
0
0
0
0
0
0
0
0
0
0.229008
786
23
114
34.173913
0.89604
0.507634
0
0
0
0
0.011142
0
0
0
0
0
0
1
0.272727
false
0.090909
0.181818
0
0.545455
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
6a975a412e5d4fce44f6c3c23326742e66d78cbe
1,272
py
Python
authserver/mailauth/migrations/0011_mnserviceuser.py
yopiti/authserver
0a1f7f5a83d03963d1ecfb5199be8e05d3068dfd
[ "MIT" ]
8
2017-07-04T10:07:32.000Z
2022-01-02T10:31:43.000Z
authserver/mailauth/migrations/0011_mnserviceuser.py
yopiti/authserver
0a1f7f5a83d03963d1ecfb5199be8e05d3068dfd
[ "MIT" ]
14
2020-02-11T21:42:38.000Z
2022-03-28T16:00:55.000Z
authserver/mailauth/migrations/0011_mnserviceuser.py
yopiti/authserver
0a1f7f5a83d03963d1ecfb5199be8e05d3068dfd
[ "MIT" ]
1
2020-03-01T10:39:28.000Z
2020-03-01T10:39:28.000Z
# -*- coding: utf-8 -*- # Generated by Django 1.11.11 on 2018-03-13 00:16 from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion import mailauth.models import uuid class Migration(migrations.Migration): dependencies = [ ('mailauth', '0010_domain_redirect_to'), ] operations = [ migrations.CreateModel( name='MNServiceUser', fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('username', models.CharField(default=uuid.uuid4, max_length=64, verbose_name='Username')), ('password', mailauth.models.PretendHasherPasswordField(max_length=128, verbose_name='Password')), ('description', models.CharField(blank=True, default='', max_length=255)), ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), ], options={ 'verbose_name': 'Service User', 'verbose_name_plural': 'Service Users', }, bases=(mailauth.models.PasswordMaskMixin, models.Model), ), ]
36.342857
118
0.633648
133
1,272
5.894737
0.556391
0.070153
0.035714
0.056122
0
0
0
0
0
0
0
0.032124
0.241352
1,272
34
119
37.411765
0.780311
0.054245
0
0
1
0
0.125833
0.019167
0
0
0
0
0
1
0
false
0.074074
0.222222
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
6aa73c2ad6102f4cce8d4e90a98090c3f6fe5363
342
py
Python
src/tools/types/obj.py
loongson-zn/build
d4bedebfa046b763c316e31c98b48ed2779741b9
[ "BSL-1.0" ]
215
2015-01-10T17:16:34.000Z
2022-02-23T15:22:08.000Z
src/tools/types/obj.py
loongson-zn/build
d4bedebfa046b763c316e31c98b48ed2779741b9
[ "BSL-1.0" ]
594
2015-01-22T16:17:55.000Z
2022-02-26T22:11:01.000Z
src/tools/types/obj.py
loongson-zn/build
d4bedebfa046b763c316e31c98b48ed2779741b9
[ "BSL-1.0" ]
302
2015-02-03T01:20:29.000Z
2022-02-12T07:01:28.000Z
# Copyright David Abrahams 2004. Distributed under the Boost # Software License, Version 1.0. (See accompanying # file LICENSE.txt or copy at https://www.bfgroup.xyz/b2/LICENSE.txt) from b2.build import type def register (): type.register_type ('OBJ', ['obj'], None, ['NT', 'CYGWIN']) type.register_type ('OBJ', ['o']) register ()
28.5
69
0.692982
49
342
4.795918
0.734694
0.153191
0.13617
0.161702
0
0
0
0
0
0
0
0.027586
0.152047
342
11
70
31.090909
0.782759
0.511696
0
0
0
0
0.110429
0
0
0
0
0
0
1
0.2
true
0
0.2
0
0.4
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
6aad34cdb7b95e79e68448f602b65f3d09cae50a
1,106
py
Python
test/smptest.py
myrtam/CANNR
b966a873ec60264b0fd42b81edadb5495237d7ea
[ "Apache-2.0" ]
null
null
null
test/smptest.py
myrtam/CANNR
b966a873ec60264b0fd42b81edadb5495237d7ea
[ "Apache-2.0" ]
null
null
null
test/smptest.py
myrtam/CANNR
b966a873ec60264b0fd42b81edadb5495237d7ea
[ "Apache-2.0" ]
1
2021-05-14T08:37:37.000Z
2021-05-14T08:37:37.000Z
""" Test harness for smp.py """ import sys import os sys.path.append('/Users/ptendick/open-source-workspace/cannr Image/source/cannr/lib') os.environ['PATH'] = '/Library/Frameworks/Python.framework/Versions/3.7/bin:' + os.environ['PATH'] import cannr import smp # Test openProcess by opening a Flask process def test_openProcess1(): return smp.openProcess( {"processInfo": "processInfo"}, ['python', '/Users/ptendick/open-source-workspace/cannr Image/test/flaskSample.py', '5000', '1']) # Test openProcess by opening a Plumber process def test_openProcess2(): return smp.openProcess( {"processInfo": "processInfo"}, ['Rscript', '--vanilla', '/Users/ptendick/open-source-workspace/cannr Image/source/cannr/runApp.R', '/Users/ptendick/open-source-workspace/cannr Image/test/hello.R', '5001', '2']) # Test countPorts def test_countPorts(): projectFilePath = '/Users/ptendick/open-source-workspace/MyRTAM Service/working/project1/project.json' project = cannr.readJSONFile(projectFilePath) return smp.countPorts(project)
32.529412
108
0.705244
133
1,106
5.842105
0.43609
0.083655
0.109395
0.148005
0.468468
0.254826
0.254826
0.254826
0.136422
0
0
0.01594
0.149186
1,106
33
109
33.515152
0.809777
0.117541
0
0.210526
0
0.105263
0.505176
0.39441
0
0
0
0
0
1
0.157895
false
0
0.210526
0.105263
0.526316
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
6ab44cf57a381d44d95045fd0ee5b06ba9aa8eed
2,257
py
Python
tracker/view/error.py
cmm1107/arch-security-tracker
7d5f7d69f2b02c056c3888a9b70132c29432a468
[ "MIT" ]
null
null
null
tracker/view/error.py
cmm1107/arch-security-tracker
7d5f7d69f2b02c056c3888a9b70132c29432a468
[ "MIT" ]
null
null
null
tracker/view/error.py
cmm1107/arch-security-tracker
7d5f7d69f2b02c056c3888a9b70132c29432a468
[ "MIT" ]
null
null
null
from binascii import hexlify from functools import wraps from logging import error from os import urandom from random import randint from flask import make_response from flask import render_template from werkzeug.exceptions import BadRequest from werkzeug.exceptions import Forbidden from werkzeug.exceptions import Gone from werkzeug.exceptions import InternalServerError from werkzeug.exceptions import MethodNotAllowed from werkzeug.exceptions import NotFound from config import get_debug_flag from tracker import tracker from tracker.symbol import smileys_sad error_handlers = [] def errorhandler(code_or_exception): def decorator(func): error_handlers.append({'func': func, 'code_or_exception': code_or_exception}) @wraps(func) def wrapped(*args, **kwargs): return func(*args, **kwargs) return wrapped return decorator def handle_error(e, code, json=False): if json: return {'message': e}, code return make_response(render_template('error.html', smiley=smileys_sad[randint(0, len(smileys_sad) - 1)], text=e, title='{}'.format(code)), code) @errorhandler(NotFound.code) def not_found(e='404: Not Found', json=False): return handle_error(e if 'check your spelling' not in '{}'.format(e) else '404: Not Found', NotFound.code, json) @errorhandler(Forbidden.code) def forbidden(e='403: Forbidden', json=False): return handle_error(e, Forbidden.code, json) @errorhandler(MethodNotAllowed.code) def method_not_allowed(e='405: Method Not Allowed', json=False): return handle_error(e, MethodNotAllowed.code, json) @errorhandler(Gone.code) def gone(e='410: Gone', json=False): return handle_error(e, Gone.code, json) @errorhandler(BadRequest.code) def bad_request(e='400: Bad Request', json=False): return handle_error(e, BadRequest.code, json) @errorhandler(Exception) @errorhandler(InternalServerError.code) def internal_error(e): if get_debug_flag(): raise e code = hexlify(urandom(4)).decode() error(Exception("Code: {}".format(code), e), exc_info=True) text = '500: Deep Shit\n{}'.format(code) return handle_error(text, InternalServerError.code)
29.311688
116
0.717767
293
2,257
5.419795
0.296928
0.048489
0.083123
0.105793
0.085013
0.085013
0
0
0
0
0
0.012917
0.176783
2,257
76
117
29.697368
0.841765
0
0
0
0
0
0.078423
0
0
0
0
0
0
1
0.178571
false
0
0.285714
0.107143
0.660714
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
6ab4b36734b64370a49309c3224c455e6990233d
59,130
gyp
Python
base/base.gyp
eval1749/elang
5208b386ba3a3e866a5c0f0271280f79f9aac8c4
[ "Apache-2.0" ]
1
2018-01-27T22:40:53.000Z
2018-01-27T22:40:53.000Z
base/base.gyp
eval1749/elang
5208b386ba3a3e866a5c0f0271280f79f9aac8c4
[ "Apache-2.0" ]
1
2016-01-29T00:54:49.000Z
2016-01-29T00:54:49.000Z
base/base.gyp
eval1749/elang
5208b386ba3a3e866a5c0f0271280f79f9aac8c4
[ "Apache-2.0" ]
null
null
null
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'variables': { 'chromium_code': 1, }, 'includes': [ '../build/win_precompile.gypi', 'base.gypi', ], 'targets': [ { 'target_name': 'base', 'type': '<(component)', 'toolsets': ['host', 'target'], 'variables': { 'base_target': 1, 'enable_wexit_time_destructors': 1, 'optimize': 'max', }, 'dependencies': [ 'base_static', 'allocator/allocator.gyp:allocator_extension_thunks', '../testing/gtest.gyp:gtest_prod', '../third_party/modp_b64/modp_b64.gyp:modp_b64', 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', ], # TODO(gregoryd): direct_dependent_settings should be shared with the # 64-bit target, but it doesn't work due to a bug in gyp 'direct_dependent_settings': { 'include_dirs': [ '..', ], }, 'conditions': [ ['desktop_linux == 1 or chromeos == 1', { 'conditions': [ ['chromeos==1', { 'sources/': [ ['include', '_chromeos\\.cc$'] ] }], ], 'dependencies': [ 'symbolize', 'xdg_mime', ], 'defines': [ 'USE_SYMBOLIZE', ], }, { # desktop_linux == 0 and chromeos == 0 'sources/': [ ['exclude', '/xdg_user_dirs/'], ['exclude', '_nss\\.cc$'], ], }], ['use_glib==1', { 'dependencies': [ '../build/linux/system.gyp:glib', ], 'export_dependent_settings': [ '../build/linux/system.gyp:glib', ], }], ['OS == "android" and _toolset == "host"', { # Always build base as a static_library for host toolset, even if # we're doing a component build. Specifically, we only care about the # target toolset using components since that's what developers are # focusing on. In theory we should do this more generally for all # targets when building for host, but getting the gyp magic # per-toolset for the "component" variable is hard, and we really only # need base on host. 'type': 'static_library', # Base for host support is the minimum required to run the # ssl false start blacklist tool. It requires further changes # to generically support host builds (and tests). # Note: when building for host, gyp has OS == "android", # hence the *_android.cc files are included but the actual code # doesn't have OS_ANDROID / ANDROID defined. 'conditions': [ ['host_os == "mac"', { 'sources/': [ ['exclude', '^native_library_linux\\.cc$'], ['exclude', '^process_util_linux\\.cc$'], ['exclude', '^sys_info_linux\\.cc$'], ['exclude', '^sys_string_conversions_linux\\.cc$'], ['exclude', '^worker_pool_linux\\.cc$'], ], }], ], }], ['OS == "android" and _toolset == "target"', { 'dependencies': [ 'base_java', 'base_jni_headers', '../build/android/ndk.gyp:cpu_features', '../third_party/ashmem/ashmem.gyp:ashmem', ], 'link_settings': { 'libraries': [ '-llog', ], }, 'sources!': [ 'debug/stack_trace_posix.cc', ], }], ['os_bsd==1', { 'include_dirs': [ '/usr/local/include', ], 'link_settings': { 'libraries': [ '-L/usr/local/lib -lexecinfo', ], }, }], ['OS == "linux"', { 'link_settings': { 'libraries': [ # We need rt for clock_gettime(). '-lrt', # For 'native_library_linux.cc' '-ldl', ], }, 'conditions': [ ['use_allocator!="tcmalloc"', { 'defines': [ 'NO_TCMALLOC', ], 'direct_dependent_settings': { 'defines': [ 'NO_TCMALLOC', ], }, }], ], }], ['OS == "win"', { # Specify delayload for base.dll. 'msvs_settings': { 'VCLinkerTool': { 'DelayLoadDLLs': [ 'cfgmgr32.dll', 'powrprof.dll', 'setupapi.dll', ], 'AdditionalDependencies': [ 'cfgmgr32.lib', 'powrprof.lib', 'setupapi.lib', ], }, }, # Specify delayload for components that link with base.lib. 'all_dependent_settings': { 'msvs_settings': { 'VCLinkerTool': { 'DelayLoadDLLs': [ 'cfgmgr32.dll', 'powrprof.dll', 'setupapi.dll', ], 'AdditionalDependencies': [ 'cfgmgr32.lib', 'powrprof.lib', 'setupapi.lib', ], }, }, }, 'copies': [ { 'destination': '<(PRODUCT_DIR)/', 'files': [ '../build/win/dbghelp_xp/dbghelp.dll', ], }, ], 'dependencies': [ 'trace_event/etw_manifest/etw_manifest.gyp:etw_manifest', ], }], ['OS == "mac" or (OS == "ios" and _toolset == "host")', { 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/AppKit.framework', '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework', '$(SDKROOT)/System/Library/Frameworks/Carbon.framework', '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', '$(SDKROOT)/System/Library/Frameworks/IOKit.framework', '$(SDKROOT)/System/Library/Frameworks/Security.framework', ], }, }], ['OS == "ios" and _toolset != "host"', { 'link_settings': { 'libraries': [ '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework', '$(SDKROOT)/System/Library/Frameworks/CoreGraphics.framework', '$(SDKROOT)/System/Library/Frameworks/CoreText.framework', '$(SDKROOT)/System/Library/Frameworks/Foundation.framework', '$(SDKROOT)/System/Library/Frameworks/UIKit.framework', ], }, }], ['OS != "win" and (OS != "ios" or _toolset == "host")', { 'dependencies': ['../third_party/libevent/libevent.gyp:libevent'], },], ['component=="shared_library"', { 'conditions': [ ['OS=="win"', { 'sources!': [ 'debug/debug_on_start_win.cc', ], }], ], }], ['OS=="ios"', { 'sources!': [ 'sync_socket.h', 'sync_socket_posix.cc', ] }], ], 'sources': [ 'auto_reset.h', 'linux_util.cc', 'linux_util.h', 'message_loop/message_pump_android.cc', 'message_loop/message_pump_android.h', 'message_loop/message_pump_glib.cc', 'message_loop/message_pump_glib.h', 'message_loop/message_pump_io_ios.cc', 'message_loop/message_pump_io_ios.h', 'message_loop/message_pump_libevent.cc', 'message_loop/message_pump_libevent.h', 'message_loop/message_pump_mac.h', 'message_loop/message_pump_mac.mm', 'metrics/field_trial.cc', 'metrics/field_trial.h', 'posix/file_descriptor_shuffle.cc', 'posix/file_descriptor_shuffle.h', 'sync_socket.h', 'sync_socket_posix.cc', 'sync_socket_win.cc', 'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc', 'third_party/xdg_user_dirs/xdg_user_dir_lookup.h', ], 'includes': [ '../build/android/increase_size_for_speed.gypi', ], }, { 'target_name': 'base_i18n', 'type': '<(component)', 'variables': { 'enable_wexit_time_destructors': 1, 'optimize': 'max', 'base_i18n_target': 1, }, 'dependencies': [ 'base', 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', ], 'conditions': [ ['OS == "win"', { # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 'msvs_disabled_warnings': [ 4267, ], }], ['icu_use_data_file_flag==1', { 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'], }, { # else icu_use_data_file_flag !=1 'conditions': [ ['OS=="win"', { 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'], }, { 'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'], }], ], }], ['OS == "ios"', { 'toolsets': ['host', 'target'], }], ], 'export_dependent_settings': [ 'base', '../third_party/icu/icu.gyp:icuuc', '../third_party/icu/icu.gyp:icui18n', ], 'includes': [ '../build/android/increase_size_for_speed.gypi', ], }, { 'target_name': 'base_message_loop_tests', 'type': 'static_library', 'dependencies': [ 'base', '../testing/gtest.gyp:gtest', ], 'sources': [ 'message_loop/message_loop_test.cc', 'message_loop/message_loop_test.h', ], }, { 'target_name': 'base_prefs', 'type': '<(component)', 'variables': { 'enable_wexit_time_destructors': 1, 'optimize': 'max', }, 'dependencies': [ 'base', ], 'export_dependent_settings': [ 'base', ], 'defines': [ 'BASE_PREFS_IMPLEMENTATION', ], 'sources': [ 'prefs/base_prefs_export.h', 'prefs/default_pref_store.cc', 'prefs/default_pref_store.h', 'prefs/json_pref_store.cc', 'prefs/json_pref_store.h', 'prefs/overlay_user_pref_store.cc', 'prefs/overlay_user_pref_store.h', 'prefs/persistent_pref_store.h', 'prefs/pref_change_registrar.cc', 'prefs/pref_change_registrar.h', 'prefs/pref_filter.h', 'prefs/pref_member.cc', 'prefs/pref_member.h', 'prefs/pref_notifier.h', 'prefs/pref_notifier_impl.cc', 'prefs/pref_notifier_impl.h', 'prefs/pref_observer.h', 'prefs/pref_registry.cc', 'prefs/pref_registry.h', 'prefs/pref_registry_simple.cc', 'prefs/pref_registry_simple.h', 'prefs/pref_service.cc', 'prefs/pref_service.h', 'prefs/pref_service_factory.cc', 'prefs/pref_service_factory.h', 'prefs/pref_store.cc', 'prefs/pref_store.h', 'prefs/pref_value_map.cc', 'prefs/pref_value_map.h', 'prefs/pref_value_store.cc', 'prefs/pref_value_store.h', 'prefs/scoped_user_pref_update.cc', 'prefs/scoped_user_pref_update.h', 'prefs/value_map_pref_store.cc', 'prefs/value_map_pref_store.h', 'prefs/writeable_pref_store.h', ], 'includes': [ '../build/android/increase_size_for_speed.gypi', ], }, { 'target_name': 'base_prefs_test_support', 'type': 'static_library', 'dependencies': [ 'base', 'base_prefs', '../testing/gmock.gyp:gmock', ], 'sources': [ 'prefs/mock_pref_change_callback.cc', 'prefs/pref_store_observer_mock.cc', 'prefs/pref_store_observer_mock.h', 'prefs/testing_pref_service.cc', 'prefs/testing_pref_service.h', 'prefs/testing_pref_store.cc', 'prefs/testing_pref_store.h', ], }, { # This is the subset of files from base that should not be used with a # dynamic library. Note that this library cannot depend on base because # base depends on base_static. 'target_name': 'base_static', 'type': 'static_library', 'variables': { 'enable_wexit_time_destructors': 1, 'optimize': 'max', }, 'toolsets': ['host', 'target'], 'sources': [ 'base_switches.cc', 'base_switches.h', 'win/pe_image.cc', 'win/pe_image.h', ], 'include_dirs': [ '..', ], 'includes': [ '../build/android/increase_size_for_speed.gypi', ], }, # Include this target for a main() function that simply instantiates # and runs a base::TestSuite. { 'target_name': 'run_all_unittests', 'type': 'static_library', 'dependencies': [ 'test_support_base', ], 'sources': [ 'test/run_all_unittests.cc', ], }, { 'target_name': 'base_unittests', 'type': '<(gtest_target_type)', 'sources': [ 'android/application_status_listener_unittest.cc', 'android/content_uri_utils_unittest.cc', 'android/jni_android_unittest.cc', 'android/jni_array_unittest.cc', 'android/jni_string_unittest.cc', 'android/library_loader/library_prefetcher_unittest.cc', 'android/path_utils_unittest.cc', 'android/scoped_java_ref_unittest.cc', 'android/sys_utils_unittest.cc', 'at_exit_unittest.cc', 'atomicops_unittest.cc', 'barrier_closure_unittest.cc', 'base64_unittest.cc', 'base64url_unittest.cc', 'big_endian_unittest.cc', 'bind_unittest.cc', 'bind_unittest.nc', 'bits_unittest.cc', 'build_time_unittest.cc', 'callback_helpers_unittest.cc', 'callback_list_unittest.cc', 'callback_list_unittest.nc', 'callback_unittest.cc', 'callback_unittest.nc', 'cancelable_callback_unittest.cc', 'command_line_unittest.cc', 'containers/adapters_unittest.cc', 'containers/hash_tables_unittest.cc', 'containers/linked_list_unittest.cc', 'containers/mru_cache_unittest.cc', 'containers/scoped_ptr_hash_map_unittest.cc', 'containers/small_map_unittest.cc', 'containers/stack_container_unittest.cc', 'cpu_unittest.cc', 'debug/crash_logging_unittest.cc', 'debug/debugger_unittest.cc', 'debug/leak_tracker_unittest.cc', 'debug/proc_maps_linux_unittest.cc', 'debug/stack_trace_unittest.cc', 'debug/task_annotator_unittest.cc', 'deferred_sequenced_task_runner_unittest.cc', 'environment_unittest.cc', 'feature_list_unittest.cc', 'file_version_info_unittest.cc', 'files/dir_reader_posix_unittest.cc', 'files/file_path_unittest.cc', 'files/file_path_watcher_unittest.cc', 'files/file_proxy_unittest.cc', 'files/file_unittest.cc', 'files/file_util_proxy_unittest.cc', 'files/file_util_unittest.cc', 'files/important_file_writer_unittest.cc', 'files/memory_mapped_file_unittest.cc', 'files/scoped_temp_dir_unittest.cc', 'gmock_unittest.cc', 'guid_unittest.cc', 'hash_unittest.cc', 'i18n/break_iterator_unittest.cc', 'i18n/case_conversion_unittest.cc', 'i18n/char_iterator_unittest.cc', 'i18n/file_util_icu_unittest.cc', 'i18n/icu_string_conversions_unittest.cc', 'i18n/message_formatter_unittest.cc', 'i18n/number_formatting_unittest.cc', 'i18n/rtl_unittest.cc', 'i18n/streaming_utf8_validator_unittest.cc', 'i18n/string_search_unittest.cc', 'i18n/time_formatting_unittest.cc', 'i18n/timezone_unittest.cc', 'id_map_unittest.cc', 'ios/crb_protocol_observers_unittest.mm', 'ios/device_util_unittest.mm', 'ios/weak_nsobject_unittest.mm', 'json/json_parser_unittest.cc', 'json/json_reader_unittest.cc', 'json/json_value_converter_unittest.cc', 'json/json_value_serializer_unittest.cc', 'json/json_writer_unittest.cc', 'json/string_escape_unittest.cc', 'lazy_instance_unittest.cc', 'logging_unittest.cc', 'mac/bind_objc_block_unittest.mm', 'mac/call_with_eh_frame_unittest.mm', 'mac/dispatch_source_mach_unittest.cc', 'mac/foundation_util_unittest.mm', 'mac/libdispatch_task_runner_unittest.cc', 'mac/mac_util_unittest.mm', 'mac/objc_property_releaser_unittest.mm', 'mac/scoped_nsobject_unittest.mm', 'mac/scoped_objc_class_swizzler_unittest.mm', 'mac/scoped_sending_event_unittest.mm', 'md5_unittest.cc', 'memory/aligned_memory_unittest.cc', 'memory/discardable_shared_memory_unittest.cc', 'memory/linked_ptr_unittest.cc', 'memory/memory_pressure_listener_unittest.cc', 'memory/memory_pressure_monitor_chromeos_unittest.cc', 'memory/memory_pressure_monitor_mac_unittest.cc', 'memory/memory_pressure_monitor_win_unittest.cc', 'memory/ref_counted_memory_unittest.cc', 'memory/ref_counted_unittest.cc', 'memory/scoped_ptr_unittest.cc', 'memory/scoped_ptr_unittest.nc', 'memory/scoped_vector_unittest.cc', 'memory/shared_memory_unittest.cc', 'memory/shared_memory_mac_unittest.cc', 'memory/singleton_unittest.cc', 'memory/weak_ptr_unittest.cc', 'memory/weak_ptr_unittest.nc', 'message_loop/message_loop_task_runner_unittest.cc', 'message_loop/message_loop_unittest.cc', 'message_loop/message_pump_glib_unittest.cc', 'message_loop/message_pump_io_ios_unittest.cc', 'message_loop/message_pump_libevent_unittest.cc', 'metrics/bucket_ranges_unittest.cc', 'metrics/field_trial_unittest.cc', 'metrics/histogram_base_unittest.cc', 'metrics/histogram_delta_serialization_unittest.cc', 'metrics/histogram_macros_unittest.cc', 'metrics/histogram_snapshot_manager_unittest.cc', 'metrics/histogram_unittest.cc', 'metrics/metrics_hashes_unittest.cc', 'metrics/sample_map_unittest.cc', 'metrics/sample_vector_unittest.cc', 'metrics/sparse_histogram_unittest.cc', 'metrics/statistics_recorder_unittest.cc', 'native_library_unittest.cc', 'numerics/safe_numerics_unittest.cc', 'observer_list_unittest.cc', 'os_compat_android_unittest.cc', 'path_service_unittest.cc', 'pickle_unittest.cc', 'posix/file_descriptor_shuffle_unittest.cc', 'posix/unix_domain_socket_linux_unittest.cc', 'power_monitor/power_monitor_unittest.cc', 'prefs/default_pref_store_unittest.cc', 'prefs/json_pref_store_unittest.cc', 'prefs/mock_pref_change_callback.h', 'prefs/overlay_user_pref_store_unittest.cc', 'prefs/pref_change_registrar_unittest.cc', 'prefs/pref_member_unittest.cc', 'prefs/pref_notifier_impl_unittest.cc', 'prefs/pref_service_unittest.cc', 'prefs/pref_value_map_unittest.cc', 'prefs/pref_value_store_unittest.cc', 'prefs/scoped_user_pref_update_unittest.cc', 'process/memory_unittest.cc', 'process/memory_unittest_mac.h', 'process/memory_unittest_mac.mm', 'process/process_metrics_unittest.cc', 'process/process_metrics_unittest_ios.cc', 'process/process_unittest.cc', 'process/process_util_unittest.cc', 'profiler/stack_sampling_profiler_unittest.cc', 'profiler/tracked_time_unittest.cc', 'rand_util_unittest.cc', 'scoped_clear_errno_unittest.cc', 'scoped_generic_unittest.cc', 'scoped_native_library_unittest.cc', 'security_unittest.cc', 'sequence_checker_unittest.cc', 'sha1_unittest.cc', 'stl_util_unittest.cc', 'strings/nullable_string16_unittest.cc', 'strings/pattern_unittest.cc', 'strings/safe_sprintf_unittest.cc', 'strings/string16_unittest.cc', 'strings/string_number_conversions_unittest.cc', 'strings/string_piece_unittest.cc', 'strings/string_split_unittest.cc', 'strings/string_tokenizer_unittest.cc', 'strings/string_util_unittest.cc', 'strings/stringize_macros_unittest.cc', 'strings/stringprintf_unittest.cc', 'strings/sys_string_conversions_mac_unittest.mm', 'strings/sys_string_conversions_unittest.cc', 'strings/utf_offset_string_conversions_unittest.cc', 'strings/utf_string_conversions_unittest.cc', 'supports_user_data_unittest.cc', 'sync_socket_unittest.cc', 'synchronization/cancellation_flag_unittest.cc', 'synchronization/condition_variable_unittest.cc', 'synchronization/lock_unittest.cc', 'synchronization/waitable_event_unittest.cc', 'synchronization/waitable_event_watcher_unittest.cc', 'sys_info_unittest.cc', 'system_monitor/system_monitor_unittest.cc', 'task/cancelable_task_tracker_unittest.cc', 'task_runner_util_unittest.cc', 'template_util_unittest.cc', 'test/histogram_tester_unittest.cc', 'test/test_pending_task_unittest.cc', 'test/test_reg_util_win_unittest.cc', 'test/trace_event_analyzer_unittest.cc', 'test/user_action_tester_unittest.cc', 'threading/non_thread_safe_unittest.cc', 'threading/platform_thread_unittest.cc', 'threading/sequenced_worker_pool_unittest.cc', 'threading/sequenced_task_runner_handle_unittest.cc', 'threading/simple_thread_unittest.cc', 'threading/thread_checker_unittest.cc', 'threading/thread_collision_warner_unittest.cc', 'threading/thread_id_name_manager_unittest.cc', 'threading/thread_local_storage_unittest.cc', 'threading/thread_local_unittest.cc', 'threading/thread_unittest.cc', 'threading/watchdog_unittest.cc', 'threading/worker_pool_posix_unittest.cc', 'threading/worker_pool_unittest.cc', 'time/pr_time_unittest.cc', 'time/time_unittest.cc', 'time/time_win_unittest.cc', 'timer/hi_res_timer_manager_unittest.cc', 'timer/mock_timer_unittest.cc', 'timer/timer_unittest.cc', 'tools_sanity_unittest.cc', 'tracked_objects_unittest.cc', 'tuple_unittest.cc', 'values_unittest.cc', 'version_unittest.cc', 'vlog_unittest.cc', 'win/dllmain.cc', 'win/enum_variant_unittest.cc', 'win/event_trace_consumer_unittest.cc', 'win/event_trace_controller_unittest.cc', 'win/event_trace_provider_unittest.cc', 'win/i18n_unittest.cc', 'win/iunknown_impl_unittest.cc', 'win/message_window_unittest.cc', 'win/object_watcher_unittest.cc', 'win/pe_image_unittest.cc', 'win/registry_unittest.cc', 'win/scoped_bstr_unittest.cc', 'win/scoped_comptr_unittest.cc', 'win/scoped_handle_unittest.cc', 'win/scoped_process_information_unittest.cc', 'win/scoped_variant_unittest.cc', 'win/shortcut_unittest.cc', 'win/startup_information_unittest.cc', 'win/win_util_unittest.cc', 'win/wrapped_window_proc_unittest.cc', '<@(trace_event_test_sources)', ], 'dependencies': [ 'base', 'base_i18n', 'base_message_loop_tests', 'base_prefs', 'base_prefs_test_support', 'base_static', 'run_all_unittests', 'test_support_base', 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', '../third_party/icu/icu.gyp:icui18n', '../third_party/icu/icu.gyp:icuuc', ], 'includes': ['../build/nocompile.gypi'], 'variables': { # TODO(ajwong): Is there a way to autodetect this? 'module_dir': 'base' }, 'conditions': [ ['OS == "android"', { 'dependencies': [ 'android/jni_generator/jni_generator.gyp:jni_generator_tests', '../testing/android/native_test.gyp:native_test_native_code', ], }], ['OS == "ios" and _toolset != "host"', { 'sources/': [ # iOS does not support FilePathWatcher. ['exclude', '^files/file_path_watcher_unittest\\.cc$'], # Only test the iOS-meaningful portion of memory and process_utils. ['exclude', '^memory/discardable_shared_memory_unittest\\.cc$'], ['exclude', '^memory/shared_memory_unittest\\.cc$'], ['exclude', '^process/memory_unittest'], ['exclude', '^process/process_unittest\\.cc$'], ['exclude', '^process/process_util_unittest\\.cc$'], ['include', '^process/process_util_unittest_ios\\.cc$'], # iOS does not use message_pump_libevent. ['exclude', '^message_loop/message_pump_libevent_unittest\\.cc$'], ], 'actions': [ { 'action_name': 'copy_test_data', 'variables': { 'test_data_files': [ 'test/data', ], 'test_data_prefix': 'base', }, 'includes': [ '../build/copy_test_data_ios.gypi' ], }, ], }], ['desktop_linux == 1 or chromeos == 1', { 'defines': [ 'USE_SYMBOLIZE', ], 'sources!': [ 'file_version_info_unittest.cc', ], 'conditions': [ [ 'desktop_linux==1', { 'sources': [ 'nix/xdg_util_unittest.cc', ], }], ], }], ['use_glib == 1', { 'dependencies': [ '../build/linux/system.gyp:glib', ], }, { # use_glib == 0 'sources!': [ 'message_loop/message_pump_glib_unittest.cc', ] }], ['use_ozone == 1', { 'sources!': [ 'message_loop/message_pump_glib_unittest.cc', ] }], ['OS == "linux"', { 'dependencies': [ 'malloc_wrapper', ], 'conditions': [ ['use_allocator!="none"', { 'dependencies': [ 'allocator/allocator.gyp:allocator', ], }], ]}, ], [ 'OS == "win" and target_arch == "x64"', { 'sources': [ 'profiler/win32_stack_frame_unwinder_unittest.cc', ], 'dependencies': [ 'base_profiler_test_support_library', ], }], ['OS == "win"', { 'sources!': [ 'file_descriptor_shuffle_unittest.cc', 'files/dir_reader_posix_unittest.cc', 'message_loop/message_pump_libevent_unittest.cc', 'threading/worker_pool_posix_unittest.cc', ], # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 'msvs_disabled_warnings': [ 4267, ], 'conditions': [ # This is needed so base_unittests uses the allocator shim, as # SecurityTest.MemoryAllocationRestriction* tests are dependent # on tcmalloc. # TODO(wfh): crbug.com/246278 Move tcmalloc specific tests into # their own test suite. ['win_use_allocator_shim==1', { 'dependencies': [ 'allocator/allocator.gyp:allocator', ], }], ['icu_use_data_file_flag==0', { # This is needed to trigger the dll copy step on windows. # TODO(mark): This should not be necessary. 'dependencies': [ '../third_party/icu/icu.gyp:icudata', ], }], ], }, { # OS != "win" 'dependencies': [ '../third_party/libevent/libevent.gyp:libevent' ], }], ], # conditions 'target_conditions': [ ['OS == "ios" and _toolset != "host"', { 'sources/': [ # Pull in specific Mac files for iOS (which have been filtered out # by file name rules). ['include', '^mac/bind_objc_block_unittest\\.mm$'], ['include', '^mac/foundation_util_unittest\\.mm$',], ['include', '^mac/objc_property_releaser_unittest\\.mm$'], ['include', '^mac/scoped_nsobject_unittest\\.mm$'], ['include', '^sys_string_conversions_mac_unittest\\.mm$'], ], }], ['OS == "android"', { 'sources/': [ ['include', '^debug/proc_maps_linux_unittest\\.cc$'], ], }], # Enable more direct string conversions on platforms with native utf8 # strings ['OS=="mac" or OS=="ios" or <(chromeos)==1 or <(chromecast)==1', { 'defines': ['SYSTEM_NATIVE_UTF8'], }], # SyncSocket isn't used on iOS ['OS=="ios"', { 'sources!': [ 'sync_socket_unittest.cc', ], }], ], # target_conditions }, { # GN: //base:base_perftests 'target_name': 'base_perftests', 'type': '<(gtest_target_type)', 'dependencies': [ 'base', 'test_support_base', '../testing/gtest.gyp:gtest', ], 'sources': [ 'message_loop/message_pump_perftest.cc', 'test/run_all_unittests.cc', 'threading/thread_perftest.cc', '../testing/perf/perf_test.cc' ], 'conditions': [ ['OS == "android"', { 'dependencies': [ '../testing/android/native_test.gyp:native_test_native_code', ], }], ], }, { # GN: //base:base_i18n_perftests 'target_name': 'base_i18n_perftests', 'type': '<(gtest_target_type)', 'dependencies': [ 'test_support_base', 'test_support_perf', '../testing/gtest.gyp:gtest', 'base_i18n', 'base', ], 'sources': [ 'i18n/streaming_utf8_validator_perftest.cc', ], }, { # GN: //base/test:test_support 'target_name': 'test_support_base', 'type': 'static_library', 'dependencies': [ 'base', 'base_static', 'base_i18n', '../testing/gmock.gyp:gmock', '../testing/gtest.gyp:gtest', '../third_party/icu/icu.gyp:icuuc', '../third_party/libxml/libxml.gyp:libxml', 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', ], 'export_dependent_settings': [ 'base', ], 'conditions': [ ['os_posix==0', { 'sources!': [ 'test/scoped_locale.cc', 'test/scoped_locale.h', ], }], ['os_bsd==1', { 'sources!': [ 'test/test_file_util_linux.cc', ], }], ['OS == "android"', { 'dependencies': [ 'base_unittests_jni_headers', 'base_java_unittest_support', ], }], ['OS == "ios"', { 'toolsets': ['host', 'target'], }], ], 'sources': [ 'test/gtest_util.cc', 'test/gtest_util.h', 'test/gtest_xml_unittest_result_printer.cc', 'test/gtest_xml_unittest_result_printer.h', 'test/gtest_xml_util.cc', 'test/gtest_xml_util.h', 'test/histogram_tester.cc', 'test/histogram_tester.h', 'test/icu_test_util.cc', 'test/icu_test_util.h', 'test/ios/wait_util.h', 'test/ios/wait_util.mm', 'test/launcher/test_launcher.cc', 'test/launcher/test_launcher.h', 'test/launcher/test_result.cc', 'test/launcher/test_result.h', 'test/launcher/test_results_tracker.cc', 'test/launcher/test_results_tracker.h', 'test/launcher/unit_test_launcher.cc', 'test/launcher/unit_test_launcher.h', 'test/launcher/unit_test_launcher_ios.cc', 'test/mock_chrome_application_mac.h', 'test/mock_chrome_application_mac.mm', 'test/mock_devices_changed_observer.cc', 'test/mock_devices_changed_observer.h', 'test/mock_entropy_provider.cc', 'test/mock_entropy_provider.h', 'test/mock_log.cc', 'test/mock_log.h', 'test/multiprocess_test.cc', 'test/multiprocess_test.h', 'test/multiprocess_test_android.cc', 'test/null_task_runner.cc', 'test/null_task_runner.h', 'test/opaque_ref_counted.cc', 'test/opaque_ref_counted.h', 'test/perf_log.cc', 'test/perf_log.h', 'test/perf_test_suite.cc', 'test/perf_test_suite.h', 'test/perf_time_logger.cc', 'test/perf_time_logger.h', 'test/power_monitor_test_base.cc', 'test/power_monitor_test_base.h', 'test/scoped_locale.cc', 'test/scoped_locale.h', 'test/scoped_path_override.cc', 'test/scoped_path_override.h', 'test/sequenced_task_runner_test_template.cc', 'test/sequenced_task_runner_test_template.h', 'test/sequenced_worker_pool_owner.cc', 'test/sequenced_worker_pool_owner.h', 'test/simple_test_clock.cc', 'test/simple_test_clock.h', 'test/simple_test_tick_clock.cc', 'test/simple_test_tick_clock.h', 'test/task_runner_test_template.cc', 'test/task_runner_test_template.h', 'test/test_discardable_memory_allocator.cc', 'test/test_discardable_memory_allocator.h', 'test/test_file_util.cc', 'test/test_file_util.h', 'test/test_file_util_android.cc', 'test/test_file_util_linux.cc', 'test/test_file_util_mac.cc', 'test/test_file_util_posix.cc', 'test/test_file_util_win.cc', 'test/test_io_thread.cc', 'test/test_io_thread.h', 'test/test_listener_ios.h', 'test/test_listener_ios.mm', 'test/test_mock_time_task_runner.cc', 'test/test_mock_time_task_runner.h', 'test/test_pending_task.cc', 'test/test_pending_task.h', 'test/test_reg_util_win.cc', 'test/test_reg_util_win.h', 'test/test_shortcut_win.cc', 'test/test_shortcut_win.h', 'test/test_simple_task_runner.cc', 'test/test_simple_task_runner.h', 'test/test_suite.cc', 'test/test_suite.h', 'test/test_support_android.cc', 'test/test_support_android.h', 'test/test_support_ios.h', 'test/test_support_ios.mm', 'test/test_switches.cc', 'test/test_switches.h', 'test/test_timeouts.cc', 'test/test_timeouts.h', 'test/test_ui_thread_android.cc', 'test/test_ui_thread_android.h', 'test/thread_test_helper.cc', 'test/thread_test_helper.h', 'test/trace_event_analyzer.cc', 'test/trace_event_analyzer.h', 'test/trace_to_file.cc', 'test/trace_to_file.h', 'test/user_action_tester.cc', 'test/user_action_tester.h', 'test/values_test_util.cc', 'test/values_test_util.h', ], 'target_conditions': [ ['OS == "ios"', { 'sources/': [ # Pull in specific Mac files for iOS (which have been filtered out # by file name rules). ['include', '^test/test_file_util_mac\\.cc$'], ], }], ['OS == "ios" and _toolset == "target"', { 'sources!': [ # iOS uses its own unit test launcher. 'test/launcher/unit_test_launcher.cc', ], }], ['OS == "ios" and _toolset == "host"', { 'sources!': [ 'test/launcher/unit_test_launcher_ios.cc', 'test/test_support_ios.h', 'test/test_support_ios.mm', ], }], ], # target_conditions }, { 'target_name': 'test_support_perf', 'type': 'static_library', 'dependencies': [ 'base', 'test_support_base', '../testing/gtest.gyp:gtest', ], 'sources': [ 'test/run_all_perftests.cc', ], 'direct_dependent_settings': { 'defines': [ 'PERF_TEST', ], }, }, { 'target_name': 'test_launcher_nacl_nonsfi', 'conditions': [ ['disable_nacl==0 and disable_nacl_untrusted==0 and enable_nacl_nonsfi_test==1', { 'type': 'static_library', 'sources': [ 'test/launcher/test_launcher_nacl_nonsfi.cc', ], 'dependencies': [ 'test_support_base', ], }, { 'type': 'none', }], ], }, ], 'conditions': [ ['OS=="ios" and "<(GENERATOR)"=="ninja"', { 'targets': [ { 'target_name': 'test_launcher', 'toolsets': ['host'], 'type': 'executable', 'dependencies': [ 'test_support_base', ], 'sources': [ 'test/launcher/test_launcher_ios.cc', ], }, ], }], ['OS!="ios"', { 'targets': [ { # GN: //base:check_example 'target_name': 'check_example', 'type': 'executable', 'sources': [ 'check_example.cc', ], 'dependencies': [ 'base', ], }, { 'target_name': 'build_utf8_validator_tables', 'type': 'executable', 'toolsets': ['host'], 'dependencies': [ 'base', '../third_party/icu/icu.gyp:icuuc', ], 'sources': [ 'i18n/build_utf8_validator_tables.cc' ], }, ], }], ['OS == "win" and target_arch=="ia32"', { 'targets': [ # The base_win64 target here allows us to use base for Win64 targets # (the normal build is 32 bits). { 'target_name': 'base_win64', 'type': '<(component)', 'variables': { 'base_target': 1, }, 'dependencies': [ 'base_static_win64', 'allocator/allocator.gyp:allocator_extension_thunks_win64', '../third_party/modp_b64/modp_b64.gyp:modp_b64_win64', 'third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations_win64', 'trace_event/etw_manifest/etw_manifest.gyp:etw_manifest', ], # TODO(gregoryd): direct_dependent_settings should be shared with the # 32-bit target, but it doesn't work due to a bug in gyp 'direct_dependent_settings': { 'include_dirs': [ '..', ], }, 'defines': [ 'BASE_WIN64', '<@(nacl_win64_defines)', ], 'configurations': { 'Common_Base': { 'msvs_target_platform': 'x64', }, }, 'conditions': [ ['component == "shared_library"', { 'sources!': [ 'debug/debug_on_start_win.cc', ], }], ], # Specify delayload for base_win64.dll. 'msvs_settings': { 'VCLinkerTool': { 'DelayLoadDLLs': [ 'cfgmgr32.dll', 'powrprof.dll', 'setupapi.dll', ], 'AdditionalDependencies': [ 'cfgmgr32.lib', 'powrprof.lib', 'setupapi.lib', ], }, }, # Specify delayload for components that link with base_win64.lib. 'all_dependent_settings': { 'msvs_settings': { 'VCLinkerTool': { 'DelayLoadDLLs': [ 'cfgmgr32.dll', 'powrprof.dll', 'setupapi.dll', ], 'AdditionalDependencies': [ 'cfgmgr32.lib', 'powrprof.lib', 'setupapi.lib', ], }, }, }, # TODO(rvargas): Bug 78117. Remove this. 'msvs_disabled_warnings': [ 4244, 4996, 4267, ], 'sources': [ 'auto_reset.h', 'linux_util.cc', 'linux_util.h', 'md5.cc', 'md5.h', 'message_loop/message_pump_libevent.cc', 'message_loop/message_pump_libevent.h', 'metrics/field_trial.cc', 'metrics/field_trial.h', 'posix/file_descriptor_shuffle.cc', 'posix/file_descriptor_shuffle.h', 'sync_socket.h', 'sync_socket_posix.cc', 'sync_socket_win.cc', 'third_party/xdg_user_dirs/xdg_user_dir_lookup.cc', 'third_party/xdg_user_dirs/xdg_user_dir_lookup.h', ], }, { 'target_name': 'base_i18n_nacl_win64', 'type': '<(component)', # TODO(gregoryd): direct_dependent_settings should be shared with the # 32-bit target, but it doesn't work due to a bug in gyp 'direct_dependent_settings': { 'include_dirs': [ '..', ], }, 'defines': [ '<@(nacl_win64_defines)', 'BASE_I18N_IMPLEMENTATION', ], 'include_dirs': [ '..', ], 'sources': [ 'i18n/icu_util_nacl_win64.cc', ], 'configurations': { 'Common_Base': { 'msvs_target_platform': 'x64', }, }, }, { # TODO(rvargas): Remove this when gyp finally supports a clean model. # See bug 36232. 'target_name': 'base_static_win64', 'type': 'static_library', 'sources': [ 'base_switches.cc', 'base_switches.h', 'win/pe_image.cc', 'win/pe_image.h', ], 'sources!': [ # base64.cc depends on modp_b64. 'base64.cc', ], 'include_dirs': [ '..', ], 'configurations': { 'Common_Base': { 'msvs_target_platform': 'x64', }, }, 'defines': [ '<@(nacl_win64_defines)', ], # TODO(rvargas): Bug 78117. Remove this. 'msvs_disabled_warnings': [ 4244, ], }, ], }], ['OS == "win" and target_arch=="x64"', { 'targets': [ { 'target_name': 'base_profiler_test_support_library', # Must be a shared library so that it can be unloaded during testing. 'type': 'shared_library', 'include_dirs': [ '..', ], 'sources': [ 'profiler/test_support_library.cc', ], }, ] }], ['os_posix==1 and OS!="mac" and OS!="ios"', { 'targets': [ { 'target_name': 'symbolize', 'type': 'static_library', 'toolsets': ['host', 'target'], 'variables': { 'chromium_code': 0, }, 'conditions': [ ['OS == "solaris"', { 'include_dirs': [ '/usr/gnu/include', '/usr/gnu/include/libelf', ], },], ], 'cflags': [ '-Wno-sign-compare', ], 'cflags!': [ '-Wextra', ], 'defines': [ 'GLOG_BUILD_CONFIG_INCLUDE="build/build_config.h"', ], 'sources': [ 'third_party/symbolize/config.h', 'third_party/symbolize/demangle.cc', 'third_party/symbolize/demangle.h', 'third_party/symbolize/glog/logging.h', 'third_party/symbolize/glog/raw_logging.h', 'third_party/symbolize/symbolize.cc', 'third_party/symbolize/symbolize.h', 'third_party/symbolize/utilities.h', ], 'include_dirs': [ '..', ], 'includes': [ '../build/android/increase_size_for_speed.gypi', ], }, { 'target_name': 'xdg_mime', 'type': 'static_library', 'toolsets': ['host', 'target'], 'variables': { 'chromium_code': 0, }, 'cflags!': [ '-Wextra', ], 'sources': [ 'third_party/xdg_mime/xdgmime.c', 'third_party/xdg_mime/xdgmime.h', 'third_party/xdg_mime/xdgmimealias.c', 'third_party/xdg_mime/xdgmimealias.h', 'third_party/xdg_mime/xdgmimecache.c', 'third_party/xdg_mime/xdgmimecache.h', 'third_party/xdg_mime/xdgmimeglob.c', 'third_party/xdg_mime/xdgmimeglob.h', 'third_party/xdg_mime/xdgmimeicon.c', 'third_party/xdg_mime/xdgmimeicon.h', 'third_party/xdg_mime/xdgmimeint.c', 'third_party/xdg_mime/xdgmimeint.h', 'third_party/xdg_mime/xdgmimemagic.c', 'third_party/xdg_mime/xdgmimemagic.h', 'third_party/xdg_mime/xdgmimeparent.c', 'third_party/xdg_mime/xdgmimeparent.h', ], 'includes': [ '../build/android/increase_size_for_speed.gypi', ], }, ], }], ['OS == "linux"', { 'targets': [ { 'target_name': 'malloc_wrapper', 'type': 'shared_library', 'dependencies': [ 'base', ], 'sources': [ 'test/malloc_wrapper.cc', ], } ], }], ['OS == "android"', { 'targets': [ { # GN: //base:base_jni_headers 'target_name': 'base_jni_headers', 'type': 'none', 'sources': [ 'android/java/src/org/chromium/base/ApkAssets.java', 'android/java/src/org/chromium/base/ApplicationStatus.java', 'android/java/src/org/chromium/base/AnimationFrameTimeHistogram.java', 'android/java/src/org/chromium/base/BuildInfo.java', 'android/java/src/org/chromium/base/CommandLine.java', 'android/java/src/org/chromium/base/ContentUriUtils.java', 'android/java/src/org/chromium/base/ContextUtils.java', 'android/java/src/org/chromium/base/CpuFeatures.java', 'android/java/src/org/chromium/base/EventLog.java', 'android/java/src/org/chromium/base/FieldTrialList.java', 'android/java/src/org/chromium/base/ImportantFileWriterAndroid.java', 'android/java/src/org/chromium/base/JNIUtils.java', 'android/java/src/org/chromium/base/JavaHandlerThread.java', 'android/java/src/org/chromium/base/LocaleUtils.java', 'android/java/src/org/chromium/base/MemoryPressureListener.java', 'android/java/src/org/chromium/base/PathService.java', 'android/java/src/org/chromium/base/PathUtils.java', 'android/java/src/org/chromium/base/PowerMonitor.java', 'android/java/src/org/chromium/base/SysUtils.java', 'android/java/src/org/chromium/base/SystemMessageHandler.java', 'android/java/src/org/chromium/base/ThreadUtils.java', 'android/java/src/org/chromium/base/TraceEvent.java', 'android/java/src/org/chromium/base/library_loader/LibraryLoader.java', 'android/java/src/org/chromium/base/metrics/RecordHistogram.java', 'android/java/src/org/chromium/base/metrics/RecordUserAction.java', ], 'variables': { 'jni_gen_package': 'base', }, 'dependencies': [ 'android_runtime_jni_headers', ], 'includes': [ '../build/jni_generator.gypi' ], }, { # GN: //base:android_runtime_jni_headers 'target_name': 'android_runtime_jni_headers', 'type': 'none', 'variables': { 'jni_gen_package': 'base', 'input_java_class': 'java/lang/Runtime.class', }, 'includes': [ '../build/jar_file_jni_generator.gypi' ], }, { # GN: //base:base_unittests_jni_headers 'target_name': 'base_unittests_jni_headers', 'type': 'none', 'sources': [ 'test/android/java/src/org/chromium/base/ContentUriTestUtils.java', 'test/android/java/src/org/chromium/base/TestUiThread.java', ], 'variables': { 'jni_gen_package': 'base', }, 'includes': [ '../build/jni_generator.gypi' ], }, { # GN: //base:base_native_libraries_gen 'target_name': 'base_native_libraries_gen', 'type': 'none', 'sources': [ 'android/java/templates/NativeLibraries.template', ], 'variables': { 'package_name': 'org/chromium/base/library_loader', 'template_deps': [], }, 'includes': [ '../build/android/java_cpp_template.gypi' ], }, { # GN: //base:base_multidex_gen 'target_name': 'base_multidex_gen', 'type': 'none', 'sources': [ 'android/java/templates/ChromiumMultiDex.template', ], 'variables': { 'package_name': 'org/chromium/base/multidex', 'template_deps': [], 'additional_gcc_preprocess_options': [ '--defines', 'MULTIDEX_CONFIGURATION_<(CONFIGURATION_NAME)', ], }, 'includes': ['../build/android/java_cpp_template.gypi'], }, { # GN: //base:base_android_java_enums_srcjar 'target_name': 'base_java_library_process_type', 'type': 'none', 'variables': { 'source_file': 'android/library_loader/library_loader_hooks.h', }, 'includes': [ '../build/android/java_cpp_enum.gypi' ], }, { # GN: //base:base_java 'target_name': 'base_java', 'type': 'none', 'variables': { 'java_in_dir': 'android/java', 'jar_excluded_classes': [ '*/NativeLibraries.class' ], }, 'dependencies': [ 'base_java_application_state', 'base_java_library_load_from_apk_status_codes', 'base_java_library_process_type', 'base_java_memory_pressure_level', 'base_multidex_gen', 'base_native_libraries_gen', '../third_party/android_tools/android_tools.gyp:android_support_multidex_javalib', '../third_party/jsr-305/jsr-305.gyp:jsr_305_javalib', ], 'includes': [ '../build/java.gypi' ], }, { # GN: //base:base_java_unittest_support 'target_name': 'base_java_unittest_support', 'type': 'none', 'dependencies': [ 'base_java', ], 'variables': { 'java_in_dir': '../base/test/android/java', }, 'includes': [ '../build/java.gypi' ], }, { # GN: //base:base_android_java_enums_srcjar 'target_name': 'base_java_application_state', 'type': 'none', 'variables': { 'source_file': 'android/application_status_listener.h', }, 'includes': [ '../build/android/java_cpp_enum.gypi' ], }, { # GN: //base:base_android_java_enums_srcjar 'target_name': 'base_java_library_load_from_apk_status_codes', 'type': 'none', 'variables': { 'source_file': 'android/library_loader/library_load_from_apk_status_codes.h' }, 'includes': [ '../build/android/java_cpp_enum.gypi' ], }, { # GN: //base:base_android_java_enums_srcjar 'target_name': 'base_java_memory_pressure_level', 'type': 'none', 'variables': { 'source_file': 'memory/memory_pressure_listener.h', }, 'includes': [ '../build/android/java_cpp_enum.gypi' ], }, { # GN: //base:base_java_test_support 'target_name': 'base_java_test_support', 'type': 'none', 'dependencies': [ 'base_java', '../testing/android/on_device_instrumentation.gyp:reporter_java', ], 'variables': { 'java_in_dir': '../base/test/android/javatests', }, 'includes': [ '../build/java.gypi' ], }, { # TODO(jbudorick): Remove this once we roll to robolectric 3.0 and pull # in the multidex shadow library. crbug.com/522043 # GN: //base:base_junit_test_support 'target_name': 'base_junit_test_support', 'type': 'none', 'dependencies': [ '../testing/android/junit/junit_test.gyp:junit_test_support', '../third_party/android_tools/android_tools.gyp:android_support_multidex_javalib', ], 'variables': { 'src_paths': [ '../base/test/android/junit/', ], }, 'includes': [ '../build/host_jar.gypi' ] }, { # GN: //base:base_junit_tests 'target_name': 'base_junit_tests', 'type': 'none', 'dependencies': [ 'base_java', 'base_java_test_support', 'base_junit_test_support', '../testing/android/junit/junit_test.gyp:junit_test_support', ], 'variables': { 'main_class': 'org.chromium.testing.local.JunitTestMain', 'src_paths': [ '../base/android/junit/', ], }, 'includes': [ '../build/host_jar.gypi' ], }, { # GN: //base:base_javatests 'target_name': 'base_javatests', 'type': 'none', 'dependencies': [ 'base_java', 'base_java_test_support', ], 'variables': { 'java_in_dir': '../base/android/javatests', }, 'includes': [ '../build/java.gypi' ], }, { # GN: //base/android/linker:chromium_android_linker 'target_name': 'chromium_android_linker', 'type': 'shared_library', 'sources': [ 'android/linker/android_dlext.h', 'android/linker/legacy_linker_jni.cc', 'android/linker/legacy_linker_jni.h', 'android/linker/linker_jni.cc', 'android/linker/linker_jni.h', 'android/linker/modern_linker_jni.cc', 'android/linker/modern_linker_jni.h', ], # The crazy linker is never instrumented. 'cflags!': [ '-finstrument-functions', ], 'dependencies': [ # The NDK contains the crazy_linker here: # '<(android_ndk_root)/crazy_linker.gyp:crazy_linker' # However, we use our own fork. See bug 384700. '../third_party/android_crazy_linker/crazy_linker.gyp:crazy_linker', ], }, { # GN: //base:base_perftests_apk 'target_name': 'base_perftests_apk', 'type': 'none', 'dependencies': [ 'base_perftests', ], 'variables': { 'test_suite_name': 'base_perftests', }, 'includes': [ '../build/apk_test.gypi' ], }, { # GN: //base:base_unittests_apk 'target_name': 'base_unittests_apk', 'type': 'none', 'dependencies': [ 'base_java', 'base_unittests', ], 'variables': { 'test_suite_name': 'base_unittests', 'isolate_file': 'base_unittests.isolate', }, 'includes': [ '../build/apk_test.gypi' ], }, ], 'conditions': [ ['test_isolation_mode != "noop"', { 'targets': [ { 'target_name': 'base_unittests_apk_run', 'type': 'none', 'dependencies': [ 'base_unittests_apk', ], 'includes': [ '../build/isolate.gypi', ], 'sources': [ 'base_unittests_apk.isolate', ], }, ] } ], ], }], ['OS == "win"', { 'targets': [ { # Target to manually rebuild pe_image_test.dll which is checked into # base/test/data/pe_image. 'target_name': 'pe_image_test', 'type': 'shared_library', 'sources': [ 'win/pe_image_test.cc', ], 'msvs_settings': { 'VCLinkerTool': { 'SubSystem': '2', # Set /SUBSYSTEM:WINDOWS 'DelayLoadDLLs': [ 'cfgmgr32.dll', 'shell32.dll', ], 'AdditionalDependencies': [ 'cfgmgr32.lib', 'shell32.lib', ], }, }, }, ], }], ['test_isolation_mode != "noop"', { 'targets': [ { 'target_name': 'base_unittests_run', 'type': 'none', 'dependencies': [ 'base_unittests', ], 'includes': [ '../build/isolate.gypi', ], 'sources': [ 'base_unittests.isolate', ], }, ], }], ], }
34.278261
96
0.532589
5,706
59,130
5.189975
0.13074
0.079692
0.014655
0.015499
0.505504
0.35159
0.271561
0.21608
0.189741
0.151415
0
0.007295
0.327668
59,130
1,724
97
34.298144
0.737618
0.074142
0
0.494788
0
0
0.557471
0.406606
0
0
0
0.00058
0
1
0
true
0
0.001226
0
0.001226
0.002452
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
6ad42755c1900a89dea96e604b75bea9a5c3b32c
9,507
py
Python
router.example.py
unyo/uhpackage
07d0263c586e5daa0012c3ff82754be381850911
[ "BSD-3-Clause" ]
null
null
null
router.example.py
unyo/uhpackage
07d0263c586e5daa0012c3ff82754be381850911
[ "BSD-3-Clause" ]
null
null
null
router.example.py
unyo/uhpackage
07d0263c586e5daa0012c3ff82754be381850911
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/python # -*- coding: utf-8 -*- # routers are dictionaries of URL routing parameters. # # For each request, the effective router is: # the built-in default base router (shown below), # updated by the BASE router in routes.py routers, # updated by the app-specific router in routes.py routers (if any), # updated by the app-specific router from applcations/app/routes.py routers (if any) # # # Router members: # # default_application: default application name # applications: list of all recognized applications, or 'ALL' to use all currently installed applications # Names in applications are always treated as an application names when they appear first in an incoming URL. # Set applications to None to disable the removal of application names from outgoing URLs. # domains: optional dict mapping domain names to application names # The domain name can include a port number: domain.com:8080 # The application name can include a controller: appx/ctlrx # path_prefix: a path fragment that is prefixed to all outgoing URLs and stripped from all incoming URLs # # Note: default_application, applications, domains & path_prefix are permitted only in the BASE router, # and domain makes sense only in an application-specific router. # The remaining members can appear in the BASE router (as defaults for all applications) # or in application-specific routers. # # default_controller: name of default controller # default_function: name of default function (all controllers) # controllers: list of valid controllers in selected app # or "DEFAULT" to use all controllers in the selected app plus 'static' # or None to disable controller-name removal. # Names in controllers are always treated as controller names when they appear in an incoming URL after # the (optional) application and language names. # languages: list of all supported languages # Names in controllers are always treated as language names when they appear in an incoming URL after # the (optional) application name. # default_language # The language code (for example: en, it-it) optionally appears in the URL following # the application (which may be omitted). For incoming URLs, the code is copied to # request.language; for outgoing URLs it is taken from request.language. # If languages=None, language support is disabled. # The default_language, if any, is omitted from the URL. # root_static: list of static files accessed from root # (mapped to the current application's static/ directory) # Each application has its own root-static files. # domain: the domain that maps to this application (alternative to using domains in the BASE router) # map_hyphen: If True (default), hyphens in incoming /a/c/f fields are converted to underscores, # and back to hyphens in outgoing URLs. Language, args and the query string are not affected. # map_static: By default, the default application is not stripped from static URLs. Set map_static=True # to override this policy. # acfe_match: regex for valid application, controller, function, extension /a/c/f.e # file_match: regex for valid file (used for static file names) # args_match: regex for valid args # This validation provides a measure of security. # If it is changed, the application perform its own validation. # # # The built-in default router supplies default values (undefined members are None): # # default_router = dict( # default_application = 'init', # applications = 'ALL', # default_controller = 'default', # controllers = 'DEFAULT', # default_function = 'index', # default_language = None, # languages = None, # root_static = ['favicon.ico', 'robots.txt'], # domains = None, # map_hyphen = True, # acfe_match = r'\w+$', # legal app/ctlr/fcn/ext # file_match = r'(\w+[-=./]?)+$', # legal file (path) name # args_match = r'([\w@ -]+[=.]?)+$', # legal arg in args # ) # # See rewrite.map_url_in() and rewrite.map_url_out() for implementation details. # This simple router set overrides only the default application name, # but provides full rewrite functionality. routers = dict( # base router BASE = dict( default_application = 'welcome', ), # 'admin' application router admin = dict( controllers = [], # don't remove controller names from admin URLs map_hyphen = False, # don't map hyphens to underscores ), ) # Error-handling redirects all HTTP errors (status codes >= 400) to a specified # path. If you wish to use error-handling redirects, uncomment the tuple # below. You can customize responses by adding a tuple entry with the first # value in 'appName/HTTPstatusCode' format. ( Only HTTP codes >= 400 are # routed. ) and the value as a path to redirect the user to. You may also use # '*' as a wildcard. # # The error handling page is also passed the error code and ticket as # variables. Traceback information will be stored in the ticket. # # routes_onerror = [ # (r'init/400', r'/init/default/login') # ,(r'init/*', r'/init/static/fail.html') # ,(r'*/404', r'/init/static/cantfind.html') # ,(r'*/*', r'/init/error/index') # ] # specify action in charge of error handling # # error_handler = dict(application='error', # controller='default', # function='index') # In the event that the error-handling page itself returns an error, web2py will # fall back to its old static responses. You can customize them here. # ErrorMessageTicket takes a string format dictionary containing (only) the # "ticket" key. # error_message = '<html><body><h1>Invalid request</h1></body></html>' # error_message_ticket = '<html><body><h1>Internal error</h1>Ticket issued: <a href="/admin/default/ticket/%(ticket)s" target="_blank">%(ticket)s</a></body></html>' def __routes_doctest(): ''' Dummy function for doctesting routes.py. Use filter_url() to test incoming or outgoing routes; filter_err() for error redirection. filter_url() accepts overrides for method and remote host: filter_url(url, method='get', remote='0.0.0.0', out=False) filter_err() accepts overrides for application and ticket: filter_err(status, application='app', ticket='tkt') >>> import os >>> import gluon.main >>> from gluon.rewrite import load, filter_url, filter_err, get_effective_router >>> load(routes=os.path.basename(__file__)) >>> filter_url('http://domain.com/abc', app=True) 'welcome' >>> filter_url('http://domain.com/welcome', app=True) 'welcome' >>> os.path.relpath(filter_url('http://domain.com/favicon.ico')) 'applications/welcome/static/favicon.ico' >>> filter_url('http://domain.com/abc') '/welcome/default/abc' >>> filter_url('http://domain.com/index/abc') "/welcome/default/index ['abc']" >>> filter_url('http://domain.com/default/abc.css') '/welcome/default/abc.css' >>> filter_url('http://domain.com/default/index/abc') "/welcome/default/index ['abc']" >>> filter_url('http://domain.com/default/index/a bc') "/welcome/default/index ['a bc']" >>> filter_url('http://domain.com/admin/bad!ctl') Traceback (most recent call last): ... HTTP: 400 BAD REQUEST [invalid controller] >>> filter_url('http://domain.com/admin/ctl/bad!fcn') Traceback (most recent call last): ... HTTP: 400 BAD REQUEST [invalid function] >>> filter_url('http://domain.com/admin/ctl/fcn.bad!ext') Traceback (most recent call last): ... HTTP: 400 BAD REQUEST [invalid extension] >>> filter_url('http://domain.com/admin/ctl/fcn/bad!arg') Traceback (most recent call last): ... HTTP: 400 BAD REQUEST [invalid arg <bad!arg>] >>> filter_url('https://domain.com/app/ctr/fcn', out=True) '/app/ctr/fcn' >>> filter_url('https://domain.com/welcome/ctr/fcn', out=True) '/ctr/fcn' >>> filter_url('https://domain.com/welcome/default/fcn', out=True) '/fcn' >>> filter_url('https://domain.com/welcome/default/index', out=True) '/' >>> filter_url('https://domain.com/welcome/appadmin/index', out=True) '/appadmin' >>> filter_url('http://domain.com/welcome/default/fcn?query', out=True) '/fcn?query' >>> filter_url('http://domain.com/welcome/default/fcn#anchor', out=True) '/fcn#anchor' >>> filter_url('http://domain.com/welcome/default/fcn?query#anchor', out=True) '/fcn?query#anchor' >>> filter_url('http://domain.com/appadmin/fcn-1') '/welcome/appadmin/fcn_1' >>> filter_url('http://domain.com/welcome/appadmin/fcn_1', out=True) '/appadmin/fcn-1' >>> filter_url('http://domain.com/examples/appadmin/fcn-1') '/examples/appadmin/fcn_1' >>> filter_url('http://domain.com/examples/appadmin/fcn_1', out=True) '/examples/appadmin/fcn-1' >>> filter_url('http://domain.com/app/static/filename-with_underscore', out=True) '/app/static/filename-with_underscore' >>> os.path.relpath(filter_url('http://domain.com/admin/static/filename-with_underscore')) 'applications/admin/static/filename-with_underscore' >>> filter_err(200) 200 >>> filter_err(399) 399 >>> filter_err(400) 400 ''' pass if __name__ == '__main__': import doctest doctest.testmod()
42.632287
164
0.679289
1,293
9,507
4.91802
0.235112
0.04246
0.042931
0.062746
0.261834
0.224092
0.182419
0.161032
0.11983
0.086806
0
0.008371
0.195856
9,507
222
165
42.824324
0.823414
0.91196
0
0.142857
0
0
0.037406
0
0
0
0
0
0
1
0.071429
false
0.071429
0.071429
0
0.142857
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
6ae0b2e5802c9a882bad8e33b9afb8e9564c00ff
4,558
py
Python
tests/model/test_guest.py
bcurnow/rfid-security-svc
d3806cb74d3d0cc2623ea425230dc8781ba4d8b4
[ "Apache-2.0" ]
null
null
null
tests/model/test_guest.py
bcurnow/rfid-security-svc
d3806cb74d3d0cc2623ea425230dc8781ba4d8b4
[ "Apache-2.0" ]
null
null
null
tests/model/test_guest.py
bcurnow/rfid-security-svc
d3806cb74d3d0cc2623ea425230dc8781ba4d8b4
[ "Apache-2.0" ]
null
null
null
import pytest from unittest.mock import patch import rfidsecuritysvc.model.guest as model from rfidsecuritysvc.model.color import Color from rfidsecuritysvc.model.guest import Guest from rfidsecuritysvc.model.sound import Sound from rfidsecuritysvc.exception import SoundNotFoundError def test_Guest(assert_model, default_sound, default_color): assert_model(_model(1, 'first', 'last', default_sound, default_color), Guest(1, 'first', 'last', default_sound, default_color)) @patch('rfidsecuritysvc.model.guest.table') def test_get(table): table.get.return_value = _default().test_to_row() assert model.get(1) == _default() table.get.assert_called_once_with(1) @patch('rfidsecuritysvc.model.guest.table') def test_get_notfound(table): table.get.return_value = None assert model.get(1) is None table.get.assert_called_once_with(1) @patch('rfidsecuritysvc.model.guest.table') def test_list(table): table.list.return_value = [ _default().test_to_row(), _default(2).test_to_row(), ] models = model.list() table.list.assert_called_once() assert models == [_default(), _default(2)] @patch('rfidsecuritysvc.model.guest.table') def test_list_noresults(table): table.list.return_value = [] models = model.list() table.list.assert_called_once() assert models == [] @patch('rfidsecuritysvc.model.guest.sound_model') @patch('rfidsecuritysvc.model.guest.table') def test_create(table, sound, default_sound): sound.get.return_value = default_sound table.create.return_value = None assert model.create('first', 'last', default_sound.id, 0xABCDEF) is None sound.get.assert_called_once_with(default_sound.id) table.create.assert_called_once_with('first', 'last', default_sound.id, 0xABCDEF) @patch('rfidsecuritysvc.model.guest.sound_model') @patch('rfidsecuritysvc.model.guest.table') def test_create_SoundNotFoundError(table, sound, default_sound): sound.get.return_value = None with pytest.raises(SoundNotFoundError): model.create('first', 'last', default_sound.id, 0xABCDEF) sound.get.assert_called_once_with(default_sound.id) table.create.assert_not_called() @patch('rfidsecuritysvc.model.guest.sound_model') @patch('rfidsecuritysvc.model.guest.table') def test_create_no_prefs(table, sound, default_sound): table.create.return_value = None assert model.create('first', 'last', None, None) is None sound.get.assert_not_called() table.create.assert_called_once_with('first', 'last', None, None) @patch('rfidsecuritysvc.model.guest.table') def test_delete(table): table.delete.return_value = 1 assert model.delete(1) == 1 table.delete.assert_called_with(1) @patch('rfidsecuritysvc.model.guest.sound_model') @patch('rfidsecuritysvc.model.guest.table') def test_update(table, sound, default_sound): sound.get.return_value = default_sound table.update.return_value = 1 assert model.update(1, 'first', 'last', default_sound.id, 0xABCDEF) == 1 sound.get.assert_called_once_with(default_sound.id) table.update.assert_called_once_with(1, 'first', 'last', default_sound.id, 0xABCDEF) @patch('rfidsecuritysvc.model.guest.sound_model') @patch('rfidsecuritysvc.model.guest.table') def test_update_no_prefs(table, sound, default_sound): table.update.return_value = 1 assert model.update(1, 'first', 'last', None, None) == 1 sound.get.assert_not_called() table.update.assert_called_once_with(1, 'first', 'last', None, None) @patch('rfidsecuritysvc.model.guest.sound_model') @patch('rfidsecuritysvc.model.guest.table') def test_update_SoundNotFoundError(table, sound, default_sound): table.update.return_value = 1 sound.get.return_value = None with pytest.raises(SoundNotFoundError): model.update(1, 'first', 'last', default_sound.id, 0xABCDEF) sound.get.assert_called_once_with(default_sound.id) table.update.assert_not_called() def test__model_no_color(creatable_guest): row = creatable_guest.test_to_row() row['color'] = None g = model.__model(row) assert g.color is None def test__model_no_sound(creatable_guest): row = creatable_guest.test_to_row() row['sound'] = None g = model.__model(row) assert g.sound is None def _default(index=1): return _model(index, f'first {index}', f'last {index}', Sound(index, f'sound_name {index}', '2021-09-25 23:13:25'), Color(0xABCDEF)) def _model(id, first_name, last_name, sound, color): return Guest(id, first_name, last_name, sound, color)
33.762963
136
0.740895
627
4,558
5.145136
0.089314
0.130192
0.147241
0.158091
0.791383
0.738686
0.706138
0.640422
0.563546
0.49349
0
0.011114
0.131417
4,558
134
137
34.014925
0.803738
0
0
0.435644
0
0
0.17047
0.130979
0
0
0.012286
0
0.29703
1
0.158416
false
0
0.069307
0.019802
0.247525
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
6ae692e1d71ed7665097647321e9c90f2d578c91
206
py
Python
test_data/parse/unexpected/symbol_table/inheritance_from_non_class/meta_model.py
aas-core-works/aas-core-csharp-codegen
731f706e2d12bf80722ac55d920fcf5402fb26ef
[ "MIT" ]
null
null
null
test_data/parse/unexpected/symbol_table/inheritance_from_non_class/meta_model.py
aas-core-works/aas-core-csharp-codegen
731f706e2d12bf80722ac55d920fcf5402fb26ef
[ "MIT" ]
2
2021-11-17T22:11:59.000Z
2021-11-18T15:17:40.000Z
test_data/parse/unexpected/symbol_table/inheritance_from_non_class/meta_model.py
aas-core-works/aas-core-csharp-codegen
731f706e2d12bf80722ac55d920fcf5402fb26ef
[ "MIT" ]
null
null
null
class Some_enum(Enum): some_literal = "some_literal" class Something(Some_enum): pass class Reference: pass __book_url__ = "dummy" __book_version__ = "dummy" associate_ref_with(Reference)
12.875
33
0.737864
26
206
5.230769
0.538462
0.117647
0
0
0
0
0
0
0
0
0
0
0.174757
206
15
34
13.733333
0.8
0
0
0.222222
0
0
0.106796
0
0
0
0
0
0
1
0
false
0.222222
0
0
0.444444
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
0a819052de1a3c3f8fa2090ece2179f25885147a
767
py
Python
pype/celery.py
h2020-westlife-eu/VRE
a85d5370767939b1971415be48a551ae6b1edc5d
[ "MIT" ]
1
2016-06-28T13:13:27.000Z
2016-06-28T13:13:27.000Z
pype/celery.py
h2020-westlife-eu/VRE
a85d5370767939b1971415be48a551ae6b1edc5d
[ "MIT" ]
12
2016-06-28T11:19:46.000Z
2017-05-05T14:24:14.000Z
pype/celery.py
h2020-westlife-eu/VRE
a85d5370767939b1971415be48a551ae6b1edc5d
[ "MIT" ]
null
null
null
# coding: utf-8 # Copyright Luna Technology 2015 # Matthieu Riviere <[email protected]> from __future__ import absolute_import import os from celery import Celery # Set the default Django settings module for the 'celery' program os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'pype.settings') from django.conf import settings from celery.signals import setup_logging @setup_logging.connect def configure_logging(sender=None, **kwargs): import logging import logging.config logging.config.dictConfig(settings.LOGGING) app = Celery('pype') app.config_from_object('django.conf:settings') app.autodiscover_tasks(lambda: settings.INSTALLED_APPS) @app.task(bind=True) def debug_task(self): print('Request: {0!r}'.format(self.request))
23.96875
65
0.783572
104
767
5.634615
0.548077
0.047782
0.068259
0
0
0
0
0
0
0
0
0.00885
0.116037
767
31
66
24.741935
0.855457
0.20339
0
0
0
0
0.120462
0.036304
0
0
0
0
0
1
0.117647
false
0
0.411765
0
0.529412
0.058824
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
0a86cf6fa8f86673090e299d74c945f26f918502
909
py
Python
backend/app/app/db/session.py
zhkuo24/full-stack-fastapi-demo
25b0d4e5c7fe303b751974748b687e98d4454f48
[ "MIT" ]
7
2021-01-06T15:44:58.000Z
2022-02-12T05:07:10.000Z
backend/app/app/db/session.py
zhkuo24/full-stack-fastapi-demo
25b0d4e5c7fe303b751974748b687e98d4454f48
[ "MIT" ]
null
null
null
backend/app/app/db/session.py
zhkuo24/full-stack-fastapi-demo
25b0d4e5c7fe303b751974748b687e98d4454f48
[ "MIT" ]
2
2022-03-09T23:20:06.000Z
2022-03-11T02:48:08.000Z
# -*- coding: utf-8 -*- # @File : session.py # @Author : zhkuo # @Time : 2021/1/3 9:12 下午 # @Desc : from sqlalchemy import create_engine # from sqlalchemy.orm import scoped_session from sqlalchemy.orm import sessionmaker from app.core.config import settings """ 参考: https://www.osgeo.cn/sqlalchemy/orm/session_basics.html https://landybird.github.io/python/2020/03/02/fastapi%E4%B8%8Easgi(5)/ 处理session的不同方法 https://github.com/tiangolo/fastapi/issues/726 处理数据库session的方法 1. sqlalchemy.orm 自带的 scoped_session 2. 采用中间件的方法,每个请求建立一个 db 连接 3. dependency 依赖的方法(官方文档推荐方法) """ # 创建连接数据库的 engine engine = create_engine(settings.SQLALCHEMY_DATABASE_URI, connect_args={"check_same_thread": False}) # 为了保证线程安全,需使用scoped_session方法 # db_session = scoped_session( # sessionmaker(autocommit=False, autoflush=False, bind=engine) # ) SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)
28.40625
99
0.766777
122
909
5.606557
0.639344
0.076023
0.049708
0.067251
0.149123
0.149123
0.149123
0
0
0
0
0.034611
0.110011
909
31
100
29.322581
0.810878
0.306931
0
0
0
0
0.055375
0
0
0
0
0
0
1
0
false
0
0.6
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
0a9de0f402594abfa8300f717bad17c1f1a23420
856
py
Python
formidable/forms/boundfield.py
jayvdb/django-formidable
df8bcd0c882990d72d302be47aeb4fb11915b1fa
[ "MIT" ]
null
null
null
formidable/forms/boundfield.py
jayvdb/django-formidable
df8bcd0c882990d72d302be47aeb4fb11915b1fa
[ "MIT" ]
null
null
null
formidable/forms/boundfield.py
jayvdb/django-formidable
df8bcd0c882990d72d302be47aeb4fb11915b1fa
[ "MIT" ]
null
null
null
from django.forms import forms class FormatBoundField(forms.BoundField): """ The format field skips the rendering with the label attribute in the form level (i.e => form.as_p() doesn't have to generate any label for format field). This boundfield has this main goal. """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # This attribute is used to generate (or not) the final label # with html tags. We force the label to None to avoid the label # generation: self.label = None class HelpTextBoundField(FormatBoundField): def value(self): return self.field.text class TitleBoundField(FormatBoundField): def value(self): return self.field.label class SeparatorBoundField(FormatBoundField): def value(self): return None
23.777778
76
0.671729
109
856
5.192661
0.522936
0.042403
0.127208
0.14841
0.212014
0.151943
0.151943
0
0
0
0
0
0.246495
856
35
77
24.457143
0.877519
0.378505
0
0.214286
0
0
0
0
0
0
0
0
0
1
0.285714
false
0
0.071429
0.214286
0.857143
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
0ab1197213ef76c98f29e3e63d45d1418b5c01ea
583
py
Python
app/configs/development_settings.py
DIS-SIN/FlaskShell
5f6d0cfeac8bea0b274d16a497e3a20cd00b155a
[ "CC0-1.0" ]
null
null
null
app/configs/development_settings.py
DIS-SIN/FlaskShell
5f6d0cfeac8bea0b274d16a497e3a20cd00b155a
[ "CC0-1.0" ]
null
null
null
app/configs/development_settings.py
DIS-SIN/FlaskShell
5f6d0cfeac8bea0b274d16a497e3a20cd00b155a
[ "CC0-1.0" ]
null
null
null
######################################################## FLASK SETTINGS ############################################################## #Variable used to securly sign cookies ##THIS IS SET IN DEV ENVIRONMENT FOR CONVENIENCE BUT SHOULD BE SET AS AN ENVIRONMENT VARIABLE IN PROD SECRET_KEY = "dev" ######################################################## DATABSE SETTINGS #################################################### #Neo4j Database URI used by the Neomodel OGM ## THIS SHOULD BE SET AS AN ENVIRONMENT VARIABLE IN PRODUCTION ## DATABASE_URI = "bolt://test:test@localhost:7687"
58.3
134
0.476844
56
583
4.928571
0.660714
0.057971
0.07971
0.094203
0.26087
0.26087
0.26087
0.26087
0
0
0
0.009542
0.101201
583
9
135
64.777778
0.517176
0.466552
0
0
0
0
0.453333
0.413333
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0abb04a5bd64547bc5fd647c86d2afb7977fd604
55
py
Python
src/data_setup/__init__.py
data-stories/chart-experiment
f4d7c86c32edca8bcb474cce5f6312138acf5cc9
[ "MIT" ]
null
null
null
src/data_setup/__init__.py
data-stories/chart-experiment
f4d7c86c32edca8bcb474cce5f6312138acf5cc9
[ "MIT" ]
1
2021-08-07T07:39:17.000Z
2021-08-07T07:39:17.000Z
src/data_setup/__init__.py
data-stories/chart-experiment
f4d7c86c32edca8bcb474cce5f6312138acf5cc9
[ "MIT" ]
1
2021-08-06T16:27:00.000Z
2021-08-06T16:27:00.000Z
__all__ = ["data_setup", "chart_params", "base_params"]
55
55
0.727273
7
55
4.714286
0.857143
0
0
0
0
0
0
0
0
0
0
0
0.072727
55
1
55
55
0.647059
0
0
0
0
0
0.589286
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0abb3c732259b19c9e708a20325a84c61a393244
1,851
py
Python
src/aiocomcrawl/models.py
rudaporto/aiocomcrawl
9f76097d9f82c5790f968d26a6f1c3908084569b
[ "Apache-2.0" ]
null
null
null
src/aiocomcrawl/models.py
rudaporto/aiocomcrawl
9f76097d9f82c5790f968d26a6f1c3908084569b
[ "Apache-2.0" ]
null
null
null
src/aiocomcrawl/models.py
rudaporto/aiocomcrawl
9f76097d9f82c5790f968d26a6f1c3908084569b
[ "Apache-2.0" ]
null
null
null
from datetime import datetime from typing import Any, List, Optional, Union from pydantic import BaseModel, Field, HttpUrl, validator from pydantic.dataclasses import dataclass class Index(BaseModel): id: str name: str time_gate: HttpUrl = Field(alias="timegate") cdx_api: HttpUrl = Field(alias="cdx-api") @dataclass(frozen=True) class ResultBody: mime_detected: Optional[str] data: Optional[str] text: Optional[List[str]] @dataclass(frozen=True) class ResultMeta: # todo: these are still raw strings warc_request_meta: Optional[str] response_header: Optional[str] class Result(BaseModel): url_key: str = Field(alias="urlkey") timestamp: datetime url: str mime: str mime_detected: str = Field(alias="mime-detected") status: int digest: str length: int offset: int filename: str languages: Optional[str] encoding: Optional[str] index_id: Optional[str] body: Optional[ResultBody] meta: Optional[ResultMeta] @validator("timestamp", pre=True) def parse_timestamp(cls, value: Any) -> Union[datetime, Any]: if isinstance(value, str): datetime_value = datetime.strptime(value, "%Y%m%d%H%M%S") return datetime_value return value class SearchPagesRequest(BaseModel): """Request existing pages on one index for a given url.""" index: Index url: str show_num_pages: str = Field(alias="showNumPages", default="true", const=True) output: str = "json" class SearchPagesResponse(BaseModel): """Response with the total number of pages in this index for a given url.""" index: Index url: str pages: int class SearchIndexRequest(BaseModel): """One page that contains records to be fetched.""" index: Index url: str page: int output: str = "json"
23.730769
81
0.678012
234
1,851
5.303419
0.444444
0.062047
0.031426
0.038678
0.053183
0.053183
0.053183
0.053183
0.053183
0
0
0
0.219341
1,851
77
82
24.038961
0.858824
0.110211
0
0.203704
0
0
0.048437
0
0
0
0
0.012987
0
1
0.018519
false
0
0.074074
0
0.907407
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
0ac2127dd527328224d7a0dde62602b62da1bdb4
678
py
Python
lgtv_rs232/commands/remote_control/remote_control_lock.py
davo22/lgtv_rs232
40562cddf7acdf6fa95124029595e3838dd9e7b0
[ "MIT" ]
null
null
null
lgtv_rs232/commands/remote_control/remote_control_lock.py
davo22/lgtv_rs232
40562cddf7acdf6fa95124029595e3838dd9e7b0
[ "MIT" ]
null
null
null
lgtv_rs232/commands/remote_control/remote_control_lock.py
davo22/lgtv_rs232
40562cddf7acdf6fa95124029595e3838dd9e7b0
[ "MIT" ]
null
null
null
from enum import Enum class RemoteControlLock(Enum): OFF = 0 ON = 1 def map_to_state(data: int): return RemoteControlLock(data) class RemoteControlLockCommands(object): _command = "km" def __init__(self, send_command): self._send_command = send_command async def get_state(self): return map_to_state(await self._send_command(self._command, 255)) async def set_state(self, state: RemoteControlLock): return map_to_state(await self._send_command(self._command, state.value)) def on(self): return self.set_state(RemoteControlLock.ON) def off(self): return self.set_state(RemoteControlLock.OFF)
22.6
81
0.70649
88
678
5.159091
0.329545
0.121145
0.132159
0.125551
0.378855
0.378855
0.207048
0.207048
0.207048
0.207048
0
0.009276
0.205015
678
29
82
23.37931
0.833024
0
0
0
0
0
0.00295
0
0
0
0
0
0
1
0.222222
false
0
0.055556
0.166667
0.833333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
0ac4d53d399503faaa282a5d9403e61ac65e0976
311
py
Python
Dataset/Leetcode/train/58/28.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/train/58/28.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
Dataset/Leetcode/train/58/28.py
kkcookies99/UAST
fff81885aa07901786141a71e5600a08d7cb4868
[ "MIT" ]
null
null
null
class Solution: def XXX(self, s): """ :type s: str :rtype: int """ cnt, tail = 0, len(s) - 1 while tail >= 0 and s[tail] == ' ': tail -= 1 while tail >= 0 and s[tail] != ' ': cnt += 1 tail -= 1 return cnt
20.733333
43
0.360129
37
311
3.027027
0.486486
0.133929
0.178571
0.196429
0.339286
0.339286
0.339286
0
0
0
0
0.044586
0.495177
311
14
44
22.214286
0.66879
0
0
0.222222
0
0
0.007874
0
0
0
0
0
0
0
null
null
0
0
null
null
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
0ad05115e0ac22a4083ac999a331c7da804f1e24
1,058
py
Python
music/models.py
anirudha-bs/Django_music_app
1b80bd4299a35fb707c32307dd115074a8ecba9f
[ "Apache-2.0" ]
null
null
null
music/models.py
anirudha-bs/Django_music_app
1b80bd4299a35fb707c32307dd115074a8ecba9f
[ "Apache-2.0" ]
null
null
null
music/models.py
anirudha-bs/Django_music_app
1b80bd4299a35fb707c32307dd115074a8ecba9f
[ "Apache-2.0" ]
null
null
null
from django.contrib.auth.models import Permission, User from django.db import models class Album(models.Model): user = models.ForeignKey(User, default=1,on_delete=models.CASCADE) artist = models.CharField(max_length=250) album_title = models.CharField(max_length=500) genre = models.CharField(max_length=100) album_logo = models.FileField(default="avatar.jpg") album_visibility = models.CharField(max_length=100, default="private") is_favorite = models.BooleanField(default=False) def __str__(self): return self.album_title + '-' + self.artist + '-' + self.genre class Song(models.Model): user = models.ForeignKey(User, default=1,on_delete=models.CASCADE) album = models.ForeignKey(Album, on_delete=models.CASCADE, null=True) song_title = models.CharField(max_length=250) audio_file = models.FileField(default='') song_visibility = models.CharField(max_length=100, default="private") is_favorite = models.BooleanField(default=False) def __str__(self): return self.song_title
37.785714
74
0.73535
137
1,058
5.481752
0.335766
0.11984
0.143808
0.191744
0.619174
0.466045
0.466045
0.466045
0.466045
0.466045
0
0.022198
0.148393
1,058
28
75
37.785714
0.811321
0
0
0.285714
0
0
0.024551
0
0
0
0
0
0
1
0.095238
false
0
0.095238
0.095238
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
0ad5ae1fbe9b6f2bb0a59a7bd762d3ef2ea1b7ed
22,315
py
Python
src/tests/cfp/views/test_cfp_user.py
xhub/pretalx
33bd07ec98ddeb5b7ff35fe7e30c4d38bef57d7e
[ "Apache-2.0" ]
null
null
null
src/tests/cfp/views/test_cfp_user.py
xhub/pretalx
33bd07ec98ddeb5b7ff35fe7e30c4d38bef57d7e
[ "Apache-2.0" ]
null
null
null
src/tests/cfp/views/test_cfp_user.py
xhub/pretalx
33bd07ec98ddeb5b7ff35fe7e30c4d38bef57d7e
[ "Apache-2.0" ]
null
null
null
import pytest from django.conf import settings from django.core import mail as djmail from django.core.files.uploadedfile import SimpleUploadedFile from django.urls import reverse from django_scopes import scope from rest_framework.authtoken.models import Token from pretalx.submission.models import SubmissionStates @pytest.mark.django_db def test_can_see_submission_list(speaker_client, submission): response = speaker_client.get(submission.event.urls.user_submissions, follow=True) assert response.status_code == 200 assert submission.title in response.content.decode() @pytest.mark.django_db def test_can_see_submission(speaker_client, submission): response = speaker_client.get(submission.urls.user_base, follow=True) assert response.status_code == 200 assert submission.title in response.content.decode() @pytest.mark.django_db def test_cannot_see_other_submission(speaker_client, other_submission): response = speaker_client.get(other_submission.urls.user_base, follow=True) assert response.status_code == 404 @pytest.mark.django_db def test_can_confirm_submission(speaker_client, accepted_submission): response = speaker_client.get(accepted_submission.urls.confirm, follow=True) accepted_submission.refresh_from_db() assert response.status_code == 200 assert accepted_submission.state == SubmissionStates.ACCEPTED response = speaker_client.post(accepted_submission.urls.confirm, follow=True) accepted_submission.refresh_from_db() assert response.status_code == 200 assert accepted_submission.state == SubmissionStates.CONFIRMED @pytest.mark.django_db def test_can_reconfirm_submission(speaker_client, accepted_submission): accepted_submission.state = SubmissionStates.CONFIRMED accepted_submission.save() response = speaker_client.get(accepted_submission.urls.confirm, follow=True) accepted_submission.refresh_from_db() assert response.status_code == 200 assert accepted_submission.state == SubmissionStates.CONFIRMED @pytest.mark.django_db def test_cannot_confirm_rejected_submission(other_speaker_client, rejected_submission): rejected_submission.state = SubmissionStates.REJECTED rejected_submission.save() response = other_speaker_client.get(rejected_submission.urls.confirm, follow=True) rejected_submission.refresh_from_db() assert response.status_code == 200 assert rejected_submission.state == SubmissionStates.REJECTED @pytest.mark.django_db def test_can_withdraw_submission(speaker_client, submission): response = speaker_client.get(submission.urls.withdraw, follow=True) submission.refresh_from_db() assert response.status_code == 200 assert submission.state == SubmissionStates.SUBMITTED response = speaker_client.post(submission.urls.withdraw, follow=True) submission.refresh_from_db() assert response.status_code == 200 assert submission.state == SubmissionStates.WITHDRAWN @pytest.mark.django_db def test_cannot_withdraw_accepted_submission(speaker_client, accepted_submission): response = speaker_client.get(accepted_submission.urls.withdraw, follow=True) accepted_submission.refresh_from_db() assert response.status_code == 200 assert accepted_submission.state == SubmissionStates.ACCEPTED @pytest.mark.django_db def test_can_edit_submission(speaker_client, submission, resource, other_resource): with scope(event=submission.event): assert submission.resources.count() == 2 resource_one = submission.resources.first() resource_two = submission.resources.last() assert submission.title in str(resource_one) f = SimpleUploadedFile('testfile.txt', b'file_content') data = { 'title': 'Ein ganz neuer Titel', 'submission_type': submission.submission_type.pk, 'content_locale': submission.content_locale, 'description': submission.description, 'abstract': submission.abstract, 'notes': submission.notes, 'slot_count': submission.slot_count, 'resource-0-id': resource_one.id, 'resource-0-description': 'new resource name', 'resource-0-resource': resource_one.resource, 'resource-1-id': resource_two.id, 'resource-1-DELETE': True, 'resource-1-description': resource_two.description, 'resource-1-resource': resource_two.resource, 'resource-2-id': '', 'resource-2-description': 'new resource', 'resource-2-resource': f, 'resource-TOTAL_FORMS': 3, 'resource-INITIAL_FORMS': 2, 'resource-MIN_NUM_FORMS': 0, 'resource-MAX_NUM_FORMS': 1000, } response = speaker_client.post(submission.urls.user_base, follow=True, data=data) assert response.status_code == 200 with scope(event=submission.event): assert submission.resources.count() == 2 submission.refresh_from_db() resource_one.refresh_from_db() new_resource = submission.resources.exclude(pk=resource_one.pk).first() assert submission.title == 'Ein ganz neuer Titel', response.content.decode() assert submission.resources.count() == 2 assert new_resource.description == 'new resource' assert new_resource.resource.read() == b'file_content' assert not submission.resources.filter(pk=resource_two.pk).exists() @pytest.mark.django_db def test_can_edit_slot_count(speaker_client, submission): with scope(event=submission.event): submission.event.settings.present_multiple_times = True data = { 'title': 'Ein ganz neuer Titel', 'submission_type': submission.submission_type.pk, 'content_locale': submission.content_locale, 'description': submission.description, 'abstract': submission.abstract, 'notes': submission.notes, 'slot_count': 13, 'resource-TOTAL_FORMS': 0, 'resource-INITIAL_FORMS': 0, 'resource-MIN_NUM_FORMS': 0, 'resource-MAX_NUM_FORMS': 1000, } response = speaker_client.post(submission.urls.user_base, follow=True, data=data) assert response.status_code == 200 with scope(event=submission.event): submission.refresh_from_db() assert submission.slot_count == 13 @pytest.mark.django_db def test_cannot_edit_confirmed_slot_count(speaker_client, confirmed_submission): submission = confirmed_submission submission.event.settings.present_multiple_times = True with scope(event=submission.event): data = { 'title': 'Ein ganz neuer Titel', 'submission_type': submission.submission_type.pk, 'content_locale': submission.content_locale, 'description': submission.description, 'abstract': submission.abstract, 'notes': submission.notes, 'slot_count': 13, 'resource-TOTAL_FORMS': 0, 'resource-INITIAL_FORMS': 0, 'resource-MIN_NUM_FORMS': 0, 'resource-MAX_NUM_FORMS': 1000, } response = speaker_client.post(submission.urls.user_base, follow=True, data=data) assert response.status_code == 200 with scope(event=submission.event): submission.refresh_from_db() assert submission.slot_count != 13 @pytest.mark.django_db def test_cannot_edit_rejected_submission(other_speaker_client, rejected_submission): title = rejected_submission.title data = { 'title': 'Ein ganz neuer Titel', 'submission_type': rejected_submission.submission_type.pk, 'content_locale': rejected_submission.content_locale, 'description': rejected_submission.description, 'abstract': rejected_submission.abstract, 'notes': rejected_submission.notes, 'resource-TOTAL_FORMS': 0, 'resource-INITIAL_FORMS': 0, 'resource-MIN_NUM_FORMS': 0, 'resource-MAX_NUM_FORMS': 1000, } response = other_speaker_client.post( rejected_submission.urls.user_base, follow=True, data=data ) assert response.status_code == 200 rejected_submission.refresh_from_db() assert rejected_submission.title == title @pytest.mark.django_db def test_can_edit_submission_type(speaker_client, submission, event): with scope(event=submission.event): new_type = event.submission_types.create(name='Other', default_duration=13) data = { 'title': 'Ein ganz neuer Titel', 'submission_type': new_type.pk, 'content_locale': submission.content_locale, 'description': submission.description, 'abstract': submission.abstract, 'notes': submission.notes, 'resource-TOTAL_FORMS': 0, 'resource-INITIAL_FORMS': 0, 'resource-MIN_NUM_FORMS': 0, 'resource-MAX_NUM_FORMS': 1000, } response = speaker_client.post(submission.urls.user_base, follow=True, data=data) assert response.status_code == 200 with scope(event=submission.event): submission.refresh_from_db() assert submission.submission_type == new_type @pytest.mark.django_db def test_cannot_edit_submission_type_after_acceptance(speaker_client, submission, event): with scope(event=submission.event): submission.accept() new_type = event.submission_types.create(name='Other', default_duration=13) data = { 'title': 'Ein ganz neuer Titel', 'submission_type': new_type.pk, 'content_locale': submission.content_locale, 'description': submission.description, 'abstract': submission.abstract, 'notes': submission.notes, 'resource-TOTAL_FORMS': 0, 'resource-INITIAL_FORMS': 0, 'resource-MIN_NUM_FORMS': 0, 'resource-MAX_NUM_FORMS': 1000, } response = speaker_client.post(submission.urls.user_base, follow=True, data=data) assert response.status_code == 200 with scope(event=submission.event): submission.refresh_from_db() assert submission.submission_type != new_type @pytest.mark.django_db def test_can_edit_profile(speaker, event, speaker_client): response = speaker_client.post( event.urls.user, data={ 'name': 'Lady Imperator', 'biography': 'Ruling since forever.', 'form': 'profile', }, follow=True, ) assert response.status_code == 200 with scope(event=event): speaker.refresh_from_db() assert speaker.profiles.get(event=event).biography == 'Ruling since forever.' assert speaker.name == 'Lady Imperator' @pytest.mark.django_db def test_can_change_api_token(speaker, event, speaker_client): speaker.regenerate_token() old_token = Token.objects.filter(user=speaker).first().key response = speaker_client.post( event.urls.user, data={ 'form': 'token', }, follow=True, ) assert response.status_code == 200 new_token = Token.objects.filter(user=speaker).first().key assert new_token != old_token @pytest.mark.django_db def test_must_provide_availabilities(speaker, event, speaker_client): event.settings.cfp_require_availabilities = True response = speaker_client.post( event.urls.user, data={ 'name': 'Lady Imperator', 'biography': 'Ruling since forever.', 'form': 'profile', }, follow=True, ) assert response.status_code == 200 with scope(event=event): speaker.refresh_from_db() assert speaker.profiles.get(event=event).biography != 'Ruling since forever.' response = speaker_client.post( event.urls.user, data={ 'name': 'Lady Imperator', 'biography': 'Ruling since forever.', 'form': 'profile', 'availabilities': '{"availabilities": []}', }, follow=True, ) assert response.status_code == 200 with scope(event=event): speaker.refresh_from_db() assert speaker.profiles.get(event=event).biography != 'Ruling since forever.' @pytest.mark.django_db def test_can_edit_login_info(speaker, event, speaker_client): response = speaker_client.post( event.urls.user, data={ 'old_password': 'speakerpwd1!', 'email': '[email protected]', 'password': '', 'password_repeat': '', 'form': 'login', }, follow=True, ) assert response.status_code == 200 speaker.refresh_from_db() assert speaker.email == '[email protected]' @pytest.mark.django_db def test_can_edit_login_info_wrong_password(speaker, event, speaker_client): response = speaker_client.post( event.urls.user, data={ 'old_password': 'speakerpwd23!', 'email': '[email protected]', 'password': '', 'password_repeat': '', 'form': 'login', }, follow=True, ) assert response.status_code == 200 speaker.refresh_from_db() assert speaker.email != '[email protected]' @pytest.mark.django_db def test_can_edit_and_update_speaker_answers( speaker, event, speaker_question, speaker_boolean_question, speaker_client, speaker_text_question, speaker_file_question, ): with scope(event=event): answer = speaker.answers.filter(question_id=speaker_question.pk).first() assert not answer f = SimpleUploadedFile('testfile.txt', b'file_content') response = speaker_client.post( event.urls.user, data={ f'question_{speaker_question.id}': 'black as the night', f'question_{speaker_boolean_question.id}': 'True', f'question_{speaker_file_question.id}': f, f'question_{speaker_text_question.id}': 'Green is totally the best color.', 'form': 'questions', }, follow=True, ) assert response.status_code == 200 with scope(event=event): answer = speaker.answers.get(question_id=speaker_question.pk) assert answer.answer == 'black as the night' assert speaker.answers.get(question_id=speaker_boolean_question.pk).answer == 'True' assert ( speaker.answers.get(question_id=speaker_text_question.pk).answer == 'Green is totally the best color.' ) file_answer = speaker.answers.get(question_id=speaker_file_question.pk) assert file_answer.answer.startswith('file://') assert file_answer.answer_file.read() == b'file_content' assert (settings.MEDIA_ROOT / file_answer.answer_file.name).exists() response = speaker_client.post( event.urls.user, data={ f'question_{speaker_question.id}': 'green as the sky', 'form': 'questions', }, follow=True, ) assert response.status_code == 200 with scope(event=event): answer.refresh_from_db() assert answer.answer == 'green as the sky' @pytest.mark.django_db def test_cannot_delete_profile_on_first_try(speaker, event, speaker_client): with scope(event=event): assert speaker.profiles.get(event=event).biography != '' response = speaker_client.post(event.urls.user_delete, follow=True) assert response.status_code == 200 with scope(event=event): speaker.refresh_from_db() assert speaker.profiles.get(event=event).biography != '' assert speaker.name != 'Deleted User' @pytest.mark.django_db def test_can_delete_profile(speaker, event, speaker_client): with scope(event=event): assert speaker.profiles.get(event=event).biography != '' response = speaker_client.post( event.urls.user_delete, data={'really': True}, follow=True ) assert response.status_code == 200 with scope(event=event): speaker.refresh_from_db() assert speaker.profiles.get(event=event).biography == '' assert speaker.name == 'Deleted User' assert speaker.email.startswith('deleted_user') assert speaker.email.endswith('@localhost') @pytest.mark.django_db def test_can_change_locale(multilingual_event, client): first_response = client.get(multilingual_event.cfp.urls.public, follow=True) assert 'submission' in first_response.content.decode() assert 'Einreichung' not in first_response.content.decode() second_response = client.get( reverse('cfp:locale.set', kwargs={'event': multilingual_event.slug}) + f'?locale=de&next=/{multilingual_event.slug}/', follow=True, ) assert 'Einreichung' in second_response.content.decode() @pytest.mark.django_db def test_persists_changed_locale(multilingual_event, orga_user, orga_client): assert orga_user.locale == 'en' response = orga_client.get( reverse('cfp:locale.set', kwargs={'event': multilingual_event.slug}) + f'?locale=de&next=/{multilingual_event.slug}/', follow=True, ) orga_user.refresh_from_db() assert response.status_code == 200 assert orga_user.locale == 'de' @pytest.mark.django_db def test_can_invite_speaker(speaker_client, submission): djmail.outbox = [] response = speaker_client.get( submission.urls.invite, follow=True, data={'email': 'invalidemail'} ) assert response.status_code == 200 data = { 'speaker': '[email protected]', 'subject': 'Please join!', 'text': 'C\'mon, it will be fun!', } response = speaker_client.post(submission.urls.invite, follow=True, data=data) assert response.status_code == 200 assert len(djmail.outbox) == 1 assert djmail.outbox[0].to == ['[email protected]'] @pytest.mark.django_db def test_can_accept_invitation(orga_client, submission): assert submission.speakers.count() == 1 response = orga_client.post(submission.urls.accept_invitation, follow=True) submission.refresh_from_db() assert response.status_code == 200 assert submission.speakers.count() == 2 @pytest.mark.django_db def test_wrong_acceptance_link(orga_client, submission): assert submission.speakers.count() == 1 response = orga_client.post( submission.urls.accept_invitation + 'olololol', follow=True ) submission.refresh_from_db() assert response.status_code == 404 assert submission.speakers.count() == 1 @pytest.mark.django_db @pytest.mark.parametrize('request_availability', (True, False)) def test_submission_accept(speaker_client, submission, request_availability): submission.event.settings.cfp_request_availabilities = request_availability submission.state = SubmissionStates.ACCEPTED submission.save() response = speaker_client.post(submission.urls.confirm, follow=True) submission.refresh_from_db() assert response.status_code == 200 assert submission.state == SubmissionStates.CONFIRMED @pytest.mark.django_db def test_submission_accept_with_missing_availability(speaker_client, submission): submission.event.settings.cfp_request_availabilities = True submission.event.settings.cfp_require_availabilities = True submission.state = SubmissionStates.ACCEPTED submission.save() response = speaker_client.post(submission.urls.confirm, follow=True) submission.refresh_from_db() assert response.status_code == 200 assert submission.state == SubmissionStates.ACCEPTED @pytest.mark.django_db def test_submission_accept_nologin(client, submission): submission.state = SubmissionStates.ACCEPTED submission.save() response = client.post(submission.urls.confirm, follow=True) submission.refresh_from_db() assert response.status_code == 200 assert response.redirect_chain[-1][1] == 302 assert 'login/?next=' in response.redirect_chain[-1][0] assert submission.state == SubmissionStates.ACCEPTED @pytest.mark.django_db def test_submission_accept_wrong_code(client, submission): submission.state = SubmissionStates.ACCEPTED submission.save() assert submission.code in submission.urls.confirm response = client.post( submission.urls.confirm.replace(submission.code, "foo"), follow=True ) assert response.status_code == 200 assert response.redirect_chain[-1][1] == 302 assert 'login/?next=' in response.redirect_chain[-1][0] @pytest.mark.django_db def test_submission_withdraw(speaker_client, submission): djmail.outbox = [] submission.state = SubmissionStates.SUBMITTED submission.save() response = speaker_client.post(submission.urls.withdraw, follow=True) assert response.status_code == 200 submission.refresh_from_db() assert submission.state == SubmissionStates.WITHDRAWN assert len(djmail.outbox) == 0 @pytest.mark.django_db def test_submission_withdraw_if_accepted(speaker_client, submission): djmail.outbox = [] with scope(event=submission.event): submission.accept() response = speaker_client.post(submission.urls.withdraw, follow=True) assert response.status_code == 200 with scope(event=submission.event): submission.refresh_from_db() assert submission.state == SubmissionStates.WITHDRAWN assert len(djmail.outbox) == 1 @pytest.mark.django_db def test_submission_withdraw_if_confirmed(speaker_client, submission): with scope(event=submission.event): submission.accept() submission.confirm() response = speaker_client.post(submission.urls.withdraw, follow=True) assert response.status_code == 200 with scope(event=submission.event): submission.refresh_from_db() assert submission.state != SubmissionStates.WITHDRAWN @pytest.mark.django_db def test_submission_withdraw_if_rejected(speaker_client, submission): with scope(event=submission.event): submission.reject() response = speaker_client.post(submission.urls.withdraw, follow=True) assert response.status_code == 200 with scope(event=submission.event): submission.refresh_from_db() assert submission.state != SubmissionStates.WITHDRAWN
36.945364
92
0.6946
2,564
22,315
5.819423
0.086583
0.054889
0.052275
0.06273
0.785202
0.735675
0.70002
0.65009
0.615374
0.564439
0
0.01171
0.200179
22,315
603
93
37.006634
0.824294
0
0
0.60735
0
0
0.113511
0.03585
0
0
0
0
0.210832
1
0.067698
false
0.01354
0.015474
0
0.083172
0
0
0
0
null
0
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0ad7c645c6d3067f3c0c435d4f3782feef6cf400
218
py
Python
src/main/java/com/bailei/study/beautyOfCoding/cpu50.py
sonymoon/algorithm
cc2a9e0125fc64bdbf6549034bad6482d2027ea2
[ "Apache-2.0" ]
null
null
null
src/main/java/com/bailei/study/beautyOfCoding/cpu50.py
sonymoon/algorithm
cc2a9e0125fc64bdbf6549034bad6482d2027ea2
[ "Apache-2.0" ]
null
null
null
src/main/java/com/bailei/study/beautyOfCoding/cpu50.py
sonymoon/algorithm
cc2a9e0125fc64bdbf6549034bad6482d2027ea2
[ "Apache-2.0" ]
null
null
null
#!/usr/bin/python3 # -*- coding: UTF-8 -*- import time busyTime = 10 idleTime = busyTime while True: start = time.clock() while time.clock() - start < busyTime: pass time.sleep(busyTime / 1000)
14.533333
42
0.614679
27
218
4.962963
0.666667
0.134328
0
0
0
0
0
0
0
0
0
0.048485
0.243119
218
14
43
15.571429
0.763636
0.178899
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.125
0.125
0
0.125
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
0ad87d7268affd7dfe13527d4d842a2d43c681ac
157
py
Python
client_driver.py
tlagore/kv_store
e3f139eabaa14d0e001193e21baf7e5c96e0358d
[ "MIT" ]
null
null
null
client_driver.py
tlagore/kv_store
e3f139eabaa14d0e001193e21baf7e5c96e0358d
[ "MIT" ]
null
null
null
client_driver.py
tlagore/kv_store
e3f139eabaa14d0e001193e21baf7e5c96e0358d
[ "MIT" ]
null
null
null
from kv_client.kv_client import KVClient def main(): kvSlave = KVClient(1, "127.0.0.1", 3456) kvSlave.start() if __name__ == "__main__": main()
19.625
44
0.656051
23
157
4.043478
0.652174
0.172043
0
0
0
0
0
0
0
0
0
0.086614
0.191083
157
8
45
19.625
0.645669
0
0
0
0
0
0.107595
0
0
0
0
0
0
1
0.166667
false
0
0.166667
0
0.333333
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0af1145915916f93873c49da300235d391c3c012
95
py
Python
T05-09/program.py
maa76/SSof-Project1920
9b4ad9ac41a648c425fcfcd49cd52ff84e528bde
[ "MIT" ]
2
2019-11-20T19:26:07.000Z
2019-11-22T00:42:23.000Z
T05-09/program.py
maa76/SSof-Project1920
9b4ad9ac41a648c425fcfcd49cd52ff84e528bde
[ "MIT" ]
2
2019-11-28T05:21:24.000Z
2019-11-28T05:21:58.000Z
T05-09/program.py
maa76/SSof-Project1920
9b4ad9ac41a648c425fcfcd49cd52ff84e528bde
[ "MIT" ]
25
2019-11-27T01:40:56.000Z
2019-12-04T23:38:59.000Z
nis=get('nis') q1="xpto1" q2=nis + "xpto2" query=query1.q2 koneksi=0 q=execute(query,koneksi)
11.875
24
0.705263
17
95
3.941176
0.705882
0
0
0
0
0
0
0
0
0
0
0.081395
0.094737
95
7
25
13.571429
0.697674
0
0
0
0
0
0.138298
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0af19b677c50c3526ce7825f2f9c6b76ac47738c
715
py
Python
projects/models.py
javixeneize/asvs-1
31e9fdfd2d538c8ed1adf23fcb4f143ef28541c6
[ "MIT" ]
1
2020-10-01T05:55:39.000Z
2020-10-01T05:55:39.000Z
projects/models.py
Tasha-Carty-220/asvs
634cc0e96daedc91d1acc06827ce82e9c13f520d
[ "MIT" ]
null
null
null
projects/models.py
Tasha-Carty-220/asvs
634cc0e96daedc91d1acc06827ce82e9c13f520d
[ "MIT" ]
null
null
null
from django.db import models from django.db.models import Q from django.contrib.auth.models import User from django.urls import reverse class ProjectQuerySet(models.QuerySet): def projects_per_user(self, user): return self.filter( Q(project_owner=user.username) ) class Projects(models.Model): project_name = models.CharField(max_length=60) project_owner = models.CharField(default=User, max_length=60) project_created = models.DateTimeField(auto_now_add=True) project_description = models.CharField(max_length=255) project_level = models.IntegerField(default=0) objects = ProjectQuerySet.as_manager() def __str__(self): return str(self.pk)
28.6
65
0.738462
93
715
5.483871
0.494624
0.078431
0.047059
0.094118
0
0
0
0
0
0
0
0.013536
0.173427
715
24
66
29.791667
0.849408
0
0
0
0
0
0
0
0
0
0
0
0
1
0.111111
false
0
0.222222
0.111111
0.888889
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
0af2fa6e42815eb039756485d8f3d3cde750d905
137
py
Python
faced/const.py
binhmuc/faced
cbc18f552da9c53628d61d56de7dfda451a6e25f
[ "MIT" ]
null
null
null
faced/const.py
binhmuc/faced
cbc18f552da9c53628d61d56de7dfda451a6e25f
[ "MIT" ]
null
null
null
faced/const.py
binhmuc/faced
cbc18f552da9c53628d61d56de7dfda451a6e25f
[ "MIT" ]
null
null
null
import os MODELS_PATH = os.path.join(os.path.dirname(__file__), "models") YOLO_SIZE = 288 YOLO_TARGET = 9 CORRECTOR_SIZE = 50
15.222222
64
0.70073
21
137
4.190476
0.666667
0.136364
0
0
0
0
0
0
0
0
0
0.054054
0.189781
137
8
65
17.125
0.738739
0
0
0
0
0
0.046512
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0af494f1b9f9c81499c5786b2c2ea3e48e90635b
1,361
py
Python
a1.py
pscly/shua_shouji
1c03056c8f5db4a3a1222b2d31fdf44c3ab07cf6
[ "MulanPSL-1.0" ]
null
null
null
a1.py
pscly/shua_shouji
1c03056c8f5db4a3a1222b2d31fdf44c3ab07cf6
[ "MulanPSL-1.0" ]
null
null
null
a1.py
pscly/shua_shouji
1c03056c8f5db4a3a1222b2d31fdf44c3ab07cf6
[ "MulanPSL-1.0" ]
null
null
null
# -*- encoding=utf8 -*- __author__ = "pscly" from airtest.core.api import * from airtest.cli.parser import cli_setup # from douyin import * if not cli_setup(): auto_setup(__file__, logdir=True, devices=[ "android://127.0.0.1:5037/decc8da3?cap_method=MINICAP_STREAM&&ori_method=MINICAPORI&&touch_method=MINITOUCH", ]) # script content print("start...") print("冲冲冲!") print("-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=") print("-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=") print("-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=") wake() # 启动手机 start_app("com.ss.android.ugc.aweme.lite") hua = 0 滑动方向 = 0 while 1: hua += 1 滑动方向 += 1 if hua == 10: touch(Template(r"tpl1607564875731.png", record_pos=(-0.404, -0.67), resolution=(1079, 2340))) sleep(5) swipe((484, 1711),(531,709)) print("-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=") print("-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=") print("-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=") # generate html report # from airtest.report.report import simple_report # simple_report(__file__, logpath=True)
23.877193
121
0.409993
117
1,361
4.57265
0.632479
0.074766
0.056075
0
0
0
0
0
0
0
0
0.051753
0.119765
1,361
56
122
24.303571
0.394825
0.124173
0
0.230769
0
0.038462
0.561285
0.530008
0
0
0
0
0
1
0
false
0
0.076923
0
0.076923
0.307692
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0af5f234889bb24214fc2ee681419b82d7cdaceb
13,717
py
Python
models/psg_seed_resnet.py
VITA-Group/Peek-a-Boo
9290d4e5e3aee0dff994e1a664ec91bd6ec93176
[ "MIT" ]
2
2022-01-22T03:57:21.000Z
2022-01-30T20:44:32.000Z
models/psg_seed_resnet.py
VITA-Group/Peek-a-Boo
9290d4e5e3aee0dff994e1a664ec91bd6ec93176
[ "MIT" ]
null
null
null
models/psg_seed_resnet.py
VITA-Group/Peek-a-Boo
9290d4e5e3aee0dff994e1a664ec91bd6ec93176
[ "MIT" ]
2
2022-01-30T12:26:56.000Z
2022-03-14T12:42:06.000Z
'''ResNet using PSG in PyTorch. For Pre-activation ResNet, see 'preact_resnet.py'. Reference: [1] Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun Deep Residual Learning for Image Recognition. arXiv:1512.03385 ''' from numpy.lib.arraysetops import isin import torch import torch.nn as nn import torch.nn.functional as F import math import numpy as np from models.masked_psg_seed_conv import PredictiveSeedConv2d from masked_layers import layers # Fixed NUM_BITS = 32 NUM_BITS_WEIGHT = 32 NUM_BITS_GRAD = None BIPRECISION = False PREDICTIVE_FORWARD = False WRITER = None WRITER_PREFIX_COUNTER = 0 # Tunable PREDICTIVE_BACKWARD = True MSB_BITS = 4 MSB_BITS_WEIGHT = 4 MSB_BITS_GRAD = 8 THRESHOLD = 0.0 SPARSIFY = False SIGN = True def conv1x1(in_planes, out_planes, stride=1, input_signed=True, predictive_forward=True, writer_prefix=""): "1x1 convolution with no padding" predictive_forward = PREDICTIVE_FORWARD and predictive_forward return PredictiveSeedConv2d( in_planes, out_planes, kernel_size=1, stride=stride, padding=0, bias=False, num_bits=NUM_BITS, num_bits_weight=NUM_BITS_WEIGHT, num_bits_grad=NUM_BITS_GRAD, biprecision=BIPRECISION, input_signed=input_signed, predictive_forward=predictive_forward, predictive_backward=PREDICTIVE_BACKWARD, msb_bits=MSB_BITS, msb_bits_weight=MSB_BITS_WEIGHT, msb_bits_grad=MSB_BITS_GRAD, threshold=THRESHOLD, sparsify=SPARSIFY, sign=SIGN, writer=WRITER, writer_prefix=writer_prefix) def conv3x3(in_planes, out_planes, stride=1, input_signed=False, predictive_forward=True, writer_prefix=""): "3x3 convolution with padding" predictive_forward = PREDICTIVE_FORWARD and predictive_forward return PredictiveSeedConv2d( in_planes, out_planes, kernel_size=3, stride=stride, padding=1, bias=False, num_bits=NUM_BITS, num_bits_weight=NUM_BITS_WEIGHT, num_bits_grad=NUM_BITS_GRAD, biprecision=BIPRECISION, input_signed=input_signed, predictive_forward=predictive_forward, predictive_backward=PREDICTIVE_BACKWARD, msb_bits=MSB_BITS, msb_bits_weight=MSB_BITS_WEIGHT, msb_bits_grad=MSB_BITS_GRAD, threshold=THRESHOLD, sparsify=SPARSIFY, sign=SIGN, writer=WRITER, writer_prefix=writer_prefix) class BasicBlock(nn.Module): expansion = 1 def __init__(self, in_planes, planes, stride=1): super(BasicBlock, self).__init__() self.conv1 = conv3x3(in_planes, planes, stride=stride, input_signed=False, predictive_forward=False, writer_prefix=None) self.bn1 = nn.BatchNorm2d(planes) self.conv2 = conv3x3(planes, planes, stride=1, input_signed=False, predictive_forward=False, writer_prefix=None) self.bn2 = nn.BatchNorm2d(planes) self.shortcut = nn.Sequential() if stride != 1 or in_planes != self.expansion*planes: self.shortcut = nn.Sequential( # nn.Conv2d(in_planes, self.expansion*planes, kernel_size=1, stride=stride, bias=False), conv1x1(in_planes, self.expansion*planes, stride=stride, input_signed=False, predictive_forward=False, writer_prefix=None), nn.BatchNorm2d(self.expansion*planes) ) def forward(self, x): out = F.relu(self.bn1(self.conv1(x))) out = self.bn2(self.conv2(out)) out += self.shortcut(x) out = F.relu(out) return out class Bottleneck(nn.Module): expansion = 4 def __init__(self, in_planes, planes, stride=1): super(Bottleneck, self).__init__() # self.conv1 = nn.Conv2d(in_planes, planes, kernel_size=1, bias=False) self.conv1 = conv1x1(in_planes, planes, stride=1, input_signed=False, predictive_forward=False, writer_prefix=None) self.bn1 = nn.BatchNorm2d(planes) # self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, padding=1, bias=False) self.conv2 = conv3x3(planes, planes, stride=stride, input_signed=False, predictive_forward=False, writer_prefix=None) self.bn2 = nn.BatchNorm2d(planes) # self.conv3 = nn.Conv2d(planes, self.expansion*planes, kernel_size=1, bias=False) self.conv3 = conv1x1(planes, self.expansion*planes, stride=1, input_signed=False, predictive_forward=False, writer_prefix=None) self.bn3 = nn.BatchNorm2d(self.expansion*planes) self.shortcut = nn.Sequential() if stride != 1 or in_planes != self.expansion*planes: self.shortcut = nn.Sequential( # nn.Conv2d(in_planes, self.expansion*planes, kernel_size=1, stride=stride, bias=False), conv1x1(in_planes, self.expansion*planes, stride=stride, input_signed=False, predictive_forward=False, writer_prefix=None), nn.BatchNorm2d(self.expansion*planes) ) def forward(self, x): out = F.relu(self.bn1(self.conv1(x))) out = F.relu(self.bn2(self.conv2(out))) out = self.bn3(self.conv3(out)) out += self.shortcut(x) out = F.relu(out) return out class ResNet(nn.Module): def __init__(self, block, num_blocks, in_planes=64, num_classes=10, init_method='standard'): super(ResNet, self).__init__() self.in_planes = in_planes self.conv1 = conv3x3(3, self.in_planes, stride=1, input_signed=True, predictive_forward=False, writer_prefix=None) self.bn1 = nn.BatchNorm2d(self.in_planes) if self.in_planes == 64: # self.conv1 = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1, bias=False) self.layer1 = self._make_layer(block, 64, num_blocks[0], stride=1) self.layer2 = self._make_layer(block, 128, num_blocks[1], stride=2) self.layer3 = self._make_layer(block, 256, num_blocks[2], stride=2) self.layer4 = self._make_layer(block, 512, num_blocks[3], stride=2) self.linear = nn.Linear(512*block.expansion, num_classes) #self.linear = layers.Linear(512*block.expansion, num_classes) elif self.in_planes == 16: self.layer1 = self._make_layer(block, 16, num_blocks[0], stride=1) self.layer2 = self._make_layer(block, 32, num_blocks[1], stride=2) self.layer3 = self._make_layer(block, 64, num_blocks[2], stride=2) self.layer4 = None self.linear = nn.Linear(64, num_classes) self.reset_conv_parameters(init_method) print('conv weights reset to {}'.format(init_method)) def reset_parameters(self, module, init_method="kaiming_uniform") -> None: if init_method == "kaiming_constant_signed": fan = nn.init._calculate_correct_fan(module.weight, "fan_in") gain = nn.init.calculate_gain("relu") std = gain / math.sqrt(fan) with torch.no_grad(): module.weight.data = module.weight.data.sign() * std elif init_method == "kaiming_constant_unsigned": fan = nn.init._calculate_correct_fan(module.weight, "fan_in") gain = nn.init.calculate_gain("relu") std = gain / math.sqrt(fan) with torch.no_grad(): module.weight.data = torch.ones_like(module.weight.data) * std elif init_method == "kaiming_normal": nn.init.kaiming_normal_(module.weight, mode="fan_in", nonlinearity="relu") elif init_method == "kaiming_uniform": nn.init.kaiming_uniform_(module.weight, mode="fan_in", nonlinearity="relu") elif init_method == "kaiming_laplace": fan = nn.init._calculate_correct_fan(module.weight, "fan_in") gain = nn.init.calculate_gain("relu") scale = gain / math.sqrt(2.0 * fan) with torch.no_grad(): new_weight = np.random.laplace(loc=0.0, scale=scale, size=module.weight.shape) module.weight.data = module.weight.data.new_tensor(torch.from_numpy(new_weight).clone().detach()) elif init_method == "xavier_normal": nn.init.xavier_normal_(module.weight) elif init_method == "xavier_constant": fan_in, fan_out = nn.init._calculate_fan_in_and_fan_out(module.weight) std = math.sqrt(2.0 / float(fan_in + fan_out)) with torch.no_grad(): module.weight.data = module.weight.data.sign() * std elif init_method == "standard": nn.init.kaiming_uniform_(module.weight, a=math.sqrt(5)) else: raise ValueError(f"{init_method} is not an initialization option!") def reset_conv_parameters(self, init_method="standard") -> None: for m in self.modules(): if isinstance(m, nn.Conv2d): self.reset_parameters(m, init_method) def get_bop_params(self): bop_params = [] for m in self.modules(): if isinstance(m, nn.Conv2d): bop_params += list(m.parameters()) return bop_params def get_non_bop_params(self): non_bop_params = [] for m in self.modules(): if isinstance(m, (nn.Linear, nn.BatchNorm2d,)): non_bop_params += list(m.parameters()) return non_bop_params def _make_layer(self, block, planes, num_blocks, stride): strides = [stride] + [1]*(num_blocks-1) layers = [] for stride in strides: layers.append(block(self.in_planes, planes, stride)) self.in_planes = planes * block.expansion return nn.Sequential(*layers) def forward(self, x): out = F.relu(self.bn1(self.conv1(x))) out = self.layer1(out) out = self.layer2(out) out = self.layer3(out) if self.layer4 is not None: out = self.layer4(out) # out = F.avg_pool2d(out, 4) out = F.avg_pool2d(out, out.size()[3]) out = out.view(out.size(0), -1) out = self.linear(out) return out def PsgSeedResNet20( num_classes=10, init_method='standard', predictive_backward=True, msb_bits=4, msb_bits_weight=4, msb_bits_grad=8, threshold=0.0, sparsify=False, sign=True ): global PREDICTIVE_BACKWARD, MSB_BITS, MSB_BITS_WEIGHT, MSB_BITS_GRAD, THRESHOLD, SPARSIFY, SIGN PREDICTIVE_BACKWARD = predictive_backward MSB_BITS = msb_bits MSB_BITS_WEIGHT = msb_bits_weight MSB_BITS_GRAD = msb_bits_grad THRESHOLD = threshold SPARSIFY = sparsify SIGN = sign return ResNet(BasicBlock, [3,3,3], in_planes=16, num_classes=num_classes, init_method=init_method) def PsgSeedResNet18( num_classes=10, init_method='standard', predictive_backward=True, msb_bits=4, msb_bits_weight=4, msb_bits_grad=8, threshold=0.0, sparsify=False, sign=True ): global PREDICTIVE_BACKWARD, MSB_BITS, MSB_BITS_WEIGHT, MSB_BITS_GRAD, THRESHOLD, SPARSIFY, SIGN PREDICTIVE_BACKWARD = predictive_backward MSB_BITS = msb_bits MSB_BITS_WEIGHT = msb_bits_weight MSB_BITS_GRAD = msb_bits_grad THRESHOLD = threshold SPARSIFY = sparsify SIGN = sign return ResNet(BasicBlock, [2,2,2,2], num_classes=num_classes, init_method=init_method) def PsgSeedResNet34( num_classes=10, init_method='standard', predictive_backward=True, msb_bits=4, msb_bits_weight=4, msb_bits_grad=8, threshold=0.0, sparsify=False, sign=True ): global PREDICTIVE_BACKWARD, MSB_BITS, MSB_BITS_WEIGHT, MSB_BITS_GRAD, THRESHOLD, SPARSIFY, SIGN PREDICTIVE_BACKWARD = predictive_backward MSB_BITS = msb_bits MSB_BITS_WEIGHT = msb_bits_weight MSB_BITS_GRAD = msb_bits_grad THRESHOLD = threshold SPARSIFY = sparsify SIGN = sign return ResNet(BasicBlock, [3,4,6,3], num_classes=num_classes, init_method=init_method) def PsgSeedResNet50( num_classes=10, init_method='standard', predictive_backward=True, msb_bits=4, msb_bits_weight=4, msb_bits_grad=8, threshold=0.0, sparsify=False, sign=True ): global PREDICTIVE_BACKWARD, MSB_BITS, MSB_BITS_WEIGHT, MSB_BITS_GRAD, THRESHOLD, SPARSIFY, SIGN PREDICTIVE_BACKWARD = predictive_backward MSB_BITS = msb_bits MSB_BITS_WEIGHT = msb_bits_weight MSB_BITS_GRAD = msb_bits_grad THRESHOLD = threshold SPARSIFY = sparsify SIGN = sign return ResNet(Bottleneck, [3,4,6,3], num_classes=num_classes, init_method=init_method) def PsgSeedResNet101( num_classes=10, init_method='standard', predictive_backward=True, msb_bits=4, msb_bits_weight=4, msb_bits_grad=8, threshold=0.0, sparsify=False, sign=True ): global PREDICTIVE_BACKWARD, MSB_BITS, MSB_BITS_WEIGHT, MSB_BITS_GRAD, THRESHOLD, SPARSIFY, SIGN PREDICTIVE_BACKWARD = predictive_backward MSB_BITS = msb_bits MSB_BITS_WEIGHT = msb_bits_weight MSB_BITS_GRAD = msb_bits_grad THRESHOLD = threshold SPARSIFY = sparsify SIGN = sign return ResNet(Bottleneck, [3,4,23,3], num_classes=num_classes, init_method=init_method) def PsgSeedResNet152( num_classes=10, init_method='standard', predictive_backward=True, msb_bits=4, msb_bits_weight=4, msb_bits_grad=8, threshold=0.0, sparsify=False, sign=True ): global PREDICTIVE_BACKWARD, MSB_BITS, MSB_BITS_WEIGHT, MSB_BITS_GRAD, THRESHOLD, SPARSIFY, SIGN PREDICTIVE_BACKWARD = predictive_backward MSB_BITS = msb_bits MSB_BITS_WEIGHT = msb_bits_weight MSB_BITS_GRAD = msb_bits_grad THRESHOLD = threshold SPARSIFY = sparsify SIGN = sign return ResNet(Bottleneck, [3,8,36,3], num_classes=num_classes, init_method=init_method) def test(): net = ResNet18() y = net(torch.randn(1,3,32,32)) print(y.size()) # test()
37.787879
139
0.679813
1,839
13,717
4.813486
0.11093
0.068798
0.042589
0.034794
0.745707
0.720176
0.684704
0.661432
0.645504
0.627429
0
0.02672
0.216957
13,717
362
140
37.892265
0.797412
0.064008
0
0.573333
0
0
0.029962
0.003726
0
0
0
0
0
1
0.066667
false
0
0.026667
0
0.156667
0.006667
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0af8ec7bff7f3176683d674120e0f5944b63d168
11,868
py
Python
lib/TelloAPI.py
wuhuikai/DeepDrone
f4700178a7568fa9e308f34d0223e28635eb7660
[ "MIT" ]
1
2019-08-19T00:12:56.000Z
2019-08-19T00:12:56.000Z
lib/TelloAPI.py
wuhuikai/DeepDrone
f4700178a7568fa9e308f34d0223e28635eb7660
[ "MIT" ]
null
null
null
lib/TelloAPI.py
wuhuikai/DeepDrone
f4700178a7568fa9e308f34d0223e28635eb7660
[ "MIT" ]
null
null
null
import cv2 import time import socket import threading class Response(object): def __init__(self): pass def recv(self, data): pass def pop(self): pass def empty(self): pass class Command(Response): def __init__(self): super(Command, self).__init__() self.response = None self.lock = threading.RLock() def recv(self, data): with self.lock: self.response = data.decode('utf-8') def pop(self): with self.lock: response, self.response = self.response, None return response def empty(self): with self.lock: return self.response is None class State(Response): def __init__(self): super(State, self).__init__() self.response = {} self.lock = threading.RLock() def recv(self, data): with self.lock: self.response = {item.split(':')[0]:float(item.split(':')[1]) for item in data.decode('utf-8').split(';') if ':' in item} def pop(self): return self.response def empty(self): return False class Client(object): def __init__(self, local_port, buffer_size, daemon, response): self.response = response self.buffer_size = buffer_size self.socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.socket.bind(('', local_port)) self.receive_thread = threading.Thread(target=self._receive_thread) self.receive_thread.daemon = daemon self.receive_thread.start() def __del__(self): """Closes the local socket.""" self.socket.close() def _receive_thread(self): """Listens for responses from the Tello. Runs as a thread, sets self.response to whatever the Tello last returned. """ while True: try: self.response.recv(self.socket.recv(self.buffer_size)) except Exception as e: print(e) break def empty(self): return self.response.empty() def pop(self): return self.response.pop() class Video(object): def __init__(self, daemon=True): self.video = cv2.VideoCapture('udp://@0.0.0.0:11111') if not self.video.isOpened(): raise RuntimeError('Failed to connect to Tello') self.frame = None self.lock = threading.RLock() self.thread = threading.Thread(target=self._update_thread) self.thread.daemon = daemon self.thread.start() def __del__(self): self.video.release() def _update_thread(self): while True: ok, frame = self.video.read() if ok: with self.lock: self.frame = frame def empty(self): with self.lock: return self.frame is None def pop(self): with self.lock: frame, self.frame = self.frame, None return frame class Tello(object): def __init__(self, local_port=9999, command_timeout=0.35, state=True, video=True): """Connects to Tello in command mode. Args: local_port (int): port of local machine for receiving command response. command_timeout (float): seconds to wait for a response of command. state (bool): receive state from Tello? video (bool): receive video from Tello? Raises: RuntimeError: If the Tello rejects the attempt to enter command mode or open the video stream. """ self.command_timeout = command_timeout self.response_client = Client(local_port, 1024, True, Command()) self.state_client = Client(8890, 1024, True, State()) if state else None self.tello_address = ('192.168.10.1', 8889) self.enter_command_mode() self.video_client = None if video: self.open_video_stream() self.video_client = Video(True) def send_command(self, command, with_return=True): """Sends a command to the Tello and waits for a response. If self.command_timeout is exceeded before a response is received, a RuntimeError exception is raised. Args: command (str): Command to send. Returns: str: Response from Tello. Raises: RuntimeError: If no response is received within self.timeout seconds. """ self.response_client.pop() self.response_client.socket.sendto(command.encode('utf-8'), self.tello_address) if not with_return: return st = time.time() while self.response_client.empty(): if time.time() - st >= self.command_timeout: raise RuntimeError('No response to command') return self.response_client.pop() def state(self): return self.state_client.pop() if self.state_client else None def read_frame(self): if self.video_client is None: raise RuntimeError('Video is not available') while self.video_client.empty(): pass return self.video_client.pop() def enter_command_mode(self): if self.send_command('command') != 'ok': raise RuntimeError('Tello rejected the attempt to enter command mode') def take_off(self): """ return: 'ok' or 'error' """ return self.send_command('takeoff') def land(self): """ return: 'ok' or 'error' """ return self.send_command('land') def open_video_stream(self): if self.send_command('streamon') != 'ok': raise RuntimeError('Tello rejected to open the video stream') def close_video_stream(self): """ return: 'ok' or 'error' """ return self.send_command('streamoff') def emergency_shutdown(self): """ return: 'ok' or 'error' """ return self.send_command('emergency') def move_up(self, x, with_return=False): """ param x: int, [20, 500] param with_return: bool return: 'ok' or 'error' """ return self.send_command('up {}'.format(x), with_return) def move_down(self, x, with_return=False): """ param x: int, [20, 500] param with_return: bool return: 'ok' or 'error' """ return self.send_command('down {}'.format(x), with_return) def move_left(self, x, with_return=False): """ param x: int, [20, 500] param with_return: bool return: 'ok' or 'error' """ return self.send_command('left {}'.format(x), with_return) def move_right(self, x, with_return=False): """ param x: int, [20, 500] param with_return: bool return: 'ok' or 'error' """ return self.send_command('right {}'.format(x), with_return) def move_forward(self, x, with_return=False): """ param x: int, [20, 500] param with_return: bool return: 'ok' or 'error' """ return self.send_command('forward {}'.format(x), with_return) def move_backward(self, x, with_return=False): """ param x: int, [20, 500] param with_return: bool return: 'ok' or 'error' """ return self.send_command('back {}'.format(x), with_return) def rotate_clockwise(self, x, with_return=False): """ param x: int, [1, 3600] param with_return: bool return: 'ok' or 'error' """ return self.send_command('cw {}'.format(x), with_return) def rotate_counter_clockwise(self, x, with_return=False): """ param x: int, [1, 3600] param with_return: bool return: 'ok' or 'error' """ return self.send_command('ccw {}'.format(x), with_return) def flip_left(self, with_return=False): """ param with_return: bool return: 'ok' or 'error' """ return self.send_command('flip l', with_return) def flip_right(self, with_return=False): """ param with_return: bool return: 'ok' or 'error' """ return self.send_command('flip r', with_return) def flip_forward(self, with_return=False): """ param with_return: bool return: 'ok' or 'error' """ return self.send_command('flip f', with_return) def flip_backward(self, with_return=False): """ param with_return: bool return: 'ok' or 'error' """ return self.send_command('flip b', with_return) def goto(self, x, y, z, speed, with_return=False): """ param x: int, [20, 500] param y: int, [20, 500] param z: int, [20, 500] param speed: int, [10-100] param with_return: bool return: 'ok' or 'error' """ return self.send_command('go {} {} {} {}'.format(x, y, z, speed), with_return) def goto_curve(self, x1, y1, z1, x2, y2, z2, speed, with_return=False): """fly a curve defined by (0, 0, 0), (x1, y1, z1), (x2, y2, z2) with speed param x1, x2: int, [-500, 500] param y1, y2: int, [-500, 500] param z1, z2: int, [-500, 500] param speed: int, [10-60] param with_return: bool return: 'ok' or 'error' """ return self.send_command('curve {} {} {} {} {} {} {}'.format(x1, y1, z1, x2, y2, z2, speed), with_return) def set_speed(self, speed, with_return=False): """ param speed: int, [10-100] param with_return: bool return: 'ok' or 'error' """ return self.send_command('speed {}'.format(speed), with_return) def set_remote_controller_command(self, left_right_velocity, forward_backward_velocity, up_down_velocity, rotate_velocity, with_return=False): """ param left_right_velocity: int, [-100, 100] param forward_backward_velocity: int, [-100, 100] param up_down_velocity: int, [-100, 100] param rotate_velocity: int, [-100, 100] param with_return: bool return: 'ok' or 'error' """ return self.send_command('rc {} {} {} {}'.format(left_right_velocity, forward_backward_velocity, up_down_velocity, rotate_velocity), with_return) def get(self, command, split=False): """ param command param split: bool, multiple values? return: int or list(int) """ result = self.send_command(command) if split: return [int(x) for x in result.split(' ')] else: return int(result) def get_speed(self): """ return: int, [10, 100] """ return self.get('speed?') def get_battery(self): """ return: int, [0, 100] """ return self.get('battery?') def get_flight_time(self): """ return: int """ return self.get('time?') def get_relative_height(self): """ return: int, [10, 3000] """ return self.get('height?') def get_temperature(self): """ return: int, [0, 90] """ return self.get('temp?') def get_imu_pose(self): """[pitch, roll, yaw] return: list(int), [[-89, 89], [-179, 179], [-179, 179]] """ return self.get('attitude?', split=True) def get_absolute_height(self): """ return: int """ return self.get('baro?') def get_imu_acceleration(self): """ return: list(int) """ return self.get('acceleration?', split=True) def get_tof_height(self): """ return: int, [10, 400]; 6553: out of bounds """ return self.get('tof?')
28.528846
153
0.565133
1,449
11,868
4.47412
0.151829
0.077125
0.053216
0.046275
0.450563
0.3648
0.292303
0.292303
0.281814
0.24356
0
0.028016
0.311257
11,868
415
154
28.59759
0.765109
0.229441
0
0.188172
0
0
0.057724
0
0
0
0
0
0
1
0.311828
false
0.026882
0.021505
0.026882
0.596774
0.005376
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
0afbe95b203d0f0c8eb9b8de7581ea6aec0cc6c2
450
py
Python
netforce_account/netforce_account/migrations/credit_remain_cur.py
nfco/netforce
35252eecd0a6633ab9d82162e9e3ff57d4da029a
[ "MIT" ]
27
2015-09-30T23:53:30.000Z
2021-06-07T04:56:25.000Z
netforce_account/netforce_account/migrations/credit_remain_cur.py
nfco/netforce
35252eecd0a6633ab9d82162e9e3ff57d4da029a
[ "MIT" ]
191
2015-10-08T11:46:30.000Z
2019-11-14T02:24:36.000Z
netforce_account/netforce_account/migrations/credit_remain_cur.py
nfco/netforce
35252eecd0a6633ab9d82162e9e3ff57d4da029a
[ "MIT" ]
32
2015-10-01T03:59:43.000Z
2022-01-13T07:31:05.000Z
from netforce.model import get_model from netforce import migration from netforce import database class Migration(migration.Migration): _name="account.credit_remain_cur" _version="2.5.0" def migrate(self): db=database.get_connection() db.execute("UPDATE account_invoice SET amount_credit_remain_cur=amount_credit_remain WHERE amount_credit_remain_cur IS NULL AND amount_credit_remain IS NOT NULL") Migration.register()
32.142857
170
0.791111
63
450
5.380952
0.52381
0.176991
0.212389
0.123894
0
0
0
0
0
0
0
0.007772
0.142222
450
13
171
34.615385
0.870466
0
0
0
0
0
0.395556
0.208889
0
0
0
0
0
1
0.1
false
0
0.3
0
0.7
0
0
0
0
null
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
0afe1be38b21464d40015306f8c1387f5700680f
4,962
py
Python
tests/test_structure_learning.py
thunderbug1/pyanom
e442bff70a4d1880a9a698c020287edf1933d498
[ "MIT" ]
null
null
null
tests/test_structure_learning.py
thunderbug1/pyanom
e442bff70a4d1880a9a698c020287edf1933d498
[ "MIT" ]
null
null
null
tests/test_structure_learning.py
thunderbug1/pyanom
e442bff70a4d1880a9a698c020287edf1933d498
[ "MIT" ]
null
null
null
import io import unittest import numpy as np class TestGraphicalLasso(unittest.TestCase): """Basic test cases.""" def _getTarget(self): from pyanom.structure_learning import GraphicalLasso return GraphicalLasso def _makeOne(self, *args, **kwargs): return self._getTarget()(*args, **kwargs) @classmethod def setUpClass(self): self.X_normal = np.array([[0.975586009, -0.745997359, -0.229331244], [-0.460992487, -1.304668238, -0.599247488], [-0.503171745, -1.308368748, -1.451411048], [-0.904446243, -0.287837582, 0.197153592], [-1.106120624, 0.243612535, 1.051237763], [0.371920628, 1.690566027, -0.468645532], [-0.861682655, 1.472544046, -0.846863556], [0.632918214, 1.35895507, -1.217528827], [0.017011646, 1.556247275, -0.149119024], [-1.129336215, 0.486811944, 0.012272206], [0.498967152, -0.530065628, -2.14011938], [0.402460108, -0.474465633, -0.041584595], [-0.847994655, -1.281269721, -0.430338406], [-0.583857254, 0.228815073, -1.321443286], [0.963425438, -1.136873938, 0.990406269], [-1.342349795, -0.147133485, 1.286410605], [-0.546153552, 0.134343445, -0.380672316], [-2.264867999, 0.227795362, 1.477762968], [0.070095074, -0.770899782, 2.100831522], [0.425213005, 0.796156033, 1.676164975]]) self.X_error = np.array([[-0.273095586, 0.356336588, 1.595876828], [-0.708547003, -0.572139833, 0.858932219], [-1.125947228, -1.049026454, 0.35980022], [0.653070988, -0.052417831, 0.787284547], [-1.059131881, 1.621161051, -1.295306533], [0.499065038, -1.064179225, 1.243325767], [0.452740621, -0.737171777, 0.352807563], [0.626897927, -1.100559392, -0.905560876], [1.338835274, 2.083549348, -1.280796042], [0.264928015, 10, 2.544472412], [-0.754827534, -1.031919195, 1.227285333], [-0.774019674, 0.241245625, -0.989132941], [1.298381426, 0.19445334, 2.267355363], [1.46892843, 1.24946146, 0.322341667], [1.057265661, -0.846614104, -0.355396321], [0.810670486, -0.719804484, -0.943762163], [1.169028226, 0.492444331, 0.234015505], [-0.307091024, -1.56195639, 0.509095939], [0.849156845, 0.533674261, 0.069183014], [0.102812565, 8, 1.545239732]]) def test_outlier_analysis_score_shape(self): target = self._makeOne() target.fit(self.X_normal) pred = target.outlier_analysis_score(self.X_error) self.assertEqual(pred.shape, (20, 3)) def test_incorrect_feature_size(self): X_normal = np.array([-0.056523959, - 0.881470896, -0.249935965, 0.186624902, -0.30183287, 2.000815584, 0.710538188, 0.591089702, 0.099804538, 0.114730483]).reshape(-1, 1) X_error = np.array([0.660985506, -1.450512173, -1.27733756, -1.420294211, 0.737179562, 1.481425898, -0.170147132, -1.527687346, 0.580282631, -3.722489636]).reshape(-1, 1) target = self._makeOne() with self.assertRaises(ValueError): target.fit(X_normal) def test_anomaly_analysis_score_shape(self): target = self._makeOne() target.fit(self.X_normal) pred, pmatrix = target.anomaly_analysis_score(self.X_error) self.assertEqual(pred.shape, (3, )) self.assertEqual(pmatrix.shape, (3, 3)) if __name__ == '__main__': unittest.main()
48.174757
77
0.438734
428
4,962
4.995327
0.455607
0.01637
0.02058
0.012161
0.13377
0.120674
0.1029
0.1029
0.1029
0.058934
0
0.503639
0.446191
4,962
102
78
48.647059
0.274381
0.003426
0
0.056818
0
0
0.00162
0
0
0
0
0
0.045455
1
0.068182
false
0
0.045455
0.011364
0.147727
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
0afefe0acef029f680c5802bbedac80261a2e2f4
8,958
py
Python
gremlin-python/src/main/jython/tests/driver/test_client.py
jseekamp/tinkerpop
5f7b7d2c4353cf2d8ee48eed6c0e5632666d16c0
[ "Apache-2.0" ]
1
2019-06-24T09:10:32.000Z
2019-06-24T09:10:32.000Z
gremlin-python/src/main/jython/tests/driver/test_client.py
jseekamp/tinkerpop
5f7b7d2c4353cf2d8ee48eed6c0e5632666d16c0
[ "Apache-2.0" ]
4
2021-01-21T01:33:32.000Z
2022-01-21T23:48:58.000Z
gremlin-python/src/main/jython/tests/driver/test_client.py
jseekamp/tinkerpop
5f7b7d2c4353cf2d8ee48eed6c0e5632666d16c0
[ "Apache-2.0" ]
null
null
null
''' Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you 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 pytest from gremlin_python.driver.protocol import GremlinServerError from gremlin_python.driver.client import Client from gremlin_python.driver.protocol import GremlinServerError from gremlin_python.driver.request import RequestMessage from gremlin_python.process.strategies import OptionsStrategy from gremlin_python.process.graph_traversal import __ from gremlin_python.structure.graph import Graph __author__ = 'David M. Brown ([email protected])' def test_connection(connection): g = Graph().traversal() t = g.V() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) results_set = connection.write(message).result() future = results_set.all() results = future.result() assert len(results) == 6 assert isinstance(results, list) assert results_set.done.done() assert 'host' in results_set.status_attributes def test_client_simple_eval(client): assert client.submit('1 + 1').all().result()[0] == 2 def test_client_simple_eval_bindings(client): assert client.submit('x + x', {'x': 2}).all().result()[0] == 4 def test_client_eval_traversal(client): assert len(client.submit('g.V()').all().result()) == 6 def test_client_error(client): try: # should fire an exception client.submit('1/0').all().result() assert False except GremlinServerError as ex: assert 'exceptions' in ex.status_attributes assert 'stackTrace' in ex.status_attributes def test_client_connection_pool_after_error(client): # Overwrite fixture with pool_size=1 client client = Client('ws://localhost:45940/gremlin', 'gmodern', pool_size=1) try: # should fire an exception client.submit('1/0').all().result() assert False except GremlinServerError as gse: # expecting the pool size to be 1 again after query returned assert gse.status_code == 597 assert client.available_pool_size == 1 def test_client_bytecode(client): g = Graph().traversal() t = g.V() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) result_set = client.submit(message) assert len(result_set.all().result()) == 6 def test_client_bytecode_options(client): # smoke test to validate serialization of OptionsStrategy. no way to really validate this from an integration # test perspective because there's no way to access the internals of the strategy via bytecode g = Graph().traversal() t = g.withStrategies(OptionsStrategy(options={"x": "test", "y": True})).V() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) result_set = client.submit(message) assert len(result_set.all().result()) == 6 ## t = g.with_("x", "test").with_("y", True).V() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) result_set = client.submit(message) assert len(result_set.all().result()) == 6 def test_iterate_result_set(client): g = Graph().traversal() t = g.V() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) result_set = client.submit(message) results = [] for result in result_set: results += result assert len(results) == 6 def test_client_async(client): g = Graph().traversal() t = g.V() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) future = client.submitAsync(message) result_set = future.result() assert len(result_set.all().result()) == 6 def test_connection_share(client): # Overwrite fixture with pool_size=1 client client = Client('ws://localhost:45940/gremlin', 'gmodern', pool_size=1) g = Graph().traversal() t = g.V() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) message2 = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) future = client.submitAsync(message) future2 = client.submitAsync(message2) result_set2 = future2.result() assert len(result_set2.all().result()) == 6 # This future has to finish for the second to yield result - pool_size=1 assert future.done() result_set = future.result() assert len(result_set.all().result()) == 6 def test_multi_conn_pool(client): g = Graph().traversal() t = g.V() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) message2 = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'gmodern'}}) client = Client('ws://localhost:45940/gremlin', 'g', pool_size=1) future = client.submitAsync(message) future2 = client.submitAsync(message2) result_set2 = future2.result() assert len(result_set2.all().result()) == 6 # with connection pool `future` may or may not be done here result_set = future.result() assert len(result_set.all().result()) == 6 def test_big_result_set(client): g = Graph().traversal() t = g.inject(1).repeat(__.addV('person').property('name', __.loops())).times(20000).count() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = client.submit(message) results = [] for result in result_set: results += result assert len(results) == 1 t = g.V().limit(10) message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = client.submit(message) results = [] for result in result_set: results += result assert len(results) == 10 t = g.V().limit(100) message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = client.submit(message) results = [] for result in result_set: results += result assert len(results) == 100 t = g.V().limit(1000) message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = client.submit(message) results = [] for result in result_set: results += result assert len(results) == 1000 t = g.V().limit(10000) message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = client.submit(message) results = [] for result in result_set: results += result assert len(results) == 10000 def test_big_result_set_secure(secure_client): g = Graph().traversal() t = g.inject(1).repeat(__.addV('person').property('name', __.loops())).times(20000).count() message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = secure_client.submit(message) results = [] for result in result_set: results += result assert len(results) == 1 t = g.V().limit(10) message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = secure_client.submit(message) results = [] for result in result_set: results += result assert len(results) == 10 t = g.V().limit(100) message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = secure_client.submit(message) results = [] for result in result_set: results += result assert len(results) == 100 t = g.V().limit(1000) message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = secure_client.submit(message) results = [] for result in result_set: results += result assert len(results) == 1000 t = g.V().limit(10000) message = RequestMessage('traversal', 'bytecode', {'gremlin': t.bytecode, 'aliases': {'g': 'g'}}) result_set = secure_client.submit(message) results = [] for result in result_set: results += result assert len(results) == 10000
36.713115
113
0.667002
1,128
8,958
5.187057
0.180851
0.056913
0.105965
0.129892
0.692189
0.665869
0.654931
0.654931
0.651854
0.651854
0
0.018361
0.185309
8,958
243
114
36.864198
0.783365
0.142443
0
0.767442
0
0
0.121738
0.0137
0
0
0
0
0.19186
1
0.081395
false
0
0.046512
0
0.127907
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
7c10a8d2f209ef6de0439f6adc19d3fc6d877d41
678
py
Python
src/genie/libs/parser/iosxe/tests/ShowIpv6ProtocolsSectionRip/cli/equal/golden_output_2_expected.py
balmasea/genieparser
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
[ "Apache-2.0" ]
204
2018-06-27T00:55:27.000Z
2022-03-06T21:12:18.000Z
src/genie/libs/parser/iosxe/tests/ShowIpv6ProtocolsSectionRip/cli/equal/golden_output_2_expected.py
balmasea/genieparser
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
[ "Apache-2.0" ]
468
2018-06-19T00:33:18.000Z
2022-03-31T23:23:35.000Z
src/genie/libs/parser/iosxe/tests/ShowIpv6ProtocolsSectionRip/cli/equal/golden_output_2_expected.py
balmasea/genieparser
d1e71a96dfb081e0a8591707b9d4872decd5d9d3
[ "Apache-2.0" ]
309
2019-01-16T20:21:07.000Z
2022-03-30T12:56:41.000Z
expected_output = { "vrf": { "VRF1": { "address_family": { "ipv6": { "instance": { "rip ripng": { "redistribute": { "static": {"route_policy": "static-to-rip"}, "connected": {}, }, "interfaces": { "GigabitEthernet3.200": {}, "GigabitEthernet2.200": {}, }, } } } } } } }
29.478261
76
0.227139
23
678
6.565217
0.869565
0
0
0
0
0
0
0
0
0
0
0.043103
0.657817
678
22
77
30.818182
0.607759
0
0
0
0
0
0.212389
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
7c283d63bcdc25c314b3c41b483eb7c2c6064da2
527
py
Python
02-static-templates-files/02_html_template.py
saidulislam/flask-bootcamp-2
4ba8f5e012aa0159275ab264f0247815dcf635e6
[ "Apache-2.0" ]
null
null
null
02-static-templates-files/02_html_template.py
saidulislam/flask-bootcamp-2
4ba8f5e012aa0159275ab264f0247815dcf635e6
[ "Apache-2.0" ]
null
null
null
02-static-templates-files/02_html_template.py
saidulislam/flask-bootcamp-2
4ba8f5e012aa0159275ab264f0247815dcf635e6
[ "Apache-2.0" ]
null
null
null
from flask import Flask, app = Flask(__name__) @app.route("/") def homepage(): return "Paws Rescue Center 🐾" @app.route("/about") def about(): return """We are a non-profit organization working as an animal rescue center. We aim to help you connect with purrfect furbaby for you! The animals you find at our website are rescue animals which have been rehabilitated. Our mission is to promote the ideology of "Adopt, don't Shop"! """ if __name__ == "__main__": app.run(debug=True)
31
91
0.677419
78
527
4.435897
0.730769
0.046243
0
0
0
0
0
0
0
0
0
0
0.225806
527
17
92
31
0.845588
0
0
0
0
0
0.636719
0
0
0
0
0
0
0
null
null
0
0.076923
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
7c2f74f5570ad8ece2d2a501cd63b62951484c2c
844
py
Python
guid.py
lihuiba/SoftSAN
1b8ab2cae92b7aac34211909b27d4ebe595275d7
[ "Apache-2.0" ]
1
2015-08-02T09:53:18.000Z
2015-08-02T09:53:18.000Z
guid.py
lihuiba/SoftSAN
1b8ab2cae92b7aac34211909b27d4ebe595275d7
[ "Apache-2.0" ]
null
null
null
guid.py
lihuiba/SoftSAN
1b8ab2cae92b7aac34211909b27d4ebe595275d7
[ "Apache-2.0" ]
2
2018-03-21T04:59:50.000Z
2019-12-03T15:54:17.000Z
import random import messages_pb2 as msg def assign(x, y): x.a=y.a; x.b=y.b; x.c=y.c; x.d=y.d def isZero(x): return (x.a==0 and x.b==0 and x.c==0 and x.d==0) def setZero(x): x.a=0; x.b=0; x.c=0; x.d=0 def toStr(x): return "%08x-%08x-%08x-%08x" % (x.a, x.b, x.c, x.d) def toTuple(x): return (x.a, x.b, x.c, x.d) def fromTuple(x): ret=msg.Guid() ret.a=x[0] ret.b=x[1] ret.c=x[2] ret.d=x[3] return ret def generate(guid=None): ret=guid or msg.Guid() ret.a=random.randint(0, 0xffffffff) ret.b=random.randint(0, 0xffffffff) ret.c=random.randint(0, 0xffffffff) ret.d=random.randint(0, 0xffffffff) return ret def fromStr(s): ret=msg.Guid() s=s.split('-') ret.a=int(s[0], 16) ret.b=int(s[1], 16) ret.c=int(s[2], 16) ret.d=int(s[3], 16) return ret
19.181818
55
0.562796
183
844
2.590164
0.20765
0.021097
0.118143
0.202532
0.2173
0.046414
0.046414
0.046414
0.046414
0
0
0.0625
0.222749
844
43
56
19.627907
0.660061
0
0
0.147059
0
0
0.023725
0
0
0
0.04745
0
0
1
0.235294
false
0
0.058824
0.088235
0.470588
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
7c30ba325b9fb817b1364d8d7e3e057255111d8c
259
py
Python
letters_of_sherlock.py
MariannaJan/LettersOfSherlock
cf356c002078d4e0e6bcf1a669bc8b358680460f
[ "FTL" ]
null
null
null
letters_of_sherlock.py
MariannaJan/LettersOfSherlock
cf356c002078d4e0e6bcf1a669bc8b358680460f
[ "FTL" ]
null
null
null
letters_of_sherlock.py
MariannaJan/LettersOfSherlock
cf356c002078d4e0e6bcf1a669bc8b358680460f
[ "FTL" ]
null
null
null
import lettercounter as lc #Books form Gutenberg Project: https://www.gutenberg.org/ebooks/author/69 lc.showPlots(text_directory_pathname="./Books/", title="Sir Arthur Conan Doyle's favourite letters", legend_label_main="in Doyle's stories")
37
73
0.749035
36
259
5.277778
0.861111
0.063158
0
0
0
0
0
0
0
0
0
0.008969
0.138996
259
7
74
37
0.843049
0.277992
0
0
0
0
0.363636
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
7c3538aced9958f0470322c0f12570121760b4ab
593
py
Python
src/pyRofex/components/messages.py
guillerminaamorin/pyRofex
14fd623ab1f1a3213e51a9454485ed478912075f
[ "MIT" ]
2
2020-12-15T22:30:40.000Z
2020-12-15T22:30:51.000Z
src/pyRofex/components/messages.py
guillerminaamorin/pyRofex
14fd623ab1f1a3213e51a9454485ed478912075f
[ "MIT" ]
null
null
null
src/pyRofex/components/messages.py
guillerminaamorin/pyRofex
14fd623ab1f1a3213e51a9454485ed478912075f
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ pyRofex.components.messages Defines APIs messages templates """ # Template for a Market Data Subscription message MARKET_DATA_SUBSCRIPTION = '{{"type":"smd","level":1, "entries":[{entries}],"products":[{symbols}]}}' # Template for an Order Subscription message ORDER_SUBSCRIPTION = '{{"type":"os","account":{{"id":"{a}"}},"snapshotOnlyActive":{snapshot}}}' # Template to specify an instrument in a market data subscription message INSTRUMENT = '{{"symbol":"{ticker}","marketId":"{market}"}}' # Template to insert a Double Quote DOUBLE_QUOTES = '"{item}"'
37.0625
101
0.689713
68
593
5.955882
0.617647
0.074074
0.162963
0.11358
0.148148
0
0
0
0
0
0
0.003817
0.116358
593
15
102
39.533333
0.769084
0.472175
0
0
0
0
0.672355
0.641638
0
0
0
0
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
7c3550de30b723134e6acdc5e3a7cc90bba86785
405
py
Python
course/task_6/flask_app.py
duboviy/async
5055daddc66e5335fb772aeb59493cc63e4a2739
[ "MIT" ]
6
2016-10-05T16:12:55.000Z
2019-04-22T11:43:21.000Z
course/task_6/flask_app.py
duboviy/async
5055daddc66e5335fb772aeb59493cc63e4a2739
[ "MIT" ]
null
null
null
course/task_6/flask_app.py
duboviy/async
5055daddc66e5335fb772aeb59493cc63e4a2739
[ "MIT" ]
2
2016-11-01T21:32:27.000Z
2016-12-24T14:00:43.000Z
#!/usr/bin/env python3.4 from flask import Flask import requests from fibonacci import fibonacci as fib app = Flask(__name__) @app.route('/count/<key>') def count(key): return requests.get('http://127.0.0.1:8080/count/{}'.format(key)).text @app.route('/fibonacci/<n>') def fibonacci(n): return str(fib(int(n))) if __name__ == "__main__": app.run(host='0.0.0.0', port=8082, debug=True)
18.409091
74
0.671605
66
405
3.939394
0.575758
0.030769
0.023077
0
0
0
0
0
0
0
0
0.05698
0.133333
405
21
75
19.285714
0.683761
0.05679
0
0
0
0
0.186352
0
0
0
0
0
0
1
0.166667
false
0
0.25
0.166667
0.583333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
7c36efe3001b7afd18524c2fd69ee073ca3d2a5c
144
py
Python
myproject/IND_Project/backend/signup/apps.py
captainTOKIO/Premchand_Aug2022_fullstack_august_python1
5fbbdd106a764c2f862cf933fdcd69d6bf4ebdf0
[ "MIT" ]
4
2021-06-30T07:14:22.000Z
2021-08-16T04:52:35.000Z
myproject/IND_Project/backend/signup/apps.py
captainTOKIO/Premchand_Aug2022_fullstack_august_python1
5fbbdd106a764c2f862cf933fdcd69d6bf4ebdf0
[ "MIT" ]
1
2022-03-28T21:14:05.000Z
2022-03-28T21:14:05.000Z
signup/apps.py
ericu-u/GirlHacks
4e800ab8ab3e33a490dc771759ca8b9be08e1441
[ "MIT" ]
4
2021-06-27T04:26:21.000Z
2021-08-13T13:00:56.000Z
from django.apps import AppConfig class SignupConfig(AppConfig): default_auto_field = 'django.db.models.BigAutoField' name = 'signup'
20.571429
56
0.756944
17
144
6.294118
0.882353
0
0
0
0
0
0
0
0
0
0
0
0.152778
144
6
57
24
0.877049
0
0
0
0
0
0.243056
0.201389
0
0
0
0
0
1
0
false
0
0.25
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2