content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
def initialize(context): context.spy= sid(8554) schedule_function(my_rebalance, date_rules.month_start(), time_rules.market_open()) def my_rebalance(context,data): position= context.portfolio.positions[context.spy].amount if position == 0: order_target_percent(context.spy, 1.0) record(lev=context.account.leverage)
def initialize(context): context.spy = sid(8554) schedule_function(my_rebalance, date_rules.month_start(), time_rules.market_open()) def my_rebalance(context, data): position = context.portfolio.positions[context.spy].amount if position == 0: order_target_percent(context.spy, 1.0) record(lev=context.account.leverage)
# Shared list of BuiltIn keywords that should be implemented # by specialized comparators. builtin_method_names = ( "should_be_equal", "should_not_be_equal", "should_be_empty", "should_not_be_empty", "should_match", "should_not_match", "should_match_regexp", "should_not_match_regexp", "should_contain", "should_not_contain", "should_contain_any", "should_not_contain_any", "should_start_with", "should_not_start_with", "should_end_with", "should_not_end_with", )
builtin_method_names = ('should_be_equal', 'should_not_be_equal', 'should_be_empty', 'should_not_be_empty', 'should_match', 'should_not_match', 'should_match_regexp', 'should_not_match_regexp', 'should_contain', 'should_not_contain', 'should_contain_any', 'should_not_contain_any', 'should_start_with', 'should_not_start_with', 'should_end_with', 'should_not_end_with')
REPORTS = [ { "address": "0xCd0D1a6BD24fCD578d1bb211487cD24f840BC900", "payload": { "messages": [ "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000001789e100000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cb935e0000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a0f0e600000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000619562600000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000185f100000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000657d40000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d7ec80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000", ], "prices": { "BAT": "0.415700", "BTC": "39091.900000", "COMP": "481.900000", "ETH": "1637.180000", "KNC": "1.933000", "LINK": "24.682000", "ZRX": "1.597200", }, "signatures": [ "0x3a6b0b7d403f330be0f12e49da0d108f424d50b11c604383800f98cb471906796b221ea563ec725db448eed29430758e83957fd30110fd0ef1d9de6cc306672b000000000000000000000000000000000000000000000000000000000000001c", "0x34374c83f25bec8e1a86e67ef0c6fd3075c44cb13075d38edba85973298978316787099a2c4449e14f774aa2531c4486e268dc905a22af3190e941430bbff664000000000000000000000000000000000000000000000000000000000000001b", "0xb1413117fffafad10df28a16da2b0a2e99147dc01b99c0ae91fbdb2ecb85d81a7197f9396ea6f012eabf9084ff1cd2385f76d2ae1c38f772971b9cd1fb3cd9c4000000000000000000000000000000000000000000000000000000000000001c", "0x5bedbc0d17bfaa04428b4c0b59023a234de4e89e7c85652c72620a4570d6de6e10994e106b8be085c4368d16de90d97e93e0b99c0cdf676dc732f18b1973bd1e000000000000000000000000000000000000000000000000000000000000001b", "0xfc74694cb78c70b48d5a895923d891f0939d9f68b1faa07c48bb9d01aa852deb68f95b90d81998491d9af978ced94df5ebfdde064ea1f0c366b9473ab51fe40f000000000000000000000000000000000000000000000000000000000000001c", "0x8c0a744a76bcda0fb1709e29ba447e625b521c77eb52618e42bd79acb7dd5ae33fac5adcc3b095d89b80ccbcf092d088350d539a1b932bd432a3f05829551230000000000000000000000000000000000000000000000000000000000000001b", "0xc470bb19e3b8328c6a4f59f6ba91b61585a6a644ba3e8161b1c9510e21c29fe16c7b0e095be9835e6c13785eb3413a615b6098c972fd6e1f0846367f4f25d822000000000000000000000000000000000000000000000000000000000000001c", ], "timestamp": "1612779749", }, }, { "address": "0xef207780639b911e6B064B8Bf6F03f8BE5260a58", "payload": { "messages": [ "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001862f80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000658380000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d82b00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178a1f80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cab7a40000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a1e50a00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000006196e9000000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000", ], "prices": { "BAT": "0.415800", "BTC": "39092.900000", "COMP": "481.000000", "ETH": "1637.280000", "KNC": "1.934000", "LINK": "24.683000", "ZRX": "1.598200", }, "signatures": [ "0x24f319f2ff0978613240ac8317bdbd380243a43aeeeee955fbdb99740471bb6e42d344d27056df235a9795d37aa4323b9ad1241551684c4cdf28245f63fdc7bd000000000000000000000000000000000000000000000000000000000000001b", "0x809c8af8b57f95e913902e8af9d4a047521b1cb91752b5c7859326de125f6bdf3010f79c8f741cbc0778ec4ccc9fc7d0f9e369b0e2850bc19e65fe56f72604d8000000000000000000000000000000000000000000000000000000000000001c", "0xebf24d5982c4f3a0527414133a6b1fc368d7b45e15ae3543f4e0a661db79fd3735f28edba94616b21211f61f93e83460a32e3d9d17ad1524785906d398edd653000000000000000000000000000000000000000000000000000000000000001b", "0xf5f0709e7f3719bde5003f33d71b3806291002133ff5062e4a7964a307a3d0a60a66f5308947b07a235c1d560733b41da5b183b438c9fb4e05991a0803584c15000000000000000000000000000000000000000000000000000000000000001b", "0x0597fd1934139b341177d00e849f32e48682310167324ba01d1c92911441179b7ae5e110fa4ad95339ff86d8f8908f54c05f98395116b9649b1eb9d22641e41f000000000000000000000000000000000000000000000000000000000000001c", "0xf392088cbb3e6d208cae3b76b5168966122cc329af7dc288d4bead0aaa08b4fe1fab124958a23a1b38cbcdda1d9ec01bfaac473baa9ea7ef5a4623d0536fd2da000000000000000000000000000000000000000000000000000000000000001c", "0xca0c50b59661bbdded30c8747eedb78f94f399269aa88a0ba0b6caf5e07b431d2b322e03d0b25df0f54b0e12bb781419d20246902d2c72b8d7cc5b1015ebebac000000000000000000000000000000000000000000000000000000000000001b", ], "timestamp": "1612779750", }, }, { "address": "0xd264c579e7b7B278395303aB64ee583917228bfd", "payload": { "messages": [ "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000061986fa00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001866e00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000006589c0000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d86980000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178a5e00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cad00e0000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a2d92e00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000", ], "prices": { "BAT": "0.415900", "BTC": "39093.900000", "COMP": "481.100000", "ETH": "1637.380000", "KNC": "1.935000", "LINK": "24.684000", "ZRX": "1.599200", }, "signatures": [ "0x8d0e96469b80f11cebe95e4cb6cb089dbd2c9fb0b767f6d70ae381bee3efbdf67d58ff8ddc62743f2a85d8a3b22d5baba12a2be89eb2d652fe552d00c8aa5dfb000000000000000000000000000000000000000000000000000000000000001c", "0xa079c89c55432039b1506a3964b7276a47013fa092b6d5d07087e953f6e1fec661eb2998e4b1396fc26557b1c5366010147e1c8f25987f75256d0e9d425b3a6d000000000000000000000000000000000000000000000000000000000000001b", "0x066eb88ad643a97d095523207e84072497f5f89e9648183e9a77aeef3f16eac31573dea48cce787085a805442fe72151301ea94debb821839b3245eb3205df8c000000000000000000000000000000000000000000000000000000000000001b", "0x8c9d61b86c68d46cd1fa578c5d252faa9cbb119c344cad61b2b67105e69813670577db1f9604a70ebadd8490fa52a968fba885964051457355c721a0bccf19ae000000000000000000000000000000000000000000000000000000000000001c", "0x5a3da98cb87f3fb14023418837f6d2cd3aa832f0ca5881fbd66be13b4e05cd25007cdb112f20d0662d7cc5262bd616efe396201c65c92caa7b528d1297362d11000000000000000000000000000000000000000000000000000000000000001b", "0x57e09b6d4f0d414a705b8e5cd21fc86e8167891df4055bd8f2e46a81b1bb09596a02f8ffed52f8fd5a5b03da450f4eee2c42fe29444ef5343aacbf48a72747fd000000000000000000000000000000000000000000000000000000000000001b", "0x3f82eaf2ac86d37d8ecfdbd0ed8e2a9e5186e0d819e3fadbea1b200447cbcaa0700bbd4be635e6e741a53768f305a78ab4888c567077987e859792eb3bda0cec000000000000000000000000000000000000000000000000000000000000001b", ], "timestamp": "1612779751", }, }, { "address": "0x4994779B1f4e1cA4582d0527cF0bf5A01248DF5C", "payload": { "messages": [ "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cae8780000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a3cd5200000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000006199f6400000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001843b80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000655180000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d8a800000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178a9c80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000", ], "prices": { "BAT": "0.415000", "BTC": "39094.900000", "COMP": "481.200000", "ETH": "1637.480000", "KNC": "1.936000", "LINK": "24.685000", "ZRX": "1.590200", }, "signatures": [ "0x70d6d8ea44af86024c1417ffec64b1a68d9f15fc9e9f7d56404f3164057139ef46c8b470da85569fad4bcdb8dadee79338a158feb606ace2cfc3c3afd241bae8000000000000000000000000000000000000000000000000000000000000001b", "0x1757a9af7796f7929b86657cae31401f34418a90f40332a54381f5d984c75ca621bf37ffe6ea1124fd09c12ebdb369a05e6922442170466208b0d00cdff590b4000000000000000000000000000000000000000000000000000000000000001c", "0xd53d341bd6583813c2a7c9d0c62a0fb12d948cf14a80a09d1a0b4ba0554c3825796321469f0460dfbed697e13e6189a50b1149d95904a68796763dbee432fae3000000000000000000000000000000000000000000000000000000000000001c", "0x43cd23f8696b2f099af12a905207dc4d2fcc955ba2ebdefefb95016cd5db1056081aed5f99f2ec2f139070801849ccae6e1635d69e98849509c5cd4f5e3bd67a000000000000000000000000000000000000000000000000000000000000001c", "0x704b2bbd0ba687dcc753ae0e1c61f14a4b66cda13c3f91326b3e75b557e43bee3d5e162d08c40fcc38dee0672242394c7c82959e8be4da6bdbfaccbf9507c0d4000000000000000000000000000000000000000000000000000000000000001b", "0x5f993deecec1c2acdbc006a427999b6e29e0bd3b25d0c830942da50d289f05f65f6ef14547a45c3bec6f5989e61f9b305618efa0488b6a14db76eadec42ab7e3000000000000000000000000000000000000000000000000000000000000001b", "0x8c9fdfc3357762adeb613e741fe4cfb37291cda30442bd89e2831a4750e479f058c13187272134fb2e848ca06faf276cfa27d53b8c3d714f4968d9852ce6f038000000000000000000000000000000000000000000000000000000000000001b", ], "timestamp": "1612779752", }, }, { "address": "0xDb3DD6a3E8216381fFf19648067ca964A8bf2C1c", "payload": { "messages": [ "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178adb00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cb00e20000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a4c17600000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000619b7ce00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001847a00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000006557c0000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000", "0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d8e680000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000", ], "prices": { "BAT": "0.415100", "BTC": "39095.900000", "COMP": "481.300000", "ETH": "1637.580000", "KNC": "1.937000", "LINK": "24.686000", "ZRX": "1.591200", }, "signatures": [ "0x1c4c0b0add2a10836fdcf0ba71ea939e472920e5ab38305f5950598f834efd3659b088cbdec1f66a8ffebb5182f6255f49e380eb6939b483d971f64a4454742b000000000000000000000000000000000000000000000000000000000000001c", "0x9e9ae712269067270787d1e9fc7bd51697143f228a41373151e5a0ef00e2ec5038dedbf1c558df7ec06ca7bd4ca10653e22762bf3d7c6001aea7078c1c0ffc1e000000000000000000000000000000000000000000000000000000000000001b", "0xa8797f59180db4f3ed51c3c11d3d59b151edbf80f54c0d8711c972655049e3331d01ee1d48f6a4faddce1ec7085fec886167f6fda8a71c44962832c81be18254000000000000000000000000000000000000000000000000000000000000001c", "0x899b2993ee394e7f8077b900faec02b96380653d1f1909d87020e5980ec30efe3c168fac123babc429933512450fbba7f6f8ed2eb8a61ef97a38925585b26990000000000000000000000000000000000000000000000000000000000000001c", "0x8ff31d3cbd608a539ea4c09da617dca509fac0f84be75840d124c490caef5e007bcefef6646404bd62669ea247fe554b1b3cf7ba0eb17612969f81cfd40481ba000000000000000000000000000000000000000000000000000000000000001c", "0xaf9e90951a5f4528a500d6eb3f5b0b2922e3da95730b71fe4df8fd38909021486bdc7d2bb7d80857042bbff43a30b5c3ffcc30b987501823988324d184b85c1f000000000000000000000000000000000000000000000000000000000000001b", "0x3cb850e04b74cf2f45df60d27c3e30f596c2df76e51bb29cac44c5818443d59b2dbc2474da481952dc3e6a00b2470cb8fb1caeb158d3234dc5a26be411e4b810000000000000000000000000000000000000000000000000000000000000001b", ], "timestamp": "1612779753", }, }, ] def test_weighted_median(a, OpenOraclePriceData, OpenOracleMedianizer): p = OpenOraclePriceData.deploy({"from": a[0]}) m = OpenOracleMedianizer.deploy(p, 100 * 86400, {"from": a[0]}) for each in REPORTS: m.postPrices(each["payload"]["messages"], each["payload"]["signatures"]) m.setReporter(REPORTS[0]["address"], 100) assert m.repoterCount() == 1 assert m.price("BTC") == 39091900000 m.setReporter(REPORTS[1]["address"], 100) m.setReporter(REPORTS[2]["address"], 100) m.setReporter(REPORTS[3]["address"], 100) m.setReporter(REPORTS[4]["address"], 100) assert m.repoterCount() == 5 assert m.price("BTC") == 39093900000 m.setReporter(REPORTS[3]["address"], 500) assert m.repoterCount() == 5 assert m.price("BTC") == 39094900000 m.setReporter(REPORTS[3]["address"], 0) assert m.repoterCount() == 4 assert m.price("BTC") == 39092900000
reports = [{'address': '0xCd0D1a6BD24fCD578d1bb211487cD24f840BC900', 'payload': {'messages': ['0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000001789e100000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cb935e0000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a0f0e600000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000619562600000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000185f100000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000657d40000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e500000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d7ec80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000'], 'prices': {'BAT': '0.415700', 'BTC': '39091.900000', 'COMP': '481.900000', 'ETH': '1637.180000', 'KNC': '1.933000', 'LINK': '24.682000', 'ZRX': '1.597200'}, 'signatures': ['0x3a6b0b7d403f330be0f12e49da0d108f424d50b11c604383800f98cb471906796b221ea563ec725db448eed29430758e83957fd30110fd0ef1d9de6cc306672b000000000000000000000000000000000000000000000000000000000000001c', '0x34374c83f25bec8e1a86e67ef0c6fd3075c44cb13075d38edba85973298978316787099a2c4449e14f774aa2531c4486e268dc905a22af3190e941430bbff664000000000000000000000000000000000000000000000000000000000000001b', '0xb1413117fffafad10df28a16da2b0a2e99147dc01b99c0ae91fbdb2ecb85d81a7197f9396ea6f012eabf9084ff1cd2385f76d2ae1c38f772971b9cd1fb3cd9c4000000000000000000000000000000000000000000000000000000000000001c', '0x5bedbc0d17bfaa04428b4c0b59023a234de4e89e7c85652c72620a4570d6de6e10994e106b8be085c4368d16de90d97e93e0b99c0cdf676dc732f18b1973bd1e000000000000000000000000000000000000000000000000000000000000001b', '0xfc74694cb78c70b48d5a895923d891f0939d9f68b1faa07c48bb9d01aa852deb68f95b90d81998491d9af978ced94df5ebfdde064ea1f0c366b9473ab51fe40f000000000000000000000000000000000000000000000000000000000000001c', '0x8c0a744a76bcda0fb1709e29ba447e625b521c77eb52618e42bd79acb7dd5ae33fac5adcc3b095d89b80ccbcf092d088350d539a1b932bd432a3f05829551230000000000000000000000000000000000000000000000000000000000000001b', '0xc470bb19e3b8328c6a4f59f6ba91b61585a6a644ba3e8161b1c9510e21c29fe16c7b0e095be9835e6c13785eb3413a615b6098c972fd6e1f0846367f4f25d822000000000000000000000000000000000000000000000000000000000000001c'], 'timestamp': '1612779749'}}, {'address': '0xef207780639b911e6B064B8Bf6F03f8BE5260a58', 'payload': {'messages': ['0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001862f80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000658380000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d82b00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178a1f80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cab7a40000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a1e50a00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e600000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000006196e9000000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000'], 'prices': {'BAT': '0.415800', 'BTC': '39092.900000', 'COMP': '481.000000', 'ETH': '1637.280000', 'KNC': '1.934000', 'LINK': '24.683000', 'ZRX': '1.598200'}, 'signatures': ['0x24f319f2ff0978613240ac8317bdbd380243a43aeeeee955fbdb99740471bb6e42d344d27056df235a9795d37aa4323b9ad1241551684c4cdf28245f63fdc7bd000000000000000000000000000000000000000000000000000000000000001b', '0x809c8af8b57f95e913902e8af9d4a047521b1cb91752b5c7859326de125f6bdf3010f79c8f741cbc0778ec4ccc9fc7d0f9e369b0e2850bc19e65fe56f72604d8000000000000000000000000000000000000000000000000000000000000001c', '0xebf24d5982c4f3a0527414133a6b1fc368d7b45e15ae3543f4e0a661db79fd3735f28edba94616b21211f61f93e83460a32e3d9d17ad1524785906d398edd653000000000000000000000000000000000000000000000000000000000000001b', '0xf5f0709e7f3719bde5003f33d71b3806291002133ff5062e4a7964a307a3d0a60a66f5308947b07a235c1d560733b41da5b183b438c9fb4e05991a0803584c15000000000000000000000000000000000000000000000000000000000000001b', '0x0597fd1934139b341177d00e849f32e48682310167324ba01d1c92911441179b7ae5e110fa4ad95339ff86d8f8908f54c05f98395116b9649b1eb9d22641e41f000000000000000000000000000000000000000000000000000000000000001c', '0xf392088cbb3e6d208cae3b76b5168966122cc329af7dc288d4bead0aaa08b4fe1fab124958a23a1b38cbcdda1d9ec01bfaac473baa9ea7ef5a4623d0536fd2da000000000000000000000000000000000000000000000000000000000000001c', '0xca0c50b59661bbdded30c8747eedb78f94f399269aa88a0ba0b6caf5e07b431d2b322e03d0b25df0f54b0e12bb781419d20246902d2c72b8d7cc5b1015ebebac000000000000000000000000000000000000000000000000000000000000001b'], 'timestamp': '1612779750'}}, {'address': '0xd264c579e7b7B278395303aB64ee583917228bfd', 'payload': {'messages': ['0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000061986fa00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001866e00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000006589c0000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d86980000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178a5e00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cad00e0000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e700000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a2d92e00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000'], 'prices': {'BAT': '0.415900', 'BTC': '39093.900000', 'COMP': '481.100000', 'ETH': '1637.380000', 'KNC': '1.935000', 'LINK': '24.684000', 'ZRX': '1.599200'}, 'signatures': ['0x8d0e96469b80f11cebe95e4cb6cb089dbd2c9fb0b767f6d70ae381bee3efbdf67d58ff8ddc62743f2a85d8a3b22d5baba12a2be89eb2d652fe552d00c8aa5dfb000000000000000000000000000000000000000000000000000000000000001c', '0xa079c89c55432039b1506a3964b7276a47013fa092b6d5d07087e953f6e1fec661eb2998e4b1396fc26557b1c5366010147e1c8f25987f75256d0e9d425b3a6d000000000000000000000000000000000000000000000000000000000000001b', '0x066eb88ad643a97d095523207e84072497f5f89e9648183e9a77aeef3f16eac31573dea48cce787085a805442fe72151301ea94debb821839b3245eb3205df8c000000000000000000000000000000000000000000000000000000000000001b', '0x8c9d61b86c68d46cd1fa578c5d252faa9cbb119c344cad61b2b67105e69813670577db1f9604a70ebadd8490fa52a968fba885964051457355c721a0bccf19ae000000000000000000000000000000000000000000000000000000000000001c', '0x5a3da98cb87f3fb14023418837f6d2cd3aa832f0ca5881fbd66be13b4e05cd25007cdb112f20d0662d7cc5262bd616efe396201c65c92caa7b528d1297362d11000000000000000000000000000000000000000000000000000000000000001b', '0x57e09b6d4f0d414a705b8e5cd21fc86e8167891df4055bd8f2e46a81b1bb09596a02f8ffed52f8fd5a5b03da450f4eee2c42fe29444ef5343aacbf48a72747fd000000000000000000000000000000000000000000000000000000000000001b', '0x3f82eaf2ac86d37d8ecfdbd0ed8e2a9e5186e0d819e3fadbea1b200447cbcaa0700bbd4be635e6e741a53768f305a78ab4888c567077987e859792eb3bda0cec000000000000000000000000000000000000000000000000000000000000001b'], 'timestamp': '1612779751'}}, {'address': '0x4994779B1f4e1cA4582d0527cF0bf5A01248DF5C', 'payload': {'messages': ['0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cae8780000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a3cd5200000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000006199f6400000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001843b80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000655180000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d8a800000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e800000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178a9c80000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000'], 'prices': {'BAT': '0.415000', 'BTC': '39094.900000', 'COMP': '481.200000', 'ETH': '1637.480000', 'KNC': '1.936000', 'LINK': '24.685000', 'ZRX': '1.590200'}, 'signatures': ['0x70d6d8ea44af86024c1417ffec64b1a68d9f15fc9e9f7d56404f3164057139ef46c8b470da85569fad4bcdb8dadee79338a158feb606ace2cfc3c3afd241bae8000000000000000000000000000000000000000000000000000000000000001b', '0x1757a9af7796f7929b86657cae31401f34418a90f40332a54381f5d984c75ca621bf37ffe6ea1124fd09c12ebdb369a05e6922442170466208b0d00cdff590b4000000000000000000000000000000000000000000000000000000000000001c', '0xd53d341bd6583813c2a7c9d0c62a0fb12d948cf14a80a09d1a0b4ba0554c3825796321469f0460dfbed697e13e6189a50b1149d95904a68796763dbee432fae3000000000000000000000000000000000000000000000000000000000000001c', '0x43cd23f8696b2f099af12a905207dc4d2fcc955ba2ebdefefb95016cd5db1056081aed5f99f2ec2f139070801849ccae6e1635d69e98849509c5cd4f5e3bd67a000000000000000000000000000000000000000000000000000000000000001c', '0x704b2bbd0ba687dcc753ae0e1c61f14a4b66cda13c3f91326b3e75b557e43bee3d5e162d08c40fcc38dee0672242394c7c82959e8be4da6bdbfaccbf9507c0d4000000000000000000000000000000000000000000000000000000000000001b', '0x5f993deecec1c2acdbc006a427999b6e29e0bd3b25d0c830942da50d289f05f65f6ef14547a45c3bec6f5989e61f9b305618efa0488b6a14db76eadec42ab7e3000000000000000000000000000000000000000000000000000000000000001b', '0x8c9fdfc3357762adeb613e741fe4cfb37291cda30442bd89e2831a4750e479f058c13187272134fb2e848ca06faf276cfa27d53b8c3d714f4968d9852ce6f038000000000000000000000000000000000000000000000000000000000000001b'], 'timestamp': '1612779752'}}, {'address': '0xDb3DD6a3E8216381fFf19648067ca964A8bf2C1c', 'payload': {'messages': ['0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000178adb00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044c494e4b00000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000001cb00e20000000000000000000000000000000000000000000000000000000000000000670726963657300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004434f4d5000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000091a4c17600000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000619b7ce00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034554480000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001847a00000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000035a52580000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000006557c0000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034241540000000000000000000000000000000000000000000000000000000000', '0x000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000602110e900000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000001d8e680000000000000000000000000000000000000000000000000000000000000006707269636573000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034b4e430000000000000000000000000000000000000000000000000000000000'], 'prices': {'BAT': '0.415100', 'BTC': '39095.900000', 'COMP': '481.300000', 'ETH': '1637.580000', 'KNC': '1.937000', 'LINK': '24.686000', 'ZRX': '1.591200'}, 'signatures': ['0x1c4c0b0add2a10836fdcf0ba71ea939e472920e5ab38305f5950598f834efd3659b088cbdec1f66a8ffebb5182f6255f49e380eb6939b483d971f64a4454742b000000000000000000000000000000000000000000000000000000000000001c', '0x9e9ae712269067270787d1e9fc7bd51697143f228a41373151e5a0ef00e2ec5038dedbf1c558df7ec06ca7bd4ca10653e22762bf3d7c6001aea7078c1c0ffc1e000000000000000000000000000000000000000000000000000000000000001b', '0xa8797f59180db4f3ed51c3c11d3d59b151edbf80f54c0d8711c972655049e3331d01ee1d48f6a4faddce1ec7085fec886167f6fda8a71c44962832c81be18254000000000000000000000000000000000000000000000000000000000000001c', '0x899b2993ee394e7f8077b900faec02b96380653d1f1909d87020e5980ec30efe3c168fac123babc429933512450fbba7f6f8ed2eb8a61ef97a38925585b26990000000000000000000000000000000000000000000000000000000000000001c', '0x8ff31d3cbd608a539ea4c09da617dca509fac0f84be75840d124c490caef5e007bcefef6646404bd62669ea247fe554b1b3cf7ba0eb17612969f81cfd40481ba000000000000000000000000000000000000000000000000000000000000001c', '0xaf9e90951a5f4528a500d6eb3f5b0b2922e3da95730b71fe4df8fd38909021486bdc7d2bb7d80857042bbff43a30b5c3ffcc30b987501823988324d184b85c1f000000000000000000000000000000000000000000000000000000000000001b', '0x3cb850e04b74cf2f45df60d27c3e30f596c2df76e51bb29cac44c5818443d59b2dbc2474da481952dc3e6a00b2470cb8fb1caeb158d3234dc5a26be411e4b810000000000000000000000000000000000000000000000000000000000000001b'], 'timestamp': '1612779753'}}] def test_weighted_median(a, OpenOraclePriceData, OpenOracleMedianizer): p = OpenOraclePriceData.deploy({'from': a[0]}) m = OpenOracleMedianizer.deploy(p, 100 * 86400, {'from': a[0]}) for each in REPORTS: m.postPrices(each['payload']['messages'], each['payload']['signatures']) m.setReporter(REPORTS[0]['address'], 100) assert m.repoterCount() == 1 assert m.price('BTC') == 39091900000 m.setReporter(REPORTS[1]['address'], 100) m.setReporter(REPORTS[2]['address'], 100) m.setReporter(REPORTS[3]['address'], 100) m.setReporter(REPORTS[4]['address'], 100) assert m.repoterCount() == 5 assert m.price('BTC') == 39093900000 m.setReporter(REPORTS[3]['address'], 500) assert m.repoterCount() == 5 assert m.price('BTC') == 39094900000 m.setReporter(REPORTS[3]['address'], 0) assert m.repoterCount() == 4 assert m.price('BTC') == 39092900000
# generated from catkin/cmake/template/pkg.context.pc.in CATKIN_PACKAGE_PREFIX = "" PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/parallels/catkin_ws/install/include".split(';') if "/home/parallels/catkin_ws/install/include" != "" else [] PROJECT_CATKIN_DEPENDS = "cv_bridge;image_geometry;image_transport;camera_info_manager;pcl_ros;roscpp;tf;visualization_msgs;std_msgs;tf2;message_runtime;sensor_msgs;geometry_msgs;resource_retriever;pcl_conversions;dynamic_reconfigure".replace(';', ' ') PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else [] PROJECT_NAME = "baxter_kinect_calibration" PROJECT_SPACE_DIR = "/home/parallels/catkin_ws/install" PROJECT_VERSION = "0.2.0"
catkin_package_prefix = '' project_pkg_config_include_dirs = '/home/parallels/catkin_ws/install/include'.split(';') if '/home/parallels/catkin_ws/install/include' != '' else [] project_catkin_depends = 'cv_bridge;image_geometry;image_transport;camera_info_manager;pcl_ros;roscpp;tf;visualization_msgs;std_msgs;tf2;message_runtime;sensor_msgs;geometry_msgs;resource_retriever;pcl_conversions;dynamic_reconfigure'.replace(';', ' ') pkg_config_libraries_with_prefix = ''.split(';') if '' != '' else [] project_name = 'baxter_kinect_calibration' project_space_dir = '/home/parallels/catkin_ws/install' project_version = '0.2.0'
self.description = "Fileconflict file -> dir on package replacement (FS#24904)" lp = pmpkg("dummy") lp.files = ["dir/filepath", "dir/file"] self.addpkg2db("local", lp) p1 = pmpkg("replace") p1.provides = ["dummy"] p1.replaces = ["dummy"] p1.files = ["dir/filepath/", "dir/filepath/file", "dir/file", "dir/file2"] self.addpkg2db("sync", p1) self.args = "-Su" self.addrule("PACMAN_RETCODE=0") self.addrule("!PKG_EXIST=dummy") self.addrule("PKG_EXIST=replace")
self.description = 'Fileconflict file -> dir on package replacement (FS#24904)' lp = pmpkg('dummy') lp.files = ['dir/filepath', 'dir/file'] self.addpkg2db('local', lp) p1 = pmpkg('replace') p1.provides = ['dummy'] p1.replaces = ['dummy'] p1.files = ['dir/filepath/', 'dir/filepath/file', 'dir/file', 'dir/file2'] self.addpkg2db('sync', p1) self.args = '-Su' self.addrule('PACMAN_RETCODE=0') self.addrule('!PKG_EXIST=dummy') self.addrule('PKG_EXIST=replace')
def find_lowest(lst): # Return the lowest positive # number in a list. def lowest(first, rest): # Base case if len(rest) == 0: return first if first > rest[0] or first < 0: return lowest(rest[0], rest[1:]) else: return lowest(first, rest) return lowest(lst[0], lst[1:]) a = [16, -6, 1, 6, 6] print(find_lowest(a))
def find_lowest(lst): def lowest(first, rest): if len(rest) == 0: return first if first > rest[0] or first < 0: return lowest(rest[0], rest[1:]) else: return lowest(first, rest) return lowest(lst[0], lst[1:]) a = [16, -6, 1, 6, 6] print(find_lowest(a))
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"get_installed_dependencies": "00_checker.ipynb", "check_new_version": "00_checker.ipynb"} modules = ["checker.py"] doc_url = "https://muellerzr.github.io/dependency_checker/" git_url = "https://github.com/muellerzr/dependency_checker/tree/master/" def custom_doc_links(name): return None
__all__ = ['index', 'modules', 'custom_doc_links', 'git_url'] index = {'get_installed_dependencies': '00_checker.ipynb', 'check_new_version': '00_checker.ipynb'} modules = ['checker.py'] doc_url = 'https://muellerzr.github.io/dependency_checker/' git_url = 'https://github.com/muellerzr/dependency_checker/tree/master/' def custom_doc_links(name): return None
num = 600851475143 p = int(num**0.5) + 1 factors = [] def addToFactors(x): for f in factors: if not x % f: return factors.append(x) for i in range(2, p): if not num % i: addToFactors(i) print(max(factors))
num = 600851475143 p = int(num ** 0.5) + 1 factors = [] def add_to_factors(x): for f in factors: if not x % f: return factors.append(x) for i in range(2, p): if not num % i: add_to_factors(i) print(max(factors))
# https://codeforces.com/problemset/problem/230/B n = int(input()) numbers = [int(x) for x in input().split()] counter = 0 for number in numbers: if number == 1 or number == 2: print('NO') continue for x in range(2, number): if counter > 1: break if number % x == 0: counter += 1 if counter == 1: print('YES') else: print('NO') counter = 0
n = int(input()) numbers = [int(x) for x in input().split()] counter = 0 for number in numbers: if number == 1 or number == 2: print('NO') continue for x in range(2, number): if counter > 1: break if number % x == 0: counter += 1 if counter == 1: print('YES') else: print('NO') counter = 0
class Solution(object): def majorityElement(self, nums): """ :type nums: List[int] :rtype: int """ c = len(nums) / 3 m = {} for n in nums: m[n] = m.get(n, 0) + 1 return [k for k, v in m.items() if v > c] def test_majority_element(): s = Solution() assert [3] == s.majorityElement([3, 2, 3]) assert [1, 2] == s.majorityElement([1, 1, 1, 3, 3, 2, 2, 2])
class Solution(object): def majority_element(self, nums): """ :type nums: List[int] :rtype: int """ c = len(nums) / 3 m = {} for n in nums: m[n] = m.get(n, 0) + 1 return [k for (k, v) in m.items() if v > c] def test_majority_element(): s = solution() assert [3] == s.majorityElement([3, 2, 3]) assert [1, 2] == s.majorityElement([1, 1, 1, 3, 3, 2, 2, 2])
# Default dt for the imaging DEF_DT = 0.2 # Parameters for cropping around bouts: PRE_INT_BT_S = 2 # before POST_INT_BT_S = 6 # after
def_dt = 0.2 pre_int_bt_s = 2 post_int_bt_s = 6
first_sequence = list(map(int, input().split())) second_sequence = list(map(int, input().split())) line = input() while not line == 'nexus': first_pair, second_pair = line.split('|') first_list_index1, second_list_index1 = list(map(int, first_pair.split(':'))) first_list_index2, second_list_index2 = list(map(int, second_pair.split(':'))) if first_list_index1 < second_list_index1 \ and first_list_index2 > second_list_index2 \ and first_list_index1 < first_list_index2 \ and second_list_index1 > second_list_index2: connected_elements_sum = first_sequence[first_list_index1] + first_sequence[first_list_index2] \ + second_sequence[second_list_index1] + second_sequence[second_list_index2] first_sequence = first_sequence[:first_list_index1] + first_sequence[first_list_index2+1:] first_sequence = [el + connected_elements_sum for el in first_sequence] second_sequence = second_sequence[:second_list_index2] + second_sequence[second_list_index1+1:] second_sequence = [el + connected_elements_sum for el in second_sequence] elif first_list_index1 > second_list_index1 \ and first_list_index2 < second_list_index2 \ and first_list_index2 < first_list_index1 \ and second_list_index1 < second_list_index2: connected_elements_sum = first_sequence[first_list_index1] + first_sequence[first_list_index2] \ + second_sequence[second_list_index1] + second_sequence[second_list_index2] first_sequence = first_sequence[:first_list_index2] + first_sequence[first_list_index1 + 1:] first_sequence = [el + connected_elements_sum for el in first_sequence] second_sequence = second_sequence[:second_list_index1] + second_sequence[second_list_index2 + 1:] second_sequence = [el + connected_elements_sum for el in second_sequence] line = input() print(', '.join(map(str, first_sequence))) print(', '.join(map(str, second_sequence)))
first_sequence = list(map(int, input().split())) second_sequence = list(map(int, input().split())) line = input() while not line == 'nexus': (first_pair, second_pair) = line.split('|') (first_list_index1, second_list_index1) = list(map(int, first_pair.split(':'))) (first_list_index2, second_list_index2) = list(map(int, second_pair.split(':'))) if first_list_index1 < second_list_index1 and first_list_index2 > second_list_index2 and (first_list_index1 < first_list_index2) and (second_list_index1 > second_list_index2): connected_elements_sum = first_sequence[first_list_index1] + first_sequence[first_list_index2] + second_sequence[second_list_index1] + second_sequence[second_list_index2] first_sequence = first_sequence[:first_list_index1] + first_sequence[first_list_index2 + 1:] first_sequence = [el + connected_elements_sum for el in first_sequence] second_sequence = second_sequence[:second_list_index2] + second_sequence[second_list_index1 + 1:] second_sequence = [el + connected_elements_sum for el in second_sequence] elif first_list_index1 > second_list_index1 and first_list_index2 < second_list_index2 and (first_list_index2 < first_list_index1) and (second_list_index1 < second_list_index2): connected_elements_sum = first_sequence[first_list_index1] + first_sequence[first_list_index2] + second_sequence[second_list_index1] + second_sequence[second_list_index2] first_sequence = first_sequence[:first_list_index2] + first_sequence[first_list_index1 + 1:] first_sequence = [el + connected_elements_sum for el in first_sequence] second_sequence = second_sequence[:second_list_index1] + second_sequence[second_list_index2 + 1:] second_sequence = [el + connected_elements_sum for el in second_sequence] line = input() print(', '.join(map(str, first_sequence))) print(', '.join(map(str, second_sequence)))
# Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def mergeKLists(self, lists: List[Optional[ListNode]]) -> Optional[ListNode]: node_list = [] sentinel = head = ListNode(0, None) for item in lists: while item: node_list.append(item.val) item = item.next for item in sorted(node_list): head.next = ListNode(item, None) head = head.next return sentinel.next
class Solution: def merge_k_lists(self, lists: List[Optional[ListNode]]) -> Optional[ListNode]: node_list = [] sentinel = head = list_node(0, None) for item in lists: while item: node_list.append(item.val) item = item.next for item in sorted(node_list): head.next = list_node(item, None) head = head.next return sentinel.next
# https://leetcode.com/problems/fair-candy-swap/discuss/161269/C%2B%2BJavaPython-Straight-Forward class Solution: def fairCandySwap(self, A: List[int], B: List[int]) -> List[int]: diff = (sum(A) - sum(B)) // 2 B = set(B) A = set(A) for b in B: if b + diff in A: return [b+diff, b]
class Solution: def fair_candy_swap(self, A: List[int], B: List[int]) -> List[int]: diff = (sum(A) - sum(B)) // 2 b = set(B) a = set(A) for b in B: if b + diff in A: return [b + diff, b]
class BaseEncounter(object): """Base encounter class.""" def __init__(self, player, check_if_happens=True): self.p = self.player = player if (check_if_happens and self.check_if_happens()) or not check_if_happens: enc_name = self.__class__.__name__ enc_dict = self.p.game.enc_count_dict if enc_name in enc_dict: enc_dict[enc_name] += 1 else: enc_dict[enc_name] = 1 self.p.refresh_screen() self.run() def check_if_happens(self): return True def run(self): pass class Guaranteed(object): @staticmethod def check_if_happens(): return True
class Baseencounter(object): """Base encounter class.""" def __init__(self, player, check_if_happens=True): self.p = self.player = player if check_if_happens and self.check_if_happens() or not check_if_happens: enc_name = self.__class__.__name__ enc_dict = self.p.game.enc_count_dict if enc_name in enc_dict: enc_dict[enc_name] += 1 else: enc_dict[enc_name] = 1 self.p.refresh_screen() self.run() def check_if_happens(self): return True def run(self): pass class Guaranteed(object): @staticmethod def check_if_happens(): return True
# create node class class Node: def __init__(self, value=None, next=None): self.value = value self.next = next # create stack class Stack: def __init__(self): self.top = None def isEmpty(self): if self.top == None: return True else: return False def peek(self): if self.isEmpty(): raise Exception('cannot peek empty stack') else: return self.top.value def push(self, val): self.top = Node(val, self.top) return True def pop(self): if self.isEmpty(): raise Exception('cannot pop empty stack') else: temp = self.top.value self.top = self.top.next return temp
class Node: def __init__(self, value=None, next=None): self.value = value self.next = next class Stack: def __init__(self): self.top = None def is_empty(self): if self.top == None: return True else: return False def peek(self): if self.isEmpty(): raise exception('cannot peek empty stack') else: return self.top.value def push(self, val): self.top = node(val, self.top) return True def pop(self): if self.isEmpty(): raise exception('cannot pop empty stack') else: temp = self.top.value self.top = self.top.next return temp
""" Copyright 2020 Robert MacGregor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") load("//libraries:zlib.bzl", "zlib") load("//applications:bison.bzl", "bison") load("//libraries:harfbuzz.bzl", "harfbuzz") def graphviz(): # Ensure dependencies are loaded zlib() harfbuzz() maybe( new_git_repository, name = "graphviz", remote = "https://gitlab.com/graphviz/graphviz.git", shallow_since = "1593420362 +0000", # Release 2.44.1 commit = "771bc4dbff3e6f358fa75cdc7774a413ccacad51", build_file = "@rules_third_party//applications:graphviz.BUILD" ) def run_graphviz(name, input, output, type="png"): native.genrule( name = name, srcs = [ "@graphviz//:graphviz", input, ], outs = [ output ], cmd = "\n".join([ "DOT_BINARY=\"$(locations @graphviz//:graphviz)\"", # Load DOT binary location - the graphviz target is multiple objects and we're interested in the binary # TODO: Perhaps a filegroup to load the binaries? "IFS=' ' read -ra DOT_DATA <<< \"$$DOT_BINARY\"", "DOT_BINARY=$$(realpath $${DOT_DATA[1]})", "DOT_LIBS=\"$$(realpath $$(dirname $$DOT_BINARY)/../lib)\"", # Generate temporary directory for DOT data "DOT_TEMPORARY=$$(mktemp -d)", "cp $$DOT_LIBS/* $$DOT_TEMPORARY", # Set library path and GVBINDIR so that DOT runs correctly "export LD_LIBRARY_PATH=\"$$DOT_TEMPORARY\"", "export GVBINDIR=\"$$DOT_TEMPORARY\"", # Generate config file to ensure plugins are loaded by dot "$$DOT_BINARY -c", "$$DOT_BINARY -T%s $(location %s) > $@" % (type, input), # Cleanup "rm -rf $$DOT_TEMPORARY" ]) )
""" Copyright 2020 Robert MacGregor Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ load('@bazel_tools//tools/build_defs/repo:utils.bzl', 'maybe') load('@bazel_tools//tools/build_defs/repo:git.bzl', 'new_git_repository') load('//libraries:zlib.bzl', 'zlib') load('//applications:bison.bzl', 'bison') load('//libraries:harfbuzz.bzl', 'harfbuzz') def graphviz(): zlib() harfbuzz() maybe(new_git_repository, name='graphviz', remote='https://gitlab.com/graphviz/graphviz.git', shallow_since='1593420362 +0000', commit='771bc4dbff3e6f358fa75cdc7774a413ccacad51', build_file='@rules_third_party//applications:graphviz.BUILD') def run_graphviz(name, input, output, type='png'): native.genrule(name=name, srcs=['@graphviz//:graphviz', input], outs=[output], cmd='\n'.join(['DOT_BINARY="$(locations @graphviz//:graphviz)"', 'IFS=\' \' read -ra DOT_DATA <<< "$$DOT_BINARY"', 'DOT_BINARY=$$(realpath $${DOT_DATA[1]})', 'DOT_LIBS="$$(realpath $$(dirname $$DOT_BINARY)/../lib)"', 'DOT_TEMPORARY=$$(mktemp -d)', 'cp $$DOT_LIBS/* $$DOT_TEMPORARY', 'export LD_LIBRARY_PATH="$$DOT_TEMPORARY"', 'export GVBINDIR="$$DOT_TEMPORARY"', '$$DOT_BINARY -c', '$$DOT_BINARY -T%s $(location %s) > $@' % (type, input), 'rm -rf $$DOT_TEMPORARY']))
# -*- coding: utf-8 -*- class Hero(object): def __init__(self, forename, surname, hero): self.forename = forename self.surname = surname self.heroname = hero
class Hero(object): def __init__(self, forename, surname, hero): self.forename = forename self.surname = surname self.heroname = hero
class Ball: def __init__(self): self.x, self.y = 320, 240 self.speed_x = -10 self.speed_y = 10 self.size = 8 def movement(self, player1, player2): self.x += self.speed_x self.y += self.speed_y if self.y <= 0: self.speed_y *= -1 elif self.y >= 480 - self.size: self.speed_y *= -1 if self.x <= 0: self.__init__() elif self.x >= 640 - self.size: self.__init__() self.speed_x *= -1 self.speed_y *= -1 for n in range(-self.size, 64): if self.y == player1.y + n: if self.x <= player1.x + 8: self.speed_x *= -1 break n += 1 for n in range(-self.size, 64): if self.y == player2.y + n: if self.x >= player2.x - 8: self.speed_x *= -1 break n += 1 class Player: def __init__(self): pass
class Ball: def __init__(self): (self.x, self.y) = (320, 240) self.speed_x = -10 self.speed_y = 10 self.size = 8 def movement(self, player1, player2): self.x += self.speed_x self.y += self.speed_y if self.y <= 0: self.speed_y *= -1 elif self.y >= 480 - self.size: self.speed_y *= -1 if self.x <= 0: self.__init__() elif self.x >= 640 - self.size: self.__init__() self.speed_x *= -1 self.speed_y *= -1 for n in range(-self.size, 64): if self.y == player1.y + n: if self.x <= player1.x + 8: self.speed_x *= -1 break n += 1 for n in range(-self.size, 64): if self.y == player2.y + n: if self.x >= player2.x - 8: self.speed_x *= -1 break n += 1 class Player: def __init__(self): pass
def fizzbuzz(n): if n%3 == 0 and n%5 != 0: resultado = "Fizz" elif n%5 == 0 and n%3 != 0: resultado = "Buzz" elif n%3 == 0 and n%5 == 0: resultado = "FizzBuzz" else: resultado = n return resultado
def fizzbuzz(n): if n % 3 == 0 and n % 5 != 0: resultado = 'Fizz' elif n % 5 == 0 and n % 3 != 0: resultado = 'Buzz' elif n % 3 == 0 and n % 5 == 0: resultado = 'FizzBuzz' else: resultado = n return resultado
{ "includes": [ "ext/snowcrash/common.gypi" ], "targets" : [ # LIBSOS { 'target_name': 'libsos', 'type': 'static_library', 'direct_dependent_settings' : { 'include_dirs': [ 'ext/sos/src' ], }, 'sources': [ 'ext/sos/src/sos.cc', 'ext/sos/src/sos.h', 'ext/sos/src/sosJSON.h', 'ext/sos/src/sosYAML.h' ] }, # LIBDRAFTER { "target_name": "libdrafter", 'type': '<(libdrafter_type)', "conditions" : [ [ 'libdrafter_type=="shared_library"', { 'defines' : [ 'DRAFTER_BUILD_SHARED' ] }, { 'defines' : [ 'DRAFTER_BUILD_STATIC' ] }], ], 'direct_dependent_settings' : { 'include_dirs': [ 'src', ], }, 'export_dependent_settings': [ 'libsos', 'ext/snowcrash/snowcrash.gyp:libsnowcrash', ], "sources": [ "src/drafter.h", "src/drafter.cc", "src/drafter_private.h", "src/drafter_private.cc", "src/stream.h", "src/Version.h", "src/NodeInfo.h", "src/Serialize.h", "src/Serialize.cc", "src/SerializeAST.h", "src/SerializeAST.cc", "src/SerializeSourcemap.h", "src/SerializeSourcemap.cc", "src/SerializeResult.h", "src/SerializeResult.cc", "src/RefractAPI.h", "src/RefractAPI.cc", "src/RefractDataStructure.h", "src/RefractDataStructure.cc", "src/RefractSourceMap.h", "src/RefractSourceMap.cc", "src/Render.h", "src/Render.cc", "src/NamedTypesRegistry.cc", "src/NamedTypesRegistry.h", "src/RefractElementFactory.h", "src/RefractElementFactory.cc", "src/ConversionContext.cc", "src/ConversionContext.h", # librefract parts - will be separated into other project "src/refract/Element.h", "src/refract/Element.cc", "src/refract/ElementFwd.h", "src/refract/Visitor.h", "src/refract/VisitorUtils.h", "src/refract/VisitorUtils.cc", "src/refract/SerializeCompactVisitor.h", "src/refract/SerializeCompactVisitor.cc", "src/refract/SerializeVisitor.h", "src/refract/SerializeVisitor.cc", "src/refract/ComparableVisitor.h", "src/refract/ComparableVisitor.cc", "src/refract/TypeQueryVisitor.h", "src/refract/TypeQueryVisitor.cc", "src/refract/IsExpandableVisitor.h", "src/refract/IsExpandableVisitor.cc", "src/refract/ExpandVisitor.h", "src/refract/ExpandVisitor.cc", "src/refract/RenderJSONVisitor.h", "src/refract/RenderJSONVisitor.cc", "src/refract/PrintVisitor.h", "src/refract/PrintVisitor.cc", "src/refract/JSONSchemaVisitor.h", "src/refract/JSONSchemaVisitor.cc", "src/refract/FilterVisitor.h", "src/refract/Registry.h", "src/refract/Registry.cc", "src/refract/Build.h", "src/refract/AppendDecorator.h", "src/refract/ElementInserter.h", "src/refract/Query.h", "src/refract/Query.cc", "src/refract/Iterate.h", ], "dependencies": [ "libsos", "ext/snowcrash/snowcrash.gyp:libsnowcrash", ], }, # TESTLIBDRAFTER { 'target_name': 'test-libdrafter', 'type': 'executable', 'include_dirs': [ 'test/vendor/Catch/include', 'test/vendor/dtl/dtl', 'src/refract', ], 'sources': [ "test/test-drafter.cc", "test/test-SerializeResultTest.cc", "test/test-SerializeSourceMapTest.cc", "test/test-RefractDataStructureTest.cc", "test/test-RefractAPITest.cc", "test/test-RefractParseResultTest.cc", "test/test-RenderTest.cc", "test/test-RefractSourceMapTest.cc", "test/test-SchemaTest.cc", "test/test-CircularReferenceTest.cc", "test/test-ApplyVisitorTest.cc", "test/test-ExtendElementTest.cc", "test/test-ElementFactoryTest.cc", "test/test-OneOfTest.cc", "test/test-SyntaxIssuesTest.cc", ], 'dependencies': [ "libdrafter", ], 'conditions': [ [ 'OS=="win"', { 'defines' : [ 'WIN' ] } ] ], }, # DRAFTER { "target_name": "drafter", "type": "executable", "conditions" : [ [ 'libdrafter_type=="static_library"', { 'defines' : [ 'DRAFTER_BUILD_STATIC' ] }], ], "sources": [ "src/main.cc", "src/config.cc", "src/config.h", "src/reporting.cc", "src/reporting.h", ], "include_dirs": [ "ext/cmdline", ], "dependencies": [ "libdrafter", ], }, # DRAFTER C-API TEST { "target_name": "test-capi", "type": "executable", "conditions" : [ [ 'libdrafter_type=="static_library"', { 'defines' : [ 'DRAFTER_BUILD_STATIC' ] }], ], "sources": [ "test/test-CAPI.c" ], "dependencies": [ "libdrafter", ], }, ], }
{'includes': ['ext/snowcrash/common.gypi'], 'targets': [{'target_name': 'libsos', 'type': 'static_library', 'direct_dependent_settings': {'include_dirs': ['ext/sos/src']}, 'sources': ['ext/sos/src/sos.cc', 'ext/sos/src/sos.h', 'ext/sos/src/sosJSON.h', 'ext/sos/src/sosYAML.h']}, {'target_name': 'libdrafter', 'type': '<(libdrafter_type)', 'conditions': [['libdrafter_type=="shared_library"', {'defines': ['DRAFTER_BUILD_SHARED']}, {'defines': ['DRAFTER_BUILD_STATIC']}]], 'direct_dependent_settings': {'include_dirs': ['src']}, 'export_dependent_settings': ['libsos', 'ext/snowcrash/snowcrash.gyp:libsnowcrash'], 'sources': ['src/drafter.h', 'src/drafter.cc', 'src/drafter_private.h', 'src/drafter_private.cc', 'src/stream.h', 'src/Version.h', 'src/NodeInfo.h', 'src/Serialize.h', 'src/Serialize.cc', 'src/SerializeAST.h', 'src/SerializeAST.cc', 'src/SerializeSourcemap.h', 'src/SerializeSourcemap.cc', 'src/SerializeResult.h', 'src/SerializeResult.cc', 'src/RefractAPI.h', 'src/RefractAPI.cc', 'src/RefractDataStructure.h', 'src/RefractDataStructure.cc', 'src/RefractSourceMap.h', 'src/RefractSourceMap.cc', 'src/Render.h', 'src/Render.cc', 'src/NamedTypesRegistry.cc', 'src/NamedTypesRegistry.h', 'src/RefractElementFactory.h', 'src/RefractElementFactory.cc', 'src/ConversionContext.cc', 'src/ConversionContext.h', 'src/refract/Element.h', 'src/refract/Element.cc', 'src/refract/ElementFwd.h', 'src/refract/Visitor.h', 'src/refract/VisitorUtils.h', 'src/refract/VisitorUtils.cc', 'src/refract/SerializeCompactVisitor.h', 'src/refract/SerializeCompactVisitor.cc', 'src/refract/SerializeVisitor.h', 'src/refract/SerializeVisitor.cc', 'src/refract/ComparableVisitor.h', 'src/refract/ComparableVisitor.cc', 'src/refract/TypeQueryVisitor.h', 'src/refract/TypeQueryVisitor.cc', 'src/refract/IsExpandableVisitor.h', 'src/refract/IsExpandableVisitor.cc', 'src/refract/ExpandVisitor.h', 'src/refract/ExpandVisitor.cc', 'src/refract/RenderJSONVisitor.h', 'src/refract/RenderJSONVisitor.cc', 'src/refract/PrintVisitor.h', 'src/refract/PrintVisitor.cc', 'src/refract/JSONSchemaVisitor.h', 'src/refract/JSONSchemaVisitor.cc', 'src/refract/FilterVisitor.h', 'src/refract/Registry.h', 'src/refract/Registry.cc', 'src/refract/Build.h', 'src/refract/AppendDecorator.h', 'src/refract/ElementInserter.h', 'src/refract/Query.h', 'src/refract/Query.cc', 'src/refract/Iterate.h'], 'dependencies': ['libsos', 'ext/snowcrash/snowcrash.gyp:libsnowcrash']}, {'target_name': 'test-libdrafter', 'type': 'executable', 'include_dirs': ['test/vendor/Catch/include', 'test/vendor/dtl/dtl', 'src/refract'], 'sources': ['test/test-drafter.cc', 'test/test-SerializeResultTest.cc', 'test/test-SerializeSourceMapTest.cc', 'test/test-RefractDataStructureTest.cc', 'test/test-RefractAPITest.cc', 'test/test-RefractParseResultTest.cc', 'test/test-RenderTest.cc', 'test/test-RefractSourceMapTest.cc', 'test/test-SchemaTest.cc', 'test/test-CircularReferenceTest.cc', 'test/test-ApplyVisitorTest.cc', 'test/test-ExtendElementTest.cc', 'test/test-ElementFactoryTest.cc', 'test/test-OneOfTest.cc', 'test/test-SyntaxIssuesTest.cc'], 'dependencies': ['libdrafter'], 'conditions': [['OS=="win"', {'defines': ['WIN']}]]}, {'target_name': 'drafter', 'type': 'executable', 'conditions': [['libdrafter_type=="static_library"', {'defines': ['DRAFTER_BUILD_STATIC']}]], 'sources': ['src/main.cc', 'src/config.cc', 'src/config.h', 'src/reporting.cc', 'src/reporting.h'], 'include_dirs': ['ext/cmdline'], 'dependencies': ['libdrafter']}, {'target_name': 'test-capi', 'type': 'executable', 'conditions': [['libdrafter_type=="static_library"', {'defines': ['DRAFTER_BUILD_STATIC']}]], 'sources': ['test/test-CAPI.c'], 'dependencies': ['libdrafter']}]}
# Config key of the MYSQL tag in config.ini MSSQL_TAG = "MSSQL" HOST_CONFIG = "host" DATABASE_CONFIG = "database" USER_CONFIG = "user" PASSWORD_CONFIG = "password" TABLE_CONFIG = "table" DRIVER_CONFIG = "driver" INSTANCE_NAME_FIELD_CONFIG = "instance_name_column" TIMESTAMP_FIELD_CONFIG = "timestamp_column" TIMESTAMP_FORMAT_CONFIG = "timestamp_format" # Config key of the INSIGHTFINDER tag in config.ini IF_TAG = "INSIGHTFINDER" LICENSE_KEY_CONFIG = "license_key" PROJECT_NAME_CONFIG = "project_name" USER_NAME_CONFIG = "user_name" SERVER_URL_CONFIG = "server_url" SAMPLING_INTERVAL = "sampling_interval" # Constant CONFIG_FILE = "config.ini" GMT = "GMT" RAW_DATA_KEY = "data" TIMESTAMP_KEY = "timestamp" INSTANCE_NAME_KEY = "tag" SUCCESS_CODE = 200 METRIC_DATA = "metricData" LICENSE_KEY = "licenseKey" PROJECT_NAME = "projectName" USER_NAME = "userName" AGENT_TYPE = "agentType" AGENT_TYPE_LOG_STREAMING = "LogStreaming" CUSTOM_PROJECT_RAW_DATA_URL = "/customprojectrawdata" NONE = "NONE" CHUNK_SIZE = 1000 # Time Constant ONE_MINUTE = 1000 * 60 FIVE_MINUTES = ONE_MINUTE * 5
mssql_tag = 'MSSQL' host_config = 'host' database_config = 'database' user_config = 'user' password_config = 'password' table_config = 'table' driver_config = 'driver' instance_name_field_config = 'instance_name_column' timestamp_field_config = 'timestamp_column' timestamp_format_config = 'timestamp_format' if_tag = 'INSIGHTFINDER' license_key_config = 'license_key' project_name_config = 'project_name' user_name_config = 'user_name' server_url_config = 'server_url' sampling_interval = 'sampling_interval' config_file = 'config.ini' gmt = 'GMT' raw_data_key = 'data' timestamp_key = 'timestamp' instance_name_key = 'tag' success_code = 200 metric_data = 'metricData' license_key = 'licenseKey' project_name = 'projectName' user_name = 'userName' agent_type = 'agentType' agent_type_log_streaming = 'LogStreaming' custom_project_raw_data_url = '/customprojectrawdata' none = 'NONE' chunk_size = 1000 one_minute = 1000 * 60 five_minutes = ONE_MINUTE * 5
print("hello, what is your name?") name = input() print("hi " + name)
print('hello, what is your name?') name = input() print('hi ' + name)
#Python 3.X solution for Easy Challenge #0007 #GitHub: https://github.com/Ashkore #https://www.reddit.com/user/Ashkoree/ alphabet = ["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] morase = [".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-",".--","-..-","-.--","--.."] def tomorase(string): string = list(string) newstring =[] for char in string: try: char = char.upper() newstring.append(morase[alphabet.index(char)]+" ") except: if char == " ": newstring.append("/ ") else: newstring.append("? ") return "".join(map(str,newstring)) def frommorase(string): string = string.split(" ") newstring = [] for char in string: try: newstring.append(alphabet[morase.index(char)]) except: if char == "/": newstring.append(" ") if char == "?": newstring.append("_") return "".join(map(str,newstring)) string = input("What is your string?") print("Morase: "+tomorase(string)) print("Normal: "+frommorase(tomorase(string)))
alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'] morase = ['.-', '-...', '-.-.', '-..', '.', '..-.', '--.', '....', '..', '.---', '-.-', '.-..', '--', '-.', '---', '.--.', '--.-', '.-.', '...', '-', '..-', '.--', '-..-', '-.--', '--..'] def tomorase(string): string = list(string) newstring = [] for char in string: try: char = char.upper() newstring.append(morase[alphabet.index(char)] + ' ') except: if char == ' ': newstring.append('/ ') else: newstring.append('? ') return ''.join(map(str, newstring)) def frommorase(string): string = string.split(' ') newstring = [] for char in string: try: newstring.append(alphabet[morase.index(char)]) except: if char == '/': newstring.append(' ') if char == '?': newstring.append('_') return ''.join(map(str, newstring)) string = input('What is your string?') print('Morase: ' + tomorase(string)) print('Normal: ' + frommorase(tomorase(string)))
# Write a function or lambda using the implementation of fold below that will # return the product of the elements of a list. def or_else(lhs, rhs): if lhs != None: return lhs else: return rhs def fold(function, arguments, initializer, accumulator = None): if len(arguments) == 0: return accumulator else: return fold( function, arguments[1:], initializer, function( or_else(accumulator, initializer), arguments[0]))
def or_else(lhs, rhs): if lhs != None: return lhs else: return rhs def fold(function, arguments, initializer, accumulator=None): if len(arguments) == 0: return accumulator else: return fold(function, arguments[1:], initializer, function(or_else(accumulator, initializer), arguments[0]))
def solution(A): nums = {} for num in A: nums[num] = 1 for num in nums: if num + 1 in nums or num - 1 in nums: return True return False def solution(N): num = N numStr = str(N) if num < 0: length = len(numStr) - 1 while length > 0: if numStr[length] == '5': numStr = numStr[:length] + numStr[length+1:] return int(numStr) length-=1 else: for i in range(len(numStr)): if numStr[i] == '5': numStr = numStr[:i] + numStr[i+1:] return int(numStr)
def solution(A): nums = {} for num in A: nums[num] = 1 for num in nums: if num + 1 in nums or num - 1 in nums: return True return False def solution(N): num = N num_str = str(N) if num < 0: length = len(numStr) - 1 while length > 0: if numStr[length] == '5': num_str = numStr[:length] + numStr[length + 1:] return int(numStr) length -= 1 else: for i in range(len(numStr)): if numStr[i] == '5': num_str = numStr[:i] + numStr[i + 1:] return int(numStr)
test = { 'name': 'q1_1', 'points': 1, 'suites': [ { 'cases': [{'code': ">>> unemployment.select('Date', 'NEI', 'NEI-PTER').take(0).column(0).item(0) == '1994-01-01'\nTrue", 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]}
test = {'name': 'q1_1', 'points': 1, 'suites': [{'cases': [{'code': ">>> unemployment.select('Date', 'NEI', 'NEI-PTER').take(0).column(0).item(0) == '1994-01-01'\nTrue", 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]}
command = input() numbers_sequence = [int(x) for x in input().split()] odd_numbers = [] even_numbers = [] for number in numbers_sequence: if number % 2 == 0: even_numbers.append(number) else: odd_numbers.append(number) if command == 'Odd': print(sum(odd_numbers) * len(numbers_sequence)) elif command == 'Even': print(sum(even_numbers) * len(numbers_sequence))
command = input() numbers_sequence = [int(x) for x in input().split()] odd_numbers = [] even_numbers = [] for number in numbers_sequence: if number % 2 == 0: even_numbers.append(number) else: odd_numbers.append(number) if command == 'Odd': print(sum(odd_numbers) * len(numbers_sequence)) elif command == 'Even': print(sum(even_numbers) * len(numbers_sequence))
def sainte_claire1(general, dev, msg) : code = 2 prio = 500 prio += adjust_prio(general, dev, msg) keys=list(); keys.append('Sainte Claire') if ( not contains(dev, keys) ) : return (0, 0, 0, '', '') if ( dev['Sainte Claire']['count'] < 3) : return (0, 0, 0, '', '') title = "RU @ Sainte Claire?" body = "\ Are you staying at Sainte Claire? I noticed your device had been detected there when I visited the Loca stand in the South Hall. You were detected by their network at the hotel reception %d times, so I guess that means you are checked in! :) I must have just missed you, I was by the hotel reception myself at %s which is when you were last seen there." % ( \ dev['Sainte Claire']['count'], approx_time_date(dev['Sainte Claire']['last_seen']) \ ) body += sig('Sly') body += location_and_time(general) body += dev_log(general, dev, msg) body += loca_sig() return ( prio, code, title, title, body )
def sainte_claire1(general, dev, msg): code = 2 prio = 500 prio += adjust_prio(general, dev, msg) keys = list() keys.append('Sainte Claire') if not contains(dev, keys): return (0, 0, 0, '', '') if dev['Sainte Claire']['count'] < 3: return (0, 0, 0, '', '') title = 'RU @ Sainte Claire?' body = 'Are you staying at Sainte Claire? I noticed your device had been detected there when I visited the Loca stand in the South Hall. You were detected by their network at the hotel reception %d times, so I guess that means you are checked in! :) I must have just missed you, I was by the hotel reception myself at %s which is when you were last seen there.' % (dev['Sainte Claire']['count'], approx_time_date(dev['Sainte Claire']['last_seen'])) body += sig('Sly') body += location_and_time(general) body += dev_log(general, dev, msg) body += loca_sig() return (prio, code, title, title, body)
"""Test the backend models module""" def test_foo(): """A fake test, because I just want to get nox to pass"""
"""Test the backend models module""" def test_foo(): """A fake test, because I just want to get nox to pass"""
# General TEMP_FILES_PATH = '/tmp/temp_files_parkun' PERSONAL_FOLDER = 'broadcaster' BOLD = 'bold' ITALIC = 'italic' MONO = 'mono' STRIKE = 'strike' POST_URL = 'post_url' # Twitter TWITTER_ENABLED = False CONSUMER_KEY = 'consumer_key' CONSUMER_SECRET = 'consumer_secret' ACCESS_TOKEN = 'access_token' ACCESS_TOKEN_SECRET = 'access_token_secret' MAX_TWI_CHARACTERS = 280 MAX_TWI_PHOTOS = 4 TWI_URL = 'twitter.com/SOME_TWITTER_ACCOUNT' # RabbitMQ RABBIT_HOST = 'localhost' RABBIT_AMQP_PORT = '5672' RABBIT_HTTP_PORT = '15672' RABBIT_LOGIN = 'broadcaster' RABBIT_PASSWORD = 'broadcaster' RABBIT_AMQP_ADDRESS = \ f'amqp://{RABBIT_LOGIN}:{RABBIT_PASSWORD}@{RABBIT_HOST}:{RABBIT_AMQP_PORT}' RABBIT_HTTP_ADDRESS = \ f'http://{RABBIT_LOGIN}:{RABBIT_PASSWORD}@{RABBIT_HOST}:{RABBIT_HTTP_PORT}' BROADCAST_QUEUE = 'broadcast' RABBIT_EXCHANGE_SHARING = 'sharing' ROUTING_KEY = 'sharing_status' # VK (see readme.md) VK_ENABLED = False VK_APP_ID = 'vk_app_id' # just to remember VK_GROUP_ID = 'vk_group_id' VK_API_TOKEN = 'vk_api_token' # Telegram TG_ENABLED = False TG_BOT_TOKEN = 'PUT_TOKEN_HERE' TG_CHANNEL = '@channel_name'
temp_files_path = '/tmp/temp_files_parkun' personal_folder = 'broadcaster' bold = 'bold' italic = 'italic' mono = 'mono' strike = 'strike' post_url = 'post_url' twitter_enabled = False consumer_key = 'consumer_key' consumer_secret = 'consumer_secret' access_token = 'access_token' access_token_secret = 'access_token_secret' max_twi_characters = 280 max_twi_photos = 4 twi_url = 'twitter.com/SOME_TWITTER_ACCOUNT' rabbit_host = 'localhost' rabbit_amqp_port = '5672' rabbit_http_port = '15672' rabbit_login = 'broadcaster' rabbit_password = 'broadcaster' rabbit_amqp_address = f'amqp://{RABBIT_LOGIN}:{RABBIT_PASSWORD}@{RABBIT_HOST}:{RABBIT_AMQP_PORT}' rabbit_http_address = f'http://{RABBIT_LOGIN}:{RABBIT_PASSWORD}@{RABBIT_HOST}:{RABBIT_HTTP_PORT}' broadcast_queue = 'broadcast' rabbit_exchange_sharing = 'sharing' routing_key = 'sharing_status' vk_enabled = False vk_app_id = 'vk_app_id' vk_group_id = 'vk_group_id' vk_api_token = 'vk_api_token' tg_enabled = False tg_bot_token = 'PUT_TOKEN_HERE' tg_channel = '@channel_name'
''' Author : MiKueen Level : Easy Problem Statement : Convert Binary Number in a Linked List to Integer Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the linked list. Example 1: Input: head = [1,0,1] Output: 5 Explanation: (101) in base 2 = (5) in base 10 Example 2: Input: head = [0] Output: 0 Example 3: Input: head = [1] Output: 1 Example 4: Input: head = [1,0,0,1,0,0,1,1,1,0,0,0,0,0,0] Output: 18880 Example 5: Input: head = [0,0] Output: 0 Constraints: The Linked List is not empty. Number of nodes will not exceed 30. Each node's value is either 0 or 1. ''' # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def getDecimalValue(self, head: ListNode) -> int: if head.next is None: return head.val # Method 1 res = '' while head: res += str(head.val) head = head.next return int(res, 2) # Method 2 - Cool trick res = 0 while head: res = 2 * res + head.val head = head.next return res
""" Author : MiKueen Level : Easy Problem Statement : Convert Binary Number in a Linked List to Integer Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number. Return the decimal value of the number in the linked list. Example 1: Input: head = [1,0,1] Output: 5 Explanation: (101) in base 2 = (5) in base 10 Example 2: Input: head = [0] Output: 0 Example 3: Input: head = [1] Output: 1 Example 4: Input: head = [1,0,0,1,0,0,1,1,1,0,0,0,0,0,0] Output: 18880 Example 5: Input: head = [0,0] Output: 0 Constraints: The Linked List is not empty. Number of nodes will not exceed 30. Each node's value is either 0 or 1. """ class Solution: def get_decimal_value(self, head: ListNode) -> int: if head.next is None: return head.val res = '' while head: res += str(head.val) head = head.next return int(res, 2) res = 0 while head: res = 2 * res + head.val head = head.next return res
def computepay(h,r): return 42.37 hrs = input("Enter Hours : ") h = float(hrs) rate = input("Enter rate per hour : ") r = float(rate) if h > 40: gross = (40*r)+(h-40)*(r*1.5) print(gross) else: gross=h*r print(gross)
def computepay(h, r): return 42.37 hrs = input('Enter Hours : ') h = float(hrs) rate = input('Enter rate per hour : ') r = float(rate) if h > 40: gross = 40 * r + (h - 40) * (r * 1.5) print(gross) else: gross = h * r print(gross)
for t in range(int(input())): p, q = map(int, input().split()) q = q + 1 hori = [0 for _ in range(q)] vert = [0 for _ in range(q)] for _ in range(p): x, y, d = input().split() x = int(x) y = int(y) if d == 'N': vert[y + 1] += 1 if d == 'S': vert[y] -= 1 vert[0] += 1 if d == 'E': hori[x + 1] += 1 if d == 'W': hori[x] -= 1 hori[0] += 1 x, y = 0, 0 cum_sum_h, max_h = 0, 0 cum_sum_v, max_v = 0, 0 for i in range(q): cum_sum_h += hori[i] if cum_sum_h > max_h: max_h = cum_sum_h x = i cum_sum_v += vert[i] if cum_sum_v > max_v: max_v = cum_sum_v y = i print('Case #{n}: {x} {y}'.format(n = t + 1, x=x, y=y))
for t in range(int(input())): (p, q) = map(int, input().split()) q = q + 1 hori = [0 for _ in range(q)] vert = [0 for _ in range(q)] for _ in range(p): (x, y, d) = input().split() x = int(x) y = int(y) if d == 'N': vert[y + 1] += 1 if d == 'S': vert[y] -= 1 vert[0] += 1 if d == 'E': hori[x + 1] += 1 if d == 'W': hori[x] -= 1 hori[0] += 1 (x, y) = (0, 0) (cum_sum_h, max_h) = (0, 0) (cum_sum_v, max_v) = (0, 0) for i in range(q): cum_sum_h += hori[i] if cum_sum_h > max_h: max_h = cum_sum_h x = i cum_sum_v += vert[i] if cum_sum_v > max_v: max_v = cum_sum_v y = i print('Case #{n}: {x} {y}'.format(n=t + 1, x=x, y=y))
matrix = [sublist.split() for sublist in input().split("|")][::-1] print(' '.join([str(number) for sublist in matrix for number in sublist]))
matrix = [sublist.split() for sublist in input().split('|')][::-1] print(' '.join([str(number) for sublist in matrix for number in sublist]))
LOGIN_URL = "/login" XPATH_EMAIL_INPUT = "//form//input[contains(@placeholder,'Email')]" XPATH_PASSWORD_INPUT = "//form//input[contains(@placeholder,'Password')]" XPATH_SUBMIT = "//form//button[contains(@type,'submit')]"
login_url = '/login' xpath_email_input = "//form//input[contains(@placeholder,'Email')]" xpath_password_input = "//form//input[contains(@placeholder,'Password')]" xpath_submit = "//form//button[contains(@type,'submit')]"
class TIFFImageCropperTest(object): """ Test Suite for TIFFImageCropper. """ pass
class Tiffimagecroppertest(object): """ Test Suite for TIFFImageCropper. """ pass
dataset=["gossipcop_fake" "gossipcop_real" "politifact_fake" "politifact_real" "Aminer"] methods=["proposed" "HITS" "CoHITS" "BGRM" "BiRank"]
dataset = ['gossipcop_fakegossipcop_realpolitifact_fakepolitifact_realAminer'] methods = ['proposedHITSCoHITSBGRMBiRank']
class Solution: def permute(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ if len(nums) < 2: return [nums] def order(prefix, suffix): if len(suffix) == 1: return [prefix+suffix] results = [] for i in range(len(suffix)): results.extend(order(prefix+[suffix[i]], suffix[:i]+suffix[i+1:])) return results return order([], nums)
class Solution: def permute(self, nums): """ :type nums: List[int] :rtype: List[List[int]] """ if len(nums) < 2: return [nums] def order(prefix, suffix): if len(suffix) == 1: return [prefix + suffix] results = [] for i in range(len(suffix)): results.extend(order(prefix + [suffix[i]], suffix[:i] + suffix[i + 1:])) return results return order([], nums)
''' https://docs.python.org/3/reference/datamodel.html#object.__getitem__ ''' class XXX(object): def __init__(self): self.data = {int(i): str(i) for i in range(3)} def __len__(self): return len(self.data) def __getitem__(self, index): if index >= len(self): raise IndexError return self.data[index], index x = XXX() for v, i in x: print(v, i)
""" https://docs.python.org/3/reference/datamodel.html#object.__getitem__ """ class Xxx(object): def __init__(self): self.data = {int(i): str(i) for i in range(3)} def __len__(self): return len(self.data) def __getitem__(self, index): if index >= len(self): raise IndexError return (self.data[index], index) x = xxx() for (v, i) in x: print(v, i)
def search(list, key): pos = -1 for i in range(0,len(list)): if list[i] == key: pos = i + 1 break if pos != -1: print("\n\nThe value {} is found to be at {} position!".format(key,pos)) else: print("\n\nThe value {} cannot be found!".format(key)) print("\nEnter the elements of the array in one string with spaces: \n") array = list(map(int, input().split())) ("\nEnter the number you want to find: \n") key = int(input("\nEnter the number you want to find: \n")) search(array,key)
def search(list, key): pos = -1 for i in range(0, len(list)): if list[i] == key: pos = i + 1 break if pos != -1: print('\n\nThe value {} is found to be at {} position!'.format(key, pos)) else: print('\n\nThe value {} cannot be found!'.format(key)) print('\nEnter the elements of the array in one string with spaces: \n') array = list(map(int, input().split())) '\nEnter the number you want to find: \n' key = int(input('\nEnter the number you want to find: \n')) search(array, key)
def diagonalDifference(arr, n): mtotal = 0 stotal = 0 for i in range(n): mtotal += arr[i][i] stotal += arr[n - 1 - i][i] return abs(mtotal - stotal) n = int(input()) arr = [ list(map(int, input().split())) for _ in range(n) ] print(diagonalDifference(arr, n))
def diagonal_difference(arr, n): mtotal = 0 stotal = 0 for i in range(n): mtotal += arr[i][i] stotal += arr[n - 1 - i][i] return abs(mtotal - stotal) n = int(input()) arr = [list(map(int, input().split())) for _ in range(n)] print(diagonal_difference(arr, n))
first_name = "Hannah" last_name = "Louisa" full_name = f"{first_name} {last_name}" print(full_name) print(f"Hello, {full_name.upper()}") message = f"Howdy, {full_name.title()}" print(message)
first_name = 'Hannah' last_name = 'Louisa' full_name = f'{first_name} {last_name}' print(full_name) print(f'Hello, {full_name.upper()}') message = f'Howdy, {full_name.title()}' print(message)
# # PySNMP MIB module DOCS-MCAST-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DOCS-MCAST-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 18:38:33 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, OctetString, Integer = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "OctetString", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueSizeConstraint, SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint") clabProjDocsis, = mibBuilder.importSymbols("CLAB-DEF-MIB", "clabProjDocsis") DocsSAId, DocsBpkmDataEncryptAlg = mibBuilder.importSymbols("DOCS-IETF-BPI2-MIB", "DocsSAId", "DocsBpkmDataEncryptAlg") ChSetId, Dsid = mibBuilder.importSymbols("DOCS-IF3-MIB", "ChSetId", "Dsid") CounterBasedGauge64, = mibBuilder.importSymbols("HCNUM-TC", "CounterBasedGauge64") ifIndex, InterfaceIndex = mibBuilder.importSymbols("IF-MIB", "ifIndex", "InterfaceIndex") InetAddress, InetAddressType, InetAddressPrefixLength = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType", "InetAddressPrefixLength") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") Counter64, MibIdentifier, Unsigned32, Integer32, Counter32, TimeTicks, Gauge32, IpAddress, iso, ModuleIdentity, NotificationType, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "MibIdentifier", "Unsigned32", "Integer32", "Counter32", "TimeTicks", "Gauge32", "IpAddress", "iso", "ModuleIdentity", "NotificationType", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity") RowStatus, MacAddress, TextualConvention, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "MacAddress", "TextualConvention", "TruthValue", "DisplayString") docsMcastMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18)) docsMcastMib.setRevisions(('2015-04-22 00:00', '2014-07-29 00:00', '2007-08-03 00:00', '2006-12-07 17:00',)) if mibBuilder.loadTexts: docsMcastMib.setLastUpdated('201504220000Z') if mibBuilder.loadTexts: docsMcastMib.setOrganization('Cable Television Laboratories, Inc.') docsMcastMibObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1)) docsMcastCmtsGrpCfgTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1), ) if mibBuilder.loadTexts: docsMcastCmtsGrpCfgTable.setStatus('current') docsMcastCmtsGrpCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1), ).setIndexNames((0, "DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgId")) if mibBuilder.loadTexts: docsMcastCmtsGrpCfgEntry.setStatus('current') docsMcastCmtsGrpCfgId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: docsMcastCmtsGrpCfgId.setStatus('current') docsMcastCmtsGrpCfgRulePriority = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 2), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgRulePriority.setStatus('current') docsMcastCmtsGrpCfgPrefixAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 3), InetAddressType()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgPrefixAddrType.setStatus('current') docsMcastCmtsGrpCfgSrcPrefixAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 4), InetAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgSrcPrefixAddr.setStatus('current') docsMcastCmtsGrpCfgSrcPrefixLen = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 5), InetAddressPrefixLength()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgSrcPrefixLen.setStatus('current') docsMcastCmtsGrpCfgGrpPrefixAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 6), InetAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgGrpPrefixAddr.setStatus('current') docsMcastCmtsGrpCfgGrpPrefixLen = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 7), InetAddressPrefixLength()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgGrpPrefixLen.setStatus('current') docsMcastCmtsGrpCfgTosLow = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgTosLow.setStatus('current') docsMcastCmtsGrpCfgTosHigh = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 9), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgTosHigh.setStatus('current') docsMcastCmtsGrpCfgTosMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 1)).setFixedLength(1)).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgTosMask.setStatus('current') docsMcastCmtsGrpCfgQosConfigId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 11), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgQosConfigId.setStatus('current') docsMcastCmtsGrpCfgEncryptConfigId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 12), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgEncryptConfigId.setStatus('current') docsMcastCmtsGrpCfgPhsConfigId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 13), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgPhsConfigId.setStatus('current') docsMcastCmtsGrpCfgRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 14), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpCfgRowStatus.setStatus('current') docsMcastCmtsGrpEncryptCfgTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2), ) if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgTable.setStatus('current') docsMcastCmtsGrpEncryptCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1), ).setIndexNames((0, "DOCS-MCAST-MIB", "docsMcastCmtsGrpEncryptCfgId")) if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgEntry.setStatus('current') docsMcastCmtsGrpEncryptCfgId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgId.setStatus('current') docsMcastCmtsGrpEncryptCfgCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("cmts", 1), ("mgmt", 2))).clone('mgmt')).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgCtrl.setStatus('current') docsMcastCmtsGrpEncryptCfgAlg = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1, 3), DocsBpkmDataEncryptAlg().clone('des56CbcMode')).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgAlg.setStatus('current') docsMcastCmtsGrpEncryptCfgRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgRowStatus.setStatus('current') docsMcastCmtsGrpPhsCfgTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3), ) if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgTable.setStatus('current') docsMcastCmtsGrpPhsCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1), ).setIndexNames((0, "DOCS-MCAST-MIB", "docsMcastCmtsGrpPhsCfgId")) if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgEntry.setStatus('current') docsMcastCmtsGrpPhsCfgId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgId.setStatus('current') docsMcastCmtsGrpPhsCfgPhsField = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgPhsField.setStatus('current') docsMcastCmtsGrpPhsCfgPhsMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgPhsMask.setStatus('current') docsMcastCmtsGrpPhsCfgPhsSize = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setUnits('Bytes').setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgPhsSize.setStatus('current') docsMcastCmtsGrpPhsCfgPhsVerify = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 5), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgPhsVerify.setStatus('current') docsMcastCmtsGrpPhsCfgRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgRowStatus.setStatus('current') docsMcastCmtsGrpQosCfgTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4), ) if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgTable.setStatus('current') docsMcastCmtsGrpQosCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1), ).setIndexNames((0, "DOCS-MCAST-MIB", "docsMcastCmtsGrpQosCfgId")) if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgEntry.setStatus('current') docsMcastCmtsGrpQosCfgId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgId.setStatus('current') docsMcastCmtsGrpQosCfgServiceClassName = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 2), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(1, 15)).clone(hexValue="")).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgServiceClassName.setStatus('current') docsMcastCmtsGrpQosCfgQosCtrl = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("singleSsession", 1), ("aggregateSession", 2)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgQosCtrl.setStatus('current') docsMcastCmtsGrpQosCfgAggSessLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgAggSessLimit.setStatus('current') docsMcastCmtsGrpQosCfgAppId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 5), Unsigned32()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgAppId.setStatus('current') docsMcastCmtsGrpQosCfgRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgRowStatus.setStatus('current') docsMcastCmtsReplSessTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5), ) if mibBuilder.loadTexts: docsMcastCmtsReplSessTable.setStatus('current') docsMcastCmtsReplSessEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1), ).setIndexNames((0, "DOCS-MCAST-MIB", "docsMcastCmtsReplSessPrefixAddrType"), (0, "DOCS-MCAST-MIB", "docsMcastCmtsReplSessGrpPrefix"), (0, "DOCS-MCAST-MIB", "docsMcastCmtsReplSessSrcPrefix"), (0, "DOCS-MCAST-MIB", "docsMcastCmtsReplSessMdIfIndex"), (0, "DOCS-MCAST-MIB", "docsMcastCmtsReplSessDcsId"), (0, "DOCS-MCAST-MIB", "docsMcastCmtsReplSessServiceFlowId")) if mibBuilder.loadTexts: docsMcastCmtsReplSessEntry.setStatus('current') docsMcastCmtsReplSessPrefixAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 1), InetAddressType()) if mibBuilder.loadTexts: docsMcastCmtsReplSessPrefixAddrType.setStatus('current') docsMcastCmtsReplSessGrpPrefix = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 2), InetAddress()) if mibBuilder.loadTexts: docsMcastCmtsReplSessGrpPrefix.setStatus('current') docsMcastCmtsReplSessSrcPrefix = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 3), InetAddress()) if mibBuilder.loadTexts: docsMcastCmtsReplSessSrcPrefix.setStatus('current') docsMcastCmtsReplSessMdIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 4), InterfaceIndex()) if mibBuilder.loadTexts: docsMcastCmtsReplSessMdIfIndex.setStatus('current') docsMcastCmtsReplSessDcsId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 5), ChSetId()) if mibBuilder.loadTexts: docsMcastCmtsReplSessDcsId.setStatus('current') docsMcastCmtsReplSessServiceFlowId = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295))) if mibBuilder.loadTexts: docsMcastCmtsReplSessServiceFlowId.setStatus('current') docsMcastCmtsReplSessDsid = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 7), Dsid()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastCmtsReplSessDsid.setStatus('current') docsMcastCmtsReplSessSaid = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 8), DocsSAId()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastCmtsReplSessSaid.setStatus('current') docsMcastDefGrpSvcClass = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 6)) docsMcastDefGrpSvcClassDef = MibScalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 6, 1), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 15)).clone(hexValue="")).setMaxAccess("readwrite") if mibBuilder.loadTexts: docsMcastDefGrpSvcClassDef.setStatus('current') docsMcastDsidPhsTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7), ) if mibBuilder.loadTexts: docsMcastDsidPhsTable.setStatus('current') docsMcastDsidPhsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-MCAST-MIB", "docsMcastDsidPhsDsid")) if mibBuilder.loadTexts: docsMcastDsidPhsEntry.setStatus('current') docsMcastDsidPhsDsid = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 1), Dsid()) if mibBuilder.loadTexts: docsMcastDsidPhsDsid.setStatus('current') docsMcastDsidPhsPhsField = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastDsidPhsPhsField.setStatus('current') docsMcastDsidPhsPhsMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastDsidPhsPhsMask.setStatus('current') docsMcastDsidPhsPhsSize = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastDsidPhsPhsSize.setStatus('current') docsMcastDsidPhsPhsVerify = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 5), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastDsidPhsPhsVerify.setStatus('current') docsMcastStatsTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8), ) if mibBuilder.loadTexts: docsMcastStatsTable.setStatus('current') docsMcastStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-MCAST-MIB", "docsMcastStatsGrpAddrType"), (0, "DOCS-MCAST-MIB", "docsMcastStatsGrpAddr"), (0, "DOCS-MCAST-MIB", "docsMcastStatsGrpPrefixLen"), (0, "DOCS-MCAST-MIB", "docsMcastStatsSrcAddrType"), (0, "DOCS-MCAST-MIB", "docsMcastStatsSrcAddr"), (0, "DOCS-MCAST-MIB", "docsMcastStatsSrcPrefixLen")) if mibBuilder.loadTexts: docsMcastStatsEntry.setStatus('current') docsMcastStatsGrpAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 1), InetAddressType()) if mibBuilder.loadTexts: docsMcastStatsGrpAddrType.setStatus('current') docsMcastStatsGrpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 2), InetAddress()) if mibBuilder.loadTexts: docsMcastStatsGrpAddr.setStatus('current') docsMcastStatsGrpPrefixLen = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 3), InetAddressPrefixLength()) if mibBuilder.loadTexts: docsMcastStatsGrpPrefixLen.setStatus('current') docsMcastStatsSrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 4), InetAddressType()) if mibBuilder.loadTexts: docsMcastStatsSrcAddrType.setStatus('current') docsMcastStatsSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 5), InetAddress()) if mibBuilder.loadTexts: docsMcastStatsSrcAddr.setStatus('current') docsMcastStatsSrcPrefixLen = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 6), InetAddressPrefixLength()) if mibBuilder.loadTexts: docsMcastStatsSrcPrefixLen.setStatus('current') docsMcastStatsDroppedPkts = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastStatsDroppedPkts.setStatus('current') docsMcastStatsDroppedOctets = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastStatsDroppedOctets.setStatus('current') docsMcastCpeListTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9), ) if mibBuilder.loadTexts: docsMcastCpeListTable.setStatus('current') docsMcastCpeListEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "DOCS-MCAST-MIB", "docsMcastCpeListGrpAddrType"), (0, "DOCS-MCAST-MIB", "docsMcastCpeListGrpAddr"), (0, "DOCS-MCAST-MIB", "docsMcastCpeListGrpPrefixLen"), (0, "DOCS-MCAST-MIB", "docsMcastCpeListSrcAddrType"), (0, "DOCS-MCAST-MIB", "docsMcastCpeListSrcAddr"), (0, "DOCS-MCAST-MIB", "docsMcastCpeListSrcPrefixLen"), (0, "DOCS-MCAST-MIB", "docsMcastCpeListCmMacAddr")) if mibBuilder.loadTexts: docsMcastCpeListEntry.setStatus('current') docsMcastCpeListGrpAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 1), InetAddressType()) if mibBuilder.loadTexts: docsMcastCpeListGrpAddrType.setStatus('current') docsMcastCpeListGrpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 2), InetAddress()) if mibBuilder.loadTexts: docsMcastCpeListGrpAddr.setStatus('current') docsMcastCpeListGrpPrefixLen = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 3), InetAddressPrefixLength()) if mibBuilder.loadTexts: docsMcastCpeListGrpPrefixLen.setStatus('current') docsMcastCpeListSrcAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 4), InetAddressType()) if mibBuilder.loadTexts: docsMcastCpeListSrcAddrType.setStatus('current') docsMcastCpeListSrcAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 5), InetAddress()) if mibBuilder.loadTexts: docsMcastCpeListSrcAddr.setStatus('current') docsMcastCpeListSrcPrefixLen = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 6), InetAddressPrefixLength()) if mibBuilder.loadTexts: docsMcastCpeListSrcPrefixLen.setStatus('current') docsMcastCpeListCmMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 7), MacAddress()) if mibBuilder.loadTexts: docsMcastCpeListCmMacAddr.setStatus('current') docsMcastCpeListDsid = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 8), Dsid()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastCpeListDsid.setStatus('current') docsMcastCpeListCpeMacAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 9), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastCpeListCpeMacAddr.setStatus('current') docsMcastCpeListCpeIpAddrType = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 10), InetAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastCpeListCpeIpAddrType.setStatus('current') docsMcastCpeListCpeIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 11), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastCpeListCpeIpAddr.setStatus('current') docsMcastBandwidthTable = MibTable((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10), ) if mibBuilder.loadTexts: docsMcastBandwidthTable.setStatus('current') docsMcastBandwidthEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: docsMcastBandwidthEntry.setStatus('current') docsMcastBandwidthAdmittedAggrBW = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10, 1, 1), CounterBasedGauge64()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastBandwidthAdmittedAggrBW.setStatus('current') docsMcastBandwidthAdmittedAggrLowWater = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10, 1, 2), CounterBasedGauge64()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastBandwidthAdmittedAggrLowWater.setStatus('current') docsMcastBandwidthAdmittedAggrHighWater = MibTableColumn((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10, 1, 3), CounterBasedGauge64()).setMaxAccess("readonly") if mibBuilder.loadTexts: docsMcastBandwidthAdmittedAggrHighWater.setStatus('current') docsMcastMibConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2)) docsMcastMibCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2, 1)) docsMcastMibGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2, 2)) docsMcastCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2, 1, 1)).setObjects(("DOCS-MCAST-MIB", "docsMcastGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): docsMcastCompliance = docsMcastCompliance.setStatus('current') docsMcastGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2, 2, 1)).setObjects(("DOCS-MCAST-MIB", "docsMcastCmtsReplSessDsid"), ("DOCS-MCAST-MIB", "docsMcastCmtsReplSessSaid"), ("DOCS-MCAST-MIB", "docsMcastDefGrpSvcClassDef"), ("DOCS-MCAST-MIB", "docsMcastDsidPhsPhsField"), ("DOCS-MCAST-MIB", "docsMcastDsidPhsPhsMask"), ("DOCS-MCAST-MIB", "docsMcastDsidPhsPhsSize"), ("DOCS-MCAST-MIB", "docsMcastDsidPhsPhsVerify"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgRulePriority"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgPrefixAddrType"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgSrcPrefixAddr"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgSrcPrefixLen"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgGrpPrefixAddr"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgGrpPrefixLen"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgTosLow"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgTosHigh"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgTosMask"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgQosConfigId"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgEncryptConfigId"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgPhsConfigId"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpCfgRowStatus"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpQosCfgServiceClassName"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpQosCfgQosCtrl"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpQosCfgAggSessLimit"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpQosCfgAppId"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpQosCfgRowStatus"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpEncryptCfgCtrl"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpEncryptCfgAlg"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpEncryptCfgRowStatus"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpPhsCfgPhsField"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpPhsCfgPhsMask"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpPhsCfgPhsSize"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpPhsCfgPhsVerify"), ("DOCS-MCAST-MIB", "docsMcastCmtsGrpPhsCfgRowStatus"), ("DOCS-MCAST-MIB", "docsMcastStatsDroppedPkts"), ("DOCS-MCAST-MIB", "docsMcastStatsDroppedOctets"), ("DOCS-MCAST-MIB", "docsMcastCpeListDsid"), ("DOCS-MCAST-MIB", "docsMcastCpeListCpeMacAddr"), ("DOCS-MCAST-MIB", "docsMcastCpeListCpeIpAddrType"), ("DOCS-MCAST-MIB", "docsMcastCpeListCpeIpAddr"), ("DOCS-MCAST-MIB", "docsMcastBandwidthAdmittedAggrBW"), ("DOCS-MCAST-MIB", "docsMcastBandwidthAdmittedAggrLowWater"), ("DOCS-MCAST-MIB", "docsMcastBandwidthAdmittedAggrHighWater")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): docsMcastGroup = docsMcastGroup.setStatus('current') mibBuilder.exportSymbols("DOCS-MCAST-MIB", docsMcastCmtsGrpEncryptCfgCtrl=docsMcastCmtsGrpEncryptCfgCtrl, docsMcastCpeListDsid=docsMcastCpeListDsid, docsMcastCmtsReplSessDsid=docsMcastCmtsReplSessDsid, docsMcastDsidPhsDsid=docsMcastDsidPhsDsid, docsMcastDsidPhsPhsMask=docsMcastDsidPhsPhsMask, docsMcastCpeListCmMacAddr=docsMcastCpeListCmMacAddr, docsMcastCmtsGrpEncryptCfgTable=docsMcastCmtsGrpEncryptCfgTable, docsMcastStatsDroppedOctets=docsMcastStatsDroppedOctets, docsMcastCmtsReplSessServiceFlowId=docsMcastCmtsReplSessServiceFlowId, docsMcastCpeListSrcAddrType=docsMcastCpeListSrcAddrType, docsMcastCmtsGrpCfgRowStatus=docsMcastCmtsGrpCfgRowStatus, docsMcastCmtsGrpEncryptCfgAlg=docsMcastCmtsGrpEncryptCfgAlg, docsMcastGroup=docsMcastGroup, docsMcastCmtsReplSessMdIfIndex=docsMcastCmtsReplSessMdIfIndex, docsMcastCmtsGrpCfgTosHigh=docsMcastCmtsGrpCfgTosHigh, docsMcastCmtsGrpEncryptCfgId=docsMcastCmtsGrpEncryptCfgId, docsMcastCmtsGrpCfgQosConfigId=docsMcastCmtsGrpCfgQosConfigId, docsMcastCmtsGrpPhsCfgRowStatus=docsMcastCmtsGrpPhsCfgRowStatus, docsMcastMibObjects=docsMcastMibObjects, docsMcastStatsGrpAddr=docsMcastStatsGrpAddr, docsMcastCmtsGrpQosCfgAppId=docsMcastCmtsGrpQosCfgAppId, docsMcastCmtsGrpQosCfgEntry=docsMcastCmtsGrpQosCfgEntry, docsMcastCpeListGrpPrefixLen=docsMcastCpeListGrpPrefixLen, docsMcastDsidPhsTable=docsMcastDsidPhsTable, docsMcastCmtsReplSessDcsId=docsMcastCmtsReplSessDcsId, docsMcastCmtsGrpPhsCfgPhsSize=docsMcastCmtsGrpPhsCfgPhsSize, docsMcastCmtsGrpCfgGrpPrefixAddr=docsMcastCmtsGrpCfgGrpPrefixAddr, docsMcastCmtsGrpCfgSrcPrefixAddr=docsMcastCmtsGrpCfgSrcPrefixAddr, docsMcastMibGroups=docsMcastMibGroups, docsMcastCmtsReplSessPrefixAddrType=docsMcastCmtsReplSessPrefixAddrType, docsMcastStatsSrcAddrType=docsMcastStatsSrcAddrType, docsMcastCmtsGrpCfgGrpPrefixLen=docsMcastCmtsGrpCfgGrpPrefixLen, docsMcastCmtsGrpCfgPrefixAddrType=docsMcastCmtsGrpCfgPrefixAddrType, docsMcastDsidPhsPhsSize=docsMcastDsidPhsPhsSize, docsMcastCmtsGrpPhsCfgPhsField=docsMcastCmtsGrpPhsCfgPhsField, docsMcastStatsSrcAddr=docsMcastStatsSrcAddr, docsMcastCmtsGrpCfgTosMask=docsMcastCmtsGrpCfgTosMask, docsMcastDsidPhsEntry=docsMcastDsidPhsEntry, docsMcastCmtsReplSessSrcPrefix=docsMcastCmtsReplSessSrcPrefix, docsMcastCmtsGrpCfgRulePriority=docsMcastCmtsGrpCfgRulePriority, docsMcastCmtsGrpQosCfgTable=docsMcastCmtsGrpQosCfgTable, docsMcastCmtsGrpQosCfgServiceClassName=docsMcastCmtsGrpQosCfgServiceClassName, docsMcastMib=docsMcastMib, docsMcastCmtsGrpCfgId=docsMcastCmtsGrpCfgId, docsMcastCmtsGrpPhsCfgId=docsMcastCmtsGrpPhsCfgId, docsMcastCmtsGrpQosCfgId=docsMcastCmtsGrpQosCfgId, docsMcastCmtsReplSessSaid=docsMcastCmtsReplSessSaid, docsMcastCmtsGrpQosCfgRowStatus=docsMcastCmtsGrpQosCfgRowStatus, docsMcastCmtsReplSessEntry=docsMcastCmtsReplSessEntry, docsMcastCmtsGrpEncryptCfgRowStatus=docsMcastCmtsGrpEncryptCfgRowStatus, docsMcastCpeListGrpAddrType=docsMcastCpeListGrpAddrType, docsMcastStatsTable=docsMcastStatsTable, docsMcastDsidPhsPhsField=docsMcastDsidPhsPhsField, docsMcastCmtsGrpQosCfgQosCtrl=docsMcastCmtsGrpQosCfgQosCtrl, docsMcastStatsDroppedPkts=docsMcastStatsDroppedPkts, docsMcastBandwidthAdmittedAggrBW=docsMcastBandwidthAdmittedAggrBW, docsMcastCmtsGrpCfgSrcPrefixLen=docsMcastCmtsGrpCfgSrcPrefixLen, docsMcastCmtsGrpPhsCfgEntry=docsMcastCmtsGrpPhsCfgEntry, docsMcastMibConformance=docsMcastMibConformance, docsMcastCmtsGrpCfgPhsConfigId=docsMcastCmtsGrpCfgPhsConfigId, docsMcastBandwidthEntry=docsMcastBandwidthEntry, docsMcastCmtsReplSessTable=docsMcastCmtsReplSessTable, docsMcastCpeListSrcPrefixLen=docsMcastCpeListSrcPrefixLen, docsMcastCpeListCpeIpAddrType=docsMcastCpeListCpeIpAddrType, docsMcastStatsGrpAddrType=docsMcastStatsGrpAddrType, docsMcastCmtsReplSessGrpPrefix=docsMcastCmtsReplSessGrpPrefix, PYSNMP_MODULE_ID=docsMcastMib, docsMcastCmtsGrpEncryptCfgEntry=docsMcastCmtsGrpEncryptCfgEntry, docsMcastStatsEntry=docsMcastStatsEntry, docsMcastCpeListGrpAddr=docsMcastCpeListGrpAddr, docsMcastCmtsGrpQosCfgAggSessLimit=docsMcastCmtsGrpQosCfgAggSessLimit, docsMcastCpeListSrcAddr=docsMcastCpeListSrcAddr, docsMcastCmtsGrpCfgTable=docsMcastCmtsGrpCfgTable, docsMcastCpeListTable=docsMcastCpeListTable, docsMcastDefGrpSvcClassDef=docsMcastDefGrpSvcClassDef, docsMcastCmtsGrpPhsCfgPhsMask=docsMcastCmtsGrpPhsCfgPhsMask, docsMcastStatsGrpPrefixLen=docsMcastStatsGrpPrefixLen, docsMcastCmtsGrpCfgTosLow=docsMcastCmtsGrpCfgTosLow, docsMcastDsidPhsPhsVerify=docsMcastDsidPhsPhsVerify, docsMcastMibCompliances=docsMcastMibCompliances, docsMcastCompliance=docsMcastCompliance, docsMcastCmtsGrpPhsCfgTable=docsMcastCmtsGrpPhsCfgTable, docsMcastDefGrpSvcClass=docsMcastDefGrpSvcClass, docsMcastCpeListCpeMacAddr=docsMcastCpeListCpeMacAddr, docsMcastBandwidthTable=docsMcastBandwidthTable, docsMcastCmtsGrpPhsCfgPhsVerify=docsMcastCmtsGrpPhsCfgPhsVerify, docsMcastCpeListCpeIpAddr=docsMcastCpeListCpeIpAddr, docsMcastCmtsGrpCfgEntry=docsMcastCmtsGrpCfgEntry, docsMcastBandwidthAdmittedAggrLowWater=docsMcastBandwidthAdmittedAggrLowWater, docsMcastCpeListEntry=docsMcastCpeListEntry, docsMcastStatsSrcPrefixLen=docsMcastStatsSrcPrefixLen, docsMcastBandwidthAdmittedAggrHighWater=docsMcastBandwidthAdmittedAggrHighWater, docsMcastCmtsGrpCfgEncryptConfigId=docsMcastCmtsGrpCfgEncryptConfigId)
(object_identifier, octet_string, integer) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'OctetString', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_size_constraint, single_value_constraint, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint') (clab_proj_docsis,) = mibBuilder.importSymbols('CLAB-DEF-MIB', 'clabProjDocsis') (docs_sa_id, docs_bpkm_data_encrypt_alg) = mibBuilder.importSymbols('DOCS-IETF-BPI2-MIB', 'DocsSAId', 'DocsBpkmDataEncryptAlg') (ch_set_id, dsid) = mibBuilder.importSymbols('DOCS-IF3-MIB', 'ChSetId', 'Dsid') (counter_based_gauge64,) = mibBuilder.importSymbols('HCNUM-TC', 'CounterBasedGauge64') (if_index, interface_index) = mibBuilder.importSymbols('IF-MIB', 'ifIndex', 'InterfaceIndex') (inet_address, inet_address_type, inet_address_prefix_length) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddress', 'InetAddressType', 'InetAddressPrefixLength') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (counter64, mib_identifier, unsigned32, integer32, counter32, time_ticks, gauge32, ip_address, iso, module_identity, notification_type, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'MibIdentifier', 'Unsigned32', 'Integer32', 'Counter32', 'TimeTicks', 'Gauge32', 'IpAddress', 'iso', 'ModuleIdentity', 'NotificationType', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity') (row_status, mac_address, textual_convention, truth_value, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'MacAddress', 'TextualConvention', 'TruthValue', 'DisplayString') docs_mcast_mib = module_identity((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18)) docsMcastMib.setRevisions(('2015-04-22 00:00', '2014-07-29 00:00', '2007-08-03 00:00', '2006-12-07 17:00')) if mibBuilder.loadTexts: docsMcastMib.setLastUpdated('201504220000Z') if mibBuilder.loadTexts: docsMcastMib.setOrganization('Cable Television Laboratories, Inc.') docs_mcast_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1)) docs_mcast_cmts_grp_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1)) if mibBuilder.loadTexts: docsMcastCmtsGrpCfgTable.setStatus('current') docs_mcast_cmts_grp_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1)).setIndexNames((0, 'DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgId')) if mibBuilder.loadTexts: docsMcastCmtsGrpCfgEntry.setStatus('current') docs_mcast_cmts_grp_cfg_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: docsMcastCmtsGrpCfgId.setStatus('current') docs_mcast_cmts_grp_cfg_rule_priority = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 2), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgRulePriority.setStatus('current') docs_mcast_cmts_grp_cfg_prefix_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 3), inet_address_type()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgPrefixAddrType.setStatus('current') docs_mcast_cmts_grp_cfg_src_prefix_addr = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 4), inet_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgSrcPrefixAddr.setStatus('current') docs_mcast_cmts_grp_cfg_src_prefix_len = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 5), inet_address_prefix_length()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgSrcPrefixLen.setStatus('current') docs_mcast_cmts_grp_cfg_grp_prefix_addr = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 6), inet_address()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgGrpPrefixAddr.setStatus('current') docs_mcast_cmts_grp_cfg_grp_prefix_len = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 7), inet_address_prefix_length()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgGrpPrefixLen.setStatus('current') docs_mcast_cmts_grp_cfg_tos_low = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgTosLow.setStatus('current') docs_mcast_cmts_grp_cfg_tos_high = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 9), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgTosHigh.setStatus('current') docs_mcast_cmts_grp_cfg_tos_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 10), octet_string().subtype(subtypeSpec=value_size_constraint(1, 1)).setFixedLength(1)).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgTosMask.setStatus('current') docs_mcast_cmts_grp_cfg_qos_config_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 11), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgQosConfigId.setStatus('current') docs_mcast_cmts_grp_cfg_encrypt_config_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 12), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgEncryptConfigId.setStatus('current') docs_mcast_cmts_grp_cfg_phs_config_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 13), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgPhsConfigId.setStatus('current') docs_mcast_cmts_grp_cfg_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 1, 1, 14), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpCfgRowStatus.setStatus('current') docs_mcast_cmts_grp_encrypt_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2)) if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgTable.setStatus('current') docs_mcast_cmts_grp_encrypt_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1)).setIndexNames((0, 'DOCS-MCAST-MIB', 'docsMcastCmtsGrpEncryptCfgId')) if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgEntry.setStatus('current') docs_mcast_cmts_grp_encrypt_cfg_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgId.setStatus('current') docs_mcast_cmts_grp_encrypt_cfg_ctrl = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('cmts', 1), ('mgmt', 2))).clone('mgmt')).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgCtrl.setStatus('current') docs_mcast_cmts_grp_encrypt_cfg_alg = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1, 3), docs_bpkm_data_encrypt_alg().clone('des56CbcMode')).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgAlg.setStatus('current') docs_mcast_cmts_grp_encrypt_cfg_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 2, 1, 4), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpEncryptCfgRowStatus.setStatus('current') docs_mcast_cmts_grp_phs_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3)) if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgTable.setStatus('current') docs_mcast_cmts_grp_phs_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1)).setIndexNames((0, 'DOCS-MCAST-MIB', 'docsMcastCmtsGrpPhsCfgId')) if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgEntry.setStatus('current') docs_mcast_cmts_grp_phs_cfg_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgId.setStatus('current') docs_mcast_cmts_grp_phs_cfg_phs_field = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgPhsField.setStatus('current') docs_mcast_cmts_grp_phs_cfg_phs_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgPhsMask.setStatus('current') docs_mcast_cmts_grp_phs_cfg_phs_size = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255))).setUnits('Bytes').setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgPhsSize.setStatus('current') docs_mcast_cmts_grp_phs_cfg_phs_verify = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 5), truth_value().clone('false')).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgPhsVerify.setStatus('current') docs_mcast_cmts_grp_phs_cfg_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 3, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpPhsCfgRowStatus.setStatus('current') docs_mcast_cmts_grp_qos_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4)) if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgTable.setStatus('current') docs_mcast_cmts_grp_qos_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1)).setIndexNames((0, 'DOCS-MCAST-MIB', 'docsMcastCmtsGrpQosCfgId')) if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgEntry.setStatus('current') docs_mcast_cmts_grp_qos_cfg_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgId.setStatus('current') docs_mcast_cmts_grp_qos_cfg_service_class_name = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 2), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(1, 15)).clone(hexValue='')).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgServiceClassName.setStatus('current') docs_mcast_cmts_grp_qos_cfg_qos_ctrl = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('singleSsession', 1), ('aggregateSession', 2)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgQosCtrl.setStatus('current') docs_mcast_cmts_grp_qos_cfg_agg_sess_limit = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgAggSessLimit.setStatus('current') docs_mcast_cmts_grp_qos_cfg_app_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 5), unsigned32()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgAppId.setStatus('current') docs_mcast_cmts_grp_qos_cfg_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 4, 1, 6), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: docsMcastCmtsGrpQosCfgRowStatus.setStatus('current') docs_mcast_cmts_repl_sess_table = mib_table((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5)) if mibBuilder.loadTexts: docsMcastCmtsReplSessTable.setStatus('current') docs_mcast_cmts_repl_sess_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1)).setIndexNames((0, 'DOCS-MCAST-MIB', 'docsMcastCmtsReplSessPrefixAddrType'), (0, 'DOCS-MCAST-MIB', 'docsMcastCmtsReplSessGrpPrefix'), (0, 'DOCS-MCAST-MIB', 'docsMcastCmtsReplSessSrcPrefix'), (0, 'DOCS-MCAST-MIB', 'docsMcastCmtsReplSessMdIfIndex'), (0, 'DOCS-MCAST-MIB', 'docsMcastCmtsReplSessDcsId'), (0, 'DOCS-MCAST-MIB', 'docsMcastCmtsReplSessServiceFlowId')) if mibBuilder.loadTexts: docsMcastCmtsReplSessEntry.setStatus('current') docs_mcast_cmts_repl_sess_prefix_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 1), inet_address_type()) if mibBuilder.loadTexts: docsMcastCmtsReplSessPrefixAddrType.setStatus('current') docs_mcast_cmts_repl_sess_grp_prefix = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 2), inet_address()) if mibBuilder.loadTexts: docsMcastCmtsReplSessGrpPrefix.setStatus('current') docs_mcast_cmts_repl_sess_src_prefix = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 3), inet_address()) if mibBuilder.loadTexts: docsMcastCmtsReplSessSrcPrefix.setStatus('current') docs_mcast_cmts_repl_sess_md_if_index = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 4), interface_index()) if mibBuilder.loadTexts: docsMcastCmtsReplSessMdIfIndex.setStatus('current') docs_mcast_cmts_repl_sess_dcs_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 5), ch_set_id()) if mibBuilder.loadTexts: docsMcastCmtsReplSessDcsId.setStatus('current') docs_mcast_cmts_repl_sess_service_flow_id = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 6), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 4294967295))) if mibBuilder.loadTexts: docsMcastCmtsReplSessServiceFlowId.setStatus('current') docs_mcast_cmts_repl_sess_dsid = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 7), dsid()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastCmtsReplSessDsid.setStatus('current') docs_mcast_cmts_repl_sess_said = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 5, 1, 8), docs_sa_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastCmtsReplSessSaid.setStatus('current') docs_mcast_def_grp_svc_class = mib_identifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 6)) docs_mcast_def_grp_svc_class_def = mib_scalar((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 6, 1), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 15)).clone(hexValue='')).setMaxAccess('readwrite') if mibBuilder.loadTexts: docsMcastDefGrpSvcClassDef.setStatus('current') docs_mcast_dsid_phs_table = mib_table((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7)) if mibBuilder.loadTexts: docsMcastDsidPhsTable.setStatus('current') docs_mcast_dsid_phs_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DOCS-MCAST-MIB', 'docsMcastDsidPhsDsid')) if mibBuilder.loadTexts: docsMcastDsidPhsEntry.setStatus('current') docs_mcast_dsid_phs_dsid = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 1), dsid()) if mibBuilder.loadTexts: docsMcastDsidPhsDsid.setStatus('current') docs_mcast_dsid_phs_phs_field = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastDsidPhsPhsField.setStatus('current') docs_mcast_dsid_phs_phs_mask = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastDsidPhsPhsMask.setStatus('current') docs_mcast_dsid_phs_phs_size = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastDsidPhsPhsSize.setStatus('current') docs_mcast_dsid_phs_phs_verify = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 7, 1, 5), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastDsidPhsPhsVerify.setStatus('current') docs_mcast_stats_table = mib_table((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8)) if mibBuilder.loadTexts: docsMcastStatsTable.setStatus('current') docs_mcast_stats_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DOCS-MCAST-MIB', 'docsMcastStatsGrpAddrType'), (0, 'DOCS-MCAST-MIB', 'docsMcastStatsGrpAddr'), (0, 'DOCS-MCAST-MIB', 'docsMcastStatsGrpPrefixLen'), (0, 'DOCS-MCAST-MIB', 'docsMcastStatsSrcAddrType'), (0, 'DOCS-MCAST-MIB', 'docsMcastStatsSrcAddr'), (0, 'DOCS-MCAST-MIB', 'docsMcastStatsSrcPrefixLen')) if mibBuilder.loadTexts: docsMcastStatsEntry.setStatus('current') docs_mcast_stats_grp_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 1), inet_address_type()) if mibBuilder.loadTexts: docsMcastStatsGrpAddrType.setStatus('current') docs_mcast_stats_grp_addr = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 2), inet_address()) if mibBuilder.loadTexts: docsMcastStatsGrpAddr.setStatus('current') docs_mcast_stats_grp_prefix_len = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 3), inet_address_prefix_length()) if mibBuilder.loadTexts: docsMcastStatsGrpPrefixLen.setStatus('current') docs_mcast_stats_src_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 4), inet_address_type()) if mibBuilder.loadTexts: docsMcastStatsSrcAddrType.setStatus('current') docs_mcast_stats_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 5), inet_address()) if mibBuilder.loadTexts: docsMcastStatsSrcAddr.setStatus('current') docs_mcast_stats_src_prefix_len = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 6), inet_address_prefix_length()) if mibBuilder.loadTexts: docsMcastStatsSrcPrefixLen.setStatus('current') docs_mcast_stats_dropped_pkts = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 7), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastStatsDroppedPkts.setStatus('current') docs_mcast_stats_dropped_octets = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 8, 1, 8), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastStatsDroppedOctets.setStatus('current') docs_mcast_cpe_list_table = mib_table((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9)) if mibBuilder.loadTexts: docsMcastCpeListTable.setStatus('current') docs_mcast_cpe_list_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'DOCS-MCAST-MIB', 'docsMcastCpeListGrpAddrType'), (0, 'DOCS-MCAST-MIB', 'docsMcastCpeListGrpAddr'), (0, 'DOCS-MCAST-MIB', 'docsMcastCpeListGrpPrefixLen'), (0, 'DOCS-MCAST-MIB', 'docsMcastCpeListSrcAddrType'), (0, 'DOCS-MCAST-MIB', 'docsMcastCpeListSrcAddr'), (0, 'DOCS-MCAST-MIB', 'docsMcastCpeListSrcPrefixLen'), (0, 'DOCS-MCAST-MIB', 'docsMcastCpeListCmMacAddr')) if mibBuilder.loadTexts: docsMcastCpeListEntry.setStatus('current') docs_mcast_cpe_list_grp_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 1), inet_address_type()) if mibBuilder.loadTexts: docsMcastCpeListGrpAddrType.setStatus('current') docs_mcast_cpe_list_grp_addr = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 2), inet_address()) if mibBuilder.loadTexts: docsMcastCpeListGrpAddr.setStatus('current') docs_mcast_cpe_list_grp_prefix_len = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 3), inet_address_prefix_length()) if mibBuilder.loadTexts: docsMcastCpeListGrpPrefixLen.setStatus('current') docs_mcast_cpe_list_src_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 4), inet_address_type()) if mibBuilder.loadTexts: docsMcastCpeListSrcAddrType.setStatus('current') docs_mcast_cpe_list_src_addr = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 5), inet_address()) if mibBuilder.loadTexts: docsMcastCpeListSrcAddr.setStatus('current') docs_mcast_cpe_list_src_prefix_len = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 6), inet_address_prefix_length()) if mibBuilder.loadTexts: docsMcastCpeListSrcPrefixLen.setStatus('current') docs_mcast_cpe_list_cm_mac_addr = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 7), mac_address()) if mibBuilder.loadTexts: docsMcastCpeListCmMacAddr.setStatus('current') docs_mcast_cpe_list_dsid = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 8), dsid()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastCpeListDsid.setStatus('current') docs_mcast_cpe_list_cpe_mac_addr = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 9), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastCpeListCpeMacAddr.setStatus('current') docs_mcast_cpe_list_cpe_ip_addr_type = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 10), inet_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastCpeListCpeIpAddrType.setStatus('current') docs_mcast_cpe_list_cpe_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 9, 1, 11), inet_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastCpeListCpeIpAddr.setStatus('current') docs_mcast_bandwidth_table = mib_table((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10)) if mibBuilder.loadTexts: docsMcastBandwidthTable.setStatus('current') docs_mcast_bandwidth_entry = mib_table_row((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: docsMcastBandwidthEntry.setStatus('current') docs_mcast_bandwidth_admitted_aggr_bw = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10, 1, 1), counter_based_gauge64()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastBandwidthAdmittedAggrBW.setStatus('current') docs_mcast_bandwidth_admitted_aggr_low_water = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10, 1, 2), counter_based_gauge64()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastBandwidthAdmittedAggrLowWater.setStatus('current') docs_mcast_bandwidth_admitted_aggr_high_water = mib_table_column((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 1, 10, 1, 3), counter_based_gauge64()).setMaxAccess('readonly') if mibBuilder.loadTexts: docsMcastBandwidthAdmittedAggrHighWater.setStatus('current') docs_mcast_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2)) docs_mcast_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2, 1)) docs_mcast_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2, 2)) docs_mcast_compliance = module_compliance((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2, 1, 1)).setObjects(('DOCS-MCAST-MIB', 'docsMcastGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): docs_mcast_compliance = docsMcastCompliance.setStatus('current') docs_mcast_group = object_group((1, 3, 6, 1, 4, 1, 4491, 2, 1, 18, 2, 2, 1)).setObjects(('DOCS-MCAST-MIB', 'docsMcastCmtsReplSessDsid'), ('DOCS-MCAST-MIB', 'docsMcastCmtsReplSessSaid'), ('DOCS-MCAST-MIB', 'docsMcastDefGrpSvcClassDef'), ('DOCS-MCAST-MIB', 'docsMcastDsidPhsPhsField'), ('DOCS-MCAST-MIB', 'docsMcastDsidPhsPhsMask'), ('DOCS-MCAST-MIB', 'docsMcastDsidPhsPhsSize'), ('DOCS-MCAST-MIB', 'docsMcastDsidPhsPhsVerify'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgRulePriority'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgPrefixAddrType'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgSrcPrefixAddr'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgSrcPrefixLen'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgGrpPrefixAddr'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgGrpPrefixLen'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgTosLow'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgTosHigh'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgTosMask'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgQosConfigId'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgEncryptConfigId'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgPhsConfigId'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpCfgRowStatus'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpQosCfgServiceClassName'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpQosCfgQosCtrl'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpQosCfgAggSessLimit'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpQosCfgAppId'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpQosCfgRowStatus'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpEncryptCfgCtrl'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpEncryptCfgAlg'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpEncryptCfgRowStatus'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpPhsCfgPhsField'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpPhsCfgPhsMask'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpPhsCfgPhsSize'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpPhsCfgPhsVerify'), ('DOCS-MCAST-MIB', 'docsMcastCmtsGrpPhsCfgRowStatus'), ('DOCS-MCAST-MIB', 'docsMcastStatsDroppedPkts'), ('DOCS-MCAST-MIB', 'docsMcastStatsDroppedOctets'), ('DOCS-MCAST-MIB', 'docsMcastCpeListDsid'), ('DOCS-MCAST-MIB', 'docsMcastCpeListCpeMacAddr'), ('DOCS-MCAST-MIB', 'docsMcastCpeListCpeIpAddrType'), ('DOCS-MCAST-MIB', 'docsMcastCpeListCpeIpAddr'), ('DOCS-MCAST-MIB', 'docsMcastBandwidthAdmittedAggrBW'), ('DOCS-MCAST-MIB', 'docsMcastBandwidthAdmittedAggrLowWater'), ('DOCS-MCAST-MIB', 'docsMcastBandwidthAdmittedAggrHighWater')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): docs_mcast_group = docsMcastGroup.setStatus('current') mibBuilder.exportSymbols('DOCS-MCAST-MIB', docsMcastCmtsGrpEncryptCfgCtrl=docsMcastCmtsGrpEncryptCfgCtrl, docsMcastCpeListDsid=docsMcastCpeListDsid, docsMcastCmtsReplSessDsid=docsMcastCmtsReplSessDsid, docsMcastDsidPhsDsid=docsMcastDsidPhsDsid, docsMcastDsidPhsPhsMask=docsMcastDsidPhsPhsMask, docsMcastCpeListCmMacAddr=docsMcastCpeListCmMacAddr, docsMcastCmtsGrpEncryptCfgTable=docsMcastCmtsGrpEncryptCfgTable, docsMcastStatsDroppedOctets=docsMcastStatsDroppedOctets, docsMcastCmtsReplSessServiceFlowId=docsMcastCmtsReplSessServiceFlowId, docsMcastCpeListSrcAddrType=docsMcastCpeListSrcAddrType, docsMcastCmtsGrpCfgRowStatus=docsMcastCmtsGrpCfgRowStatus, docsMcastCmtsGrpEncryptCfgAlg=docsMcastCmtsGrpEncryptCfgAlg, docsMcastGroup=docsMcastGroup, docsMcastCmtsReplSessMdIfIndex=docsMcastCmtsReplSessMdIfIndex, docsMcastCmtsGrpCfgTosHigh=docsMcastCmtsGrpCfgTosHigh, docsMcastCmtsGrpEncryptCfgId=docsMcastCmtsGrpEncryptCfgId, docsMcastCmtsGrpCfgQosConfigId=docsMcastCmtsGrpCfgQosConfigId, docsMcastCmtsGrpPhsCfgRowStatus=docsMcastCmtsGrpPhsCfgRowStatus, docsMcastMibObjects=docsMcastMibObjects, docsMcastStatsGrpAddr=docsMcastStatsGrpAddr, docsMcastCmtsGrpQosCfgAppId=docsMcastCmtsGrpQosCfgAppId, docsMcastCmtsGrpQosCfgEntry=docsMcastCmtsGrpQosCfgEntry, docsMcastCpeListGrpPrefixLen=docsMcastCpeListGrpPrefixLen, docsMcastDsidPhsTable=docsMcastDsidPhsTable, docsMcastCmtsReplSessDcsId=docsMcastCmtsReplSessDcsId, docsMcastCmtsGrpPhsCfgPhsSize=docsMcastCmtsGrpPhsCfgPhsSize, docsMcastCmtsGrpCfgGrpPrefixAddr=docsMcastCmtsGrpCfgGrpPrefixAddr, docsMcastCmtsGrpCfgSrcPrefixAddr=docsMcastCmtsGrpCfgSrcPrefixAddr, docsMcastMibGroups=docsMcastMibGroups, docsMcastCmtsReplSessPrefixAddrType=docsMcastCmtsReplSessPrefixAddrType, docsMcastStatsSrcAddrType=docsMcastStatsSrcAddrType, docsMcastCmtsGrpCfgGrpPrefixLen=docsMcastCmtsGrpCfgGrpPrefixLen, docsMcastCmtsGrpCfgPrefixAddrType=docsMcastCmtsGrpCfgPrefixAddrType, docsMcastDsidPhsPhsSize=docsMcastDsidPhsPhsSize, docsMcastCmtsGrpPhsCfgPhsField=docsMcastCmtsGrpPhsCfgPhsField, docsMcastStatsSrcAddr=docsMcastStatsSrcAddr, docsMcastCmtsGrpCfgTosMask=docsMcastCmtsGrpCfgTosMask, docsMcastDsidPhsEntry=docsMcastDsidPhsEntry, docsMcastCmtsReplSessSrcPrefix=docsMcastCmtsReplSessSrcPrefix, docsMcastCmtsGrpCfgRulePriority=docsMcastCmtsGrpCfgRulePriority, docsMcastCmtsGrpQosCfgTable=docsMcastCmtsGrpQosCfgTable, docsMcastCmtsGrpQosCfgServiceClassName=docsMcastCmtsGrpQosCfgServiceClassName, docsMcastMib=docsMcastMib, docsMcastCmtsGrpCfgId=docsMcastCmtsGrpCfgId, docsMcastCmtsGrpPhsCfgId=docsMcastCmtsGrpPhsCfgId, docsMcastCmtsGrpQosCfgId=docsMcastCmtsGrpQosCfgId, docsMcastCmtsReplSessSaid=docsMcastCmtsReplSessSaid, docsMcastCmtsGrpQosCfgRowStatus=docsMcastCmtsGrpQosCfgRowStatus, docsMcastCmtsReplSessEntry=docsMcastCmtsReplSessEntry, docsMcastCmtsGrpEncryptCfgRowStatus=docsMcastCmtsGrpEncryptCfgRowStatus, docsMcastCpeListGrpAddrType=docsMcastCpeListGrpAddrType, docsMcastStatsTable=docsMcastStatsTable, docsMcastDsidPhsPhsField=docsMcastDsidPhsPhsField, docsMcastCmtsGrpQosCfgQosCtrl=docsMcastCmtsGrpQosCfgQosCtrl, docsMcastStatsDroppedPkts=docsMcastStatsDroppedPkts, docsMcastBandwidthAdmittedAggrBW=docsMcastBandwidthAdmittedAggrBW, docsMcastCmtsGrpCfgSrcPrefixLen=docsMcastCmtsGrpCfgSrcPrefixLen, docsMcastCmtsGrpPhsCfgEntry=docsMcastCmtsGrpPhsCfgEntry, docsMcastMibConformance=docsMcastMibConformance, docsMcastCmtsGrpCfgPhsConfigId=docsMcastCmtsGrpCfgPhsConfigId, docsMcastBandwidthEntry=docsMcastBandwidthEntry, docsMcastCmtsReplSessTable=docsMcastCmtsReplSessTable, docsMcastCpeListSrcPrefixLen=docsMcastCpeListSrcPrefixLen, docsMcastCpeListCpeIpAddrType=docsMcastCpeListCpeIpAddrType, docsMcastStatsGrpAddrType=docsMcastStatsGrpAddrType, docsMcastCmtsReplSessGrpPrefix=docsMcastCmtsReplSessGrpPrefix, PYSNMP_MODULE_ID=docsMcastMib, docsMcastCmtsGrpEncryptCfgEntry=docsMcastCmtsGrpEncryptCfgEntry, docsMcastStatsEntry=docsMcastStatsEntry, docsMcastCpeListGrpAddr=docsMcastCpeListGrpAddr, docsMcastCmtsGrpQosCfgAggSessLimit=docsMcastCmtsGrpQosCfgAggSessLimit, docsMcastCpeListSrcAddr=docsMcastCpeListSrcAddr, docsMcastCmtsGrpCfgTable=docsMcastCmtsGrpCfgTable, docsMcastCpeListTable=docsMcastCpeListTable, docsMcastDefGrpSvcClassDef=docsMcastDefGrpSvcClassDef, docsMcastCmtsGrpPhsCfgPhsMask=docsMcastCmtsGrpPhsCfgPhsMask, docsMcastStatsGrpPrefixLen=docsMcastStatsGrpPrefixLen, docsMcastCmtsGrpCfgTosLow=docsMcastCmtsGrpCfgTosLow, docsMcastDsidPhsPhsVerify=docsMcastDsidPhsPhsVerify, docsMcastMibCompliances=docsMcastMibCompliances, docsMcastCompliance=docsMcastCompliance, docsMcastCmtsGrpPhsCfgTable=docsMcastCmtsGrpPhsCfgTable, docsMcastDefGrpSvcClass=docsMcastDefGrpSvcClass, docsMcastCpeListCpeMacAddr=docsMcastCpeListCpeMacAddr, docsMcastBandwidthTable=docsMcastBandwidthTable, docsMcastCmtsGrpPhsCfgPhsVerify=docsMcastCmtsGrpPhsCfgPhsVerify, docsMcastCpeListCpeIpAddr=docsMcastCpeListCpeIpAddr, docsMcastCmtsGrpCfgEntry=docsMcastCmtsGrpCfgEntry, docsMcastBandwidthAdmittedAggrLowWater=docsMcastBandwidthAdmittedAggrLowWater, docsMcastCpeListEntry=docsMcastCpeListEntry, docsMcastStatsSrcPrefixLen=docsMcastStatsSrcPrefixLen, docsMcastBandwidthAdmittedAggrHighWater=docsMcastBandwidthAdmittedAggrHighWater, docsMcastCmtsGrpCfgEncryptConfigId=docsMcastCmtsGrpCfgEncryptConfigId)
def square(x): return x*x print(type(square)) print(id(square)) print(str(square))
def square(x): return x * x print(type(square)) print(id(square)) print(str(square))
# # PySNMP MIB module CISCO-VOICE-ATM-DIAL-CONTROL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-VOICE-ATM-DIAL-CONTROL-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:19:12 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) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, SingleValueConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint") cCallHistoryIndex, = mibBuilder.importSymbols("CISCO-DIAL-CONTROL-MIB", "cCallHistoryIndex") ciscoExperiment, = mibBuilder.importSymbols("CISCO-SMI", "ciscoExperiment") CvcSpeechCoderRate, CvcInBandSignaling, CvcGUid, CvcFaxTransmitRate = mibBuilder.importSymbols("CISCO-VOICE-COMMON-DIAL-CONTROL-MIB", "CvcSpeechCoderRate", "CvcInBandSignaling", "CvcGUid", "CvcFaxTransmitRate") callActiveSetupTime, callActiveIndex = mibBuilder.importSymbols("DIAL-CONTROL-MIB", "callActiveSetupTime", "callActiveIndex") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") NotificationType, Bits, Counter64, ObjectIdentity, IpAddress, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, iso, ModuleIdentity, Counter32, TimeTicks, Integer32, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Bits", "Counter64", "ObjectIdentity", "IpAddress", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "iso", "ModuleIdentity", "Counter32", "TimeTicks", "Integer32", "Unsigned32") DisplayString, TruthValue, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TruthValue", "TextualConvention") ciscoVoiceAtmDialControlMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 10, 35)) ciscoVoiceAtmDialControlMIB.setRevisions(('2002-11-17 00:00', '1999-03-20 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setRevisionsDescriptions(('Modify the following objects: [1] Add a new enum definition in CvAtmSessionProtocol [2] Change the default value in cvAtmPeerCfgInBandSignaling ', 'Add new objects for handling the following: [1] Call History object ids 6-17 to bring MIB inline with stored Call History record. [2] Added Call Active Entry objects [3] Added Dialpeer Objects for VoATM ',)) if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setLastUpdated('200211170000Z') if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setContactInfo(' Cisco Systems Customer Service Postal: 170 W. Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-voice@cisco.com') if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setDescription('This MIB module enhances the IETF Dial Control MIB (RFC2128) by providing ATM management information over a data network.') ciscoVoiceAtmDialControlMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 1)) cvAtmCallHistory = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1)) cvAtmCallActive = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2)) cvAtmDialPeer = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3)) class CvAtmSessionProtocol(TextualConvention, Integer32): description = 'Represents a Session Protocol used by Voice calls between a local and remote router via the ATM backbone. other - none of the following. ciscoSwitched - cisco proprietary ATM session protocol. ' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("other", 1), ("ciscoSwitched", 2), ("aal2Trunk", 3)) cvAtmCallHistoryTable = MibTable((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1), ) if mibBuilder.loadTexts: cvAtmCallHistoryTable.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryTable.setDescription('This table is the ATM extension to the call history table of IETF Dial Control MIB. It contains ATM call leg information about specific voice over ATM call.') cvAtmCallHistoryEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1), ).setIndexNames((0, "CISCO-DIAL-CONTROL-MIB", "cCallHistoryIndex")) if mibBuilder.loadTexts: cvAtmCallHistoryEntry.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryEntry.setDescription('The information regarding a single ATM call leg. An entry of this table is created when its associated call history entry in the IETF Dial Control MIB is created and the call history entry contains information for the call establishment to the peer on the data network backbone via a voice over ATM peer. Th the IETF Dial Control MIB is deleted.') cvAtmCallHistoryConnectionId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 1), CvcGUid()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistoryConnectionId.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryConnectionId.setDescription('The global call identifier for the ATM call.') cvAtmCallHistoryVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4095))).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistoryVpi.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryVpi.setDescription('The VPI used for this ATM connection.') cvAtmCallHistoryVci = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistoryVci.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryVci.setDescription('The VCI used for this ATM connection.') cvAtmCallHistoryLowerIfName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistoryLowerIfName.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryLowerIfName.setDescription('The ifName of the ATM interface associated with this call.') cvAtmCallHistorySessionTarget = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistorySessionTarget.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistorySessionTarget.setDescription('The object indicates the session target of the peer that was used for the voice over ATM call. A zero length string indicates that the value is unavailable.') cvAtmCallHistorySubchannelID = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistorySubchannelID.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistorySubchannelID.setDescription('The subchannel used for this ATM connection.') cvAtmCallHistorySessionProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 7), CvAtmSessionProtocol()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistorySessionProtocol.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistorySessionProtocol.setDescription('Indicates the session protocol used on this call.') cvAtmCallHistoryCalledNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistoryCalledNumber.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryCalledNumber.setDescription('Indicates the called party number for trunk connection calls. A zero length string indicates that this data is unavailable.') cvAtmCallHistoryDtmfRelay = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 9), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistoryDtmfRelay.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryDtmfRelay.setDescription('Indicates if Dtmf Relay was enabled for the call.') cvAtmCallHistoryUseSeqNumbers = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 10), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallHistoryUseSeqNumbers.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryUseSeqNumbers.setDescription('Indicates if Sequence Numbers were used on the voice data packets.') cvAtmCallActiveTable = MibTable((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1), ) if mibBuilder.loadTexts: cvAtmCallActiveTable.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveTable.setDescription('This table is the ATM extension to the active call table of IETF Dial Control MIB. It contains ATM call leg information about specific voice over ATM call.') cvAtmCallActiveEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1), ).setIndexNames((0, "DIAL-CONTROL-MIB", "callActiveSetupTime"), (0, "DIAL-CONTROL-MIB", "callActiveIndex")) if mibBuilder.loadTexts: cvAtmCallActiveEntry.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveEntry.setDescription('The information regarding a single ATM call leg. An entry of this table is created when its associated call active entry in the IETF Dial Control MIB is created. The call active entry contains information for the call establishment to the peer on the data network backbone via a voice over ATM peer. The entry is deleted when its associated call active entry in the IETF Dial Control MIB is deleted.') cvAtmCallActiveConnectionId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 1), CvcGUid()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveConnectionId.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveConnectionId.setDescription('The global call identifier for the ATM call.') cvAtmCallActiveVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4095))).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveVpi.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveVpi.setDescription('The VPI used for this ATM connection.') cvAtmCallActiveVci = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveVci.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveVci.setDescription('The VCI used for this ATM connection.') cvAtmCallActiveLowerIfName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveLowerIfName.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveLowerIfName.setDescription('The ifName of the ATM interface associated with this call.') cvAtmCallActiveSessionTarget = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveSessionTarget.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveSessionTarget.setDescription('The object indicates the session target of the peer that is used for the voice over ATM call. A null string indicates that the value is unavailable.') cvAtmCallActiveSubchannelID = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveSubchannelID.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveSubchannelID.setDescription('The subchannel used for this ATM connection.') cvAtmCallActiveSessionProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 7), CvAtmSessionProtocol()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveSessionProtocol.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveSessionProtocol.setDescription('Indicates the session protocol being used on this call.') cvAtmCallActiveCalledNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveCalledNumber.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveCalledNumber.setDescription('Indicates the called party number for trunk connection calls. A null string indicates that this data is unavailable.') cvAtmCallActiveDtmfRelay = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 9), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveDtmfRelay.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveDtmfRelay.setDescription('Indicates if Dtmf Relay is enabled for the call.') cvAtmCallActiveUseSeqNumbers = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 10), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cvAtmCallActiveUseSeqNumbers.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveUseSeqNumbers.setDescription('Indicates if Sequence Numbers are used on the voice data packets.') cvAtmPeerCfgTable = MibTable((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1), ) if mibBuilder.loadTexts: cvAtmPeerCfgTable.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgTable.setDescription('The table contains the Voice over ATM (ATM) peer specific information that is required to accept or place voice calls via the ATM backbone with the session protocol specified in cvAtmPeerCfgSessionProtocol.') cvAtmPeerCfgEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: cvAtmPeerCfgEntry.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgEntry.setDescription("A single ATM specific Peer. One entry per ATM encapsulation. The entry is created when its associated 'voiceOverATM(152)' encapsulation ifEntry is created. This entry is deleted when its associated ifEntry is deleted.") cvAtmPeerCfgSessionProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 1), CvAtmSessionProtocol().clone('ciscoSwitched')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgSessionProtocol.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgSessionProtocol.setDescription('The object specifies the session protocol to be used for Internet call between local and remote router via ATM backbone.') cvAtmPeerCfgInterfaceName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 2), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgInterfaceName.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgInterfaceName.setDescription('The object specifies the ifName on which the call will go out. A zero length string indicates that no interface has been assigned.') cvAtmPeerCfgVpi = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 4095))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgVpi.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgVpi.setDescription('The VPI used for this ATM connection.') cvAtmPeerCfgVci = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgVci.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgVci.setDescription('The VCI used for this ATM connection.') cvAtmPeerCfgVcName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 5), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgVcName.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgVcName.setDescription('The VC Name used for this ATM connection.') cvAtmPeerCfgCoderRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 6), CvcSpeechCoderRate().clone('g729Ar8000')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgCoderRate.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgCoderRate.setDescription('This object specifies the default voice coder rate of speech for the ATM peer.') cvAtmPeerCfgCodecBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 240)).clone(30)).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgCodecBytes.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgCodecBytes.setDescription('This object specifies the payload size for the voice packets to be transmitted during the call.') cvAtmPeerCfgFaxRate = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 8), CvcFaxTransmitRate().clone('voiceRate')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgFaxRate.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgFaxRate.setDescription("This object specifies the default transmit rate of FAX for the ATM peer. If the value of this object is 'none', then the Fax relay feature is disabled; otherwise the Fax relay feature is enabled.") cvAtmPeerCfgFaxBytes = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 240)).clone(30)).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgFaxBytes.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgFaxBytes.setDescription('This object specifies the payload size for the fax packets to be transmitted during the call.') cvAtmPeerCfgInBandSignaling = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 10), CvcInBandSignaling().clone('cas')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgInBandSignaling.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgInBandSignaling.setDescription('This object specifies the type of in-band signaling used between the two end points of the call and is used by the router to determine how to interpret the ABCD signaling bits sent as part of the voice payload data.') cvAtmPeerCfgVADEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 11), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgVADEnable.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgVADEnable.setDescription("This object specifies whether or not VAD (Voice Activity Detection) is enabled. If the object value is 'false', then the voice data is continuously transmitted to ATM backbone.") cvAtmPeerCfgUseSeqNumbers = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 12), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgUseSeqNumbers.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgUseSeqNumbers.setDescription('This object specifies whether or not Sequence Numbers are generated on voice packets.') cvAtmPeerCfgDtmfRelay = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 13), TruthValue().clone('false')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cvAtmPeerCfgDtmfRelay.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgDtmfRelay.setDescription('This object specifies whether or not Dtmf Relay is enabled. If it is then dtmf digits are transported as FRF11 Annex C packets, instead of being encoded as speech.') ciscoVoiceAtmDialControlMIBNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 2)) ciscoVoiceAtmDialControlMIBNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 2, 0)) ciscoVoiceAtmDialControlMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 3)) ciscoVoiceAtmDialControlMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 1)) ciscoVoiceAtmDialControlMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 2)) ciscoVoiceAtmDialControlMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 1, 1)).setObjects(("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistoryGroup"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveGroup"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoVoiceAtmDialControlMIBCompliance = ciscoVoiceAtmDialControlMIBCompliance.setStatus('current') if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIBCompliance.setDescription('The compliance statement for entities which implement the CISCO VOICE ATM DIAL CONTROL MIB') cvAtmCallHistoryGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 2, 1)).setObjects(("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistoryConnectionId"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistoryVpi"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistoryVci"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistoryLowerIfName"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistorySessionTarget"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistorySubchannelID"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistorySessionProtocol"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistoryCalledNumber"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistoryDtmfRelay"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallHistoryUseSeqNumbers")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cvAtmCallHistoryGroup = cvAtmCallHistoryGroup.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryGroup.setDescription('A collection of objects providing the ATM Call History entry capability.') cvAtmCallActiveGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 2, 2)).setObjects(("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveConnectionId"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveVpi"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveVci"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveLowerIfName"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveSessionTarget"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveSubchannelID"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveSessionProtocol"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveCalledNumber"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveDtmfRelay"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmCallActiveUseSeqNumbers")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cvAtmCallActiveGroup = cvAtmCallActiveGroup.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveGroup.setDescription('A collection of objects providing the ATM Call Active entry capability.') cvAtmPeerCfgGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 2, 3)).setObjects(("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgSessionProtocol"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgInterfaceName"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgVpi"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgVci"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgVcName"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgCoderRate"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgCodecBytes"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgFaxRate"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgFaxBytes"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgInBandSignaling"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgVADEnable"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgUseSeqNumbers"), ("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", "cvAtmPeerCfgDtmfRelay")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cvAtmPeerCfgGroup = cvAtmPeerCfgGroup.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgGroup.setDescription('A collection of objects providing the ATM Dialpeer capability. These objects have been implemented as read-only.') mibBuilder.exportSymbols("CISCO-VOICE-ATM-DIAL-CONTROL-MIB", cvAtmPeerCfgFaxRate=cvAtmPeerCfgFaxRate, cvAtmCallActiveSessionTarget=cvAtmCallActiveSessionTarget, cvAtmCallHistoryGroup=cvAtmCallHistoryGroup, cvAtmCallHistoryUseSeqNumbers=cvAtmCallHistoryUseSeqNumbers, ciscoVoiceAtmDialControlMIBConformance=ciscoVoiceAtmDialControlMIBConformance, cvAtmPeerCfgGroup=cvAtmPeerCfgGroup, cvAtmCallHistoryVpi=cvAtmCallHistoryVpi, cvAtmCallActiveVpi=cvAtmCallActiveVpi, cvAtmCallActiveDtmfRelay=cvAtmCallActiveDtmfRelay, cvAtmCallHistorySessionTarget=cvAtmCallHistorySessionTarget, cvAtmCallActiveSubchannelID=cvAtmCallActiveSubchannelID, cvAtmCallHistoryEntry=cvAtmCallHistoryEntry, cvAtmCallActiveUseSeqNumbers=cvAtmCallActiveUseSeqNumbers, cvAtmPeerCfgTable=cvAtmPeerCfgTable, cvAtmCallHistoryConnectionId=cvAtmCallHistoryConnectionId, cvAtmCallActiveSessionProtocol=cvAtmCallActiveSessionProtocol, cvAtmCallActive=cvAtmCallActive, cvAtmPeerCfgVci=cvAtmPeerCfgVci, ciscoVoiceAtmDialControlMIBNotifications=ciscoVoiceAtmDialControlMIBNotifications, cvAtmCallActiveLowerIfName=cvAtmCallActiveLowerIfName, cvAtmCallHistoryTable=cvAtmCallHistoryTable, cvAtmCallActiveEntry=cvAtmCallActiveEntry, cvAtmCallActiveCalledNumber=cvAtmCallActiveCalledNumber, cvAtmPeerCfgInterfaceName=cvAtmPeerCfgInterfaceName, cvAtmCallActiveTable=cvAtmCallActiveTable, ciscoVoiceAtmDialControlMIB=ciscoVoiceAtmDialControlMIB, cvAtmCallHistorySessionProtocol=cvAtmCallHistorySessionProtocol, cvAtmPeerCfgVcName=cvAtmPeerCfgVcName, cvAtmCallHistoryDtmfRelay=cvAtmCallHistoryDtmfRelay, ciscoVoiceAtmDialControlMIBCompliance=ciscoVoiceAtmDialControlMIBCompliance, cvAtmPeerCfgEntry=cvAtmPeerCfgEntry, cvAtmPeerCfgCoderRate=cvAtmPeerCfgCoderRate, ciscoVoiceAtmDialControlMIBObjects=ciscoVoiceAtmDialControlMIBObjects, cvAtmCallActiveConnectionId=cvAtmCallActiveConnectionId, cvAtmPeerCfgSessionProtocol=cvAtmPeerCfgSessionProtocol, CvAtmSessionProtocol=CvAtmSessionProtocol, cvAtmDialPeer=cvAtmDialPeer, cvAtmPeerCfgInBandSignaling=cvAtmPeerCfgInBandSignaling, cvAtmPeerCfgFaxBytes=cvAtmPeerCfgFaxBytes, cvAtmPeerCfgVpi=cvAtmPeerCfgVpi, cvAtmCallHistoryVci=cvAtmCallHistoryVci, cvAtmPeerCfgUseSeqNumbers=cvAtmPeerCfgUseSeqNumbers, cvAtmPeerCfgVADEnable=cvAtmPeerCfgVADEnable, cvAtmPeerCfgDtmfRelay=cvAtmPeerCfgDtmfRelay, cvAtmCallActiveVci=cvAtmCallActiveVci, cvAtmCallHistoryCalledNumber=cvAtmCallHistoryCalledNumber, ciscoVoiceAtmDialControlMIBNotificationPrefix=ciscoVoiceAtmDialControlMIBNotificationPrefix, cvAtmPeerCfgCodecBytes=cvAtmPeerCfgCodecBytes, ciscoVoiceAtmDialControlMIBGroups=ciscoVoiceAtmDialControlMIBGroups, cvAtmCallHistoryLowerIfName=cvAtmCallHistoryLowerIfName, cvAtmCallActiveGroup=cvAtmCallActiveGroup, PYSNMP_MODULE_ID=ciscoVoiceAtmDialControlMIB, ciscoVoiceAtmDialControlMIBCompliances=ciscoVoiceAtmDialControlMIBCompliances, cvAtmCallHistory=cvAtmCallHistory, cvAtmCallHistorySubchannelID=cvAtmCallHistorySubchannelID)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, single_value_constraint, constraints_union, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'SingleValueConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'ValueRangeConstraint') (c_call_history_index,) = mibBuilder.importSymbols('CISCO-DIAL-CONTROL-MIB', 'cCallHistoryIndex') (cisco_experiment,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoExperiment') (cvc_speech_coder_rate, cvc_in_band_signaling, cvc_g_uid, cvc_fax_transmit_rate) = mibBuilder.importSymbols('CISCO-VOICE-COMMON-DIAL-CONTROL-MIB', 'CvcSpeechCoderRate', 'CvcInBandSignaling', 'CvcGUid', 'CvcFaxTransmitRate') (call_active_setup_time, call_active_index) = mibBuilder.importSymbols('DIAL-CONTROL-MIB', 'callActiveSetupTime', 'callActiveIndex') (if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex') (object_group, notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'NotificationGroup', 'ModuleCompliance') (notification_type, bits, counter64, object_identity, ip_address, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32, iso, module_identity, counter32, time_ticks, integer32, unsigned32) = mibBuilder.importSymbols('SNMPv2-SMI', 'NotificationType', 'Bits', 'Counter64', 'ObjectIdentity', 'IpAddress', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32', 'iso', 'ModuleIdentity', 'Counter32', 'TimeTicks', 'Integer32', 'Unsigned32') (display_string, truth_value, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TruthValue', 'TextualConvention') cisco_voice_atm_dial_control_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 10, 35)) ciscoVoiceAtmDialControlMIB.setRevisions(('2002-11-17 00:00', '1999-03-20 00:00')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setRevisionsDescriptions(('Modify the following objects: [1] Add a new enum definition in CvAtmSessionProtocol [2] Change the default value in cvAtmPeerCfgInBandSignaling ', 'Add new objects for handling the following: [1] Call History object ids 6-17 to bring MIB inline with stored Call History record. [2] Added Call Active Entry objects [3] Added Dialpeer Objects for VoATM ')) if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setLastUpdated('200211170000Z') if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setContactInfo(' Cisco Systems Customer Service Postal: 170 W. Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-voice@cisco.com') if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIB.setDescription('This MIB module enhances the IETF Dial Control MIB (RFC2128) by providing ATM management information over a data network.') cisco_voice_atm_dial_control_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 1)) cv_atm_call_history = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1)) cv_atm_call_active = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2)) cv_atm_dial_peer = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3)) class Cvatmsessionprotocol(TextualConvention, Integer32): description = 'Represents a Session Protocol used by Voice calls between a local and remote router via the ATM backbone. other - none of the following. ciscoSwitched - cisco proprietary ATM session protocol. ' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('other', 1), ('ciscoSwitched', 2), ('aal2Trunk', 3)) cv_atm_call_history_table = mib_table((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1)) if mibBuilder.loadTexts: cvAtmCallHistoryTable.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryTable.setDescription('This table is the ATM extension to the call history table of IETF Dial Control MIB. It contains ATM call leg information about specific voice over ATM call.') cv_atm_call_history_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1)).setIndexNames((0, 'CISCO-DIAL-CONTROL-MIB', 'cCallHistoryIndex')) if mibBuilder.loadTexts: cvAtmCallHistoryEntry.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryEntry.setDescription('The information regarding a single ATM call leg. An entry of this table is created when its associated call history entry in the IETF Dial Control MIB is created and the call history entry contains information for the call establishment to the peer on the data network backbone via a voice over ATM peer. Th the IETF Dial Control MIB is deleted.') cv_atm_call_history_connection_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 1), cvc_g_uid()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistoryConnectionId.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryConnectionId.setDescription('The global call identifier for the ATM call.') cv_atm_call_history_vpi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistoryVpi.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryVpi.setDescription('The VPI used for this ATM connection.') cv_atm_call_history_vci = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistoryVci.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryVci.setDescription('The VCI used for this ATM connection.') cv_atm_call_history_lower_if_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistoryLowerIfName.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryLowerIfName.setDescription('The ifName of the ATM interface associated with this call.') cv_atm_call_history_session_target = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistorySessionTarget.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistorySessionTarget.setDescription('The object indicates the session target of the peer that was used for the voice over ATM call. A zero length string indicates that the value is unavailable.') cv_atm_call_history_subchannel_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistorySubchannelID.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistorySubchannelID.setDescription('The subchannel used for this ATM connection.') cv_atm_call_history_session_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 7), cv_atm_session_protocol()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistorySessionProtocol.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistorySessionProtocol.setDescription('Indicates the session protocol used on this call.') cv_atm_call_history_called_number = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistoryCalledNumber.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryCalledNumber.setDescription('Indicates the called party number for trunk connection calls. A zero length string indicates that this data is unavailable.') cv_atm_call_history_dtmf_relay = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 9), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistoryDtmfRelay.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryDtmfRelay.setDescription('Indicates if Dtmf Relay was enabled for the call.') cv_atm_call_history_use_seq_numbers = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 1, 1, 1, 10), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallHistoryUseSeqNumbers.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryUseSeqNumbers.setDescription('Indicates if Sequence Numbers were used on the voice data packets.') cv_atm_call_active_table = mib_table((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1)) if mibBuilder.loadTexts: cvAtmCallActiveTable.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveTable.setDescription('This table is the ATM extension to the active call table of IETF Dial Control MIB. It contains ATM call leg information about specific voice over ATM call.') cv_atm_call_active_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1)).setIndexNames((0, 'DIAL-CONTROL-MIB', 'callActiveSetupTime'), (0, 'DIAL-CONTROL-MIB', 'callActiveIndex')) if mibBuilder.loadTexts: cvAtmCallActiveEntry.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveEntry.setDescription('The information regarding a single ATM call leg. An entry of this table is created when its associated call active entry in the IETF Dial Control MIB is created. The call active entry contains information for the call establishment to the peer on the data network backbone via a voice over ATM peer. The entry is deleted when its associated call active entry in the IETF Dial Control MIB is deleted.') cv_atm_call_active_connection_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 1), cvc_g_uid()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveConnectionId.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveConnectionId.setDescription('The global call identifier for the ATM call.') cv_atm_call_active_vpi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveVpi.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveVpi.setDescription('The VPI used for this ATM connection.') cv_atm_call_active_vci = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveVci.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveVci.setDescription('The VCI used for this ATM connection.') cv_atm_call_active_lower_if_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 4), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveLowerIfName.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveLowerIfName.setDescription('The ifName of the ATM interface associated with this call.') cv_atm_call_active_session_target = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 5), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveSessionTarget.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveSessionTarget.setDescription('The object indicates the session target of the peer that is used for the voice over ATM call. A null string indicates that the value is unavailable.') cv_atm_call_active_subchannel_id = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveSubchannelID.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveSubchannelID.setDescription('The subchannel used for this ATM connection.') cv_atm_call_active_session_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 7), cv_atm_session_protocol()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveSessionProtocol.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveSessionProtocol.setDescription('Indicates the session protocol being used on this call.') cv_atm_call_active_called_number = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 8), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveCalledNumber.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveCalledNumber.setDescription('Indicates the called party number for trunk connection calls. A null string indicates that this data is unavailable.') cv_atm_call_active_dtmf_relay = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 9), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveDtmfRelay.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveDtmfRelay.setDescription('Indicates if Dtmf Relay is enabled for the call.') cv_atm_call_active_use_seq_numbers = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 2, 1, 1, 10), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cvAtmCallActiveUseSeqNumbers.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveUseSeqNumbers.setDescription('Indicates if Sequence Numbers are used on the voice data packets.') cv_atm_peer_cfg_table = mib_table((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1)) if mibBuilder.loadTexts: cvAtmPeerCfgTable.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgTable.setDescription('The table contains the Voice over ATM (ATM) peer specific information that is required to accept or place voice calls via the ATM backbone with the session protocol specified in cvAtmPeerCfgSessionProtocol.') cv_atm_peer_cfg_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex')) if mibBuilder.loadTexts: cvAtmPeerCfgEntry.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgEntry.setDescription("A single ATM specific Peer. One entry per ATM encapsulation. The entry is created when its associated 'voiceOverATM(152)' encapsulation ifEntry is created. This entry is deleted when its associated ifEntry is deleted.") cv_atm_peer_cfg_session_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 1), cv_atm_session_protocol().clone('ciscoSwitched')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgSessionProtocol.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgSessionProtocol.setDescription('The object specifies the session protocol to be used for Internet call between local and remote router via ATM backbone.') cv_atm_peer_cfg_interface_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 2), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgInterfaceName.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgInterfaceName.setDescription('The object specifies the ifName on which the call will go out. A zero length string indicates that no interface has been assigned.') cv_atm_peer_cfg_vpi = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 4095))).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgVpi.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgVpi.setDescription('The VPI used for this ATM connection.') cv_atm_peer_cfg_vci = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgVci.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgVci.setDescription('The VCI used for this ATM connection.') cv_atm_peer_cfg_vc_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 5), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgVcName.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgVcName.setDescription('The VC Name used for this ATM connection.') cv_atm_peer_cfg_coder_rate = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 6), cvc_speech_coder_rate().clone('g729Ar8000')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgCoderRate.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgCoderRate.setDescription('This object specifies the default voice coder rate of speech for the ATM peer.') cv_atm_peer_cfg_codec_bytes = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 240)).clone(30)).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgCodecBytes.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgCodecBytes.setDescription('This object specifies the payload size for the voice packets to be transmitted during the call.') cv_atm_peer_cfg_fax_rate = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 8), cvc_fax_transmit_rate().clone('voiceRate')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgFaxRate.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgFaxRate.setDescription("This object specifies the default transmit rate of FAX for the ATM peer. If the value of this object is 'none', then the Fax relay feature is disabled; otherwise the Fax relay feature is enabled.") cv_atm_peer_cfg_fax_bytes = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 240)).clone(30)).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgFaxBytes.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgFaxBytes.setDescription('This object specifies the payload size for the fax packets to be transmitted during the call.') cv_atm_peer_cfg_in_band_signaling = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 10), cvc_in_band_signaling().clone('cas')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgInBandSignaling.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgInBandSignaling.setDescription('This object specifies the type of in-band signaling used between the two end points of the call and is used by the router to determine how to interpret the ABCD signaling bits sent as part of the voice payload data.') cv_atm_peer_cfg_vad_enable = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 11), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgVADEnable.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgVADEnable.setDescription("This object specifies whether or not VAD (Voice Activity Detection) is enabled. If the object value is 'false', then the voice data is continuously transmitted to ATM backbone.") cv_atm_peer_cfg_use_seq_numbers = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 12), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgUseSeqNumbers.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgUseSeqNumbers.setDescription('This object specifies whether or not Sequence Numbers are generated on voice packets.') cv_atm_peer_cfg_dtmf_relay = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 35, 1, 3, 1, 1, 13), truth_value().clone('false')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cvAtmPeerCfgDtmfRelay.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgDtmfRelay.setDescription('This object specifies whether or not Dtmf Relay is enabled. If it is then dtmf digits are transported as FRF11 Annex C packets, instead of being encoded as speech.') cisco_voice_atm_dial_control_mib_notification_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 2)) cisco_voice_atm_dial_control_mib_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 2, 0)) cisco_voice_atm_dial_control_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 3)) cisco_voice_atm_dial_control_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 1)) cisco_voice_atm_dial_control_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 2)) cisco_voice_atm_dial_control_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 1, 1)).setObjects(('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistoryGroup'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveGroup'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_voice_atm_dial_control_mib_compliance = ciscoVoiceAtmDialControlMIBCompliance.setStatus('current') if mibBuilder.loadTexts: ciscoVoiceAtmDialControlMIBCompliance.setDescription('The compliance statement for entities which implement the CISCO VOICE ATM DIAL CONTROL MIB') cv_atm_call_history_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 2, 1)).setObjects(('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistoryConnectionId'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistoryVpi'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistoryVci'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistoryLowerIfName'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistorySessionTarget'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistorySubchannelID'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistorySessionProtocol'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistoryCalledNumber'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistoryDtmfRelay'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallHistoryUseSeqNumbers')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cv_atm_call_history_group = cvAtmCallHistoryGroup.setStatus('current') if mibBuilder.loadTexts: cvAtmCallHistoryGroup.setDescription('A collection of objects providing the ATM Call History entry capability.') cv_atm_call_active_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 2, 2)).setObjects(('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveConnectionId'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveVpi'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveVci'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveLowerIfName'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveSessionTarget'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveSubchannelID'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveSessionProtocol'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveCalledNumber'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveDtmfRelay'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmCallActiveUseSeqNumbers')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cv_atm_call_active_group = cvAtmCallActiveGroup.setStatus('current') if mibBuilder.loadTexts: cvAtmCallActiveGroup.setDescription('A collection of objects providing the ATM Call Active entry capability.') cv_atm_peer_cfg_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 35, 3, 2, 3)).setObjects(('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgSessionProtocol'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgInterfaceName'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgVpi'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgVci'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgVcName'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgCoderRate'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgCodecBytes'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgFaxRate'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgFaxBytes'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgInBandSignaling'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgVADEnable'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgUseSeqNumbers'), ('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', 'cvAtmPeerCfgDtmfRelay')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cv_atm_peer_cfg_group = cvAtmPeerCfgGroup.setStatus('current') if mibBuilder.loadTexts: cvAtmPeerCfgGroup.setDescription('A collection of objects providing the ATM Dialpeer capability. These objects have been implemented as read-only.') mibBuilder.exportSymbols('CISCO-VOICE-ATM-DIAL-CONTROL-MIB', cvAtmPeerCfgFaxRate=cvAtmPeerCfgFaxRate, cvAtmCallActiveSessionTarget=cvAtmCallActiveSessionTarget, cvAtmCallHistoryGroup=cvAtmCallHistoryGroup, cvAtmCallHistoryUseSeqNumbers=cvAtmCallHistoryUseSeqNumbers, ciscoVoiceAtmDialControlMIBConformance=ciscoVoiceAtmDialControlMIBConformance, cvAtmPeerCfgGroup=cvAtmPeerCfgGroup, cvAtmCallHistoryVpi=cvAtmCallHistoryVpi, cvAtmCallActiveVpi=cvAtmCallActiveVpi, cvAtmCallActiveDtmfRelay=cvAtmCallActiveDtmfRelay, cvAtmCallHistorySessionTarget=cvAtmCallHistorySessionTarget, cvAtmCallActiveSubchannelID=cvAtmCallActiveSubchannelID, cvAtmCallHistoryEntry=cvAtmCallHistoryEntry, cvAtmCallActiveUseSeqNumbers=cvAtmCallActiveUseSeqNumbers, cvAtmPeerCfgTable=cvAtmPeerCfgTable, cvAtmCallHistoryConnectionId=cvAtmCallHistoryConnectionId, cvAtmCallActiveSessionProtocol=cvAtmCallActiveSessionProtocol, cvAtmCallActive=cvAtmCallActive, cvAtmPeerCfgVci=cvAtmPeerCfgVci, ciscoVoiceAtmDialControlMIBNotifications=ciscoVoiceAtmDialControlMIBNotifications, cvAtmCallActiveLowerIfName=cvAtmCallActiveLowerIfName, cvAtmCallHistoryTable=cvAtmCallHistoryTable, cvAtmCallActiveEntry=cvAtmCallActiveEntry, cvAtmCallActiveCalledNumber=cvAtmCallActiveCalledNumber, cvAtmPeerCfgInterfaceName=cvAtmPeerCfgInterfaceName, cvAtmCallActiveTable=cvAtmCallActiveTable, ciscoVoiceAtmDialControlMIB=ciscoVoiceAtmDialControlMIB, cvAtmCallHistorySessionProtocol=cvAtmCallHistorySessionProtocol, cvAtmPeerCfgVcName=cvAtmPeerCfgVcName, cvAtmCallHistoryDtmfRelay=cvAtmCallHistoryDtmfRelay, ciscoVoiceAtmDialControlMIBCompliance=ciscoVoiceAtmDialControlMIBCompliance, cvAtmPeerCfgEntry=cvAtmPeerCfgEntry, cvAtmPeerCfgCoderRate=cvAtmPeerCfgCoderRate, ciscoVoiceAtmDialControlMIBObjects=ciscoVoiceAtmDialControlMIBObjects, cvAtmCallActiveConnectionId=cvAtmCallActiveConnectionId, cvAtmPeerCfgSessionProtocol=cvAtmPeerCfgSessionProtocol, CvAtmSessionProtocol=CvAtmSessionProtocol, cvAtmDialPeer=cvAtmDialPeer, cvAtmPeerCfgInBandSignaling=cvAtmPeerCfgInBandSignaling, cvAtmPeerCfgFaxBytes=cvAtmPeerCfgFaxBytes, cvAtmPeerCfgVpi=cvAtmPeerCfgVpi, cvAtmCallHistoryVci=cvAtmCallHistoryVci, cvAtmPeerCfgUseSeqNumbers=cvAtmPeerCfgUseSeqNumbers, cvAtmPeerCfgVADEnable=cvAtmPeerCfgVADEnable, cvAtmPeerCfgDtmfRelay=cvAtmPeerCfgDtmfRelay, cvAtmCallActiveVci=cvAtmCallActiveVci, cvAtmCallHistoryCalledNumber=cvAtmCallHistoryCalledNumber, ciscoVoiceAtmDialControlMIBNotificationPrefix=ciscoVoiceAtmDialControlMIBNotificationPrefix, cvAtmPeerCfgCodecBytes=cvAtmPeerCfgCodecBytes, ciscoVoiceAtmDialControlMIBGroups=ciscoVoiceAtmDialControlMIBGroups, cvAtmCallHistoryLowerIfName=cvAtmCallHistoryLowerIfName, cvAtmCallActiveGroup=cvAtmCallActiveGroup, PYSNMP_MODULE_ID=ciscoVoiceAtmDialControlMIB, ciscoVoiceAtmDialControlMIBCompliances=ciscoVoiceAtmDialControlMIBCompliances, cvAtmCallHistory=cvAtmCallHistory, cvAtmCallHistorySubchannelID=cvAtmCallHistorySubchannelID)
def visualization(): """Extract final adjust process values from BHDS tables. Args: pri_df {pyspark.sql.dataframe.DataFrame} -- Primary BHDS data Returns: [pyspark.sql.dataframe.DataFrame] -- Dataframe with features. """ print('visualizing data....')
def visualization(): """Extract final adjust process values from BHDS tables. Args: pri_df {pyspark.sql.dataframe.DataFrame} -- Primary BHDS data Returns: [pyspark.sql.dataframe.DataFrame] -- Dataframe with features. """ print('visualizing data....')
def quote(msg: str): return msg.replace("`", "") def cleanup_code(content): if content.startswith("```") and content.endswith("```"): output = content[3:-3].rstrip("\n").lstrip("\n") return output return content.strip("` \n")
def quote(msg: str): return msg.replace('`', '') def cleanup_code(content): if content.startswith('```') and content.endswith('```'): output = content[3:-3].rstrip('\n').lstrip('\n') return output return content.strip('` \n')
# Reading and Writing Plain Text Files print("""Steps to reading and writing text files in Python: Open 1. open() function: open's the file helloFile = open('<file name.txt>') helloFile.read() helloFile.close() Read 2. readlines() method: returns all of the lines as strings inside of a list. helloFile = open('<file name.txt>') helloFile.readlines() helloFile.close() Write mode 1. helloFile = open('<file name.txt>', 'w') # the w will turn the function into write mode. Write mode will overwrite items in the text file. helloFile.read() helloFile.close() Append mode 1. helloFile = open('<file name.txt>', 'a') # the w will turn the function into append mode. Append mode will add on to the file. helloFile.read() helloFile.close() For both the write & append mode then it will automatically create the file. helloFile.write(<text input>) helloFile.close() Relative filepath: If you don't put a directory in write mode then it will use the current working directory Shelve Module Used to save variables (list, dictionaries, complex data files) into the python program to binary shelf files using the shelve module. Then in the future you can call back to shelved data in order to use the it. They are stored as .bak, .dat, .dir file types. The files are binary files so they cannot be read in notepad. import shelve shelfFile = shelve.open('mydata') shelfFile['cats'] = ['zophie, 'Pooka', 'Simon', 'Fat-tail', 'Cleo] shelfFile.close() Keys Method shelfFile = shelve.open('mydata') shelfFile.keys .ist(shelfFile.keys()) list(shelfFile.values()) """)
print("Steps to reading and writing text files in Python:\nOpen\n1. open() function: open's the file\n\nhelloFile = open('<file name.txt>')\nhelloFile.read()\nhelloFile.close()\n\nRead\n2. readlines() method: returns all of the lines as strings inside of a list.\n\nhelloFile = open('<file name.txt>')\nhelloFile.readlines()\nhelloFile.close()\n\nWrite mode\n1. helloFile = open('<file name.txt>', 'w') # the w will turn the function into write mode. Write mode will overwrite items in the text file.\nhelloFile.read()\nhelloFile.close()\n\nAppend mode\n1. helloFile = open('<file name.txt>', 'a') # the w will turn the function into append mode. Append mode will add on to the file.\nhelloFile.read()\nhelloFile.close()\n\nFor both the write & append mode then it will automatically create the file.\nhelloFile.write(<text input>)\nhelloFile.close()\n\nRelative filepath: If you don't put a directory in write mode then it will use the current working directory\n\nShelve Module\nUsed to save variables (list, dictionaries, complex data files) into the python program to binary shelf files using the shelve module.\nThen in the future you can call back to shelved data in order to use the it. They are stored as .bak, .dat, .dir file types. The files are binary files so they cannot be read in notepad.\n\nimport shelve\nshelfFile = shelve.open('mydata')\nshelfFile['cats'] = ['zophie, 'Pooka', 'Simon', 'Fat-tail', 'Cleo]\nshelfFile.close()\n\nKeys Method\nshelfFile = shelve.open('mydata')\nshelfFile.keys\n.ist(shelfFile.keys())\nlist(shelfFile.values())\n\n")
# Joe defined a dictionary listing his favorite artists, their albums, # and the song from each of the albums. It looks as follows: #tracks = {"Woodkid": {"The Golden Age": "Run Boy Run", # "On the Other Side": "Samara"}, # "Cure": {"Disintegration": "Lovesong", # "Wish": "Friday I'm in love"}} # Joe's tastes can change, though. # Your task is to define a tracklist() function that would take # several keyword arguments representing musicians and # dictionaries with albums and songs as values. For the example # above, the call of this function will look as follows: # The function should print the values from the dictionary in the # following form: def tracklist(**tracks): for key, value in tracks.items(): print(key) for k, v in value.items(): print(f'ALBUM: {k} TRACK: {v}') def tracklist(**artists): for artist, album in artists.items(): print(artist) print("\n".join(f'ALBUM: {album_name} TRACK: {track}' for album_name, track in album.items())) def tracklist(**artists): for artist, albums in artists.items(): print(artist, *[f"ALBUM: {album} TRACK: {track}" for album, track in albums.items()], sep='\n') tracklist(Woodkid={"The Golden Age": "Run Boy Run", "On the Other Side": "Samara"}, Cure={"Disintergration": "Lovesong", "Wish": "Friday I'm in love"})
def tracklist(**tracks): for (key, value) in tracks.items(): print(key) for (k, v) in value.items(): print(f'ALBUM: {k} TRACK: {v}') def tracklist(**artists): for (artist, album) in artists.items(): print(artist) print('\n'.join((f'ALBUM: {album_name} TRACK: {track}' for (album_name, track) in album.items()))) def tracklist(**artists): for (artist, albums) in artists.items(): print(artist, *[f'ALBUM: {album} TRACK: {track}' for (album, track) in albums.items()], sep='\n') tracklist(Woodkid={'The Golden Age': 'Run Boy Run', 'On the Other Side': 'Samara'}, Cure={'Disintergration': 'Lovesong', 'Wish': "Friday I'm in love"})
# Challenge Link - https://app.codility.com/programmers/lessons/2-arrays/cyclic_rotation/ # My Results - https://app.codility.com/demo/results/trainingFGAZZW-5XB/ def solution(A, K): # write your code in Python 3.6 if not A: return [] idx = [i for i in range(0, len(A))] while K: idx = [i + 1 for i in idx] max_index = idx.index(max(idx)) idx[max_index] = 0 K = K - 1 new_list = [0] * len(A) for n, index in zip(A, idx): new_list[index] = n return new_list
def solution(A, K): if not A: return [] idx = [i for i in range(0, len(A))] while K: idx = [i + 1 for i in idx] max_index = idx.index(max(idx)) idx[max_index] = 0 k = K - 1 new_list = [0] * len(A) for (n, index) in zip(A, idx): new_list[index] = n return new_list
class Account: resource = 'accounts' def __init__(self, requestor): self.requestor = requestor def retrieve(self): return self.requestor.request('GET', '{}'.format(self.resource))
class Account: resource = 'accounts' def __init__(self, requestor): self.requestor = requestor def retrieve(self): return self.requestor.request('GET', '{}'.format(self.resource))
class Mapper: """This module takes a user-input string and chunks it into formatted tuples which contains relevant data for all essential pieces of string.""" def maptolist(self, arg, langbound): """Returns formatted-tuple containing relevant processing data for each token.""" #update return self._internalmap(arg, langbound) def _internalmap(self, arg, langbound): # Internally seperates the string into relevant tokens. # update return langbound.split(arg)
class Mapper: """This module takes a user-input string and chunks it into formatted tuples which contains relevant data for all essential pieces of string.""" def maptolist(self, arg, langbound): """Returns formatted-tuple containing relevant processing data for each token.""" return self._internalmap(arg, langbound) def _internalmap(self, arg, langbound): return langbound.split(arg)
_base_ = 'resnet50_head1_4xb64-steplr1e-1-20e_in1k-10pct.py' # optimizer optimizer = dict(lr=0.01)
_base_ = 'resnet50_head1_4xb64-steplr1e-1-20e_in1k-10pct.py' optimizer = dict(lr=0.01)
#!/usr/bin/env python3 class Text: """A probably unnecessary wrapper for a \\n-delimited block of text.""" def __init__(self, raw_text:str): self.raw_text = raw_text self.lines = [l.strip() for l in raw_text.split("\n")] def get_block(self, start, length): return self.lines[start: length + 1]
class Text: """A probably unnecessary wrapper for a \\n-delimited block of text.""" def __init__(self, raw_text: str): self.raw_text = raw_text self.lines = [l.strip() for l in raw_text.split('\n')] def get_block(self, start, length): return self.lines[start:length + 1]
# -*- coding: utf-8 -*- def search(key, arr): return list(filter(lambda n: n[0] == key, arr)) def main(): arr = [[100, 2], [300, 3], [500, 4], [800, 5], [200, 6]] inp_id = 200 ret = search(inp_id, arr) print(ret) if len(ret) > 0: print("ok") else: print("Error") if __name__ == '__main__': main()
def search(key, arr): return list(filter(lambda n: n[0] == key, arr)) def main(): arr = [[100, 2], [300, 3], [500, 4], [800, 5], [200, 6]] inp_id = 200 ret = search(inp_id, arr) print(ret) if len(ret) > 0: print('ok') else: print('Error') if __name__ == '__main__': main()
file = open("BoyNames.txt", "r") data = file.read() boys_names = data.split('\n') file = open("GirlNames.txt", "r") data = file.read() girls_names = data.split('\n') file.close() choice = input("Enter 'boy', 'girl', or 'both':") if choice == "boy": name = input("Enter a boy's name:") if name in boys_names: print(f"{name} was a popular boy's name between 2000 and 2009.") else: print(f"{name} was not a popular boy's name between 2000 and 2009.") elif choice == "girl": name = input("Enter a girl's name:") if name in girls_names: print(f"{name} was a popular girl's name between 2000 and 2009.") else: print(f"{name} was not a popular girl's name between 2000 and 2009.") elif choice == "both": bname = input("Enter a boy's name:") if bname in boys_names: print(f"{bname} was a popular boy's name between 2000 and 2009.") else: print(f"{bname} was not a popular boy's name between 2000 and 2009.") gname = input("Enter a girl's name:") if gname in girls_names: print(f"{gname} was a popular girl's name between 2000 and 2009.") else: print(f"{gname} was not a popular girl's name between 2000 and 2009.")
file = open('BoyNames.txt', 'r') data = file.read() boys_names = data.split('\n') file = open('GirlNames.txt', 'r') data = file.read() girls_names = data.split('\n') file.close() choice = input("Enter 'boy', 'girl', or 'both':") if choice == 'boy': name = input("Enter a boy's name:") if name in boys_names: print(f"{name} was a popular boy's name between 2000 and 2009.") else: print(f"{name} was not a popular boy's name between 2000 and 2009.") elif choice == 'girl': name = input("Enter a girl's name:") if name in girls_names: print(f"{name} was a popular girl's name between 2000 and 2009.") else: print(f"{name} was not a popular girl's name between 2000 and 2009.") elif choice == 'both': bname = input("Enter a boy's name:") if bname in boys_names: print(f"{bname} was a popular boy's name between 2000 and 2009.") else: print(f"{bname} was not a popular boy's name between 2000 and 2009.") gname = input("Enter a girl's name:") if gname in girls_names: print(f"{gname} was a popular girl's name between 2000 and 2009.") else: print(f"{gname} was not a popular girl's name between 2000 and 2009.")
a = int(input()) for _ in range(a): x = input() y = x[::-1] counter = 0 while x != y or not counter: x = str(int(x) + int(y)) y = x[::-1] counter += 1 print(counter, x)
a = int(input()) for _ in range(a): x = input() y = x[::-1] counter = 0 while x != y or not counter: x = str(int(x) + int(y)) y = x[::-1] counter += 1 print(counter, x)
# ------------------------------ # 81. Search in Rotated Sorted Array II # # Description: # Follow up for "Search in Rotated Sorted Array": # What if duplicates are allowed? # # Would this affect the run-time complexity? How and why? # # Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. # (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). # Write a function to determine if a given target is in the array. # The array may contain duplicates. # # Version: 1.0 # 01/27/18 by Jianfa # ------------------------------ class Solution(object): def search(self, nums, target): """ :type nums: List[int] :type target: int :rtype: bool """ if not nums: return False low = 0 high = len(nums) - 1 while low <= high: mid = (low + high) / 2 if nums[mid] == target: return True elif nums[mid] < nums[high]: if nums[mid] < target and target <= nums[high]: low = mid + 1 else: high = mid - 1 elif nums[mid] > nums[high]: if nums[mid] > target and target >= nums[low]: high = mid - 1 else: low = mid + 1 else: high -= 1 return False # Used for testing if __name__ == "__main__": test = Solution() nums = [1] target = 0 print(test.search(nums, target)) # ------------------------------ # Summary: # Follow the idea from https://leetcode.com/problems/search-in-rotated-sorted-array-ii/discuss/28194.
class Solution(object): def search(self, nums, target): """ :type nums: List[int] :type target: int :rtype: bool """ if not nums: return False low = 0 high = len(nums) - 1 while low <= high: mid = (low + high) / 2 if nums[mid] == target: return True elif nums[mid] < nums[high]: if nums[mid] < target and target <= nums[high]: low = mid + 1 else: high = mid - 1 elif nums[mid] > nums[high]: if nums[mid] > target and target >= nums[low]: high = mid - 1 else: low = mid + 1 else: high -= 1 return False if __name__ == '__main__': test = solution() nums = [1] target = 0 print(test.search(nums, target))
#!/usr/bin/env python3 # coding: utf-8 class K8sResponseHelper(object): LOCATION_NOT_DEFINE = "NOT_DEFINE" NGINX_INGRESS_SUFFIX = "nginx-ingress-controller" def __init__(self): self.input_data_list = None def set_input_data_list(self, input_data_list): """ :return: K8sResponseHelper """ self.input_data_list = input_data_list return self def get_input_data_list(self): """ :return: InputDataList[kubernetes/client/models/*] """ return self.input_data_list def parse(self): """ Parse InputDataList[kubernetes/client/models/*] to list[K8sResponseExternal]. InputDataList[kubernetes/client/models/*] set by K8sResponseHelper.set_input_data_list() Execute From K8sResponseExternalList.call() :return: list[K8sResponseExternal] """ assert False
class K8Sresponsehelper(object): location_not_define = 'NOT_DEFINE' nginx_ingress_suffix = 'nginx-ingress-controller' def __init__(self): self.input_data_list = None def set_input_data_list(self, input_data_list): """ :return: K8sResponseHelper """ self.input_data_list = input_data_list return self def get_input_data_list(self): """ :return: InputDataList[kubernetes/client/models/*] """ return self.input_data_list def parse(self): """ Parse InputDataList[kubernetes/client/models/*] to list[K8sResponseExternal]. InputDataList[kubernetes/client/models/*] set by K8sResponseHelper.set_input_data_list() Execute From K8sResponseExternalList.call() :return: list[K8sResponseExternal] """ assert False
# Input. s = '36743676522426214741687639282183216978128565594112364817283598621384839756628424146779311928318383597235968644687665159591573413233616717112157752469191845757712928347624726438516211153946892241449523148419426259291788938621886334734497823163281389389853675932246734153563861233894952657625868415432316155487242813798425779743561987563734944962846865263722712768674838244444385768568489842989878163655771847362656153372265945464128668412439248966939398765446171855144544285463517258749813731314365947372548811434646381595273172982466142248474238762554858654679415418693478512641864168398722199638775667744977941183772494538685398862344164521446115925528534491788728448668455349588972443295391385389551783289417349823383324748411689198219329996666752251815562522759374542652969147696419669914534586732436912798519697722586795746371697338416716842214313393228587413399534716394984183943123375517819622837972796431166264646432893478557659387795573234889141897313158457637142238315327877493994933514112645586351127139429281675912366669475931711974332271368287413985682374943195886455927839573986464555141679291998645936683639162588375974549467767623463935561847869527383395278248952314792112113126231246742753119748113828843917812547224498319849947517745625844819175973986843636628414965664466582172419197227695368492433353199233558872319529626825788288176275546566474824257336863977574347328469153319428883748696399544974133392589823343773897313173336568883385364166336362398636684459886283964242249228938383219255513996468586953519638111599935229115228837559242752925943653623682985576323929415445443378189472782454958232341986626791182861644112974418239286486722654442144851173538756859647218768134572858331849543266169672745221391659363674921469481143686952478771714585793322926824623482923579986434741714167134346384551362664177865452895348948953472328966995731169672573555621939584872187999325322327893336736611929752613241935211664248961527687778371971259654541239471766714469122213793348414477789271187324629397292446879752673' d = {} swapped_in_last = False for i, c in enumerate(s): k = int(c) # Edge cases. if i == 0 and c == s[-1]: d[k] = d.get(k, 0) + 1 swapped_in_last = True if i == len(s) - 2 and swapped_in_last: break if i < len(s) - 1 and s[i+1] == c: d[k] = d.get(k, 0) + 1 total = 0 for k, n in d.items(): total += k*n print(total)
s = '36743676522426214741687639282183216978128565594112364817283598621384839756628424146779311928318383597235968644687665159591573413233616717112157752469191845757712928347624726438516211153946892241449523148419426259291788938621886334734497823163281389389853675932246734153563861233894952657625868415432316155487242813798425779743561987563734944962846865263722712768674838244444385768568489842989878163655771847362656153372265945464128668412439248966939398765446171855144544285463517258749813731314365947372548811434646381595273172982466142248474238762554858654679415418693478512641864168398722199638775667744977941183772494538685398862344164521446115925528534491788728448668455349588972443295391385389551783289417349823383324748411689198219329996666752251815562522759374542652969147696419669914534586732436912798519697722586795746371697338416716842214313393228587413399534716394984183943123375517819622837972796431166264646432893478557659387795573234889141897313158457637142238315327877493994933514112645586351127139429281675912366669475931711974332271368287413985682374943195886455927839573986464555141679291998645936683639162588375974549467767623463935561847869527383395278248952314792112113126231246742753119748113828843917812547224498319849947517745625844819175973986843636628414965664466582172419197227695368492433353199233558872319529626825788288176275546566474824257336863977574347328469153319428883748696399544974133392589823343773897313173336568883385364166336362398636684459886283964242249228938383219255513996468586953519638111599935229115228837559242752925943653623682985576323929415445443378189472782454958232341986626791182861644112974418239286486722654442144851173538756859647218768134572858331849543266169672745221391659363674921469481143686952478771714585793322926824623482923579986434741714167134346384551362664177865452895348948953472328966995731169672573555621939584872187999325322327893336736611929752613241935211664248961527687778371971259654541239471766714469122213793348414477789271187324629397292446879752673' d = {} swapped_in_last = False for (i, c) in enumerate(s): k = int(c) if i == 0 and c == s[-1]: d[k] = d.get(k, 0) + 1 swapped_in_last = True if i == len(s) - 2 and swapped_in_last: break if i < len(s) - 1 and s[i + 1] == c: d[k] = d.get(k, 0) + 1 total = 0 for (k, n) in d.items(): total += k * n print(total)
try: a = int(input("Primeiro numero: ")) b = int(input("Segundo numero: ")) r = a / b except Exception as erro: print("Problema encontrado foi {}".format(erro.__class__)) else: print("O resultado e {:.1f}".format(r)) finally: print("Volte Sempre! Muito Obrigado :)")
try: a = int(input('Primeiro numero: ')) b = int(input('Segundo numero: ')) r = a / b except Exception as erro: print('Problema encontrado foi {}'.format(erro.__class__)) else: print('O resultado e {:.1f}'.format(r)) finally: print('Volte Sempre! Muito Obrigado :)')
# Isaac Roberts # Imports # Functions # Main execution of the program. def main(): # Open provided CSV file f = open("Python/airport-project/Airports.txt", 'r') # Define list to store seperated CSV file in. airports_list = [] # Loop through file and split each line into seperate lists. for i in f: split_line = i.split(',') # Delete the unneeded newline (\n) from the list del split_line[-1] # Append the split lines into one list to create a listed version of our CSV file. airports_list.append(split_line) menu(airports_list) # Kills program when called. def exitProgram(): exit() # Command line option menu. def menu(airports_list): while True: choice = input( ''' Choose an option by typing the respective number: 1 - Enter airport details 2 - Enter flight details 3 - Enter price plan and calculate profit 4 - Clear data 5 - Quit ''' ) try: if choice == '1': print("Enter airport details") elif choice == '2': print("Enter flight details") elif choice == '3': print("Enter price plan and calculate profit") elif choice == '4': print("Clear Data") elif choice == '5': exitProgram() except: print("Please enter a valid input.") main()
def main(): f = open('Python/airport-project/Airports.txt', 'r') airports_list = [] for i in f: split_line = i.split(',') del split_line[-1] airports_list.append(split_line) menu(airports_list) def exit_program(): exit() def menu(airports_list): while True: choice = input('\nChoose an option by typing the respective number:\n 1 - Enter airport details\n 2 - Enter flight details\n 3 - Enter price plan and calculate profit\n 4 - Clear data\n 5 - Quit\n ') try: if choice == '1': print('Enter airport details') elif choice == '2': print('Enter flight details') elif choice == '3': print('Enter price plan and calculate profit') elif choice == '4': print('Clear Data') elif choice == '5': exit_program() except: print('Please enter a valid input.') main()
class settings: def init(): global baseURL global password global username global usertestingpassword global usertestingemail global twilliotemplate
class Settings: def init(): global baseURL global password global username global usertestingpassword global usertestingemail global twilliotemplate
# # PySNMP MIB module NETONIX-SWITCH-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NETONIX-SWITCH-MIB # Produced by pysmi-0.3.4 at Wed May 1 14:19:56 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) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") snmpMIBGroups, = mibBuilder.importSymbols("SNMPv2-MIB", "snmpMIBGroups") Unsigned32, ObjectIdentity, ModuleIdentity, Counter64, IpAddress, Gauge32, iso, Bits, Counter32, MibIdentifier, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, enterprises, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "ObjectIdentity", "ModuleIdentity", "Counter64", "IpAddress", "Gauge32", "iso", "Bits", "Counter32", "MibIdentifier", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "enterprises", "NotificationType") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") netonixSwitch = ModuleIdentity((1, 3, 6, 1, 4, 1, 46242)) netonixSwitch.setRevisions(('1998-03-23 18:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: netonixSwitch.setRevisionsDescriptions(('The MIB Module for Netonix Switches.',)) if mibBuilder.loadTexts: netonixSwitch.setLastUpdated('9803231800Z') if mibBuilder.loadTexts: netonixSwitch.setOrganization('Netonix') if mibBuilder.loadTexts: netonixSwitch.setContactInfo('eric@netonix.com') if mibBuilder.loadTexts: netonixSwitch.setDescription('The MIB Module for Netonix Switches.') netonixSwitchGroup = ObjectGroup((1, 3, 6, 1, 6, 3, 1, 2, 2, 8)).setObjects(("NETONIX-SWITCH-MIB", "firmwareVersion"), ("NETONIX-SWITCH-MIB", "fanSpeed"), ("NETONIX-SWITCH-MIB", "tempDescription"), ("NETONIX-SWITCH-MIB", "temp"), ("NETONIX-SWITCH-MIB", "voltageDescription"), ("NETONIX-SWITCH-MIB", "voltage"), ("NETONIX-SWITCH-MIB", "poeStatus"), ("NETONIX-SWITCH-MIB", "totalPowerConsumption"), ("NETONIX-SWITCH-MIB", "dcdcInputCurrent"), ("NETONIX-SWITCH-MIB", "dcdcEfficiency")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): netonixSwitchGroup = netonixSwitchGroup.setStatus('current') if mibBuilder.loadTexts: netonixSwitchGroup.setDescription('A collection of objects providing basic instrumentation and control of an SNMPv2 entity.') netonixSwitchConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 46242, 99)) netonixSwitchGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 46242, 99, 1)) netonixSwitchCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 46242, 99, 2)) netonixSwitchCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 46242, 99, 2, 1)).setObjects(("NETONIX-SWITCH-MIB", "netonixSwitchGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): netonixSwitchCompliance = netonixSwitchCompliance.setStatus('current') if mibBuilder.loadTexts: netonixSwitchCompliance.setDescription('The compliance statement for switches which implement the Netonix Switch MIB.') class VoltageTC(TextualConvention, Integer32): description = 'A voltage with 2 decimal places' status = 'current' displayHint = 'd-2' class PowerTC(TextualConvention, Integer32): description = 'Power consumption in watts with 1 decimal place' status = 'current' displayHint = 'd-1' class CurrentTC(TextualConvention, Integer32): description = 'Current in amps with 1 decimal place' status = 'current' displayHint = 'd-1' firmwareVersion = MibScalar((1, 3, 6, 1, 4, 1, 46242, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: firmwareVersion.setStatus('current') if mibBuilder.loadTexts: firmwareVersion.setDescription('The version of the firmware running on the switch') totalPowerConsumption = MibScalar((1, 3, 6, 1, 4, 1, 46242, 6), PowerTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: totalPowerConsumption.setStatus('current') if mibBuilder.loadTexts: totalPowerConsumption.setDescription('Total power being consumed by the switch, in Watts') dcdcInputCurrent = MibScalar((1, 3, 6, 1, 4, 1, 46242, 7), CurrentTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: dcdcInputCurrent.setStatus('current') if mibBuilder.loadTexts: dcdcInputCurrent.setDescription('DCDC Input Current in amps') dcdcEfficiency = MibScalar((1, 3, 6, 1, 4, 1, 46242, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: dcdcEfficiency.setStatus('current') if mibBuilder.loadTexts: dcdcEfficiency.setDescription('DCDC power supply efficiency, percentage') fanTable = MibTable((1, 3, 6, 1, 4, 1, 46242, 2), ) if mibBuilder.loadTexts: fanTable.setStatus('current') if mibBuilder.loadTexts: fanTable.setDescription('Fan watching information.') fanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 46242, 2, 1), ).setIndexNames((0, "NETONIX-SWITCH-MIB", "fanIndex")) if mibBuilder.loadTexts: fanEntry.setStatus('current') if mibBuilder.loadTexts: fanEntry.setDescription('An entry containing a disk and its statistics.') fanIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: fanIndex.setStatus('current') if mibBuilder.loadTexts: fanIndex.setDescription('Integer reference number (row number) for the fan mib.') fanSpeed = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fanSpeed.setStatus('current') if mibBuilder.loadTexts: fanSpeed.setDescription('Integer reference number (row number) for the fan mib.') poeStatusTable = MibTable((1, 3, 6, 1, 4, 1, 46242, 5), ) if mibBuilder.loadTexts: poeStatusTable.setStatus('current') if mibBuilder.loadTexts: poeStatusTable.setDescription('PoE Status per port.') poeStatusEntry = MibTableRow((1, 3, 6, 1, 4, 1, 46242, 5, 1), ).setIndexNames((0, "NETONIX-SWITCH-MIB", "poeStatusIndex")) if mibBuilder.loadTexts: poeStatusEntry.setStatus('current') if mibBuilder.loadTexts: poeStatusEntry.setDescription('An entry containing poe status.') poeStatusIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: poeStatusIndex.setStatus('current') if mibBuilder.loadTexts: poeStatusIndex.setDescription('Integer reference number (row number) for the poe status.') poeStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 5, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: poeStatus.setStatus('current') if mibBuilder.loadTexts: poeStatus.setDescription('poe status.') tempTable = MibTable((1, 3, 6, 1, 4, 1, 46242, 3), ) if mibBuilder.loadTexts: tempTable.setStatus('current') if mibBuilder.loadTexts: tempTable.setDescription('Temperature watching information.') tempEntry = MibTableRow((1, 3, 6, 1, 4, 1, 46242, 3, 1), ).setIndexNames((0, "NETONIX-SWITCH-MIB", "tempIndex")) if mibBuilder.loadTexts: tempEntry.setStatus('current') if mibBuilder.loadTexts: tempEntry.setDescription('An entry containing a temperature sensor.') tempIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: tempIndex.setStatus('current') if mibBuilder.loadTexts: tempIndex.setDescription('Integer reference number (row number) for the temp mib.') tempDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 3, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: tempDescription.setStatus('current') if mibBuilder.loadTexts: tempDescription.setDescription('Description of this temperature sensor') temp = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: temp.setStatus('current') if mibBuilder.loadTexts: temp.setDescription('The current temperature for this sensor') voltageTable = MibTable((1, 3, 6, 1, 4, 1, 46242, 4), ) if mibBuilder.loadTexts: voltageTable.setStatus('current') if mibBuilder.loadTexts: voltageTable.setDescription('Voltage watching information.') voltageEntry = MibTableRow((1, 3, 6, 1, 4, 1, 46242, 4, 1), ).setIndexNames((0, "NETONIX-SWITCH-MIB", "voltageIndex")) if mibBuilder.loadTexts: voltageEntry.setStatus('current') if mibBuilder.loadTexts: voltageEntry.setDescription('An entry containing a voltage sensor.') voltageIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 4, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: voltageIndex.setStatus('current') if mibBuilder.loadTexts: voltageIndex.setDescription('Integer reference number (row number) for the voltage mib.') voltageDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 4, 1, 2), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: voltageDescription.setStatus('current') if mibBuilder.loadTexts: voltageDescription.setDescription('Description of this voltage sensor') voltage = MibTableColumn((1, 3, 6, 1, 4, 1, 46242, 4, 1, 3), VoltageTC()).setMaxAccess("readonly") if mibBuilder.loadTexts: voltage.setStatus('current') if mibBuilder.loadTexts: voltage.setDescription('The current voltage for this sensor') mibBuilder.exportSymbols("NETONIX-SWITCH-MIB", VoltageTC=VoltageTC, netonixSwitchGroup=netonixSwitchGroup, dcdcEfficiency=dcdcEfficiency, voltageIndex=voltageIndex, voltage=voltage, firmwareVersion=firmwareVersion, netonixSwitchConformance=netonixSwitchConformance, tempTable=tempTable, fanIndex=fanIndex, voltageEntry=voltageEntry, tempDescription=tempDescription, tempIndex=tempIndex, fanTable=fanTable, poeStatusIndex=poeStatusIndex, netonixSwitchCompliances=netonixSwitchCompliances, netonixSwitch=netonixSwitch, fanEntry=fanEntry, CurrentTC=CurrentTC, netonixSwitchGroups=netonixSwitchGroups, dcdcInputCurrent=dcdcInputCurrent, netonixSwitchCompliance=netonixSwitchCompliance, fanSpeed=fanSpeed, poeStatusEntry=poeStatusEntry, voltageDescription=voltageDescription, totalPowerConsumption=totalPowerConsumption, PYSNMP_MODULE_ID=netonixSwitch, poeStatus=poeStatus, voltageTable=voltageTable, tempEntry=tempEntry, poeStatusTable=poeStatusTable, temp=temp, PowerTC=PowerTC)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (single_value_constraint, value_range_constraint, value_size_constraint, constraints_union, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection') (object_group, notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'NotificationGroup', 'ModuleCompliance') (snmp_mib_groups,) = mibBuilder.importSymbols('SNMPv2-MIB', 'snmpMIBGroups') (unsigned32, object_identity, module_identity, counter64, ip_address, gauge32, iso, bits, counter32, mib_identifier, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, time_ticks, enterprises, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'ObjectIdentity', 'ModuleIdentity', 'Counter64', 'IpAddress', 'Gauge32', 'iso', 'Bits', 'Counter32', 'MibIdentifier', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'TimeTicks', 'enterprises', 'NotificationType') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') netonix_switch = module_identity((1, 3, 6, 1, 4, 1, 46242)) netonixSwitch.setRevisions(('1998-03-23 18:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: netonixSwitch.setRevisionsDescriptions(('The MIB Module for Netonix Switches.',)) if mibBuilder.loadTexts: netonixSwitch.setLastUpdated('9803231800Z') if mibBuilder.loadTexts: netonixSwitch.setOrganization('Netonix') if mibBuilder.loadTexts: netonixSwitch.setContactInfo('eric@netonix.com') if mibBuilder.loadTexts: netonixSwitch.setDescription('The MIB Module for Netonix Switches.') netonix_switch_group = object_group((1, 3, 6, 1, 6, 3, 1, 2, 2, 8)).setObjects(('NETONIX-SWITCH-MIB', 'firmwareVersion'), ('NETONIX-SWITCH-MIB', 'fanSpeed'), ('NETONIX-SWITCH-MIB', 'tempDescription'), ('NETONIX-SWITCH-MIB', 'temp'), ('NETONIX-SWITCH-MIB', 'voltageDescription'), ('NETONIX-SWITCH-MIB', 'voltage'), ('NETONIX-SWITCH-MIB', 'poeStatus'), ('NETONIX-SWITCH-MIB', 'totalPowerConsumption'), ('NETONIX-SWITCH-MIB', 'dcdcInputCurrent'), ('NETONIX-SWITCH-MIB', 'dcdcEfficiency')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): netonix_switch_group = netonixSwitchGroup.setStatus('current') if mibBuilder.loadTexts: netonixSwitchGroup.setDescription('A collection of objects providing basic instrumentation and control of an SNMPv2 entity.') netonix_switch_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 46242, 99)) netonix_switch_groups = mib_identifier((1, 3, 6, 1, 4, 1, 46242, 99, 1)) netonix_switch_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 46242, 99, 2)) netonix_switch_compliance = module_compliance((1, 3, 6, 1, 4, 1, 46242, 99, 2, 1)).setObjects(('NETONIX-SWITCH-MIB', 'netonixSwitchGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): netonix_switch_compliance = netonixSwitchCompliance.setStatus('current') if mibBuilder.loadTexts: netonixSwitchCompliance.setDescription('The compliance statement for switches which implement the Netonix Switch MIB.') class Voltagetc(TextualConvention, Integer32): description = 'A voltage with 2 decimal places' status = 'current' display_hint = 'd-2' class Powertc(TextualConvention, Integer32): description = 'Power consumption in watts with 1 decimal place' status = 'current' display_hint = 'd-1' class Currenttc(TextualConvention, Integer32): description = 'Current in amps with 1 decimal place' status = 'current' display_hint = 'd-1' firmware_version = mib_scalar((1, 3, 6, 1, 4, 1, 46242, 1), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: firmwareVersion.setStatus('current') if mibBuilder.loadTexts: firmwareVersion.setDescription('The version of the firmware running on the switch') total_power_consumption = mib_scalar((1, 3, 6, 1, 4, 1, 46242, 6), power_tc()).setMaxAccess('readonly') if mibBuilder.loadTexts: totalPowerConsumption.setStatus('current') if mibBuilder.loadTexts: totalPowerConsumption.setDescription('Total power being consumed by the switch, in Watts') dcdc_input_current = mib_scalar((1, 3, 6, 1, 4, 1, 46242, 7), current_tc()).setMaxAccess('readonly') if mibBuilder.loadTexts: dcdcInputCurrent.setStatus('current') if mibBuilder.loadTexts: dcdcInputCurrent.setDescription('DCDC Input Current in amps') dcdc_efficiency = mib_scalar((1, 3, 6, 1, 4, 1, 46242, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: dcdcEfficiency.setStatus('current') if mibBuilder.loadTexts: dcdcEfficiency.setDescription('DCDC power supply efficiency, percentage') fan_table = mib_table((1, 3, 6, 1, 4, 1, 46242, 2)) if mibBuilder.loadTexts: fanTable.setStatus('current') if mibBuilder.loadTexts: fanTable.setDescription('Fan watching information.') fan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 46242, 2, 1)).setIndexNames((0, 'NETONIX-SWITCH-MIB', 'fanIndex')) if mibBuilder.loadTexts: fanEntry.setStatus('current') if mibBuilder.loadTexts: fanEntry.setDescription('An entry containing a disk and its statistics.') fan_index = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: fanIndex.setStatus('current') if mibBuilder.loadTexts: fanIndex.setDescription('Integer reference number (row number) for the fan mib.') fan_speed = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fanSpeed.setStatus('current') if mibBuilder.loadTexts: fanSpeed.setDescription('Integer reference number (row number) for the fan mib.') poe_status_table = mib_table((1, 3, 6, 1, 4, 1, 46242, 5)) if mibBuilder.loadTexts: poeStatusTable.setStatus('current') if mibBuilder.loadTexts: poeStatusTable.setDescription('PoE Status per port.') poe_status_entry = mib_table_row((1, 3, 6, 1, 4, 1, 46242, 5, 1)).setIndexNames((0, 'NETONIX-SWITCH-MIB', 'poeStatusIndex')) if mibBuilder.loadTexts: poeStatusEntry.setStatus('current') if mibBuilder.loadTexts: poeStatusEntry.setDescription('An entry containing poe status.') poe_status_index = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: poeStatusIndex.setStatus('current') if mibBuilder.loadTexts: poeStatusIndex.setDescription('Integer reference number (row number) for the poe status.') poe_status = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 5, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: poeStatus.setStatus('current') if mibBuilder.loadTexts: poeStatus.setDescription('poe status.') temp_table = mib_table((1, 3, 6, 1, 4, 1, 46242, 3)) if mibBuilder.loadTexts: tempTable.setStatus('current') if mibBuilder.loadTexts: tempTable.setDescription('Temperature watching information.') temp_entry = mib_table_row((1, 3, 6, 1, 4, 1, 46242, 3, 1)).setIndexNames((0, 'NETONIX-SWITCH-MIB', 'tempIndex')) if mibBuilder.loadTexts: tempEntry.setStatus('current') if mibBuilder.loadTexts: tempEntry.setDescription('An entry containing a temperature sensor.') temp_index = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: tempIndex.setStatus('current') if mibBuilder.loadTexts: tempIndex.setDescription('Integer reference number (row number) for the temp mib.') temp_description = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 3, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: tempDescription.setStatus('current') if mibBuilder.loadTexts: tempDescription.setDescription('Description of this temperature sensor') temp = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 3, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: temp.setStatus('current') if mibBuilder.loadTexts: temp.setDescription('The current temperature for this sensor') voltage_table = mib_table((1, 3, 6, 1, 4, 1, 46242, 4)) if mibBuilder.loadTexts: voltageTable.setStatus('current') if mibBuilder.loadTexts: voltageTable.setDescription('Voltage watching information.') voltage_entry = mib_table_row((1, 3, 6, 1, 4, 1, 46242, 4, 1)).setIndexNames((0, 'NETONIX-SWITCH-MIB', 'voltageIndex')) if mibBuilder.loadTexts: voltageEntry.setStatus('current') if mibBuilder.loadTexts: voltageEntry.setDescription('An entry containing a voltage sensor.') voltage_index = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 4, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: voltageIndex.setStatus('current') if mibBuilder.loadTexts: voltageIndex.setDescription('Integer reference number (row number) for the voltage mib.') voltage_description = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 4, 1, 2), display_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: voltageDescription.setStatus('current') if mibBuilder.loadTexts: voltageDescription.setDescription('Description of this voltage sensor') voltage = mib_table_column((1, 3, 6, 1, 4, 1, 46242, 4, 1, 3), voltage_tc()).setMaxAccess('readonly') if mibBuilder.loadTexts: voltage.setStatus('current') if mibBuilder.loadTexts: voltage.setDescription('The current voltage for this sensor') mibBuilder.exportSymbols('NETONIX-SWITCH-MIB', VoltageTC=VoltageTC, netonixSwitchGroup=netonixSwitchGroup, dcdcEfficiency=dcdcEfficiency, voltageIndex=voltageIndex, voltage=voltage, firmwareVersion=firmwareVersion, netonixSwitchConformance=netonixSwitchConformance, tempTable=tempTable, fanIndex=fanIndex, voltageEntry=voltageEntry, tempDescription=tempDescription, tempIndex=tempIndex, fanTable=fanTable, poeStatusIndex=poeStatusIndex, netonixSwitchCompliances=netonixSwitchCompliances, netonixSwitch=netonixSwitch, fanEntry=fanEntry, CurrentTC=CurrentTC, netonixSwitchGroups=netonixSwitchGroups, dcdcInputCurrent=dcdcInputCurrent, netonixSwitchCompliance=netonixSwitchCompliance, fanSpeed=fanSpeed, poeStatusEntry=poeStatusEntry, voltageDescription=voltageDescription, totalPowerConsumption=totalPowerConsumption, PYSNMP_MODULE_ID=netonixSwitch, poeStatus=poeStatus, voltageTable=voltageTable, tempEntry=tempEntry, poeStatusTable=poeStatusTable, temp=temp, PowerTC=PowerTC)
###checks to see which elements in array1, a1, are substrings of elements in array2, a2### ###returns sorted array of these elements### def in_array(a1, a2): inArray = set() for i in a1: for x in a2: if i in x: inArray.add(i) return sorted(inArray)
def in_array(a1, a2): in_array = set() for i in a1: for x in a2: if i in x: inArray.add(i) return sorted(inArray)
AI_TYPE_TO_ROLE = {"redis_ycsb": ("ycsb", "redis"), "hadoop": ("hadoopmaster", "hadoopslave"), "linpack": ("linpack",), "wrk": ("wrk", "apache"), "filebench": ("filebench",), "sysbench": ("sysbench", "mysql"), #"unixbench": ("unixbench",), "netperf": ("netclient", "netserver"), #"memtier": ("memtier", "redis"), "multichase": ("multichase",), "oldisim": ("oldisimdriver", "oldisimlb", "oldisimroot", "oldisimleaf"), "open_daytrader": ("client_open_daytrader", "geronimo", "mysql")} #"mongo_ycsb": ("ycsb", "mongos", "mongo_cfg_server", "mongodb")} AI_ROLE_TO_TYPE = {role: t for t, roles in AI_TYPE_TO_ROLE.items() for role in roles} AI_TYPE_TO_METRICS = {t: ("latency", "throughput") for t, _ in AI_TYPE_TO_ROLE.items()} AI_TYPE_TO_METRICS_OVERRIDE = {"linpack": ("throughput",), "filebench": ("throughput",), "unixbench": ("throughput",), "netperf": ("bandwidth",), "multichase": ("throughput", "completion_time", "quiescent_time")} AI_TYPE_TO_METRICS.update(AI_TYPE_TO_METRICS_OVERRIDE) AI_ROLE_TO_COUNT = {role: 1 for role in AI_ROLE_TO_TYPE.keys()} AI_ROLE_TO_COUNT_OVERRIDE = {"hadoopslave": 2, "mongodb": 3, "oldisimleaf": 2} AI_ROLE_TO_COUNT.update(AI_ROLE_TO_COUNT_OVERRIDE) def getPerfColName(t): m = AI_TYPE_TO_METRICS[t][0] metric = f"avg_{m}_rescaled" if m == "throughput": metric = f"{metric}_inverse" return metric
ai_type_to_role = {'redis_ycsb': ('ycsb', 'redis'), 'hadoop': ('hadoopmaster', 'hadoopslave'), 'linpack': ('linpack',), 'wrk': ('wrk', 'apache'), 'filebench': ('filebench',), 'sysbench': ('sysbench', 'mysql'), 'multichase': ('multichase',), 'oldisim': ('oldisimdriver', 'oldisimlb', 'oldisimroot', 'oldisimleaf'), 'open_daytrader': ('client_open_daytrader', 'geronimo', 'mysql')} ai_role_to_type = {role: t for (t, roles) in AI_TYPE_TO_ROLE.items() for role in roles} ai_type_to_metrics = {t: ('latency', 'throughput') for (t, _) in AI_TYPE_TO_ROLE.items()} ai_type_to_metrics_override = {'linpack': ('throughput',), 'filebench': ('throughput',), 'unixbench': ('throughput',), 'netperf': ('bandwidth',), 'multichase': ('throughput', 'completion_time', 'quiescent_time')} AI_TYPE_TO_METRICS.update(AI_TYPE_TO_METRICS_OVERRIDE) ai_role_to_count = {role: 1 for role in AI_ROLE_TO_TYPE.keys()} ai_role_to_count_override = {'hadoopslave': 2, 'mongodb': 3, 'oldisimleaf': 2} AI_ROLE_TO_COUNT.update(AI_ROLE_TO_COUNT_OVERRIDE) def get_perf_col_name(t): m = AI_TYPE_TO_METRICS[t][0] metric = f'avg_{m}_rescaled' if m == 'throughput': metric = f'{metric}_inverse' return metric
def permutation(input_list): if len(input_list) == 0: return [] elif len(input_list) == 1: return [input_list] else: result = [] for i in range(len(input_list)): element = input_list[i] other_elements = input_list[:i] + input_list[i + 1:] for p in permutation(other_elements): result.append([element] + p) return result def permutation2(input_list): if len(input_list) == 0: yield [] elif len(input_list) == 1: yield input_list else: for i in range(len(input_list)): element = input_list[i] other_elements = input_list[:i] + input_list[i + 1:] for p in permutation2(other_elements): yield [element] + p
def permutation(input_list): if len(input_list) == 0: return [] elif len(input_list) == 1: return [input_list] else: result = [] for i in range(len(input_list)): element = input_list[i] other_elements = input_list[:i] + input_list[i + 1:] for p in permutation(other_elements): result.append([element] + p) return result def permutation2(input_list): if len(input_list) == 0: yield [] elif len(input_list) == 1: yield input_list else: for i in range(len(input_list)): element = input_list[i] other_elements = input_list[:i] + input_list[i + 1:] for p in permutation2(other_elements): yield ([element] + p)
# Definition for a binary tree node. class TreeNode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def constructMaximumBinaryTree(self, nums): """ :type nums: List[int] :rtype: TreeNode """ maxnum = -1 for x in nums: if x > maxnum: maxnum = x mid = nums.index(maxnum) root = TreeNode(maxnum) if mid > 0: root.left = self.constructMaximumBinaryTree(nums[:mid]) else: root.left = None if mid < len(nums)-1: root.right = self.constructMaximumBinaryTree(nums[mid+1:]) else: root.right = None return root
class Treenode(object): def __init__(self, x): self.val = x self.left = None self.right = None class Solution(object): def construct_maximum_binary_tree(self, nums): """ :type nums: List[int] :rtype: TreeNode """ maxnum = -1 for x in nums: if x > maxnum: maxnum = x mid = nums.index(maxnum) root = tree_node(maxnum) if mid > 0: root.left = self.constructMaximumBinaryTree(nums[:mid]) else: root.left = None if mid < len(nums) - 1: root.right = self.constructMaximumBinaryTree(nums[mid + 1:]) else: root.right = None return root
""" [12/03/13] Challenge #143 [Easy] Braille https://www.reddit.com/r/dailyprogrammer/comments/1s061q/120313_challenge_143_easy_braille/ # [](#EasyIcon) *(Easy)*: Braille [Braille](http://en.wikipedia.org/wiki/Braille) is a writing system based on a series of raised / lowered bumps on a material, for the purpose of being read through touch rather than sight. It's an incredibly powerful reading & writing system for those who are blind / visually impaired. Though the letter system has up to 64 unique glyph, 26 are used in [English Braille](http://en.wikipedia.org/wiki/English_Braille) for letters. The rest are used for numbers, words, accents, ligatures, etc. Your goal is to read in a string of Braille characters ([using standard English Braille defined here](http://en.wikipedia.org/wiki/English_Braille#Alphabet)) and print off the word in standard English letters. You only have to support the 26 English letters. # Formal Inputs & Outputs ## Input Description Input will consistent of an array of 2x6 space-delimited Braille characters. This array is always on the same line, so regardless of how long the text is, it will always be on 3-rows of text. A lowered bump is a dot character '.', while a raised bump is an upper-case 'O' character. ## Output Description Print the transcribed Braille. # Sample Inputs & Outputs ## Sample Input O. O. O. O. O. .O O. O. O. OO OO .O O. O. .O OO .O OO O. .O .. .. O. O. O. .O O. O. O. .. ## Sample Output helloworld """ def main(): pass if __name__ == "__main__": main()
""" [12/03/13] Challenge #143 [Easy] Braille https://www.reddit.com/r/dailyprogrammer/comments/1s061q/120313_challenge_143_easy_braille/ # [](#EasyIcon) *(Easy)*: Braille [Braille](http://en.wikipedia.org/wiki/Braille) is a writing system based on a series of raised / lowered bumps on a material, for the purpose of being read through touch rather than sight. It's an incredibly powerful reading & writing system for those who are blind / visually impaired. Though the letter system has up to 64 unique glyph, 26 are used in [English Braille](http://en.wikipedia.org/wiki/English_Braille) for letters. The rest are used for numbers, words, accents, ligatures, etc. Your goal is to read in a string of Braille characters ([using standard English Braille defined here](http://en.wikipedia.org/wiki/English_Braille#Alphabet)) and print off the word in standard English letters. You only have to support the 26 English letters. # Formal Inputs & Outputs ## Input Description Input will consistent of an array of 2x6 space-delimited Braille characters. This array is always on the same line, so regardless of how long the text is, it will always be on 3-rows of text. A lowered bump is a dot character '.', while a raised bump is an upper-case 'O' character. ## Output Description Print the transcribed Braille. # Sample Inputs & Outputs ## Sample Input O. O. O. O. O. .O O. O. O. OO OO .O O. O. .O OO .O OO O. .O .. .. O. O. O. .O O. O. O. .. ## Sample Output helloworld """ def main(): pass if __name__ == '__main__': main()
""" After an apology from the opponent (they play C while it plays D, only happens when they play D first), if the opponent immediately plays D, it plays another C instead of punishing in order to encourage the opponent to get back to CC-chain (i.e. olive branch). If it plays D again, go full D. Difference between tftGrudgeOliveCM is that it does not have an increasing threshold of required good relations each time it is betrayed. Makes it vulnerable to strategies like alternating between D and C. """ # memory[0] is True if it is currently doing the olive branch procedure, memory[1] is true if it is playing all D. def strategy(history, memory): if history.shape[1] == 0: return 1, [False, False] elif history[1][-1] == 0 and history[0][-1] == 1: # new betrayal if history.shape[1] > 2 and history[0][-2] == 0: # just exited apology cycle return 1, [True, False] elif memory[0]: # betrayed during the 'good relations' period memory[1] = True elif history[1][-1] == 1 and memory[0]: memory[0] = False if memory[1]: return 0, memory return history[1][-1], memory
""" After an apology from the opponent (they play C while it plays D, only happens when they play D first), if the opponent immediately plays D, it plays another C instead of punishing in order to encourage the opponent to get back to CC-chain (i.e. olive branch). If it plays D again, go full D. Difference between tftGrudgeOliveCM is that it does not have an increasing threshold of required good relations each time it is betrayed. Makes it vulnerable to strategies like alternating between D and C. """ def strategy(history, memory): if history.shape[1] == 0: return (1, [False, False]) elif history[1][-1] == 0 and history[0][-1] == 1: if history.shape[1] > 2 and history[0][-2] == 0: return (1, [True, False]) elif memory[0]: memory[1] = True elif history[1][-1] == 1 and memory[0]: memory[0] = False if memory[1]: return (0, memory) return (history[1][-1], memory)
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(): REAL_FLAG = "oren_ctf_spectre!" FAKE_FLAG = "oren_ctf_z3r0d4y!" license = [chr(ord(c1) ^ ord(c2)) for c1,c2 in zip(REAL_FLAG, FAKE_FLAG)] with open('license.bin', 'wb') as licensefile: for byte in license: licensefile.write(bytes(byte, 'utf-8')) if __name__ == "__main__": main()
def main(): real_flag = 'oren_ctf_spectre!' fake_flag = 'oren_ctf_z3r0d4y!' license = [chr(ord(c1) ^ ord(c2)) for (c1, c2) in zip(REAL_FLAG, FAKE_FLAG)] with open('license.bin', 'wb') as licensefile: for byte in license: licensefile.write(bytes(byte, 'utf-8')) if __name__ == '__main__': main()
class OUTGOING: TOKEN = 'token' TEAM_ID = 'team_id' TEAM_DOMAIN = 'team_domain' CHANNEL_ID = 'channel_id' CHANNEL_NAME = 'channel_name' TIMESTAMP = 'timestamp' USER_ID = 'user_id' USER_NAME = 'user_name' TEXT = 'text' TRIGGER_WORD = 'trigger_word' class INCOMING: USER_NAME = 'username' TEXT = 'text' ICON_URL = 'icon_url' ICON_EMOJI = 'icon_emoji'
class Outgoing: token = 'token' team_id = 'team_id' team_domain = 'team_domain' channel_id = 'channel_id' channel_name = 'channel_name' timestamp = 'timestamp' user_id = 'user_id' user_name = 'user_name' text = 'text' trigger_word = 'trigger_word' class Incoming: user_name = 'username' text = 'text' icon_url = 'icon_url' icon_emoji = 'icon_emoji'
ODL_IP = "127.0.0.1" ODL_PORT = "8181" ODL_USER = "admin" ODL_PASS = "admin"
odl_ip = '127.0.0.1' odl_port = '8181' odl_user = 'admin' odl_pass = 'admin'
def arithmetic_arranger(problems, solutions = False): if len(problems) > 5: return 'Error: Too many problems.' problem_list = [] for prob in problems: output = '' arr = prob.split(' ') if arr[1] != '+' or arr[1] != '+': return "Error: Operator must be '+' or '-'." if arr[0].isdigit() == False or arr[2].isdigit() == False: return "Error: Numbers must only contain digits." if len(arr[0]) > 4 or len(arr[2]) > 4: return "Error: Numbers cannot be more than four digits." max_digits = max([len(arr[0]), len(arr[2])]) for space in range(max_digits - len(arr[0])): output += ' ' output += arr[0] + '\n' output += arr[1] + ' ' for space in range(max_digits - len(arr[2])): output += ' ' output += arr[2] + '\n' for space in range(max_digits): output += '-' output += '\n' if solutions: if arr[1] == '+': solution = (arr[0]) + int(arr[1]) else: solution = (arr[0]) - int(arr[1]) output += str(solution) problem_list.append(output) return problem_list.split(' ')
def arithmetic_arranger(problems, solutions=False): if len(problems) > 5: return 'Error: Too many problems.' problem_list = [] for prob in problems: output = '' arr = prob.split(' ') if arr[1] != '+' or arr[1] != '+': return "Error: Operator must be '+' or '-'." if arr[0].isdigit() == False or arr[2].isdigit() == False: return 'Error: Numbers must only contain digits.' if len(arr[0]) > 4 or len(arr[2]) > 4: return 'Error: Numbers cannot be more than four digits.' max_digits = max([len(arr[0]), len(arr[2])]) for space in range(max_digits - len(arr[0])): output += ' ' output += arr[0] + '\n' output += arr[1] + ' ' for space in range(max_digits - len(arr[2])): output += ' ' output += arr[2] + '\n' for space in range(max_digits): output += '-' output += '\n' if solutions: if arr[1] == '+': solution = arr[0] + int(arr[1]) else: solution = arr[0] - int(arr[1]) output += str(solution) problem_list.append(output) return problem_list.split(' ')
_, ax = plt.subplots(figsize=(8, 8)) ax = sns.kdeplot( data=X_train_scaled, x="Culmen Length (mm)", y="Culmen Depth (mm)", levels=10, fill=True, cmap=plt.cm.viridis, ax=ax, ) _ = ax.axis("square")
(_, ax) = plt.subplots(figsize=(8, 8)) ax = sns.kdeplot(data=X_train_scaled, x='Culmen Length (mm)', y='Culmen Depth (mm)', levels=10, fill=True, cmap=plt.cm.viridis, ax=ax) _ = ax.axis('square')
def doiList(): return [ "10.1016/j.jksuci.2019.05.004", # ScienceDirect good example "10.1016/j.eswa.2019.04.070" ]
def doi_list(): return ['10.1016/j.jksuci.2019.05.004', '10.1016/j.eswa.2019.04.070']
class IPGroup(): def __init__(self, key, packet_count, total_packet_size, process_number): self.packet_count = packet_count self.total_packet_size = total_packet_size self.process_number = process_number self.groupname = key @property def averagePacketSize(self): return self.total_packet_size / self.packet_count @property def averagePacketCountPerProcess(self): return self.packet_count / self.process_number
class Ipgroup: def __init__(self, key, packet_count, total_packet_size, process_number): self.packet_count = packet_count self.total_packet_size = total_packet_size self.process_number = process_number self.groupname = key @property def average_packet_size(self): return self.total_packet_size / self.packet_count @property def average_packet_count_per_process(self): return self.packet_count / self.process_number
# Specifies the login method to use -- whether the user logs in by entering # his username, e-mail address, or either one of both. Possible values # are 'username' | 'email' | 'username_email' # ACCOUNT_AUTHENTICATION_METHOD # The URL to redirect to after a successful e-mail confirmation, in case no # user is logged in. Default value is settings.LOGIN_URL. # ACCOUNT_EMAIL_CONFIRMATION_ANONYMOUS_REDIRECT_URL # The URL to redirect to after a successful e-mail confirmation, in case of # an authenticated user. Default is settings.LOGIN_REDIRECT_URL # ACCOUNT_EMAIL_CONFIRMATION_AUTHENTICATED_REDIRECT_URL # Determines the expiration date of email confirmation mails (# of days). # ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS = 3 # The user is required to hand over an e-mail address when signing up. ACCOUNT_EMAIL_REQUIRED = True # Determines the e-mail verification method during signup. When set to # "mandatory" the user is blocked from logging in until the email # address is verified. Choose "optional" or "none" to allow logins # with an unverified e-mail address. In case of "optional", the e-mail # verification mail is still sent, whereas in case of "none" no e-mail # verification mails are sent. ACCOUNT_EMAIL_VERIFICATION = "optional" # Subject-line prefix to use for email messages sent. By default, the name # of the current Site (django.contrib.sites) is used. # ACCOUNT_EMAIL_SUBJECT_PREFIX = '[Site] ' # A string pointing to a custom form class (e.g. 'myapp.forms.SignupForm') # that is used during signup to ask the user for additional input # (e.g. newsletter signup, birth date). This class should implement a # 'save' method, accepting the newly signed up user as its only parameter. # ACCOUNT_SIGNUP_FORM_CLASS = None # When signing up, let the user type in his password twice to avoid typ-o's. # ACCOUNT_SIGNUP_PASSWORD_VERIFICATION = True # Enforce uniqueness of e-mail addresses. ACCOUNT_UNIQUE_EMAIL = True # A callable (or string of the form 'some.module.callable_name') that takes # a user as its only argument and returns the display name of the user. The # default implementation returns user.username. # ACCOUNT_USER_DISPLAY # An integer specifying the minimum allowed length of a username. # ACCOUNT_USERNAME_MIN_LENGTH = 1 # The user is required to enter a username when signing up. Note that the # user will be asked to do so even if ACCOUNT_AUTHENTICATION_METHOD is set # to email. Set to False when you do not wish to prompt the user to enter a # username. ACCOUNT_USERNAME_REQUIRED = True # render_value parameter as passed to PasswordInput fields. # ACCOUNT_PASSWORD_INPUT_RENDER_VALUE = False # An integer specifying the minimum password length. ACCOUNT_PASSWORD_MIN_LENGTH = 6 # Request e-mail address from 3rd party account provider? E.g. using OpenID # AX, or the Facebook 'email' permission. # SOCIALACCOUNT_QUERY_EMAIL = ACCOUNT_EMAIL_REQUIRED # Attempt to bypass the signup form by using fields (e.g. username, email) # retrieved from the social account provider. If a conflict arises due to a # duplicate e-mail address the signup form will still kick in. # SOCIALACCOUNT_AUTO_SIGNUP = True # Enable support for django-avatar. When enabled, the profile image of the # user is copied locally into django-avatar at signup. Default is # 'avatar' in settings.INSTALLED_APPS. # SOCIALACCOUNT_AVATAR_SUPPORT # Dictionary containing provider specific settings. SOCIALACCOUNT_PROVIDERS = { 'google': { 'SCOPE': [ 'profile', 'email', ], 'AUTH_PARAMS': { 'access_type': 'online', } }, 'facebook': { 'METHOD': 'oauth2', 'SCOPE': ['email', 'public_profile', 'user_friends'], 'AUTH_PARAMS': {'auth_type': 'reauthenticate'}, 'INIT_PARAMS': {'cookie': True}, 'FIELDS': [ 'id', 'email', 'name', 'first_name', 'last_name', 'verified', 'locale', 'timezone', 'link', 'gender', 'updated_time', ], 'EXCHANGE_TOKEN': True, 'VERIFIED_EMAIL': False, 'VERSION': 'v2.4', }, 'github': { 'SCOPE': [ 'user', 'repo', 'read:org', ], }, }
account_email_required = True account_email_verification = 'optional' account_unique_email = True account_username_required = True account_password_min_length = 6 socialaccount_providers = {'google': {'SCOPE': ['profile', 'email'], 'AUTH_PARAMS': {'access_type': 'online'}}, 'facebook': {'METHOD': 'oauth2', 'SCOPE': ['email', 'public_profile', 'user_friends'], 'AUTH_PARAMS': {'auth_type': 'reauthenticate'}, 'INIT_PARAMS': {'cookie': True}, 'FIELDS': ['id', 'email', 'name', 'first_name', 'last_name', 'verified', 'locale', 'timezone', 'link', 'gender', 'updated_time'], 'EXCHANGE_TOKEN': True, 'VERIFIED_EMAIL': False, 'VERSION': 'v2.4'}, 'github': {'SCOPE': ['user', 'repo', 'read:org']}}
''' A Popular Strategy Using Autocorrelation One puzzling anomaly with stocks is that investors tend to overreact to news. Following large jumps, either up or down, stock prices tend to reverse. This is described as mean reversion in stock prices: prices tend to bounce back, or revert, towards previous levels after large moves, which are observed over time horizons of about a week. A more mathematical way to describe mean reversion is to say that stock returns are negatively autocorrelated. This simple idea is actually the basis for a popular hedge fund strategy. If you're curious to learn more about this hedge fund strategy (although it's not necessary reading for anything else later in the course), see here. You'll look at the autocorrelation of weekly returns of MSFT stock from 2012 to 2017. You'll start with a DataFrame MSFT of daily prices. You should use the .resample() method to get weekly prices and then compute returns from prices. Use the pandas method .autocorr() to get the autocorrelation and show that the autocorrelation is negative. Note that the .autocorr() method only works on Series, not DataFrames (even DataFrames with one column), so you will have to select the column in the DataFrame. INSTRUCTIONS 100XP INSTRUCTIONS 100XP Use the .resample() method with rule='W' and how='last'to convert daily data to weekly data. Create a new DataFrame, returns, of percent changes in weekly prices using the .pct_change() method. Compute the autocorrelation using the .autocorr() method on the series of closing stock prices, which is the column Adj Close in the DataFrame returns. ''' # Convert the daily data to weekly data MSFT = MSFT.resample(rule='w',how='last') # Compute the percentage change of prices returns = MSFT.pct_change() # Compute and print the autocorrelation of returns autocorrelation = returns['Adj Close'].autocorr() print("The autocorrelation of weekly returns is %4.2f" %(autocorrelation))
""" A Popular Strategy Using Autocorrelation One puzzling anomaly with stocks is that investors tend to overreact to news. Following large jumps, either up or down, stock prices tend to reverse. This is described as mean reversion in stock prices: prices tend to bounce back, or revert, towards previous levels after large moves, which are observed over time horizons of about a week. A more mathematical way to describe mean reversion is to say that stock returns are negatively autocorrelated. This simple idea is actually the basis for a popular hedge fund strategy. If you're curious to learn more about this hedge fund strategy (although it's not necessary reading for anything else later in the course), see here. You'll look at the autocorrelation of weekly returns of MSFT stock from 2012 to 2017. You'll start with a DataFrame MSFT of daily prices. You should use the .resample() method to get weekly prices and then compute returns from prices. Use the pandas method .autocorr() to get the autocorrelation and show that the autocorrelation is negative. Note that the .autocorr() method only works on Series, not DataFrames (even DataFrames with one column), so you will have to select the column in the DataFrame. INSTRUCTIONS 100XP INSTRUCTIONS 100XP Use the .resample() method with rule='W' and how='last'to convert daily data to weekly data. Create a new DataFrame, returns, of percent changes in weekly prices using the .pct_change() method. Compute the autocorrelation using the .autocorr() method on the series of closing stock prices, which is the column Adj Close in the DataFrame returns. """ msft = MSFT.resample(rule='w', how='last') returns = MSFT.pct_change() autocorrelation = returns['Adj Close'].autocorr() print('The autocorrelation of weekly returns is %4.2f' % autocorrelation)
# Colors blue = '#377EB8' red = '#E41A1C' green = '#4DAF4A'
blue = '#377EB8' red = '#E41A1C' green = '#4DAF4A'
# ------------------------------ # 228. Summary Ranges # # Description: # Given a sorted integer array without duplicates, return the summary of its ranges. # # Example 1: # Input: [0,1,2,4,5,7] # Output: ["0->2","4->5","7"] # Example 2: # Input: [0,2,3,4,6,8,9] # Output: ["0","2->4","6","8->9"] # # Version: 1.0 # 12/11/17 by Jianfa # ------------------------------ class Solution(object): def summaryRanges(self, nums): """ :type nums: List[int] :rtype: List[str] """ if not nums: return [] res = [] s = nums[0] e = nums[0] for x in nums[1:]: if x - e == 1: e = x else: if s == e: res.append(str(s)) else: res.append("%d->%d" % (s, e)) s = x e = x if s == e: res.append(str(s)) else: res.append("%d->%d" % (s, e)) return res # Used for testing if __name__ == "__main__": test = Solution() # ------------------------------ # Summary: # Initialize s and e, then check from the second item in array one by one. If a new item is more than 1 greater # than the previous, add a new summary to result list. # Finally add the last summary string to the result.
class Solution(object): def summary_ranges(self, nums): """ :type nums: List[int] :rtype: List[str] """ if not nums: return [] res = [] s = nums[0] e = nums[0] for x in nums[1:]: if x - e == 1: e = x else: if s == e: res.append(str(s)) else: res.append('%d->%d' % (s, e)) s = x e = x if s == e: res.append(str(s)) else: res.append('%d->%d' % (s, e)) return res if __name__ == '__main__': test = solution()
class ConfigClass: def __init__(self): # link to a zip file in google drive with your pretrained model self._model_url = "https://drive.google.com/file/d/14VduVhV12k1mgLJMJ0WMhtRlFqwqMKtN/view?usp=sharing" # False/True flag indicating whether the testing system will download # and overwrite the existing model files. In other words, keep this as # False until you update the model, submit with True to download # the updated model (with a valid model_url), then turn back to False # in subsequent submissions to avoid the slow downloading of the large # model file with every submission. self._download_model = True self.corpusPath = '' self.savedFileMainFolder = '' self.saveFilesWithStem = self.savedFileMainFolder + "/WithStem" self.saveFilesWithoutStem = self.savedFileMainFolder + "/WithoutStem" self.toStem = False print('Project was created successfully..') def get__corpusPath(self): return self.corpusPath def get_model_url(self): return self._model_url def get_download_model(self): return self._download_model
class Configclass: def __init__(self): self._model_url = 'https://drive.google.com/file/d/14VduVhV12k1mgLJMJ0WMhtRlFqwqMKtN/view?usp=sharing' self._download_model = True self.corpusPath = '' self.savedFileMainFolder = '' self.saveFilesWithStem = self.savedFileMainFolder + '/WithStem' self.saveFilesWithoutStem = self.savedFileMainFolder + '/WithoutStem' self.toStem = False print('Project was created successfully..') def get__corpus_path(self): return self.corpusPath def get_model_url(self): return self._model_url def get_download_model(self): return self._download_model
'''4. Write a Python program to add two positive integers without using the '+' operator. Note: Use bit wise operations to add two numbers.''' num1 = 4 num2 = 34 num3 = num1.__add__(num2) print(num3)
"""4. Write a Python program to add two positive integers without using the '+' operator. Note: Use bit wise operations to add two numbers.""" num1 = 4 num2 = 34 num3 = num1.__add__(num2) print(num3)
__copyright__ = "Copyright 2019, RISE Research Institutes of Sweden" __author__ = "Naveed Anwar Bhatti and Martina Brachmann" def maprange(a, b, s): ''' Maps an input value to an ouput value depending on a sensors' and actuators's range Parameters ---------- a : tupel (float, float) the sensors' known/given range (from, to) b : tupel (float, float) the actuators' known/given range (from, to) s : float current input value Returns ------- float : the mapped value ''' (a1, a2), (b1, b2) = a, b return b1 + ((s - a1) * (b2 - b1) / (a2 - a1)) def maprange_by_factor(a, b, s, fac): return maprange(a, b, s * fac) def maprange_by_hop_factor(a, b, s, h_f): (hops, factor) = h_f fac = 1 for hop in range(1, hops+1): factor = factor / hop fac = fac + factor return maprange_by_factor(a, b, s, fac) def maprange_by_neighbor(a, b, s, neighbor): pass
__copyright__ = 'Copyright 2019, RISE Research Institutes of Sweden' __author__ = 'Naveed Anwar Bhatti and Martina Brachmann' def maprange(a, b, s): """ Maps an input value to an ouput value depending on a sensors' and actuators's range Parameters ---------- a : tupel (float, float) the sensors' known/given range (from, to) b : tupel (float, float) the actuators' known/given range (from, to) s : float current input value Returns ------- float : the mapped value """ ((a1, a2), (b1, b2)) = (a, b) return b1 + (s - a1) * (b2 - b1) / (a2 - a1) def maprange_by_factor(a, b, s, fac): return maprange(a, b, s * fac) def maprange_by_hop_factor(a, b, s, h_f): (hops, factor) = h_f fac = 1 for hop in range(1, hops + 1): factor = factor / hop fac = fac + factor return maprange_by_factor(a, b, s, fac) def maprange_by_neighbor(a, b, s, neighbor): pass
class Card: def __init__(self,rank,suit): # instance recevies two parameters rank and suit self.rank = rank self.suit = suit self.rank_list = ['2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A'] # a list contains all ranks self.suit_list = ['H', 'C', 'D', 'S'] # a list containing all suits assert self.rank.upper() in self.rank_list, 'Invalid Rank' # checks if the rank is in the list, not case sensitive assert self.suit.upper() in self.suit_list, 'Invalid Suit' # checks if the suit is in the list, not case sensitive def get(self): # returns rank and the suit return self.rank+self.suit def get_rank(self): # returns rank return self.rank def get_suit(self): # returns suit return self.suit def __gt__(self,other): # checks if the rank of the passed card is smaller for i in range(len(self.rank_list)): # ranks are ordered in increasing order in self.rank_list, so higher the rank, higher the index if self.rank_list[i] == self.rank: # checks for the rank in the list and stores the index rank = i if self.rank_list[i] == other.rank: rank_other = i return rank > rank_other # compares the index to determines if the passed card's rank is smaller or greater def __lt__(self,other): # checks if the rank of the passed card is greater for i in range(len(self.rank_list)): # ranks are ordered in increasing order in self.rank_list, so higher the rank, higher the index if self.rank_list[i] == self.rank: # checks for the rank in the list and stores the index rank = i if self.rank_list[i] == other.rank: rank_other = i return rank < rank_other # compares the index to determines if the passed card's rank is smaller or greater def __eq__(self,other): return self.rank == other.rank # returns if the rank of the passed card is equal def __str__(self): # converts card object to a printable form return self.rank + self.suit def convert_rank(self,rank): # converts rank accordding to its positon in the list, adds two to the index as the index counting starts from 0 in python and the ranks start from 2 for i in range(len(self.rank_list)): if self.rank_list[i] == rank: return i+2
class Card: def __init__(self, rank, suit): self.rank = rank self.suit = suit self.rank_list = ['2', '3', '4', '5', '6', '7', '8', '9', 'T', 'J', 'Q', 'K', 'A'] self.suit_list = ['H', 'C', 'D', 'S'] assert self.rank.upper() in self.rank_list, 'Invalid Rank' assert self.suit.upper() in self.suit_list, 'Invalid Suit' def get(self): return self.rank + self.suit def get_rank(self): return self.rank def get_suit(self): return self.suit def __gt__(self, other): for i in range(len(self.rank_list)): if self.rank_list[i] == self.rank: rank = i if self.rank_list[i] == other.rank: rank_other = i return rank > rank_other def __lt__(self, other): for i in range(len(self.rank_list)): if self.rank_list[i] == self.rank: rank = i if self.rank_list[i] == other.rank: rank_other = i return rank < rank_other def __eq__(self, other): return self.rank == other.rank def __str__(self): return self.rank + self.suit def convert_rank(self, rank): for i in range(len(self.rank_list)): if self.rank_list[i] == rank: return i + 2
n = 1 while True: num = int(input(f"Enter value{n}: ")) if num == -99: break n += 1 print(f"You entered {n-1} numbers.")
n = 1 while True: num = int(input(f'Enter value{n}: ')) if num == -99: break n += 1 print(f'You entered {n - 1} numbers.')
while True: n = int(input()) if n == -1: break last_elapsed = 0 distance = 0 for _ in range(n): s, t = map(int, input().split()) _t = t - last_elapsed distance += s * _t last_elapsed = t print(distance, "miles")
while True: n = int(input()) if n == -1: break last_elapsed = 0 distance = 0 for _ in range(n): (s, t) = map(int, input().split()) _t = t - last_elapsed distance += s * _t last_elapsed = t print(distance, 'miles')
POSTGRES_DATA_TYPES = { "int2": "smallint", "integer": "integer", "uuid": "uuid", "string": "varchar", "timestamp": "timestamp", }
postgres_data_types = {'int2': 'smallint', 'integer': 'integer', 'uuid': 'uuid', 'string': 'varchar', 'timestamp': 'timestamp'}
def rotLeft(a, d): for x in range(d): temp = a[0] a.pop(0) a.append(temp) return a no_of_inputs = 5 no_of_rotation = 4 my_str = "1 2 3 4 5" my_arr = [s for s in my_str.strip().split()] print(rotLeft(my_arr, no_of_rotation))
def rot_left(a, d): for x in range(d): temp = a[0] a.pop(0) a.append(temp) return a no_of_inputs = 5 no_of_rotation = 4 my_str = '1 2 3 4 5' my_arr = [s for s in my_str.strip().split()] print(rot_left(my_arr, no_of_rotation))
# We have tossed a coin a 6 times and saved the results in a list # called heads_or_tails. The values are integers: 1 stands for a # head, while 0 denotes a tail. # Add some code to find out whether the list has any heads. Do # not print the variable check, just store the result in it. # Fingers crossed check = any(heads_or_tails)# are there any heads in the list heads_or_tails
check = any(heads_or_tails)
A, B, C = list(map(int, input().split())) if C <= B: print('-1') else: print(int(A / (C-B) + 1))
(a, b, c) = list(map(int, input().split())) if C <= B: print('-1') else: print(int(A / (C - B) + 1))
''' Intuition ---- Intuition is an engine, some building bricks and a set of tools meant to let you efficiently and intuitively make your own automated quantitative trading system. It is designed to let traders, developers and scientists explore, improve and deploy market technical hacks. :copyright (c) 2014 Xavier Bruhiere :license: Apache 2.0, see LICENSE for more details. ''' __project__ = 'intuition' __author__ = 'Xavier Bruhiere' __copyright__ = 'Xavier Bruhiere' __licence__ = 'Apache 2.0' __version__ = '0.4.0'
""" Intuition ---- Intuition is an engine, some building bricks and a set of tools meant to let you efficiently and intuitively make your own automated quantitative trading system. It is designed to let traders, developers and scientists explore, improve and deploy market technical hacks. :copyright (c) 2014 Xavier Bruhiere :license: Apache 2.0, see LICENSE for more details. """ __project__ = 'intuition' __author__ = 'Xavier Bruhiere' __copyright__ = 'Xavier Bruhiere' __licence__ = 'Apache 2.0' __version__ = '0.4.0'
"""jotter The main functionality of jotter, including CLI and other modules. Author: Figglewatts <me@figglewatts.co.uk> """ __version__ = "0.1.3"
"""jotter The main functionality of jotter, including CLI and other modules. Author: Figglewatts <me@figglewatts.co.uk> """ __version__ = '0.1.3'
#assignment2 homework1 student1=input("Enter student name1:") student2=input("Enter student name2:") student3=input("Enter student name3:") print("Student1 Name is:"+student1+"\n"+"Student2 Name is:"+student2+"\n"+"Student3 Name is:"+student3) #assignment2 homework2 def function1(): print("Function1 output:",age) def function2(): age=30 print("Function2 output:",age) def function3(): global age age=40 print("Function3 output:",age) age=20 function1() function2() function3() print("Outside function output:",age)
student1 = input('Enter student name1:') student2 = input('Enter student name2:') student3 = input('Enter student name3:') print('Student1 Name is:' + student1 + '\n' + 'Student2 Name is:' + student2 + '\n' + 'Student3 Name is:' + student3) def function1(): print('Function1 output:', age) def function2(): age = 30 print('Function2 output:', age) def function3(): global age age = 40 print('Function3 output:', age) age = 20 function1() function2() function3() print('Outside function output:', age)
""" 26 / 26 test cases passed. Runtime: 36 ms Memory Usage: 15 MB """ class Solution: def lengthLongestPath(self, input: str) -> int: ans = 0 level_depth = {-1: 0} for path in input.split('\n'): depth = path.count('\t') level_depth[depth] = level_depth[depth - 1] + len(path) - depth if '.' in path: ans = max(ans, level_depth[depth] + depth) return ans
""" 26 / 26 test cases passed. Runtime: 36 ms Memory Usage: 15 MB """ class Solution: def length_longest_path(self, input: str) -> int: ans = 0 level_depth = {-1: 0} for path in input.split('\n'): depth = path.count('\t') level_depth[depth] = level_depth[depth - 1] + len(path) - depth if '.' in path: ans = max(ans, level_depth[depth] + depth) return ans
class Solution(object): def divide(self, dividend, divisor): """ :type dividend: int :type divisor: int :rtype: int """ sign = 1 if (dividend >= 0) == (divisor >= 0) else -1 dd = abs(dividend) dr = abs(divisor) if dd < dr: return 0 if dd == dr: return sign if dr == 1: dd = dd if sign > 0 else -dd return min(2 ** 31 - 1, dd) res = 1 while dd > dr + dr: dr += dr res += res return sign * (res + self.divide(dd - dr, abs(divisor)))
class Solution(object): def divide(self, dividend, divisor): """ :type dividend: int :type divisor: int :rtype: int """ sign = 1 if (dividend >= 0) == (divisor >= 0) else -1 dd = abs(dividend) dr = abs(divisor) if dd < dr: return 0 if dd == dr: return sign if dr == 1: dd = dd if sign > 0 else -dd return min(2 ** 31 - 1, dd) res = 1 while dd > dr + dr: dr += dr res += res return sign * (res + self.divide(dd - dr, abs(divisor)))
class LimitedStack: def __init__ (self,max_size=200): self.stack = [] self.max_size = max_size def add (self,item=None): self.stack.append(item) if len(self.stack) > self.max_size: self.stack = self.stack[1:] def get (self): if self.stack: return self.stack.pop()
class Limitedstack: def __init__(self, max_size=200): self.stack = [] self.max_size = max_size def add(self, item=None): self.stack.append(item) if len(self.stack) > self.max_size: self.stack = self.stack[1:] def get(self): if self.stack: return self.stack.pop()
"""Top-level package for spotibox.""" __author__ = """Martin Hanewald""" __email__ = 'martin.hanewald@gmail.com' __version__ = '0.2.0'
"""Top-level package for spotibox.""" __author__ = 'Martin Hanewald' __email__ = 'martin.hanewald@gmail.com' __version__ = '0.2.0'
class Config(object): env = 'default' backbone = 'resnet18' classify = 'softmax' num_classes = 5000 metric = 'arc_margin' easy_margin = False use_se = False loss = 'focal_loss' display = False finetune = False meta_train = '/preprocessed/train_meta.csv' train_root = '/preprocessed' train_list = 'full_data_train.txt' val_list = 'full_data_val.txt' checkpoints_path = 'checkpoints' save_interval = 1 train_batch_size = 32 # batch size input_shape = (630, 80) mp3aug_ratio = 1.0 npy_aug = True optimizer = 'sgd' use_gpu = True # use GPU or not gpu_id = '0, 1' num_workers = 0 # how many workers for loading data print_freq = 100 # print info every N batch debug_file = '/tmp/debug' # if os.path.exists(debug_file): enter ipdb result_file = '/result/submission.csv' max_epoch = 100 lr = 1e-2 # initial learning rate lr_step = 10 lr_decay = 0.5 # when val_loss increase, lr = lr*lr_decay weight_decay = 1e-1
class Config(object): env = 'default' backbone = 'resnet18' classify = 'softmax' num_classes = 5000 metric = 'arc_margin' easy_margin = False use_se = False loss = 'focal_loss' display = False finetune = False meta_train = '/preprocessed/train_meta.csv' train_root = '/preprocessed' train_list = 'full_data_train.txt' val_list = 'full_data_val.txt' checkpoints_path = 'checkpoints' save_interval = 1 train_batch_size = 32 input_shape = (630, 80) mp3aug_ratio = 1.0 npy_aug = True optimizer = 'sgd' use_gpu = True gpu_id = '0, 1' num_workers = 0 print_freq = 100 debug_file = '/tmp/debug' result_file = '/result/submission.csv' max_epoch = 100 lr = 0.01 lr_step = 10 lr_decay = 0.5 weight_decay = 0.1