content
stringlengths
7
1.05M
# Simple Math Libraries def add(*nums): number = 0 for num in nums: number += num return number def sub(*nums): number = 0 for num in nums: number -= num return number def multiply(*nums): number = 1 for num in nums: number *= num return number def square(num): return num ** 2 def cube(num): return num ** 3 def powerof(num1, num2): return num1**num2 def div2num(dividend, divisor): return dividend/divisor def sqrt(num): return num ** 0.5 def curt(num): return num ** (1/3)
""" Faca um programa que receba 6 numeros inteiros e mostre: - Os numeros pares digitados; -A soma dos numeros pares digitados; -Os numeros impares digitados; -A quantidade de numeros impares digitados; """ x = [] soma = 0 quant = 0 for z in range(6): x.append(int(input('Digite um numero: '))) print('Numeros pares digitados:') for i, y in enumerate(x): if y % 2 == 0: print(f'[{i}] = {y}') soma = soma + y print('Numeros impares digitados:') for a, b in enumerate(x): if b % 2 != 0: print(f'[{a}] = {b}') quant += 1 print(f'A soma dos numeros pares digitados: {soma}') print(f'A quantidade de numeros impares digitados: {quant}')
#!/usr/bin/env python # coding: utf-8 def countAnswers(__values): batchComplete = False answerCount = 0 answerDict = {} for answers in __values: for answer in answers: answerDict[answer] = 1 if answers == '': batchComplete = True if batchComplete: answerCount += len(answerDict) answerDict = {} batchComplete = False answerCount += len(answerDict) return answerCount values = [] with open('day6_input') as fp: line = fp.readline() while line: if(line != ''): values.append(line.strip()) line = fp.readline() print(countAnswers(values))
# -*- coding: utf-8 -*- # Copyright 2020 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Templates for generating event classes for structured metrics.""" HEADER_FILE_TEMPLATE = """\ // Generated from gen_events.py. DO NOT EDIT! // source: structured.xml #ifndef {file.guard_path} #define {file.guard_path} #include <cstdint> #include <string> #include <brillo/brillo_export.h> #include "metrics/structured/event_base.h" namespace metrics {{ namespace structured {{ namespace events {{ constexpr uint64_t kProjectNameHashes[] = {project_hashes}; {project_code} }} // namespace events }} // namespace structured }} // namespace metrics #endif // {file.guard_path}\ """ HEADER_PROJECT_TEMPLATE = """\ namespace {project.namespace} {{ {event_code}\ }} // namespace {project.namespace} """ HEADER_EVENT_TEMPLATE = """\ class BRILLO_EXPORT {event.name} final : public ::metrics::structured::EventBase {{ public: {event.name}(); ~{event.name}() override; static constexpr uint64_t kEventNameHash = UINT64_C({event.name_hash}); static constexpr uint64_t kProjectNameHash = UINT64_C({project.name_hash}); static constexpr IdType kIdType = IdType::{project.id_type}; static constexpr StructuredEventProto_EventType kEventType = StructuredEventProto_EventType_{project.event_type}; {metric_code}\ }}; """ HEADER_METRIC_TEMPLATE = """\ static constexpr uint64_t k{metric.name}NameHash = UINT64_C({metric.hash}); {event.name}& Set{metric.name}(const {metric.type} value); """ IMPL_FILE_TEMPLATE = """\ // Generated from gen_events.py. DO NOT EDIT! // source: structured.xml #include "structured_events.h" namespace metrics {{ namespace structured {{ namespace events {{ {project_code} }} // namespace events }} // namespace structured }} // namespace metrics\ """ IMPL_PROJECT_TEMPLATE = """\ namespace {project.namespace} {{ {event_code}\ }} // namespace {project.namespace} """ IMPL_EVENT_TEMPLATE = """\ {event.name}::{event.name}() : ::metrics::structured::EventBase(kEventNameHash, kProjectNameHash, kIdType, kEventType) {{}} {event.name}::~{event.name}() = default; {metric_code}\ """ IMPL_METRIC_TEMPLATE = """\ {event.name}& {event.name}::Set{metric.name}(const {metric.type} value) {{ {metric.setter}(k{metric.name}NameHash, value); return *this; }} """
{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "%matplotlib inline\n", "from matplotlib import style\n", "style.use('fivethirtyeight')\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import datetime as dt\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "import sqlalchemy\n", "from sqlalchemy.ext.automap import automap_base\n", "from sqlalchemy.orm import Session\n", "from sqlalchemy import create_engine, func" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "#set engine\n", "engine = create_engine(\"sqlite:///Resources/hawaii.sqlite\")" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 2 }
#!/usr/bin/env python3 class ObjInfo(dict): def __init__(self): #, pre_id, name, letter, expire_state, id): self.side_id_name = ['front', 'back', 'left_side', 'right_side', 'bottom', 'side_id5', 'side_id6', 'side_id7', 'side_id8', 'side_id9'] self.obj = { # predefined merchandise information "pre_id": None, # predefined aruco ID range(i.e. 10~19) "name": '', # 'plum_riceball', 'salmon_riceball', 'sandwich', 'burger', 'drink', 'lunch_box' "letter": '', # ABCD, EFGH, IJK, LMN, OPQ, RST "expired": '', # 'new', 'old', 'expired' # update after camera take picture, changable due to object pose "id": None, # current detected aruco ID "side_id": '', # side_id_name: 'front', 'back', 'left_side', 'right_side', 'bottom', ... "pos": None, # position (x, y, z) "vector": None, # aruco marker z axis vector???? "euler": None, # rotation "sucang": None, # sucker angle? "cam_H_mrk": None, } def __getitem__(self, key): return self.obj[key] def __setitem__(self, key, value): self.obj[key] = value
# Version number as Major.Minor.Patch # The version modification must respect the following rules: # Major should be incremented in case there is a breaking change. (eg: 2.5.8 -> 3.0.0) # Minor should be incremented in case there is an enhancement. (eg: 2.5.8 -> 2.6.0) # Patch should be incremented in case there is a bug fix. (eg: 2.5.8 -> 2.5.9) __version__ = "3.3.1"
# https://codeforces.com/problemset/problem/427/A n = int(input()) events = [int(x) for x in input().split()] counter = 0 free_officer = 0 for event in events: free_officer += event if free_officer < 0: counter += 1 free_officer = 0 print(counter)
# coding=utf-8 class ResultBean(dict): def __init__(self): dict.__init__(self) # 继承pyton字典类的方法和属性 def seet(self): self['abc'] = 'asss' return self
class Menu: def __init__(self, options: list): self.options = options def printMenu(self): print(' [ Main Menu ] ') for i in range(len(self.options)): print((i + 1), '::', self.options[i]) def getMenuInput(self, waitValidated: bool): returnValue = -2 while returnValue == -2: selection = input('Select Option >> ') if selection.isnumeric(): selection = int(selection) if selection > 0 and selection <= len(self.options): returnValue = selection - 1 elif waitValidated: print('\r') else: returnValue = -1 return returnValue # waitValidated waits for a valid input before returning def createMenu(self, waitValidated = False): self.printMenu() selection = self.getMenuInput(waitValidated) return selection
# TASK """Given names and phone numbers, assemble a phone book that maps friends' names to their respective phone numbers. You will then be given an unknown number of names to query your phone book for. For each queried, print the associated entry from your phone book on a new line in the form name=phoneNumber; if an entry for is not found, print Not found instead.""" # Input Format """ The first line contains an integer, , denoting the number of entries in the phone book. Each of the subsequent lines describes an entry in the form of space-separated values on a single line. The first value is a friend's name, and the second value is an -digit phone number. After the lines of phone book entries, there are an unknown number of lines of queries. Each line (query) contains a to look up, and you must continue reading lines until there is no more input. Note: Names consist of lowercase English alphabetic letters and are first names only. """ if __name__ == '__main__': n = int(input('How many Entries? ')) e = [input('Enter Name (firstname in lowercase) and Number: ').split(' ') for _ in range(n)] q = [] while True: key = input('Find Whom (firstname in lowercase): ').split() if len(key) == 0: break else: q.append(key) continue entries = dict(e) for query in q: for name in query: if name in entries: print(f"\n{name}={entries[name]}") else: print('\n',name,': Not found') continue
# python DDP_moco_ccrop.py path/to/this/config # model dim = 128 model = dict(type='ResNet', depth=18, num_classes=dim, maxpool=False) moco = dict(dim=dim, K=65536, m=0.999, T=0.20, mlp=True) loss = dict(type='CrossEntropyLoss') # data root = '/path/to/your/dataset' mean = (0.4914, 0.4822, 0.4465) std = (0.2023, 0.1994, 0.2010) batch_size = 512 num_workers = 4 data = dict( train=dict( ds_dict=dict( type='CIFAR10_boxes', root=root, train=True, ), rcrop_dict=dict( type='cifar_train_rcrop', mean=mean, std=std ), ccrop_dict=dict( type='cifar_train_ccrop', alpha=0.1, mean=mean, std=std ), ), eval_train=dict( ds_dict=dict( type='CIFAR10', root=root, train=True, ), trans_dict=dict( type='cifar_test', mean=mean, std=std ), ), ) # boxes warmup_epochs = 100 loc_interval = 100 box_thresh = 0.10 # training optimizer & scheduler epochs = 500 lr = 0.5 optimizer = dict(type='SGD', lr=lr, momentum=0.9, weight_decay=1e-4) lr_cfg = dict( # passed to adjust_learning_rate(cfg=lr_cfg) type='Cosine', steps=epochs, lr=lr, decay_rate=0.1, # decay_steps=[100, 150] warmup_steps=0, # warmup_from=0.01 ) # log & save log_interval = 20 save_interval = 250 work_dir = None # rewritten by args resume = None load = None port = 10001
#@liveupdate("globalClassMethod", "svc.debug::debugSvc", "OnRemoteExec") def OnRemoteExec(self, signedCode): eve.Message("CustomNotify", {"notify": "OnRemoteExec called"}) # No need to check if we're a client! code = marshal.loads(signedCode) self._Exec(code, {})
#frase = 'Curso em video python' #print(frase[:13]) #frase = ' Curso em video python ' #print(len(frase.strip())) #frase = 'Curso em Video Python' #print(frase.replace('Python', 'Android')) #frase ='Curso em Video Python' #print('Curso' in frase) frase = 'Curso em Vidio Python' dividido = frase.split() print(dividido[0])
# # PySNMP MIB module CISCO-GPRS-L2RLY-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-GPRS-L2RLY-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:42:06 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") TimeTicks, iso, IpAddress, Bits, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, Unsigned32, MibIdentifier, Counter64, ObjectIdentity, NotificationType, Integer32, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "iso", "IpAddress", "Bits", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "Unsigned32", "MibIdentifier", "Counter64", "ObjectIdentity", "NotificationType", "Integer32", "Counter32") DisplayString, TruthValue, TextualConvention, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TruthValue", "TextualConvention", "RowStatus") ciscoGprsL2rlyMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 9993)) if mibBuilder.loadTexts: ciscoGprsL2rlyMIB.setLastUpdated('9812150000Z') if mibBuilder.loadTexts: ciscoGprsL2rlyMIB.setOrganization('Cisco Systems, Inc.') ciscoGprsL2rlyObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1)) ciscoGprsL2rlyConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1)) ciscoGprsL2rlyStats = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2)) cgprsL2rlyUid = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64)).clone(32)).setMaxAccess("readwrite") if mibBuilder.loadTexts: cgprsL2rlyUid.setStatus('current') cgprsL2rlyUnitType = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("datacomUnit", 1), ("telecomUnit", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cgprsL2rlyUnitType.setStatus('current') cgprsL2rlyEchoTimer = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1000))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: cgprsL2rlyEchoTimer.setStatus('current') cgprsL2rlyFlowControlFlag = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 4), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cgprsL2rlyFlowControlFlag.setStatus('current') cgprsL2rlyDroppedPktsMonTime = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535)).clone(300)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: cgprsL2rlyDroppedPktsMonTime.setStatus('current') cgprsL2rlyNoRespToKeepAliveMsgNotificationEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 6), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cgprsL2rlyNoRespToKeepAliveMsgNotificationEnable.setStatus('current') cgprsL2rlyUnitJoinNotificationEnable = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 7), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cgprsL2rlyUnitJoinNotificationEnable.setStatus('current') cgprsL2rlyInterfaceTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 8), ) if mibBuilder.loadTexts: cgprsL2rlyInterfaceTable.setStatus('current') cgprsL2rlyInterfaceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 8, 1), ).setIndexNames((0, "CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyInterfaceId")) if mibBuilder.loadTexts: cgprsL2rlyInterfaceEntry.setStatus('current') cgprsL2rlyInterfaceId = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 8, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: cgprsL2rlyInterfaceId.setStatus('current') cgprsL2rlyInterfaceRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 1, 8, 1, 2), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cgprsL2rlyInterfaceRowStatus.setStatus('current') cgprsL2rlyFlowControlTriggerCount = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cgprsL2rlyFlowControlTriggerCount.setStatus('current') cgprsL2rlyInputQLen = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2, 2), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: cgprsL2rlyInputQLen.setStatus('current') cgprsL2rlyTotalPacketsDropped = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2, 3), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: cgprsL2rlyTotalPacketsDropped.setStatus('current') cgprsL2rlyDroppedPktsTimeFrame = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: cgprsL2rlyDroppedPktsTimeFrame.setStatus('current') cgprsL2rlyDroppedPktsCount = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2, 5), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: cgprsL2rlyDroppedPktsCount.setStatus('current') cgprsL2rlyPeerTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2, 6), ) if mibBuilder.loadTexts: cgprsL2rlyPeerTable.setStatus('current') cgprsL2rlyPeerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2, 6, 1), ).setIndexNames((0, "CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyPeerUid"), (0, "CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyInterfaceId")) if mibBuilder.loadTexts: cgprsL2rlyPeerEntry.setStatus('current') cgprsL2rlyPeerUid = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2, 6, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 64))) if mibBuilder.loadTexts: cgprsL2rlyPeerUid.setStatus('current') cgprsL2rlyPeerUnitType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 9993, 1, 2, 6, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("datacomUnit", 1), ("telecomUnit", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: cgprsL2rlyPeerUnitType.setStatus('current') ciscoGprsL2rlyNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 9993, 2)) ciscoGprsL2rlyNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 9993, 2, 0)) cgprsL2rlyUnitJoinNotification = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 9993, 2, 0, 1)).setObjects(("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyUid")) if mibBuilder.loadTexts: cgprsL2rlyUnitJoinNotification.setStatus('current') cgprsL2rlyNoRespToKeepAliveMsgNotification = NotificationType((1, 3, 6, 1, 4, 1, 9, 9, 9993, 2, 0, 2)).setObjects(("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyUid")) if mibBuilder.loadTexts: cgprsL2rlyNoRespToKeepAliveMsgNotification.setStatus('current') ciscoGprsL2rlyConformances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 9993, 3)) cgprsL2rlyCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 9993, 3, 1)) cgprsL2rlyGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 9993, 3, 2)) cgprsL2rlyCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 9993, 3, 1, 1)).setObjects(("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyConfigGroup"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyStatsGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cgprsL2rlyCompliance = cgprsL2rlyCompliance.setStatus('current') cgprsL2rlyConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 9993, 3, 2, 1)).setObjects(("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyUid"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyUnitType"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyEchoTimer"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyFlowControlFlag"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyDroppedPktsMonTime"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyNoRespToKeepAliveMsgNotificationEnable"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyUnitJoinNotificationEnable"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyInterfaceRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cgprsL2rlyConfigGroup = cgprsL2rlyConfigGroup.setStatus('current') cgprsL2rlyStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 9993, 3, 2, 2)).setObjects(("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyFlowControlTriggerCount"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyInputQLen"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyTotalPacketsDropped"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyDroppedPktsTimeFrame"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyDroppedPktsCount"), ("CISCO-GPRS-L2RLY-MIB", "cgprsL2rlyPeerUnitType")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cgprsL2rlyStatsGroup = cgprsL2rlyStatsGroup.setStatus('current') mibBuilder.exportSymbols("CISCO-GPRS-L2RLY-MIB", cgprsL2rlyDroppedPktsCount=cgprsL2rlyDroppedPktsCount, cgprsL2rlyPeerUid=cgprsL2rlyPeerUid, ciscoGprsL2rlyStats=ciscoGprsL2rlyStats, cgprsL2rlyUid=cgprsL2rlyUid, cgprsL2rlyConfigGroup=cgprsL2rlyConfigGroup, cgprsL2rlyInterfaceTable=cgprsL2rlyInterfaceTable, cgprsL2rlyUnitJoinNotification=cgprsL2rlyUnitJoinNotification, cgprsL2rlyNoRespToKeepAliveMsgNotification=cgprsL2rlyNoRespToKeepAliveMsgNotification, cgprsL2rlyInterfaceRowStatus=cgprsL2rlyInterfaceRowStatus, cgprsL2rlyDroppedPktsMonTime=cgprsL2rlyDroppedPktsMonTime, ciscoGprsL2rlyNotificationPrefix=ciscoGprsL2rlyNotificationPrefix, cgprsL2rlyDroppedPktsTimeFrame=cgprsL2rlyDroppedPktsTimeFrame, cgprsL2rlyCompliances=cgprsL2rlyCompliances, cgprsL2rlyFlowControlTriggerCount=cgprsL2rlyFlowControlTriggerCount, cgprsL2rlyStatsGroup=cgprsL2rlyStatsGroup, cgprsL2rlyTotalPacketsDropped=cgprsL2rlyTotalPacketsDropped, cgprsL2rlyNoRespToKeepAliveMsgNotificationEnable=cgprsL2rlyNoRespToKeepAliveMsgNotificationEnable, cgprsL2rlyInterfaceId=cgprsL2rlyInterfaceId, cgprsL2rlyInterfaceEntry=cgprsL2rlyInterfaceEntry, cgprsL2rlyUnitJoinNotificationEnable=cgprsL2rlyUnitJoinNotificationEnable, cgprsL2rlyCompliance=cgprsL2rlyCompliance, ciscoGprsL2rlyNotifications=ciscoGprsL2rlyNotifications, PYSNMP_MODULE_ID=ciscoGprsL2rlyMIB, cgprsL2rlyPeerUnitType=cgprsL2rlyPeerUnitType, cgprsL2rlyInputQLen=cgprsL2rlyInputQLen, cgprsL2rlyEchoTimer=cgprsL2rlyEchoTimer, cgprsL2rlyGroups=cgprsL2rlyGroups, cgprsL2rlyUnitType=cgprsL2rlyUnitType, cgprsL2rlyFlowControlFlag=cgprsL2rlyFlowControlFlag, cgprsL2rlyPeerTable=cgprsL2rlyPeerTable, ciscoGprsL2rlyMIB=ciscoGprsL2rlyMIB, ciscoGprsL2rlyConfig=ciscoGprsL2rlyConfig, ciscoGprsL2rlyObjects=ciscoGprsL2rlyObjects, cgprsL2rlyPeerEntry=cgprsL2rlyPeerEntry, ciscoGprsL2rlyConformances=ciscoGprsL2rlyConformances)
host = '127.0.0.1' port = 833 server_processes = 3 # 服务器多进程处理 error_info = 'XML' # error_code = 'JSON' logger_config={ 'format': '%(levelname)s ==> ::: %(message)s', 'datefmt': '%Y-%m-%d %H:%M:%S' }
""" This is the Scratchpad! This file is not graded, but you can use it to test your code. You can write and test your function in the Scratchpad, but make sure to copy and paste it into the Unit Test file before checking your answer. Remember to only copy and paste the function you want to submit, not all of your tests. """ # Add your own tests here # with the character at `index` replaced with a dash (-) def replace_at_index(string, index): return string[0:index]+"-"+string[index+1:] print(replace_at_index("eggplant", 3)) print(replace_at_index("strange", 0))
DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = () MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': '/tmp/locality.db' } } TIME_ZONE = "UTC" LANGUAGE_CODE = "en-us" SITE_ID = 1 USE_I18N = True USE_L10N = True MEDIA_ROOT = '' MEDIA_URL = '' STATIC_ROOT = '' STATIC_URL = '/static/' ADMIN_MEDIA_PREFIX = '/static/admin/' STATICFILES_DIRS = () STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', 'django.contrib.staticfiles.finders.DefaultStorageFinder', ) SECRET_KEY = 'd=eh)2xs8*px19*9_54-)q1=l=q*wy=(v+e002w95c@!)p_8)n' TEMPLATE_LOADERS = ( 'django.template.loaders.filesystem.Loader', 'django.template.loaders.app_directories.Loader', 'django.template.loaders.eggs.Loader', ) MIDDLEWARE_CLASSES = ( 'django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', ) ROOT_URLCONF = 'locality.urls' TEMPLATE_DIRS = () INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.messages', 'django.contrib.staticfiles', 'django.contrib.admin', 'locality', ) LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'class': 'django.utils.log.AdminEmailHandler' } }, 'loggers': { 'django.request': { 'handlers': ['mail_admins'], 'level': 'ERROR', 'propagate': True, }, } }
"""pynter - Minimal utility for generating images with textual caption""" __version__ = '0.1.0' __author__ = 'Gabriele Picco <[email protected]>' __all__ = []
#program to convert a list of tuples into a dictionary. #create a list l = [("x", 1), ("x", 2), ("x", 3), ("y", 1), ("y", 2), ("z", 1)] d = {} for a, b in l: d.setdefault(a, []).append(b) print (d)
floor_number = int(input()) room_number = int(input()) for floor in range(floor_number, 0, -1): if floor == floor_number: result = [f'L{floor}{room}' for room in range(room_number)] print(' '.join(result)) continue if floor % 2 == 0: result = [f'O{floor}{room}' for room in range(room_number)] else: result = [f'A{floor}{room}' for room in range(room_number)] print(' '.join(result))
class User: last_name = '' first_name = '' email = '' def authenticate(self): # some logic to authenticate should be added here, currently it does nothing # e.g. we can access the attributes of the object to authenticate via email # address. Here, we just print it out instead of actually logging in anywhere: print("logging in user " + self.first_name + " " + self.last_name + " with email address " + self.email) def setName(self, fn, ln): # "self" is the reference, pointing the current object the # method is called on. We are assigning the parameter values from this method # to the attributes of THIS object here self.last_name = ln self.first_name = fn def setEmail(self, email): # same as above. Methods like this one that just set internal attributes are called # setter methods. To access internal attributes, we can also write getter methods. # Think how one could look like! self.email = email # Now we can generate a subclass "Student" from the base class "User". # All methods and attributes of the base class are inherited and down # have to be written again! class Student(User): student_id = '' starting_year = 0 def setId(self, id): self.student_id = id def setStartingYear(self, year): self.starting_year = year # We can do the same for the Staff class. Again, just *extending* the base # class with the additional methods and attributes required. class Staff(User): phone = '' def setPhone(self, phone): self.phone = phone; # And the same for the Administrator class Administrator(User): role = '' def setRole(self, role): self.role = role student1 = Student() student1.setName("Homer", "Simpson") student1.setEmail("[email protected]") student1.setId("SIM2343342") student2 = Student() student2.setName("Martin", "Meyer") student2.setEmail("[email protected]") student2.setId("MEY8284342") student2.setStartingYear(2019) staff1 = Staff() staff1.setName("Daniel", "Cobham") staff1.setEmail("[email protected]") staff1.setPhone("+43 4534234275") staff1.authenticate() all_users = [] all_users.append(student1) all_users.append(student2) all_users.append(staff1) print("number of users in list: %d" % len(all_users)) for u in all_users: u.authenticate()
def esPrimo(numero, a=2): #Caso base if numero <= 2: return True if (numero == 2) else False if numero%a==0: return False if a*a> numero: return True #Para al siguiente divisor return esPrimo(numero,a+1) def verificarLista(lista: list, contador=0, listaaux=None): """Esta funcion verifica si la lista cumple las condiciones del enunciado, es decir si la suma adyacente es un primo Esta funcion tiene que recibir como parametro si o si la lista a verificar, contador=0 y listaaux=[] """ if listaaux is None: listaaux = [] largo = len(lista) - 1 Exito = False particular = lista[contador - 1] + (lista[contador]) if esPrimo(particular) == True: listaaux.append("SI") if len(listaaux) == len(lista): Exito = True if contador == largo: return Exito else: return verificarLista(lista, contador + 1, listaaux) def permutar(lista): if len(lista) == 0: return [] if len(lista) == 1: return [lista] listafinal = [] for i in range(len(lista)): m = lista[i] remLst = lista[:i] + lista[i + 1:] for p in permutar(remLst): listafinal.append([m] + p) return listafinal def Desglosar(numero:int,lista=[]): """Esta funcion recibe un numero y devuelve una lista a partir de este numero creado""" def rev(l): """Esta funcion hace que la lista creada se le de reversa, todo recursivamente""" if len(l) == 0: return [] return [l[-1]] + rev(l[:-1]) if numero==0: reversa=rev(lista) return reversa else: lista.append(numero) return Desglosar(numero-1,lista) def purificar(lista,contador=0,listaaux=None): """Esta funcion elimina de la permutacion todos los que tenga un 1 al principcio d ela lista""" largo = len(lista) - 1 if listaaux is None: listaaux = [] if len(lista) == 0: return [] if lista[contador][0]==1: listaaux.append(lista[contador]) if contador==largo: return listaaux else: return purificar(lista,contador+1,listaaux) def Hacer(numero:int,contador,listafinal): lista=Desglosar(numero) permutacion=permutar(lista) contatemp=0 listaaux=[] if contador==numero-1: return listafinal if verificarLista(permutacion[contador],contatemp,listaaux)==True: listafinal.append(permutacion[contador]) else: return Hacer(numero,contador+1,listafinal) numero=8 lista=Desglosar(numero) permutacion=permutar(lista) listaaux=[] # # vilgax=[[1, 2, 3, 8, 5, 6, 7, 4], [1, 2, 5, 8, 3, 4, 7, 6], [1, 4, 7, 6, 5, 8, 3, 2], [1, 6, 7, 4, 3, 8, 5, 2], [2, 1, 4, 7, 6, 5, 8, 3], [2, 1, 6, 7, 4, 3, 8, 5], [2, 3, 8, 5, 6, 7, 4, 1], [2, 5, 8, 3, 4, 7, 6, 1], [3, 2, 1, 4, 7, 6, 5, 8], [3, 4, 7, 6, 1, 2, 5, 8], [3, 8, 5, 2, 1, 6, 7, 4], [3, 8, 5, 6, 7, 4, 1, 2], [4, 1, 2, 3, 8, 5, 6, 7], [4, 3, 8, 5, 2, 1, 6, 7], [4, 7, 6, 1, 2, 5, 8, 3], [4, 7, 6, 5, 8, 3, 2, 1], [5, 2, 1, 6, 7, 4, 3, 8], [5, 6, 7, 4, 1, 2, 3, 8], [5, 8, 3, 2, 1, 4, 7, 6], [5, 8, 3, 4, 7, 6, 1, 2], [6, 1, 2, 5, 8, 3, 4, 7], [6, 5, 8, 3, 2, 1, 4, 7], [6, 7, 4, 1, 2, 3, 8, 5], [6, 7, 4, 3, 8, 5, 2, 1], [7, 4, 1, 2, 3, 8, 5, 6], [7, 4, 3, 8, 5, 2, 1, 6], [7, 6, 1, 2, 5, 8, 3, 4], [7, 6, 5, 8, 3, 2, 1, 4], [8, 3, 2, 1, 4, 7, 6, 5], [8, 3, 4, 7, 6, 1, 2, 5], [8, 5, 2, 1, 6, 7, 4, 3], [8, 5, 6, 7, 4, 1, 2, 3]] # for recorrer in range(0,len(permutacion)): # if verificarLista(permutacion[recorrer])==True: # listaaux.append(permutacion[recorrer])
grid = [ [ 8, 2,22,97,38,15, 0,40, 0,75, 4, 5, 7,78,52,12,50,77,91, 8], [49,49,99,40,17,81,18,57,60,87,17,40,98,43,69,48, 4,56,62, 0], [81,49,31,73,55,79,14,29,93,71,40,67,53,88,30, 3,49,13,36,65], [52,70,95,23, 4,60,11,42,69,24,68,56, 1,32,56,71,37, 2,36,91], [22,31,16,71,51,67,63,89,41,92,36,54,22,40,40,28,66,33,13,80], [24,47,32,60,99, 3,45, 2,44,75,33,53,78,36,84,20,35,17,12,50], [32,98,81,28,64,23,67,10,26,38,40,67,59,54,70,66,18,38,64,70], [67,26,20,68, 2,62,12,20,95,63,94,39,63, 8,40,91,66,49,94,21], [24,55,58, 5,66,73,99,26,97,17,78,78,96,83,14,88,34,89,63,72], [21,36,23, 9,75, 0,76,44,20,45,35,14, 0,61,33,97,34,31,33,95], [78,17,53,28,22,75,31,67,15,94, 3,80, 4,62,16,14, 9,53,56,92], [16,39, 5,42,96,35,31,47,55,58,88,24, 0,17,54,24,36,29,85,57], [86,56, 0,48,35,71,89, 7, 5,44,44,37,44,60,21,58,51,54,17,58], [19,80,81,68, 5,94,47,69,28,73,92,13,86,52,17,77, 4,89,55,40], [ 4,52, 8,83,97,35,99,16, 7,97,57,32,16,26,26,79,33,27,98,66], [88,36,68,87,57,62,20,72, 3,46,33,67,46,55,12,32,63,93,53,69], [ 4,42,16,73,38,25,39,11,24,94,72,18, 8,46,29,32,40,62,76,36], [20,69,36,41,72,30,23,88,34,62,99,69,82,67,59,85,74, 4,36,16], [20,73,35,29,78,31,90, 1,74,31,49,71,48,86,81,16,23,57, 5,54], [ 1,70,54,71,83,51,54,69,16,92,33,48,61,43,52, 1,89,19,67,48], ] def grid_prod(i_max, x, y, dx, dy, prod=1): for i in range(i_max): prod *= grid[y + i*dy][x + i*dx] return prod grid_w = grid_h = 20 d = 4 ans = 0 for x in range(grid_w): for y in range(grid_h): if x + d <= grid_w: ans = max(ans, grid_prod(d, x, y, 1, 0)) if y + d <= grid_h: ans = max(ans, grid_prod(d, x, y, 1, 1)) if y - d >= 1: ans = max(ans, grid_prod(d, x, y, 1, -1)) if y + d <= grid_h: ans = max(ans, grid_prod(d, x, y, 0, 1)) print(ans) # Copyright Junipyr. All rights reserved. # https://github.com/Junipyr
# The MIT License (MIT) # # Copyright (c) 2007-2017 Einar Lielmanis, Liam Newman, and contributors. # # 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. class BeautifierOptions: def __init__(self): self.indent_size = 4 self.indent_char = ' ' self.indent_with_tabs = False self.eol = 'auto' self.preserve_newlines = True self.max_preserve_newlines = 10 self.space_in_paren = False self.space_in_empty_paren = False self.e4x = False self.jslint_happy = False self.space_after_anon_function = False self.brace_style = 'collapse' self.keep_array_indentation = False self.space_before_conditional = True self.keep_function_indentation = False self.eval_code = False self.unescape_strings = False self.wrap_line_length = 0 self.unindent_chained_methods = False self.break_chained_methods = False self.end_with_newline = False self.comma_first = False self.operator_position = 'before-newline' self.css = None self.js = None self.html = None # For testing of beautify ignore:start directive self.test_output_raw = False self.editorconfig = False def __repr__(self): return \ """indent_size = %d indent_char = [%s] preserve_newlines = %s max_preserve_newlines = %d space_in_paren = %s jslint_happy = %s space_after_anon_function = %s indent_with_tabs = %s brace_style = %s keep_array_indentation = %s eval_code = %s wrap_line_length = %s unescape_strings = %s """ % ( self.indent_size, self.indent_char, self.preserve_newlines, self.max_preserve_newlines, self.space_in_paren, self.jslint_happy, self.space_after_anon_function, self.indent_with_tabs, self.brace_style, self.keep_array_indentation, self.eval_code, self.wrap_line_length, self.unescape_strings, )
class Aluno(): def __init__(self): self.nome = "Pinguim" self.rg = 1234567891011 self.curso = "missanga" def printa(self): print("nome = ",self.nome) print("rg = ",self.rg) print("curso = ",self.curso) Aluno = Aluno() Aluno.printa()
class RedisList: def __init__(self, redis, key, converter, content=None): self.key_ = key self.redis_ = redis self.converter_ = converter if content: self.reset(content) def __len__(self): return self.redis_.llen(self.key_) def __getitem__(self, index): if type(index) is slice: start = index.start if index.start else 0 stop = index.stop - 1 if index.stop else -1 value = self.redis_.lrange(self.key_, start, stop) value = [self.converter_.to_value(v) for v in value] else: value = self.redis_.lindex(self.key_, index) if value is None: raise IndexError('list index out of range') value = self.converter_.to_value(value) return value def __setitem__(self, index, value): self.redis_.lset(self.key_, index, self.converter_.from_value(value)) return value def __call__(self): return self[:] def __repr__(self): return str(self()) def __str__(self): return str(self()) def reset(self, value_list=None): self.redis_.delete(self.key_) if value_list: self.redis_.rpush(self.key_, *[self.converter_.from_value(v) for v in value_list]) def append(self, value): self.redis_.rpushx(self.key_, self.converter_.from_value(value)) def extend(self, value_list): self.redis_.rpush(self.key_, *[self.converter_.from_value(v) for v in value_list]) def pop(self, idx=-1): if idx == 0: return self.converter_.to_value(self.redis_.lpop(self.key_)) else: return self.converter_.to_value(self.redis_.rpop(self.key_))
# # PySNMP MIB module NTPv4-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NTPv4-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:15: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") ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "ValueRangeConstraint", "SingleValueConstraint") InetAddress, InetAddressType = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress", "InetAddressType") ModuleCompliance, ObjectGroup, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "ObjectGroup", "NotificationGroup") Gauge32, Counter64, ObjectIdentity, TimeTicks, iso, Integer32, IpAddress, MibIdentifier, mib_2, Unsigned32, ModuleIdentity, Bits, Counter32, MibScalar, MibTable, MibTableRow, MibTableColumn, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Gauge32", "Counter64", "ObjectIdentity", "TimeTicks", "iso", "Integer32", "IpAddress", "MibIdentifier", "mib-2", "Unsigned32", "ModuleIdentity", "Bits", "Counter32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "NotificationType") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") Utf8String, = mibBuilder.importSymbols("SYSAPPL-MIB", "Utf8String") ntpSnmpMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 197)) ntpSnmpMIB.setRevisions(('2010-05-17 00:00',)) if mibBuilder.loadTexts: ntpSnmpMIB.setLastUpdated('201005170000Z') if mibBuilder.loadTexts: ntpSnmpMIB.setOrganization('The IETF NTP Working Group (ntpwg)') ntpSnmpMIBObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 1)) ntpEntInfo = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 1, 1)) ntpEntStatus = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 1, 2)) ntpAssociation = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 1, 3)) ntpEntControl = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 1, 4)) ntpEntNotifObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 1, 5)) class NtpStratum(TextualConvention, Unsigned32): status = 'current' displayHint = 'd' subtypeSpec = Unsigned32.subtypeSpec + ValueRangeConstraint(1, 16) class NtpDateTime(TextualConvention, OctetString): reference = 'RFC 5905, section 6' status = 'current' displayHint = '4d:4d:4d.4d' subtypeSpec = OctetString.subtypeSpec + ConstraintsUnion(ValueSizeConstraint(0, 0), ValueSizeConstraint(16, 16), ) ntpEntSoftwareName = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 1, 1), Utf8String()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntSoftwareName.setStatus('current') ntpEntSoftwareVersion = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 1, 2), Utf8String()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntSoftwareVersion.setStatus('current') ntpEntSoftwareVendor = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 1, 3), Utf8String()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntSoftwareVendor.setStatus('current') ntpEntSystemType = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 1, 4), Utf8String()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntSystemType.setStatus('current') ntpEntTimeResolution = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 1, 5), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntTimeResolution.setStatus('current') ntpEntTimePrecision = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntTimePrecision.setStatus('current') ntpEntTimeDistance = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 1, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntTimeDistance.setStatus('current') ntpEntStatusCurrentMode = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 99))).clone(namedValues=NamedValues(("notRunning", 1), ("notSynchronized", 2), ("noneConfigured", 3), ("syncToLocal", 4), ("syncToRefclock", 5), ("syncToRemoteServer", 6), ("unknown", 99)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusCurrentMode.setStatus('current') ntpEntStatusStratum = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 2), NtpStratum()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusStratum.setStatus('current') ntpEntStatusActiveRefSourceId = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 3), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 99999))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusActiveRefSourceId.setStatus('current') ntpEntStatusActiveRefSourceName = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 4), Utf8String()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusActiveRefSourceName.setStatus('current') ntpEntStatusActiveOffset = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 5), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusActiveOffset.setStatus('current') ntpEntStatusNumberOfRefSources = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 99))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusNumberOfRefSources.setStatus('current') ntpEntStatusDispersion = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 7), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusDispersion.setStatus('current') ntpEntStatusEntityUptime = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 8), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusEntityUptime.setStatus('current') ntpEntStatusDateTime = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 9), NtpDateTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusDateTime.setStatus('current') ntpEntStatusLeapSecond = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 10), NtpDateTime()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusLeapSecond.setStatus('current') ntpEntStatusLeapSecDirection = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(-1, 1))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusLeapSecDirection.setStatus('current') ntpEntStatusInPkts = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 12), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusInPkts.setStatus('current') ntpEntStatusOutPkts = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 13), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusOutPkts.setStatus('current') ntpEntStatusBadVersion = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 14), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusBadVersion.setStatus('current') ntpEntStatusProtocolError = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 15), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusProtocolError.setStatus('current') ntpEntStatusNotifications = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 2, 16), Counter32()).setUnits('notifications').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatusNotifications.setStatus('current') ntpEntStatPktModeTable = MibTable((1, 3, 6, 1, 2, 1, 197, 1, 2, 17), ) if mibBuilder.loadTexts: ntpEntStatPktModeTable.setStatus('current') ntpEntStatPktModeEntry = MibTableRow((1, 3, 6, 1, 2, 1, 197, 1, 2, 17, 1), ).setIndexNames((0, "NTPv4-MIB", "ntpEntStatPktMode")) if mibBuilder.loadTexts: ntpEntStatPktModeEntry.setStatus('current') ntpEntStatPktMode = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 2, 17, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("symetricactive", 1), ("symetricpassive", 2), ("client", 3), ("server", 4), ("broadcastserver", 5), ("broadcastclient", 6)))) if mibBuilder.loadTexts: ntpEntStatPktMode.setStatus('current') ntpEntStatPktSent = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 2, 17, 1, 2), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatPktSent.setStatus('current') ntpEntStatPktReceived = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 2, 17, 1, 3), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpEntStatPktReceived.setStatus('current') ntpAssociationTable = MibTable((1, 3, 6, 1, 2, 1, 197, 1, 3, 1), ) if mibBuilder.loadTexts: ntpAssociationTable.setStatus('current') ntpAssociationEntry = MibTableRow((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1), ).setIndexNames((0, "NTPv4-MIB", "ntpAssocId")) if mibBuilder.loadTexts: ntpAssociationEntry.setStatus('current') ntpAssocId = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 99999))) if mibBuilder.loadTexts: ntpAssocId.setStatus('current') ntpAssocName = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 2), Utf8String()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocName.setStatus('current') ntpAssocRefId = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocRefId.setStatus('current') ntpAssocAddressType = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 4), InetAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocAddressType.setStatus('current') ntpAssocAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 5), InetAddress().subtype(subtypeSpec=ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(8, 8), ValueSizeConstraint(16, 16), ValueSizeConstraint(20, 20), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocAddress.setStatus('current') ntpAssocOffset = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocOffset.setStatus('current') ntpAssocStratum = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 7), NtpStratum()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocStratum.setStatus('current') ntpAssocStatusJitter = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 8), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocStatusJitter.setStatus('current') ntpAssocStatusDelay = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 9), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocStatusDelay.setStatus('current') ntpAssocStatusDispersion = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 1, 1, 10), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocStatusDispersion.setStatus('current') ntpAssociationStatisticsTable = MibTable((1, 3, 6, 1, 2, 1, 197, 1, 3, 2), ) if mibBuilder.loadTexts: ntpAssociationStatisticsTable.setStatus('current') ntpAssociationStatisticsEntry = MibTableRow((1, 3, 6, 1, 2, 1, 197, 1, 3, 2, 1), ).setIndexNames((0, "NTPv4-MIB", "ntpAssocId")) if mibBuilder.loadTexts: ntpAssociationStatisticsEntry.setStatus('current') ntpAssocStatInPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 2, 1, 1), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocStatInPkts.setStatus('current') ntpAssocStatOutPkts = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 2, 1, 2), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocStatOutPkts.setStatus('current') ntpAssocStatProtocolError = MibTableColumn((1, 3, 6, 1, 2, 1, 197, 1, 3, 2, 1, 3), Counter32()).setUnits('packets').setMaxAccess("readonly") if mibBuilder.loadTexts: ntpAssocStatProtocolError.setStatus('current') ntpEntHeartbeatInterval = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 4, 1), Unsigned32().clone(60)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: ntpEntHeartbeatInterval.setStatus('current') ntpEntNotifBits = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 4, 2), Bits().clone(namedValues=NamedValues(("notUsed", 0), ("entNotifModeChange", 1), ("entNotifStratumChange", 2), ("entNotifSyspeerChanged", 3), ("entNotifAddAssociation", 4), ("entNotifRemoveAssociation", 5), ("entNotifConfigChanged", 6), ("entNotifLeapSecondAnnounced", 7), ("entNotifHeartbeat", 8)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ntpEntNotifBits.setStatus('current') ntpEntNotifMessage = MibScalar((1, 3, 6, 1, 2, 1, 197, 1, 5, 1), Utf8String().clone('no event')).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: ntpEntNotifMessage.setStatus('current') ntpEntNotifications = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 0)) ntpEntNotifModeChange = NotificationType((1, 3, 6, 1, 2, 1, 197, 0, 1)).setObjects(("NTPv4-MIB", "ntpEntStatusCurrentMode")) if mibBuilder.loadTexts: ntpEntNotifModeChange.setStatus('current') ntpEntNotifStratumChange = NotificationType((1, 3, 6, 1, 2, 1, 197, 0, 2)).setObjects(("NTPv4-MIB", "ntpEntStatusDateTime"), ("NTPv4-MIB", "ntpEntStatusStratum"), ("NTPv4-MIB", "ntpEntNotifMessage")) if mibBuilder.loadTexts: ntpEntNotifStratumChange.setStatus('current') ntpEntNotifSyspeerChanged = NotificationType((1, 3, 6, 1, 2, 1, 197, 0, 3)).setObjects(("NTPv4-MIB", "ntpEntStatusDateTime"), ("NTPv4-MIB", "ntpEntStatusActiveRefSourceId"), ("NTPv4-MIB", "ntpEntNotifMessage")) if mibBuilder.loadTexts: ntpEntNotifSyspeerChanged.setStatus('current') ntpEntNotifAddAssociation = NotificationType((1, 3, 6, 1, 2, 1, 197, 0, 4)).setObjects(("NTPv4-MIB", "ntpEntStatusDateTime"), ("NTPv4-MIB", "ntpAssocName"), ("NTPv4-MIB", "ntpEntNotifMessage")) if mibBuilder.loadTexts: ntpEntNotifAddAssociation.setStatus('current') ntpEntNotifRemoveAssociation = NotificationType((1, 3, 6, 1, 2, 1, 197, 0, 5)).setObjects(("NTPv4-MIB", "ntpEntStatusDateTime"), ("NTPv4-MIB", "ntpAssocName"), ("NTPv4-MIB", "ntpEntNotifMessage")) if mibBuilder.loadTexts: ntpEntNotifRemoveAssociation.setStatus('current') ntpEntNotifConfigChanged = NotificationType((1, 3, 6, 1, 2, 1, 197, 0, 6)).setObjects(("NTPv4-MIB", "ntpEntStatusDateTime"), ("NTPv4-MIB", "ntpEntNotifMessage")) if mibBuilder.loadTexts: ntpEntNotifConfigChanged.setStatus('current') ntpEntNotifLeapSecondAnnounced = NotificationType((1, 3, 6, 1, 2, 1, 197, 0, 7)).setObjects(("NTPv4-MIB", "ntpEntStatusDateTime"), ("NTPv4-MIB", "ntpEntNotifMessage")) if mibBuilder.loadTexts: ntpEntNotifLeapSecondAnnounced.setStatus('current') ntpEntNotifHeartbeat = NotificationType((1, 3, 6, 1, 2, 1, 197, 0, 8)).setObjects(("NTPv4-MIB", "ntpEntStatusDateTime"), ("NTPv4-MIB", "ntpEntStatusCurrentMode"), ("NTPv4-MIB", "ntpEntHeartbeatInterval"), ("NTPv4-MIB", "ntpEntNotifMessage")) if mibBuilder.loadTexts: ntpEntNotifHeartbeat.setStatus('current') ntpEntConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 2)) ntpEntCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 2, 1)) ntpEntGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 197, 2, 2)) ntpEntNTPCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 197, 2, 1, 1)).setObjects(("NTPv4-MIB", "ntpEntObjectsGroup1")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntpEntNTPCompliance = ntpEntNTPCompliance.setStatus('current') ntpEntSNTPCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 197, 2, 1, 2)).setObjects(("NTPv4-MIB", "ntpEntObjectsGroup1"), ("NTPv4-MIB", "ntpEntObjectsGroup2"), ("NTPv4-MIB", "ntpEntNotifGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntpEntSNTPCompliance = ntpEntSNTPCompliance.setStatus('current') ntpEntObjectsGroup1 = ObjectGroup((1, 3, 6, 1, 2, 1, 197, 2, 2, 1)).setObjects(("NTPv4-MIB", "ntpEntSoftwareName"), ("NTPv4-MIB", "ntpEntSoftwareVersion"), ("NTPv4-MIB", "ntpEntSoftwareVendor"), ("NTPv4-MIB", "ntpEntSystemType"), ("NTPv4-MIB", "ntpEntStatusEntityUptime"), ("NTPv4-MIB", "ntpEntStatusDateTime"), ("NTPv4-MIB", "ntpAssocName"), ("NTPv4-MIB", "ntpAssocRefId"), ("NTPv4-MIB", "ntpAssocAddressType"), ("NTPv4-MIB", "ntpAssocAddress")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntpEntObjectsGroup1 = ntpEntObjectsGroup1.setStatus('current') ntpEntObjectsGroup2 = ObjectGroup((1, 3, 6, 1, 2, 1, 197, 2, 2, 2)).setObjects(("NTPv4-MIB", "ntpEntTimeResolution"), ("NTPv4-MIB", "ntpEntTimePrecision"), ("NTPv4-MIB", "ntpEntTimeDistance"), ("NTPv4-MIB", "ntpEntStatusCurrentMode"), ("NTPv4-MIB", "ntpEntStatusStratum"), ("NTPv4-MIB", "ntpEntStatusActiveRefSourceId"), ("NTPv4-MIB", "ntpEntStatusActiveRefSourceName"), ("NTPv4-MIB", "ntpEntStatusActiveOffset"), ("NTPv4-MIB", "ntpEntStatusNumberOfRefSources"), ("NTPv4-MIB", "ntpEntStatusDispersion"), ("NTPv4-MIB", "ntpEntStatusLeapSecond"), ("NTPv4-MIB", "ntpEntStatusLeapSecDirection"), ("NTPv4-MIB", "ntpEntStatusInPkts"), ("NTPv4-MIB", "ntpEntStatusOutPkts"), ("NTPv4-MIB", "ntpEntStatusBadVersion"), ("NTPv4-MIB", "ntpEntStatusProtocolError"), ("NTPv4-MIB", "ntpEntStatusNotifications"), ("NTPv4-MIB", "ntpEntStatPktSent"), ("NTPv4-MIB", "ntpEntStatPktReceived"), ("NTPv4-MIB", "ntpAssocOffset"), ("NTPv4-MIB", "ntpAssocStratum"), ("NTPv4-MIB", "ntpAssocStatusJitter"), ("NTPv4-MIB", "ntpAssocStatusDelay"), ("NTPv4-MIB", "ntpAssocStatusDispersion"), ("NTPv4-MIB", "ntpAssocStatInPkts"), ("NTPv4-MIB", "ntpAssocStatOutPkts"), ("NTPv4-MIB", "ntpAssocStatProtocolError"), ("NTPv4-MIB", "ntpEntHeartbeatInterval"), ("NTPv4-MIB", "ntpEntNotifBits"), ("NTPv4-MIB", "ntpEntNotifMessage")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntpEntObjectsGroup2 = ntpEntObjectsGroup2.setStatus('current') ntpEntNotifGroup = NotificationGroup((1, 3, 6, 1, 2, 1, 197, 2, 2, 3)).setObjects(("NTPv4-MIB", "ntpEntNotifModeChange"), ("NTPv4-MIB", "ntpEntNotifStratumChange"), ("NTPv4-MIB", "ntpEntNotifSyspeerChanged"), ("NTPv4-MIB", "ntpEntNotifAddAssociation"), ("NTPv4-MIB", "ntpEntNotifRemoveAssociation"), ("NTPv4-MIB", "ntpEntNotifConfigChanged"), ("NTPv4-MIB", "ntpEntNotifLeapSecondAnnounced"), ("NTPv4-MIB", "ntpEntNotifHeartbeat")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ntpEntNotifGroup = ntpEntNotifGroup.setStatus('current') mibBuilder.exportSymbols("NTPv4-MIB", ntpEntStatus=ntpEntStatus, ntpEntInfo=ntpEntInfo, ntpEntStatusDateTime=ntpEntStatusDateTime, ntpEntStatusActiveRefSourceName=ntpEntStatusActiveRefSourceName, ntpEntNotifStratumChange=ntpEntNotifStratumChange, ntpEntNotifAddAssociation=ntpEntNotifAddAssociation, ntpEntHeartbeatInterval=ntpEntHeartbeatInterval, ntpEntStatPktModeEntry=ntpEntStatPktModeEntry, ntpAssocAddress=ntpAssocAddress, ntpEntObjectsGroup1=ntpEntObjectsGroup1, ntpAssocStratum=ntpAssocStratum, ntpEntTimeResolution=ntpEntTimeResolution, ntpEntNotifMessage=ntpEntNotifMessage, ntpAssocOffset=ntpAssocOffset, ntpEntStatusActiveRefSourceId=ntpEntStatusActiveRefSourceId, ntpAssociationEntry=ntpAssociationEntry, ntpAssocAddressType=ntpAssocAddressType, ntpAssociationTable=ntpAssociationTable, ntpEntNotifModeChange=ntpEntNotifModeChange, ntpEntSoftwareVersion=ntpEntSoftwareVersion, ntpAssociationStatisticsEntry=ntpAssociationStatisticsEntry, ntpEntNotifObjects=ntpEntNotifObjects, ntpEntStatusEntityUptime=ntpEntStatusEntityUptime, ntpAssocId=ntpAssocId, ntpAssocName=ntpAssocName, ntpEntStatusActiveOffset=ntpEntStatusActiveOffset, ntpEntStatusLeapSecond=ntpEntStatusLeapSecond, ntpEntSystemType=ntpEntSystemType, ntpEntStatPktReceived=ntpEntStatPktReceived, PYSNMP_MODULE_ID=ntpSnmpMIB, ntpSnmpMIB=ntpSnmpMIB, NtpStratum=NtpStratum, ntpEntNotifications=ntpEntNotifications, ntpSnmpMIBObjects=ntpSnmpMIBObjects, ntpAssocStatusDispersion=ntpAssocStatusDispersion, ntpEntNTPCompliance=ntpEntNTPCompliance, ntpEntStatusOutPkts=ntpEntStatusOutPkts, ntpEntStatPktModeTable=ntpEntStatPktModeTable, ntpEntSNTPCompliance=ntpEntSNTPCompliance, NtpDateTime=NtpDateTime, ntpEntNotifSyspeerChanged=ntpEntNotifSyspeerChanged, ntpEntNotifHeartbeat=ntpEntNotifHeartbeat, ntpAssocRefId=ntpAssocRefId, ntpEntStatusProtocolError=ntpEntStatusProtocolError, ntpAssocStatOutPkts=ntpAssocStatOutPkts, ntpAssocStatInPkts=ntpAssocStatInPkts, ntpEntSoftwareName=ntpEntSoftwareName, ntpAssocStatProtocolError=ntpAssocStatProtocolError, ntpEntStatusBadVersion=ntpEntStatusBadVersion, ntpEntGroups=ntpEntGroups, ntpEntStatusDispersion=ntpEntStatusDispersion, ntpEntStatusInPkts=ntpEntStatusInPkts, ntpAssocStatusDelay=ntpAssocStatusDelay, ntpAssociationStatisticsTable=ntpAssociationStatisticsTable, ntpEntStatusNotifications=ntpEntStatusNotifications, ntpEntNotifRemoveAssociation=ntpEntNotifRemoveAssociation, ntpEntNotifLeapSecondAnnounced=ntpEntNotifLeapSecondAnnounced, ntpEntSoftwareVendor=ntpEntSoftwareVendor, ntpEntStatusNumberOfRefSources=ntpEntStatusNumberOfRefSources, ntpEntStatPktMode=ntpEntStatPktMode, ntpEntNotifConfigChanged=ntpEntNotifConfigChanged, ntpEntTimeDistance=ntpEntTimeDistance, ntpEntCompliances=ntpEntCompliances, ntpEntObjectsGroup2=ntpEntObjectsGroup2, ntpEntTimePrecision=ntpEntTimePrecision, ntpEntStatusStratum=ntpEntStatusStratum, ntpEntStatusCurrentMode=ntpEntStatusCurrentMode, ntpEntStatusLeapSecDirection=ntpEntStatusLeapSecDirection, ntpAssocStatusJitter=ntpAssocStatusJitter, ntpEntNotifGroup=ntpEntNotifGroup, ntpEntControl=ntpEntControl, ntpEntNotifBits=ntpEntNotifBits, ntpEntStatPktSent=ntpEntStatPktSent, ntpEntConformance=ntpEntConformance, ntpAssociation=ntpAssociation)
def average_discount(list_of_changes): total = 0 count = 0 for change in list_of_changes: if change < 0: total += (- change) count += 1 return round((total / count), 2) def calculate_discount_averages(x): result=[] for i in x: try: y=average_discount(i) except ZeroDivisionError: y=0 result.append(y) return result
n = int(input()) even_ones = set() odd_ones = set() index = 0 sum_of_chars = 0 for _ in range(n): name = input() index += 1 for char in name: sum_of_chars += int(ord(char)) sum_of_chars //= index if sum_of_chars % 2 == 0: even_ones.add(sum_of_chars) else: odd_ones.add(sum_of_chars) sum_of_chars = 0 if sum(even_ones) == sum(odd_ones): result = odd_ones.union(even_ones) elif sum(odd_ones) > sum(even_ones): result = odd_ones.difference(even_ones) elif sum(even_ones) > sum(odd_ones): result = odd_ones.symmetric_difference(even_ones) print(', '.join([str(x) for x in result]))
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0. class Action(object): """ A build step """ def is_main(self): """ Returns True if this action needs no external tasks run to set it up """ return False def run(self, env): pass def __str__(self): return self.__class__.__name__
# configs config_path = './config/config.yaml' # urls base_url = 'https://www.finanzen.net/index/' ext_urls = { 'DAX' : 'dax/30-werte', 'TECDAX' : 'tecdax/werte', 'DOW JONES' : 'dow_jones/werte', 'MDAX' : 'mdax/werte', 'SDAX' : 'sdax/werte', 'S&P500' : 's&p_500/werte', 'NASDAQ100' : 'nasdaq_100/werte', 'EUROSTOXX' : 'euro_stoxx_50/werte', 'SMI' : 'smi/werte', 'ATX' : 'atx/werte', 'CAC40' : 'cac_40/werte' } # rename cols mappings rename_dict = { 'name' : 'stock', 'current' : 'current price', 'last_day' : 'previous day price', 'percent_change' : '% drop' } # lower threshold in percent per_threshold = -5.0
n = int(input("Enter Number:")) sum = 0 while(n != 0): sum += n % 10 n //= 10 #floor division print(sum)
# Interactive Coding Exercise 2 # Solution - Wrapped the input on line 4 in an int(). year = int(input("Which year do you want to check?")) if year % 4 == 0: if year % 100 == 0: if year % 400 == 0: print("Leap year.") else: print("Not leap year.") else: print("Leap year.") else: print("Not leap year.")
def find_empty_space(board): """ find an empty space in the board param board: partially complete board return: (int, int) the row and the column """ for i in range(9): for j in range(9): if board[i][j] == 0: return (i,j) return None def valid_number(board, number, position): """ return if the number fit in the position param board: 2d list of ints param position: (row, col) param number: integer return: boolean """ for i in range(9): if board[position[0]][i] == number and position[1] != i: return False for i in range(9): if board[i][position[1]] == number and position[0] != i: return False box_row = (position[0] // 3)*3 box_column = (position[1] // 3)*3 for i in range(box_row, box_row+3): for j in range(box_column, box_column+3): if board[i][j] == number and (i,j) != position: return False return True def solve(board): """ solve a sudoku board using backtracking param board: 2d list of integers return: solution """ space_found = find_empty_space(board) if not space_found: return True else: row, col = space_found for i in range(1, 10): if valid_number(board, i, (row, col)): board[row][col] = i if solve(board): return True board[row][col] = 0 return False def print_board(board): """ prints the board param board: 2d List of integers return: None """ for i in range(9): if i%3 == 0 and i != 0: print("-"*21, sep=' ', end='\n') for j in range(9): if j%3 == 0 and j != 0: print('|', sep=' ', end=' ') print(board[i][j], sep=' ', end=' ') print(' ')
class CPP: @staticmethod def __protection_exception(prop): raise Exception(f'Can not modify constant property: {prop}') @staticmethod def protect(obj, prop): setattr(obj.__class__, prop, property( lambda self: getattr(self, '_'+prop), lambda self, value: CPP.__protection_exception(prop) ))
class User: def __init__(self, username, password): self.name = username self.password = password def login(self): return def logout(self): return
def is_valid(s): stack = [] for i in range(len(s)): if s[i] == "(" or s[i] == "[" or s[i] == "{": stack.append(s[i]) else: if len(stack) == 0: return False if s[i] == ")" and stack[-1] != "(": return False if s[i] == "]" and stack[-1] != "[": return False if s[i] == "}" and stack[-1] != "{": return False stack.pop() return len(stack) == 0 if __name__ == "__main__": s_ = "()[]{}" print(is_valid(s_))
#W.A.P TO TAKE INPUT FROM USER (empid,name,salary) AND PRINT EMPLOYEE DETAILS emp=int(input('Enter employee ID:')) name=input('Enter your name:') sal=int(input('Enter your annual salary:')) print('Employee Details --> \n Employee ID:',emp,'\n Name:',name,'\n Annual Salary:',sal)
def main(): def findMin(x): minNum = x[0] for i in x: if minNum > i: minNum = i return minNum print(findMin([0,1,2,3,4,5,-3,24,-56])) # = -56 if __name__ == '__main__': main()
a = 'some_string' b = 'some' + '_' + 'string' c = 'somestring' print(id(a)) print(id(b)) print(id(c))
__all__ = ['split_and_load'] def split_and_load(data, ctx_list, batch_axis=0, even_split=True): """Splits an NDArray into `len(ctx_list)` slices along `batch_axis` and loads each slice to one context in `ctx_list`. Parameters ---------- data : NDArray A batch of data. ctx_list : list of Context A list of Contexts. batch_axis : int, default 0 The axis along which to slice. even_split : bool, default True Whether to force all slices to have the same number of elements. Returns ------- list of NDArray Each corresponds to a context in `ctx_list`. """ if len(ctx_list) == 1: return [d.as_in_context(ctx_list[0]) for d in data] size = len(data) num_slice = len(ctx_list) step = size // num_slice for i in range(num_slice): for k in range(i*step, (i+1)*step): data[k].as_in_context(ctx_list[i]) return data
# Copyright 2019, A10 Networks # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. # ============== # Argument Names # ============== LOADBALANCERS_LIST = 'loadbalancers_list' VRID_LIST = 'vrid_list' SET_THUNDER_UPDATE_AT = 'set-thunder-update-at' SET_THUNDER_BACKUP_UPDATE_AT = 'set-thunder-backup-update-at' # Member count with specific IP. MEMBER_COUNT_IP = 'member_count_ip' MEMBER_COUNT_IP_PORT_PROTOCOL = 'member_count_ip_port_protocol' POOL_COUNT_IP = 'pool_count_ip' WRITE_MEM_SHARED_PART = 'write_mem_shared_part' WRITE_MEM_FOR_SHARED_PARTITION = 'write_memory_for_shared_partition' WRITE_MEM_FOR_LOCAL_PARTITION = 'write_memory_for_local_partition' MEMBER_LIST = 'member_list' SUBNET_LIST = 'subnet_list' MEMBERS = 'members' POOLS = 'pools' PARTITION_PROJECT_LIST = 'partition_project_list' IFNUM_BACKUP = 'ifnum_backup' IFNUM_MASTER = 'ifnum_master' LISTENER_STATS = 'listener_stats' # Octavia taskflow flow and task names (missing name in victoria octavia) RELOADLOAD_BALANCER = 'octavia-reloadload-balancer' VTHUNDER = 'vthunder' STATUS = 'status' ROLE = 'role' BACKUP_VTHUNDER = 'backup_vthunder' MASTER_VTHUNDER = 'master_vthunder' VRRP_STATUS = 'vrrp_status' MASTER_VRRP_STATUS = 'master_vrrp_status' BACKUP_VRRP_STATUS = 'backup_vrrp_status' NAT_POOL = 'nat_pool' NAT_FLAVOR = 'nat_flavor' SUBNET_PORT = 'subnet_port' WRITE_MEM_SHARED = 'write_mem_shared' WRITE_MEM_PRIVATE = 'write_mem_private' FAILED = 'FAILED' USED_SPARE = 'USED_SPARE' SPARE_VTHUNDER = 'spare_vthunder' FAILOVER_VTHUNDER = 'failover_vthunder' OCTAVIA_HEALTH_MANAGER_CONTROLLER = 'octavia_health_manager_controller' OCTAVIA_HEALTH_MONITOR = 'octavia_health_monitor' VTHUNDER_CONFIG = 'vthunder_config' DEVICE_CONFIG_DICT = 'device_config_dict' DEVICE_KEY_PREFIX = '[dev]' USE_DEVICE_FLAVOR = 'use_device_flavor' VTHUNDER_ID = "vthunder_id" DEVICE_ID = "device_id" SET_ID = "set_id" VRID = "vrid" DEVICE_PRIORITY = 'device_priority' FLOATING_IP = 'floating_ip' FLOATING_IP_MASK = 'floating_ip_mask' CERT_DATA = 'cert_data' SP_OBJ_DICT = { 'HTTP_COOKIE': "cookie_persistence", 'APP_COOKIE': "cookie_persistence", 'SOURCE_IP': "src_ip_persistence", } HTTP_TYPE = ['HTTP', 'HTTPS'] PERS_TYPE = ['cookie_persistence', 'src_ip_persistence'] NO_DEST_NAT_SUPPORTED_PROTOCOL = ['tcp', 'udp'] PORT = 'port' LB_COUNT = 'lb_count' LB_COUNT_SUBNET = 'lb_count_subnet' LB_COUNT_FLAVOR = 'lb_count_flavor' MEMBER_COUNT = 'member_count' DELETE_VRID = 'delete_vrid' LB_COUNT_THUNDER = 'lb_count_thunder' MEMBER_COUNT_THUNDER = 'member_count_thunder' LB_COUNT_THUNDER_PARTITION = 'lb_count_thunder_partition' ID = 'id' SECURITY_GROUPS = 'security_groups' VIP_SEC_GROUP_PREFIX = 'lb-' LB_RESOURCE = 'lb_resource' SUBNET_ID = "subnet_id" VLAN_ID = "vlan_id" TAG_INTERFACE = "tag_interface" VE_INTERFACE = "ve_interface" DELETE_VLAN = "delete_vlan" VLAN = "vlan" FLAT = "flat" SUPPORTED_NETWORK_TYPE = [FLAT, VLAN] SSL_TEMPLATE = "ssl_template" COMPUTE_BUSY = "compute_busy" VTHUNDER_LIST = "vthunder_list" NETWORK_LIST = "network_list" ADDED_NETWORK = "added_network" COMPUTE_PAUSED = "PAUSED" L2DSR_FLAVOR = "l2dsr_flavor" MASTER_AMPHORA_STATUS = "master_amphora_status" BACKUP_AMPHORA_STATUS = "backup_amphora_status" # ACOS versions ACOS_5_2_1_P2 = "5.2.1-P2" # ============================ # Taskflow flow and task names # ============================ GET_VTHUNDER_FOR_LB_SUBFLOW = 'octavia-get-vthunder-for-lb-subflow' BACKUP_AMPHORA_PLUG = 'backup-amphora-plug' GET_MASTER_VTHUNDER_INTERFACE = 'get-master-vthunder-intercae' GET_BACKUP_VTHUNDER_INTERFACE = 'get-backup-vthunder-intercae' MASTER_CONNECTIVITY_WAIT = 'master-connectivity-wait' BACKUP_CONNECTIVITY_WAIT = 'backup-connectivity-wait' ENABLE_MASTER_VTHUNDER_INTERFACE = 'enable-master-vthunder-interface' ENABLE_BACKUP_VTHUNDER_INTERFACE = 'enable-backup-vthunder-interface' ENABLE_VTHUNDER_INTERFACE = 'enable-vthunder-interface' MASTER_ENABLE_INTERFACE = 'master-enable-interface' BACKUP_ENABLE_INTERFACE = 'backup-enable-interface' MARK_VTHUNDER_MASTER_ACTIVE_IN_DB = 'mark-vthunder-master-active-in-db' MARK_VTHUNDER_BACKUP_ACTIVE_IN_DB = 'mark-vthunder-backup-active-in-db' MARK_VTHUNDER_MASTER_DELETED_IN_DB = 'mark-vthunder-master-deleted-in-db' MARK_VTHUNDER_BACKUP_DELETED_IN_DB = 'mark-vthunder-backup-deleted-in-db' GET_BACKUP_VTHUNDER_BY_LB = 'get-backup-vthunder-by-lb' GET_VTHUNDER_FROM_LB = 'get-vthunder-from-lb' CREATE_HEALTH_MONITOR_ON_VTHUNDER = 'create-health-monitor-on-vthunder' CREATE_HEALTH_MONITOR_ON_SPARE = 'create-health-monitor-on-spare' MARK_AMPHORA_READY_INDB = 'mark-amphora-ready-indb' HANDLE_SESS_PERS = 'handle-session-persistence-delta-subflow' GET_LOADBALANCER_FROM_DB = 'Get-Loadbalancer-from-db' GET_BACKUP_LOADBALANCER_FROM_DB = 'get-backup-loadbalancer-from-db' CONFIGURE_VRRP_FOR_MASTER_VTHUNDER = 'configure-vrrp-for-master-vthunder' CONFIGURE_VRRP_FOR_BACKUP_VTHUNDER = 'configure-vrrp-for-backup-vthunder' CONFIGURE_VRID_FOR_MASTER_VTHUNDER = 'configure-vrid-for-master-vthunder' CONFIGURE_VRID_FOR_BACKUP_VTHUNDER = 'configure-vrid-for-backup-vthunder' WAIT_FOR_MASTER_SYNC = 'wait-for-master-sync' WAIT_FOR_BACKUP_SYNC = 'wait-for-backup-sync' CONFIGURE_AVCS_SYNC_FOR_MASTER = 'configure-avcs-sync-for-master' CONFIGURE_AVCS_SYNC_FOR_BACKUP = 'configure-avcs-sync-for-backup' CONFIGURE_AVCS_FOR_FAILOVER = 'configure-avcs-for-failover' CHECK_VRRP_STATUS = 'check-vrrp-status' CHECK_VRRP_MASTER_STATUS = 'check-vrrp-master-status' CHECK_VRRP_BACKUP_STATUS = 'check-vrrp-backup-status' CONFIRM_VRRP_STATUS = 'confirm-vrrp-status' ADD_VRRP_SET_ID_INDB = 'add-vrrp-set-id-db' DELETE_VRRP_SET_ID_INDB = 'delete-vrrp-set-id-db' GET_VRRP_SET_ID_INDB = 'get-vrrp-set-id-db' ALLOCATE_VIP = 'allocate-vip' UPDATE_VIP_AFTER_ALLOCATION = 'update-vip-after-allocation' ALLOW_L2DSR = 'allow-l2dsr' ALLOW_NO_SNAT = 'allow-no-snat' AMPHORAE_POST_VIP_PLUG = 'amphorae-post-vip-plug' AMPHORA_POST_NETWORK_UNPLUG = 'amphorae-post-network-plug' AMPHORA_POST_NETWORK_UNPLUG_FOR_BACKUP_VTHUNDER = 'amphorae-post-network-plug-for-backup-vthunder' AMP_POST_VIP_PLUG = 'amp-post-vip-plug' AMPHORAE_POST_VIP_PLUG_FOR_MASTER = 'amphorae-post-vip-plug-for-master' AMPHORAE_POST_VIP_PLUG_FOR_BACKUP = 'amphorae-post-vip-plug-for-backup' VCS_RELOAD = 'vcs-reload' GET_BACKUP_VTHUNDER = 'get-backup-vthunder' GET_MASTER_VTHUNDER = 'get-master-vthunder' CONNECTIVITY_WAIT_FOR_MASTER_VTHUNDER = 'connectivity-wait-for-master-vthunder' CONNECTIVITY_WAIT_FOR_BACKUP_VTHUNDER = 'connectivity-wait-for-backup-vthunder' GET_VTHUNDER_MASTER = 'get-vthunder-master' WAIT_FOR_MASTER_VCS_RELOAD = 'wait-for-master-vcs-reload' WAIT_FOR_BACKUP_VCS_RELOAD = 'wait-for-backup-vcs-reload' VCS_SYNC_WAIT = "wait-for-vcs_ready" GET_COMPUTE_FOR_PROJECT = 'get-compute-for-project' VALIDATE_COMPUTE_FOR_PROJECT = 'validate-compute-for-project' GET_SPARE_COMPUTE_FOR_PROJECT = 'get-spare-compute-for-project' DELETE_STALE_SPARE_VTHUNDER = 'delete-stale-spare-vthunder' CREATE_VTHUNDER_ENTRY = 'create-vthunder-entry' UPDATE_ACOS_VERSION_IN_VTHUNDER_ENTRY = 'update-acos-version-in-vthunder-entry' UPDATE_ACOS_VERSION_FOR_BACKUP_VTHUNDER = 'update-acos-version-for-backup-vthunder' VTHUNDER_BY_LB = 'vthunder-by-loadbalancer' GET_VTHUNDER_BY_LB = 'get-vthunder-by-lb' VTHUNDER_CONNECTIVITY_WAIT = 'vthunder-connectivity-wait' WAIT_FOR_VTHUNDER_CONNECTIVITY = 'wait-for-vthunder-connectivity' CHANGE_PARTITION = 'change-partition' CREATE_SSL_CERT_FLOW = 'create-ssl-cert-flow' DELETE_SSL_CERT_FLOW = 'delete-ssl-cert-flow' LISTENER_TYPE_DECIDER_FLOW = 'listener_type_decider_flow' DELETE_LOADBALANCER_VRID_SUBFLOW = 'delete-loadbalancer-vrid-subflow' REVOKE_ACTIVE_VTHUNDER_LICENSE = 'revoke-active-vthunder-license' REVOKE_BACKUP_VTHUNDER_LICENSE = 'revoke-backup-vthunder-license' HANDLE_VRID_LOADBALANCER_SUBFLOW = 'handle-vrid-loadbalancer-subflow' CREATE_MEMBER_SNAT_POOL_SUBFLOW = 'create-member-snat-pool-subflow' DELETE_MEMBER_VTHUNDER_INTERNAL_SUBFLOW = 'delete-member-vthunder-internal-subflow' DELETE_MEMBER_VRID_SUBFLOW = 'delete-member-vrid-subflow' DELETE_MEMBER_VRID_INTERNAL_SUBFLOW = 'delete-member-vrid-internal-subflow' DELETE_HEALTH_MONITOR_VTHUNDER_SUBFLOW = 'delete-hm-vthunder-subflow' DELETE_HEALTH_MONITOR_SUBFLOW_WITH_POOL_DELETE_FLOW = 'delete-health-monitor-subflow' \ '-with-pool-delete-flow' DELETE_MEMBERS_SUBFLOW_WITH_POOL_DELETE_FLOW = 'delete-members-subflow-with-pool-delete-flow' HANDLE_VRID_MEMBER_SUBFLOW = 'handle-vrid-member-subflow' SPARE_VTHUNDER_CREATE = 'spare-vthunder-create' ACTIVATE_GLM_LICENSE_SUBFLOW = 'activate-glm-license-subflow' CONFIGURE_DNS_NAMESERVERS = 'configure-dns-nameservers' ACTIVATE_FLEXPOOL_LICENSE = 'activate-flexpool-license' CONFIGURE_PROXY_SERVER = 'configure-proxy-server' SET_VTHUNDER_HOSTNAME = 'set-vthunder-hostname' WRITE_MEMORY_THUNDER_FLOW = 'write-memory-thunder-flow' RELOAD_CHECK_THUNDER_FLOW = 'reload-check-thunder-flow' LB_TO_VTHUNDER_SUBFLOW = 'lb-to-vthunder-subflow' GET_SPARE_AMPHORA_SBUFLOW = 'get-sapre_amphora-subflow' GET_LB_RESOURCE = 'get-lb-resource' GET_LB_RESOURCE_SUBNET = 'get-lb-resource-subnet' GET_PROJECT_COUNT = 'get-child-parent-project-count' GET_LB_COUNT_SUBNET = 'get-lb-count-by-subnet' UPDATE_LISTENER_STATS_FLOW = 'update-listener-stats-flow' GET_VTHUNDER_AMPHORA = 'get-vthunder-amphora' COMPUTE_DELETE = 'compute-delete' SET_VTHUNDER_TO_STANDBY = 'set-vthunder-to-standby' GET_LBS_BY_THUNDER = 'get-loadbalancers-by-thunder' MARK_LB_PENIND_UPDATE_IN_DB = 'mark-vthunder-pending-update-in-db' MARK_LB_ACTIVE_IN_DB = 'mark-vthunder-active-in-db' GET_VTHUNDER_NETWORK_LIST = 'get-vthunder-network-list' GET_AMPHORA_FOR_FAILOVER = 'get-amphora-for-failover' PLUG_NETWORK_BY_IDS = 'plug-network-by-ids' PLUG_VIP_NETWORK_ON_SPARE = 'plusg-vip-network-on-spare' POST_SPARE_PLUG_NETWORK = 'post-failover-plug-network' GET_VCS_DEVICE_ID = 'get-vcs-device-id' POST_FAILOVER_DB_UPDATE = 'post-failover-db-update' MARK_LB_LIST_ERROR_ON_REVERT = 'mark-lb-list-error-on-revert' # ====================== # Non-Taskflow Constants # ====================== OCTAVIA_OWNER = 'Octavia' TOPOLOGY_SPARE = 'SPARE' READY = "READY"
lots_of_numbers = range(-1000, 1000) the_same_numbers = range(-1000, 1000) same_numbers = ( i for i, j in zip(lots_of_numbers, the_same_numbers) if i is j ) print(*same_numbers, sep=", ")
def rotate(string, n): """Rotate characters in a string. Expects string and n (int) for number of characters to move. """ return string[n:] + string[:n] print (rotate('pybites loves julian and bob!',-15))
class Config: BOT_TOKEN = '' # from @botfather APP_ID = '' # from https://my.telegram.org/apps API_HASH = '' # from https://my.telegram.org/apps API_KEY = '' # from https://mixdrop.co API_EMAIL = '' # from https://mixdrop.co AUTH_USERS = [694380168] # ADD YOUR USER ID
""" https://leetcode.com/problems/counting-bits/ Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array. Example 1: Input: 2 Output: [0,1,1] Example 2: Input: 5 Output: [0,1,1,2,1,2] Follow up: It is very easy to come up with a solution with run time O(n*sizeof(integer)). But can you do it in linear time O(n) /possibly in a single pass? Space complexity should be O(n). Can you do it like a boss? Do it without using any builtin function like __builtin_popcount in c++ or in any other language. """ class Solution(object): def countBits(self, num): """ :type num: int :rtype: List[int] """ if num == 0: return [0] counts = [0] * (num + 1) counts[0] = 0 counts[1] = 1 for number in range(2, num + 1): counts[number] = counts[int(number / 2)] + counts[number % 2] return counts
debug = True run = { "echo": True }
age = float(input()) gender = input() if gender =="m": if age >= 16: print("Mr.") else: print("Master") if gender == "f": if age >= 16: print("Ms.") else: print("Miss")
""" Asked by: Snapchat [Easy]. Given an array of time intervals (start, end) for classroom lectures (possibly overlapping), find the minimum number of rooms required. For example, given [(30, 75), (0, 50), (60, 150)], you should return 2. """
T = int(input()) if 1 <= T <= 100: for i in range(T): N = int(input()) a = [] for j in range(N - 1): l = int(input()) if l <= N: a.append(l) for k in range(1, N + 1): if k not in a: print(k)
# # PySNMP MIB module ALCATEL-IND1-IGMP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALCATEL-IND1-IGMP-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:17:51 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) # softentIND1Igmp, = mibBuilder.importSymbols("ALCATEL-IND1-BASE", "softentIND1Igmp") Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") InetAddressIPv4, InetAddressType, InetAddress = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddressIPv4", "InetAddressType", "InetAddress") NotificationGroup, ObjectGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ObjectGroup", "ModuleCompliance") Unsigned32, Bits, MibIdentifier, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, TimeTicks, Counter64, IpAddress, Counter32, iso, NotificationType, Integer32, ModuleIdentity, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "Bits", "MibIdentifier", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "TimeTicks", "Counter64", "IpAddress", "Counter32", "iso", "NotificationType", "Integer32", "ModuleIdentity", "ObjectIdentity") RowStatus, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "TextualConvention", "DisplayString") alcatelIND1IgmpMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1)) alcatelIND1IgmpMIB.setRevisions(('2011-02-23 00:00', '2009-03-31 00:00', '2008-09-10 00:00', '2008-08-08 00:00', '2007-04-03 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: alcatelIND1IgmpMIB.setRevisionsDescriptions(('Add zero-based query object', 'IGMP helper address changes', 'Add flood unknown object', 'The latest version of this MIB Module. Added maximum group limit objects.', 'The revised version of this MIB Module.',)) if mibBuilder.loadTexts: alcatelIND1IgmpMIB.setLastUpdated('201102230000Z') if mibBuilder.loadTexts: alcatelIND1IgmpMIB.setOrganization('Alcatel-Lucent') if mibBuilder.loadTexts: alcatelIND1IgmpMIB.setContactInfo('Please consult with Customer Service to ensure the most appropriate version of this document is used with the products in question: Alcatel-Lucent, Enterprise Solutions Division (Formerly Alcatel Internetworking, Incorporated) 26801 West Agoura Road Agoura Hills, CA 91301-5122 United States Of America Telephone: North America +1 800 995 2696 Latin America +1 877 919 9526 Europe +31 23 556 0100 Asia +65 394 7933 All Other +1 818 878 4507 Electronic Mail: [email protected] World Wide Web: http://alcatel-lucent.com/wps/portal/enterprise File Transfer Protocol: ftp://ftp.ind.alcatel.com/pub/products/mibs') if mibBuilder.loadTexts: alcatelIND1IgmpMIB.setDescription('This module describes an authoritative enterprise-specific Simple Network Management Protocol (SNMP) Management Information Base (MIB): Proprietary IPv4 Multicast MIB definitions The right to make changes in specification and other information contained in this document without prior notice is reserved. No liability shall be assumed for any incidental, indirect, special, or consequential damages whatsoever arising from or related to this document or the information contained herein. Vendors, end-users, and other interested parties are granted non-exclusive license to use this specification in connection with management of the products for which it is intended to be used. Copyright (C) 1995-2007 Alcatel-Lucent ALL RIGHTS RESERVED WORLDWIDE') alcatelIND1IgmpMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1)) alaIgmp = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1)) alaIgmpStatus = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpStatus.setStatus('current') if mibBuilder.loadTexts: alaIgmpStatus.setDescription('Administratively enable IPv4 multicast switching and routing on the system.') alaIgmpQuerying = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpQuerying.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerying.setDescription('Administratively enable IGMP Querying on the system.') alaIgmpSpoofing = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpSpoofing.setStatus('current') if mibBuilder.loadTexts: alaIgmpSpoofing.setDescription('Administratively enable IGMP Spoofing on the system.') alaIgmpZapping = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpZapping.setStatus('current') if mibBuilder.loadTexts: alaIgmpZapping.setDescription('Administratively enable IGMP Zapping on the system.') alaIgmpVersion = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 5), Unsigned32().clone(2)).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVersion.setStatus('current') if mibBuilder.loadTexts: alaIgmpVersion.setDescription('Set the default IGMP protocol Version running on the system.') alaIgmpRobustness = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 6), Unsigned32().clone(2)).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpRobustness.setStatus('current') if mibBuilder.loadTexts: alaIgmpRobustness.setDescription('Set the IGMP Robustness variable used on the system.') alaIgmpQueryInterval = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 7), Unsigned32().clone(125)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpQueryInterval.setStatus('current') if mibBuilder.loadTexts: alaIgmpQueryInterval.setDescription('Set the IGMP Query Interval used on the system.') alaIgmpQueryResponseInterval = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 8), Unsigned32().clone(100)).setUnits('tenths of seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpQueryResponseInterval.setStatus('current') if mibBuilder.loadTexts: alaIgmpQueryResponseInterval.setDescription('Set the IGMP Query Response Interval on the system.') alaIgmpLastMemberQueryInterval = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 9), Unsigned32().clone(10)).setUnits('tenths of seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpLastMemberQueryInterval.setStatus('current') if mibBuilder.loadTexts: alaIgmpLastMemberQueryInterval.setDescription('Set the IGMP Last Member Query Interval on the system.') alaIgmpRouterTimeout = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 10), Unsigned32().clone(90)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpRouterTimeout.setStatus('current') if mibBuilder.loadTexts: alaIgmpRouterTimeout.setDescription('The IGMP Router Timeout on the system.') alaIgmpSourceTimeout = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 11), Unsigned32().clone(30)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpSourceTimeout.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceTimeout.setDescription('The IGMP Source Timeout on the system.') alaIgmpProxying = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpProxying.setStatus('current') if mibBuilder.loadTexts: alaIgmpProxying.setDescription('Administratively enable IGMP Proxying on the system.') alaIgmpUnsolicitedReportInterval = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 13), Unsigned32().clone(1)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpUnsolicitedReportInterval.setStatus('current') if mibBuilder.loadTexts: alaIgmpUnsolicitedReportInterval.setDescription('The IGMP Unsolicited Report Interval on the system.') alaIgmpQuerierForwarding = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 14), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpQuerierForwarding.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerierForwarding.setDescription('Administratively enable IGMP Querier Forwarding on the system.') alaIgmpMaxGroupLimit = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 15), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpMaxGroupLimit.setStatus('current') if mibBuilder.loadTexts: alaIgmpMaxGroupLimit.setDescription('The global limit on maximum number of IGMP Group memberships that can be learnt on each port/vlan instance.') alaIgmpMaxGroupExceedAction = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("drop", 1), ("replace", 2))).clone('none')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpMaxGroupExceedAction.setStatus('current') if mibBuilder.loadTexts: alaIgmpMaxGroupExceedAction.setDescription('The global configuration of action to be taken when IGMP group membership limit is exceeded on a port/vlan instance.') alaIgmpFloodUnknown = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpFloodUnknown.setStatus('current') if mibBuilder.loadTexts: alaIgmpFloodUnknown.setDescription('Administratively enable flooding of multicast data packets during flow learning and setup.') alaIgmpHelperAddressType = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 18), InetAddressType().subtype(subtypeSpec=ValueRangeConstraint(1, 1))).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpHelperAddressType.setStatus('current') if mibBuilder.loadTexts: alaIgmpHelperAddressType.setDescription('Set the address type of the helper address. Must be ipv4(1) and set at the same time as alaIgmpHelperAddress.') alaIgmpHelperAddress = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 19), InetAddress().subtype(subtypeSpec=ValueSizeConstraint(4, 4)).setFixedLength(4)).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpHelperAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpHelperAddress.setDescription('The configured IPv4 helper address. When an IGMP report or leave is received by the device it will remove the IP header and regenerate a new IP header with a destination IP address specified. Use 0.0.0.0 to no longer help an IGMP report to an remote address. Must be set at the same time as alaIgmpHelperAddressType') alaIgmpZeroBasedQuery = MibScalar((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpZeroBasedQuery.setStatus('current') if mibBuilder.loadTexts: alaIgmpZeroBasedQuery.setDescription('Administratively enable the use of an all-zero source IPv4 address for query packets when a non-querier is querying the membership of a port') alaIgmpVlan = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2)) alaIgmpVlanTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1), ) if mibBuilder.loadTexts: alaIgmpVlanTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanTable.setDescription('The VLAN table contains the information on which IPv4 multicast switching and routing is configured.') alaIgmpVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanIndex")) if mibBuilder.loadTexts: alaIgmpVlanEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanEntry.setDescription('An entry corresponds to a VLAN on which IPv4 multicast switching and routing is configured.') alaIgmpVlanIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpVlanIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanIndex.setDescription('The VLAN on which IPv4 multicast switching and routing is configured.') alaIgmpVlanStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanStatus.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanStatus.setDescription('Administratively enable IPv4 multicast switching and routing on the VLAN.') alaIgmpVlanQuerying = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanQuerying.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanQuerying.setDescription('Administratively enable IGMP Querying on the VLAN.') alaIgmpVlanSpoofing = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanSpoofing.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanSpoofing.setDescription('Administratively enable IGMP Spoofing on the VLAN.') alaIgmpVlanZapping = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanZapping.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanZapping.setDescription('Administratively enable IGMP Zapping on the VLAN.') alaIgmpVlanVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 6), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanVersion.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanVersion.setDescription('Set the default IGMP protocol Version running on the VLAN.') alaIgmpVlanRobustness = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 7), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanRobustness.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanRobustness.setDescription('Set the IGMP Robustness variable used on the VLAN.') alaIgmpVlanQueryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 8), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanQueryInterval.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanQueryInterval.setDescription('Set the IGMP Query Interval used on the VLAN.') alaIgmpVlanQueryResponseInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 9), Unsigned32()).setUnits('tenths of seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanQueryResponseInterval.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanQueryResponseInterval.setDescription('Set the IGMP Query Response Interval on the VLAN.') alaIgmpVlanLastMemberQueryInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 10), Unsigned32()).setUnits('tenths of seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanLastMemberQueryInterval.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanLastMemberQueryInterval.setDescription('Set the IGMP Last Member Query Interval on the VLAN.') alaIgmpVlanRouterTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 11), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanRouterTimeout.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanRouterTimeout.setDescription('Set the IGMP Router Timeout on the VLAN.') alaIgmpVlanSourceTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 12), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanSourceTimeout.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanSourceTimeout.setDescription('Set the IGMP Source Timeout on the VLAN.') alaIgmpVlanProxying = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanProxying.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanProxying.setDescription('Administratively enable IGMP Proxying on the VLAN.') alaIgmpVlanUnsolicitedReportInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 14), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanUnsolicitedReportInterval.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanUnsolicitedReportInterval.setDescription('Set the IGMP Unsolicited Report Interval on the VLAN.') alaIgmpVlanQuerierForwarding = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanQuerierForwarding.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanQuerierForwarding.setDescription('Administratively enable IGMP Querier Forwarding on the VLAN.') alaIgmpVlanMaxGroupLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 16), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanMaxGroupLimit.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanMaxGroupLimit.setDescription('The maximum number of IGMP Group memberships that can be learnt on the VLAN.') alaIgmpVlanMaxGroupExceedAction = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 17), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("drop", 1), ("replace", 2))).clone('none')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanMaxGroupExceedAction.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanMaxGroupExceedAction.setDescription('The action to be taken when the IGMP group membership limit is exceeded on the VLAN.') alaIgmpVlanZeroBasedQuery = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 2, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpVlanZeroBasedQuery.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanZeroBasedQuery.setDescription('Administratively enable the use of an all-zero source IPv4 address for query packets when a non-querier is querying the membership of a port on the VLAN') alaIgmpMember = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3)) alaIgmpMemberTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3, 1), ) if mibBuilder.loadTexts: alaIgmpMemberTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberTable.setDescription('The table listing the IGMP group membership information.') alaIgmpMemberEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpMemberVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpMemberIfIndex"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpMemberGroupAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpMemberSourceAddress")) if mibBuilder.loadTexts: alaIgmpMemberEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberEntry.setDescription('An entry corresponding to an IGMP group membership request.') alaIgmpMemberVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpMemberVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberVlan.setDescription("The group membership request's VLAN.") alaIgmpMemberIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3, 1, 1, 2), InterfaceIndex()) if mibBuilder.loadTexts: alaIgmpMemberIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberIfIndex.setDescription("The group membership request's ifIndex.") alaIgmpMemberGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3, 1, 1, 3), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpMemberGroupAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberGroupAddress.setDescription("The group membership request's IPv4 group address.") alaIgmpMemberSourceAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3, 1, 1, 4), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpMemberSourceAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberSourceAddress.setDescription("The group membership request's IPv4 source address.") alaIgmpMemberMode = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("include", 1), ("exclude", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpMemberMode.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberMode.setDescription("The group membership request's IGMP source filter mode.") alaIgmpMemberCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpMemberCount.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberCount.setDescription("The group membership request's counter.") alaIgmpMemberTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 3, 1, 1, 7), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpMemberTimeout.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberTimeout.setDescription("The group membership request's timeout.") alaIgmpStaticMember = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 4)) alaIgmpStaticMemberTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 4, 1), ) if mibBuilder.loadTexts: alaIgmpStaticMemberTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticMemberTable.setDescription('The table listing the static IGMP group membership information.') alaIgmpStaticMemberEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 4, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticMemberVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticMemberIfIndex"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticMemberGroupAddress")) if mibBuilder.loadTexts: alaIgmpStaticMemberEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticMemberEntry.setDescription('An entry corresponding to a static IGMP group membership request.') alaIgmpStaticMemberVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 4, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpStaticMemberVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticMemberVlan.setDescription("The static group membership request's VLAN.") alaIgmpStaticMemberIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 4, 1, 1, 2), InterfaceIndex()) if mibBuilder.loadTexts: alaIgmpStaticMemberIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticMemberIfIndex.setDescription("The static group membership request's ifIndex.") alaIgmpStaticMemberGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 4, 1, 1, 3), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpStaticMemberGroupAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticMemberGroupAddress.setDescription("The static group membership request's IPv4 group address.") alaIgmpStaticMemberRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 4, 1, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIgmpStaticMemberRowStatus.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticMemberRowStatus.setDescription('Used in accordance with installation and removal conventions for conceptual rows.') alaIgmpNeighbor = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 5)) alaIgmpNeighborTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 5, 1), ) if mibBuilder.loadTexts: alaIgmpNeighborTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpNeighborTable.setDescription('The table listing the neighboring IP multicast routers.') alaIgmpNeighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 5, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpNeighborVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpNeighborIfIndex"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpNeighborHostAddress")) if mibBuilder.loadTexts: alaIgmpNeighborEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpNeighborEntry.setDescription('An entry corresponding to an IP multicast router.') alaIgmpNeighborVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 5, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpNeighborVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpNeighborVlan.setDescription("The IP multicast router's VLAN.") alaIgmpNeighborIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 5, 1, 1, 2), InterfaceIndex()) if mibBuilder.loadTexts: alaIgmpNeighborIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpNeighborIfIndex.setDescription("The IP multicast router's ifIndex.") alaIgmpNeighborHostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 5, 1, 1, 3), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpNeighborHostAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpNeighborHostAddress.setDescription("The IP multicast router's IPv4 host address.") alaIgmpNeighborCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 5, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpNeighborCount.setStatus('current') if mibBuilder.loadTexts: alaIgmpNeighborCount.setDescription("The IP multicast router's counter.") alaIgmpNeighborTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 5, 1, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpNeighborTimeout.setStatus('current') if mibBuilder.loadTexts: alaIgmpNeighborTimeout.setDescription("The IP multicast router's timeout.") alaIgmpStaticNeighbor = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 6)) alaIgmpStaticNeighborTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 6, 1), ) if mibBuilder.loadTexts: alaIgmpStaticNeighborTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticNeighborTable.setDescription('The table listing the static IP multicast routers.') alaIgmpStaticNeighborEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 6, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticNeighborVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticNeighborIfIndex")) if mibBuilder.loadTexts: alaIgmpStaticNeighborEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticNeighborEntry.setDescription('An entry corresponding to a static IP multicast router.') alaIgmpStaticNeighborVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 6, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpStaticNeighborVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticNeighborVlan.setDescription("The static IP multicast router's VLAN.") alaIgmpStaticNeighborIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 6, 1, 1, 2), InterfaceIndex()) if mibBuilder.loadTexts: alaIgmpStaticNeighborIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticNeighborIfIndex.setDescription("The static IP multicast router's ifIndex.") alaIgmpStaticNeighborRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 6, 1, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIgmpStaticNeighborRowStatus.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticNeighborRowStatus.setDescription('Used in accordance with installation and removal conventions for conceptual rows.') alaIgmpQuerier = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 7)) alaIgmpQuerierTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 7, 1), ) if mibBuilder.loadTexts: alaIgmpQuerierTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerierTable.setDescription('The table listing the neighboring IGMP queriers.') alaIgmpQuerierEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 7, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpQuerierVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpQuerierIfIndex"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpQuerierHostAddress")) if mibBuilder.loadTexts: alaIgmpQuerierEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerierEntry.setDescription('An entry corresponding to an IGMP querier.') alaIgmpQuerierVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 7, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpQuerierVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerierVlan.setDescription("The IGMP querier's VLAN.") alaIgmpQuerierIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 7, 1, 1, 2), InterfaceIndex()) if mibBuilder.loadTexts: alaIgmpQuerierIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerierIfIndex.setDescription("The IGMP querier's ifIndex.") alaIgmpQuerierHostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 7, 1, 1, 3), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpQuerierHostAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerierHostAddress.setDescription("The IGMP querier's IPv4 host address.") alaIgmpQuerierCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 7, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpQuerierCount.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerierCount.setDescription("The IGMP querier's counter.") alaIgmpQuerierTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 7, 1, 1, 5), TimeTicks()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpQuerierTimeout.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerierTimeout.setDescription("The IGMP querier's timeout.") alaIgmpStaticQuerier = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 8)) alaIgmpStaticQuerierTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 8, 1), ) if mibBuilder.loadTexts: alaIgmpStaticQuerierTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticQuerierTable.setDescription('The table listing the static IGMP queriers.') alaIgmpStaticQuerierEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 8, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticQuerierVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticQuerierIfIndex")) if mibBuilder.loadTexts: alaIgmpStaticQuerierEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticQuerierEntry.setDescription('An entry corresponding to a static IGMP querier.') alaIgmpStaticQuerierVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 8, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpStaticQuerierVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticQuerierVlan.setDescription("The static IGMP querier's VLAN.") alaIgmpStaticQuerierIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 8, 1, 1, 2), InterfaceIndex()) if mibBuilder.loadTexts: alaIgmpStaticQuerierIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticQuerierIfIndex.setDescription("The static IGMP querier's ifIndex.") alaIgmpStaticQuerierRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 8, 1, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: alaIgmpStaticQuerierRowStatus.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticQuerierRowStatus.setDescription('Used in accordance with installation and removal conventions for conceptual rows.') alaIgmpSource = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9)) alaIgmpSourceTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9, 1), ) if mibBuilder.loadTexts: alaIgmpSourceTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceTable.setDescription('The table listing the IP multicast source information.') alaIgmpSourceEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpSourceVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpSourceGroupAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpSourceHostAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpSourceDestAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpSourceOrigAddress")) if mibBuilder.loadTexts: alaIgmpSourceEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceEntry.setDescription('An entry corresponding to an IP multicast source flow.') alaIgmpSourceVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpSourceVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceVlan.setDescription("The IP multicast source flow's VLAN.") alaIgmpSourceIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9, 1, 1, 2), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpSourceIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceIfIndex.setDescription("The IP multicast source flow's ifIndex.") alaIgmpSourceGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9, 1, 1, 3), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpSourceGroupAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceGroupAddress.setDescription("The IP multicast source flow's IPv4 group address.") alaIgmpSourceHostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9, 1, 1, 4), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpSourceHostAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceHostAddress.setDescription("The IP multicast source flow's IPv4 host address.") alaIgmpSourceDestAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9, 1, 1, 5), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpSourceDestAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceDestAddress.setDescription("The IP multicast source flow's IPv4 tunnel destination address.") alaIgmpSourceOrigAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9, 1, 1, 6), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpSourceOrigAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceOrigAddress.setDescription("The IP multicast source flow's IPv4 tunnel source address.") alaIgmpSourceType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 9, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("mcast", 1), ("pim", 2), ("ipip", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpSourceType.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceType.setDescription("The IP multicast source flow's encapsulation type.") alaIgmpForward = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10)) alaIgmpForwardTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1), ) if mibBuilder.loadTexts: alaIgmpForwardTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardTable.setDescription('The table listing the IP multicast forward information.') alaIgmpForwardEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardGroupAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardHostAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardDestAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardOrigAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardNextVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardNextIfIndex")) if mibBuilder.loadTexts: alaIgmpForwardEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardEntry.setDescription('An entry corresponding to an IP multicast forwarded flow.') alaIgmpForwardVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpForwardVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardVlan.setDescription("The IP multicast forwarded flow's VLAN.") alaIgmpForwardIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 2), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpForwardIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardIfIndex.setDescription("The IP multicast forwarded flow's ifIndex.") alaIgmpForwardGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 3), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpForwardGroupAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardGroupAddress.setDescription("The IP multicast forwarded flow's IPv4 group address.") alaIgmpForwardHostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 4), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpForwardHostAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardHostAddress.setDescription("The IP multicast forwarded flow's IPv4 host address.") alaIgmpForwardDestAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 5), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpForwardDestAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardDestAddress.setDescription("The IP multicast forwarded flow's IPv4 tunnel destination address.") alaIgmpForwardOrigAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 6), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpForwardOrigAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardOrigAddress.setDescription("The IP multicast forwarded flow's IPv4 tunnel source address.") alaIgmpForwardType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("mcast", 1), ("pim", 2), ("ipip", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpForwardType.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardType.setDescription("The IP multicast forwarded flow's encapsulation type.") alaIgmpForwardNextVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 8), Unsigned32()) if mibBuilder.loadTexts: alaIgmpForwardNextVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardNextVlan.setDescription("The IP multicast forwarded flow's next VLAN.") alaIgmpForwardNextIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 9), InterfaceIndex()) if mibBuilder.loadTexts: alaIgmpForwardNextIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardNextIfIndex.setDescription("The IP multicast forwarded flow's next ifIndex.") alaIgmpForwardNextType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 10, 1, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("mcast", 1), ("pim", 2), ("ipip", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpForwardNextType.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardNextType.setDescription("The IP multicast forwarded flow's next encapsulation type.") alaIgmpTunnel = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11)) alaIgmpTunnelTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1), ) if mibBuilder.loadTexts: alaIgmpTunnelTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelTable.setDescription('The table listing the IP multicast tunnel information.') alaIgmpTunnelEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelVlan"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelGroupAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelHostAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelDestAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelOrigAddress"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelNextDestAddress")) if mibBuilder.loadTexts: alaIgmpTunnelEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelEntry.setDescription('An entry corresponding to an IP multicast tunneled flow.') alaIgmpTunnelVlan = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpTunnelVlan.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelVlan.setDescription("The IP multicast tunneled flow's VLAN.") alaIgmpTunnelIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1, 2), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpTunnelIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelIfIndex.setDescription("The IP multicast tunneled flow's ifIndex.") alaIgmpTunnelGroupAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1, 3), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpTunnelGroupAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelGroupAddress.setDescription("The IP multicast tunneled flow's IPv4 group address.") alaIgmpTunnelHostAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1, 4), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpTunnelHostAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelHostAddress.setDescription("The IP multicast tunneled flow's IPv4 host address.") alaIgmpTunnelDestAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1, 5), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpTunnelDestAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelDestAddress.setDescription("The IP multicast tunneled flow's IPv4 tunnel destination address.") alaIgmpTunnelOrigAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1, 6), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpTunnelOrigAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelOrigAddress.setDescription("The IP multicast tunneled flow's IPv4 tunnel source address.") alaIgmpTunnelType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("mcast", 1), ("pim", 2), ("ipip", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpTunnelType.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelType.setDescription("The IP multicast tunneled flow's encapsulation type.") alaIgmpTunnelNextDestAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1, 8), InetAddressIPv4()) if mibBuilder.loadTexts: alaIgmpTunnelNextDestAddress.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelNextDestAddress.setDescription("The IP multicast tunneled flow's next IPv4 tunnel destination address.") alaIgmpTunnelNextType = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 11, 1, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("mcast", 1), ("pim", 2), ("ipip", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpTunnelNextType.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelNextType.setDescription("The IP multicast tunneled flow's next encapsulation type.") alaIgmpPort = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 12)) alaIgmpPortTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 12, 1), ) if mibBuilder.loadTexts: alaIgmpPortTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortTable.setDescription('The table listing the IP multicast port information.') alaIgmpPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 12, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpPortIfIndex")) if mibBuilder.loadTexts: alaIgmpPortEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortEntry.setDescription('An entry corresponding to IP multicast port information.') alaIgmpPortIfIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 12, 1, 1, 1), InterfaceIndex()) if mibBuilder.loadTexts: alaIgmpPortIfIndex.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortIfIndex.setDescription("The IP multicast port's ifIndex.") alaIgmpPortMaxGroupLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 12, 1, 1, 2), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpPortMaxGroupLimit.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortMaxGroupLimit.setDescription('The maximum number of IGMP Group memberships that can be learnt on the port.') alaIgmpPortMaxGroupExceedAction = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 12, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("drop", 1), ("replace", 2))).clone('none')).setMaxAccess("readwrite") if mibBuilder.loadTexts: alaIgmpPortMaxGroupExceedAction.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortMaxGroupExceedAction.setDescription('The action to be taken when IGMP group membership limit is exceeded for the port.') alaIgmpPortVlan = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 13)) alaIgmpPortVlanTable = MibTable((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 13, 1), ) if mibBuilder.loadTexts: alaIgmpPortVlanTable.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortVlanTable.setDescription('The table listing the IGMP group membership limit information for a port/vlan instance.') alaIgmpPortVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 13, 1, 1), ).setIndexNames((0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpPortIfIndex"), (0, "ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanId")) if mibBuilder.loadTexts: alaIgmpPortVlanEntry.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortVlanEntry.setDescription('An entry corresponding to IGMP group membership limit on a port/vlan.') alaIgmpVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 13, 1, 1, 1), Unsigned32()) if mibBuilder.loadTexts: alaIgmpVlanId.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanId.setDescription('The IP multicast group membership VLAN.') alaIgmpPortVlanCurrentGroupCount = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 13, 1, 1, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpPortVlanCurrentGroupCount.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortVlanCurrentGroupCount.setDescription('The current IP multicast group memberships on a port/vlan instance.') alaIgmpPortVlanMaxGroupLimit = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 13, 1, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpPortVlanMaxGroupLimit.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortVlanMaxGroupLimit.setDescription('Maximum IGMP Group memberships on the port/vlan instance.') alaIgmpPortVlanMaxGroupExceedAction = MibTableColumn((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 1, 13, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2))).clone(namedValues=NamedValues(("none", 0), ("drop", 1), ("replace", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: alaIgmpPortVlanMaxGroupExceedAction.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortVlanMaxGroupExceedAction.setDescription('The action to be taken when IGMP group membership limit is exceeded for the port/vlan instance.') alcatelIND1IgmpMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2)) alcatelIND1IgmpMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 1)) alaIgmpCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 1, 1)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpMemberGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticMemberGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpNeighborGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticNeighborGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpQuerierGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticQuerierGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpSourceGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpPortGroup"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpPortVlanGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpCompliance = alaIgmpCompliance.setStatus('current') if mibBuilder.loadTexts: alaIgmpCompliance.setDescription('The compliance statement for systems running IPv4 multicast switch and routing and implementing ALCATEL-IND1-IGMP-MIB.') alcatelIND1IgmpMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2)) alaIgmpGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 1)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpStatus"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpQuerying"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpSpoofing"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpZapping"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVersion"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpRobustness"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpQueryInterval"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpQueryResponseInterval"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpLastMemberQueryInterval"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpRouterTimeout"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpSourceTimeout"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpProxying"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpUnsolicitedReportInterval"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpQuerierForwarding"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpMaxGroupLimit"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpMaxGroupExceedAction"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpFloodUnknown"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpHelperAddressType"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpHelperAddress"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpZeroBasedQuery")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpGroup = alaIgmpGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpGroup.setDescription('A collection of objects to support management of IPv4 multicast switching and routing system configuration.') alaIgmpVlanGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 2)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanStatus"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanQuerying"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanSpoofing"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanZapping"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanVersion"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanRobustness"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanQueryInterval"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanQueryResponseInterval"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanLastMemberQueryInterval"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanRouterTimeout"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanSourceTimeout"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanProxying"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanUnsolicitedReportInterval"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanQuerierForwarding"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanMaxGroupLimit"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanMaxGroupExceedAction"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpVlanZeroBasedQuery")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpVlanGroup = alaIgmpVlanGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpVlanGroup.setDescription('A collection of objects to support management of IPv4 multicast switching and routing vlan configuration.') alaIgmpMemberGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 3)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpMemberMode"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpMemberCount"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpMemberTimeout")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpMemberGroup = alaIgmpMemberGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpMemberGroup.setDescription('A collection of objects to support IPv4 multicast switching and routing group membership information.') alaIgmpStaticMemberGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 4)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticMemberRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpStaticMemberGroup = alaIgmpStaticMemberGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticMemberGroup.setDescription('A collection of objects to support IPv4 multicast switching and routing static group membership information tables.') alaIgmpNeighborGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 5)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpNeighborCount"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpNeighborTimeout")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpNeighborGroup = alaIgmpNeighborGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpNeighborGroup.setDescription('A collection of objects to support IPv4 multicast switching and routing IP multicast router information.') alaIgmpStaticNeighborGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 6)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticNeighborRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpStaticNeighborGroup = alaIgmpStaticNeighborGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticNeighborGroup.setDescription('A collection of objects to support IPv4 multicast switching and routing static IP multicast router information.') alaIgmpQuerierGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 7)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpQuerierCount"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpQuerierTimeout")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpQuerierGroup = alaIgmpQuerierGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpQuerierGroup.setDescription('A collection of objects to support IPv4 multicast switching and routing IGMP querier information.') alaIgmpStaticQuerierGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 8)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpStaticQuerierRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpStaticQuerierGroup = alaIgmpStaticQuerierGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpStaticQuerierGroup.setDescription('A collection of objects to support IPv4 multicast switching and routing static IGMP querier information.') alaIgmpSourceGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 9)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpSourceIfIndex"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpSourceType")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpSourceGroup = alaIgmpSourceGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpSourceGroup.setDescription('A collection of objects to support IPv4 multicast switching and routing IP multicast source information.') alaIgmpForwardGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 10)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardIfIndex"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardType"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpForwardNextType")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpForwardGroup = alaIgmpForwardGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpForwardGroup.setDescription('A collection of objects to support IPv4 multicast switching and routing IP multicast forward information.') alaIgmpTunnelGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 11)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelIfIndex"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelType"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpTunnelNextType")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpTunnelGroup = alaIgmpTunnelGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpTunnelGroup.setDescription('A collection of objects to support IPv4 multicast switching and routing IP multicast tunnel information.') alaIgmpPortGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 12)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpPortMaxGroupLimit"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpPortMaxGroupExceedAction")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpPortGroup = alaIgmpPortGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortGroup.setDescription('A collection of objects to support IPv4 multicast switching configuration.') alaIgmpPortVlanGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 6486, 801, 1, 2, 1, 34, 1, 2, 2, 13)).setObjects(("ALCATEL-IND1-IGMP-MIB", "alaIgmpPortVlanCurrentGroupCount"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpPortVlanMaxGroupLimit"), ("ALCATEL-IND1-IGMP-MIB", "alaIgmpPortVlanMaxGroupExceedAction")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alaIgmpPortVlanGroup = alaIgmpPortVlanGroup.setStatus('current') if mibBuilder.loadTexts: alaIgmpPortVlanGroup.setDescription('An object to support IPv4 multicast switching group limit information for a port/vlan instance.') mibBuilder.exportSymbols("ALCATEL-IND1-IGMP-MIB", alaIgmpMember=alaIgmpMember, alaIgmpPortVlanMaxGroupLimit=alaIgmpPortVlanMaxGroupLimit, alaIgmpPortTable=alaIgmpPortTable, alaIgmpForward=alaIgmpForward, alaIgmpGroup=alaIgmpGroup, alaIgmpSourceOrigAddress=alaIgmpSourceOrigAddress, alaIgmpSourceIfIndex=alaIgmpSourceIfIndex, alaIgmpQuerierVlan=alaIgmpQuerierVlan, alaIgmpHelperAddressType=alaIgmpHelperAddressType, alaIgmpZeroBasedQuery=alaIgmpZeroBasedQuery, alaIgmpSourceTable=alaIgmpSourceTable, alaIgmpPortVlanCurrentGroupCount=alaIgmpPortVlanCurrentGroupCount, alaIgmp=alaIgmp, alaIgmpStaticMember=alaIgmpStaticMember, alaIgmpMemberGroupAddress=alaIgmpMemberGroupAddress, alaIgmpStaticMemberIfIndex=alaIgmpStaticMemberIfIndex, alaIgmpTunnelIfIndex=alaIgmpTunnelIfIndex, alaIgmpNeighborCount=alaIgmpNeighborCount, alaIgmpMemberMode=alaIgmpMemberMode, alaIgmpSourceHostAddress=alaIgmpSourceHostAddress, alaIgmpSourceGroup=alaIgmpSourceGroup, alaIgmpPortVlanEntry=alaIgmpPortVlanEntry, alaIgmpMemberVlan=alaIgmpMemberVlan, alaIgmpForwardNextType=alaIgmpForwardNextType, alaIgmpSourceEntry=alaIgmpSourceEntry, alaIgmpHelperAddress=alaIgmpHelperAddress, alaIgmpStaticMemberVlan=alaIgmpStaticMemberVlan, alcatelIND1IgmpMIBObjects=alcatelIND1IgmpMIBObjects, alaIgmpVlanLastMemberQueryInterval=alaIgmpVlanLastMemberQueryInterval, alaIgmpFloodUnknown=alaIgmpFloodUnknown, alcatelIND1IgmpMIBConformance=alcatelIND1IgmpMIBConformance, alaIgmpVlanVersion=alaIgmpVlanVersion, alaIgmpPortEntry=alaIgmpPortEntry, alaIgmpVlanZeroBasedQuery=alaIgmpVlanZeroBasedQuery, alaIgmpPortGroup=alaIgmpPortGroup, alaIgmpVlanMaxGroupExceedAction=alaIgmpVlanMaxGroupExceedAction, alaIgmpVlanZapping=alaIgmpVlanZapping, alaIgmpForwardDestAddress=alaIgmpForwardDestAddress, alaIgmpSource=alaIgmpSource, alaIgmpNeighborVlan=alaIgmpNeighborVlan, alaIgmpForwardGroupAddress=alaIgmpForwardGroupAddress, alaIgmpStaticQuerierEntry=alaIgmpStaticQuerierEntry, alaIgmpForwardHostAddress=alaIgmpForwardHostAddress, alaIgmpVersion=alaIgmpVersion, alaIgmpVlanStatus=alaIgmpVlanStatus, alaIgmpPort=alaIgmpPort, alaIgmpStaticQuerierGroup=alaIgmpStaticQuerierGroup, alaIgmpNeighborHostAddress=alaIgmpNeighborHostAddress, alaIgmpVlanGroup=alaIgmpVlanGroup, alaIgmpVlanUnsolicitedReportInterval=alaIgmpVlanUnsolicitedReportInterval, alaIgmpTunnelDestAddress=alaIgmpTunnelDestAddress, alaIgmpQueryInterval=alaIgmpQueryInterval, alaIgmpMaxGroupExceedAction=alaIgmpMaxGroupExceedAction, alaIgmpNeighborTimeout=alaIgmpNeighborTimeout, alaIgmpSourceDestAddress=alaIgmpSourceDestAddress, alaIgmpQuerierIfIndex=alaIgmpQuerierIfIndex, alaIgmpZapping=alaIgmpZapping, alaIgmpMemberTable=alaIgmpMemberTable, alaIgmpTunnelVlan=alaIgmpTunnelVlan, alaIgmpTunnelTable=alaIgmpTunnelTable, alaIgmpStaticNeighborGroup=alaIgmpStaticNeighborGroup, alaIgmpPortMaxGroupLimit=alaIgmpPortMaxGroupLimit, alaIgmpPortVlan=alaIgmpPortVlan, alaIgmpQuerierCount=alaIgmpQuerierCount, alaIgmpNeighborEntry=alaIgmpNeighborEntry, alaIgmpSourceTimeout=alaIgmpSourceTimeout, alcatelIND1IgmpMIBGroups=alcatelIND1IgmpMIBGroups, alaIgmpMemberIfIndex=alaIgmpMemberIfIndex, alaIgmpTunnelGroupAddress=alaIgmpTunnelGroupAddress, alaIgmpMemberEntry=alaIgmpMemberEntry, alaIgmpVlanIndex=alaIgmpVlanIndex, alaIgmpStaticMemberRowStatus=alaIgmpStaticMemberRowStatus, alaIgmpPortMaxGroupExceedAction=alaIgmpPortMaxGroupExceedAction, alaIgmpStaticNeighborVlan=alaIgmpStaticNeighborVlan, alaIgmpStaticQuerierRowStatus=alaIgmpStaticQuerierRowStatus, alaIgmpForwardNextIfIndex=alaIgmpForwardNextIfIndex, alaIgmpStaticNeighbor=alaIgmpStaticNeighbor, alaIgmpTunnelEntry=alaIgmpTunnelEntry, alaIgmpForwardIfIndex=alaIgmpForwardIfIndex, alaIgmpMaxGroupLimit=alaIgmpMaxGroupLimit, alaIgmpVlanId=alaIgmpVlanId, alaIgmpMemberGroup=alaIgmpMemberGroup, alaIgmpQuerierTimeout=alaIgmpQuerierTimeout, alaIgmpVlanRobustness=alaIgmpVlanRobustness, alaIgmpVlan=alaIgmpVlan, alaIgmpTunnelType=alaIgmpTunnelType, alaIgmpForwardEntry=alaIgmpForwardEntry, alaIgmpVlanSpoofing=alaIgmpVlanSpoofing, alaIgmpQuerierHostAddress=alaIgmpQuerierHostAddress, alaIgmpRouterTimeout=alaIgmpRouterTimeout, alaIgmpStaticMemberGroupAddress=alaIgmpStaticMemberGroupAddress, alaIgmpStaticQuerierVlan=alaIgmpStaticQuerierVlan, alaIgmpLastMemberQueryInterval=alaIgmpLastMemberQueryInterval, alaIgmpMemberSourceAddress=alaIgmpMemberSourceAddress, alaIgmpQuerierTable=alaIgmpQuerierTable, alaIgmpStaticMemberTable=alaIgmpStaticMemberTable, alaIgmpQuerierForwarding=alaIgmpQuerierForwarding, alaIgmpStaticNeighborEntry=alaIgmpStaticNeighborEntry, alaIgmpCompliance=alaIgmpCompliance, alaIgmpVlanQueryInterval=alaIgmpVlanQueryInterval, alaIgmpQuerying=alaIgmpQuerying, alaIgmpNeighbor=alaIgmpNeighbor, alaIgmpVlanProxying=alaIgmpVlanProxying, alaIgmpSourceVlan=alaIgmpSourceVlan, alaIgmpUnsolicitedReportInterval=alaIgmpUnsolicitedReportInterval, alaIgmpTunnel=alaIgmpTunnel, alaIgmpVlanSourceTimeout=alaIgmpVlanSourceTimeout, alaIgmpForwardNextVlan=alaIgmpForwardNextVlan, alaIgmpQuerier=alaIgmpQuerier, alaIgmpProxying=alaIgmpProxying, alaIgmpVlanQuerierForwarding=alaIgmpVlanQuerierForwarding, alaIgmpSpoofing=alaIgmpSpoofing, alaIgmpStaticQuerierTable=alaIgmpStaticQuerierTable, alcatelIND1IgmpMIB=alcatelIND1IgmpMIB, alaIgmpStaticNeighborRowStatus=alaIgmpStaticNeighborRowStatus, alaIgmpStatus=alaIgmpStatus, alaIgmpForwardType=alaIgmpForwardType, alaIgmpVlanTable=alaIgmpVlanTable, alaIgmpQueryResponseInterval=alaIgmpQueryResponseInterval, alaIgmpStaticNeighborIfIndex=alaIgmpStaticNeighborIfIndex, alaIgmpForwardGroup=alaIgmpForwardGroup, alaIgmpTunnelHostAddress=alaIgmpTunnelHostAddress, alaIgmpPortVlanTable=alaIgmpPortVlanTable, alaIgmpStaticMemberGroup=alaIgmpStaticMemberGroup, alaIgmpTunnelNextDestAddress=alaIgmpTunnelNextDestAddress, alcatelIND1IgmpMIBCompliances=alcatelIND1IgmpMIBCompliances, alaIgmpNeighborIfIndex=alaIgmpNeighborIfIndex, alaIgmpVlanQueryResponseInterval=alaIgmpVlanQueryResponseInterval, alaIgmpForwardTable=alaIgmpForwardTable, alaIgmpStaticQuerierIfIndex=alaIgmpStaticQuerierIfIndex, alaIgmpVlanMaxGroupLimit=alaIgmpVlanMaxGroupLimit, alaIgmpRobustness=alaIgmpRobustness, alaIgmpTunnelNextType=alaIgmpTunnelNextType, alaIgmpQuerierEntry=alaIgmpQuerierEntry, PYSNMP_MODULE_ID=alcatelIND1IgmpMIB, alaIgmpMemberTimeout=alaIgmpMemberTimeout, alaIgmpStaticQuerier=alaIgmpStaticQuerier, alaIgmpPortVlanMaxGroupExceedAction=alaIgmpPortVlanMaxGroupExceedAction, alaIgmpVlanQuerying=alaIgmpVlanQuerying, alaIgmpVlanRouterTimeout=alaIgmpVlanRouterTimeout, alaIgmpForwardOrigAddress=alaIgmpForwardOrigAddress, alaIgmpQuerierGroup=alaIgmpQuerierGroup, alaIgmpPortVlanGroup=alaIgmpPortVlanGroup, alaIgmpForwardVlan=alaIgmpForwardVlan, alaIgmpNeighborGroup=alaIgmpNeighborGroup, alaIgmpSourceType=alaIgmpSourceType, alaIgmpSourceGroupAddress=alaIgmpSourceGroupAddress, alaIgmpPortIfIndex=alaIgmpPortIfIndex, alaIgmpVlanEntry=alaIgmpVlanEntry, alaIgmpMemberCount=alaIgmpMemberCount, alaIgmpTunnelGroup=alaIgmpTunnelGroup, alaIgmpStaticMemberEntry=alaIgmpStaticMemberEntry, alaIgmpTunnelOrigAddress=alaIgmpTunnelOrigAddress, alaIgmpStaticNeighborTable=alaIgmpStaticNeighborTable, alaIgmpNeighborTable=alaIgmpNeighborTable)
def vector_bits2int(arr): n = arr.shape[0] # number of columns a = arr[0] << n - 1 for j in range(1, n): # "overlay" with the shifted bits of the next column a |= arr[j] << n - 1 - j return a
#! /usr/bin/env python3 def func1(): x = set([1,2,3,4]) y = set([3,4,5,6,7]) z = frozenset([4,5]) print(x) print(y) x.add(5) x.remove(3) print(x) print("x|y=", x | y) # x U y print("x.union(y)=", x.union(y)) print("x&y=", x & y) # x ~U y print("x.intersection(y)=", x.intersection(y)) print("x-y=", x - y) # x - (x ~U y) print("x.difference(y)=", x.difference(y)) print("x.symmetric_difference(y)=", x.symmetric_difference(y)) def func2(): x = frozenset([1,2,3,4]) y = frozenset([1,2]) print(x) print(y) print("x.issubset(y)=", x.issubset(y)) print("x.issuperset(y)=", x.issuperset(y)) def func3(): x = set([1,2,3]) y = set([5,6,7]) print(x) x.update(y) print(x) if __name__=="__main__": print("\nfunc1()") func1() print("\nfunc2()") func2() print("\nfunc3()") func3()
size = 21 array = [[0 for i in range(size)] for j in range(size)] for i in range(size): array[0][i] = 1 array[i][0] = 1 for i in range(1,size): for j in range(1,size): array[i][j] = array[i-1][j] + array[i][j-1] print(array[size-1][size-1])
""" File that contains configurations used by the model """ GRID_WIDTH = 10 GRID_HEIGHT = 40 SPAWN_LINE = 19
def peak(arr, low, high): n = len(arr) while low <= high: mid = low + (high - low) / 2 mid = int(mid) if (mid == 0 or arr[mid-1] <= arr[mid]) and (mid == n-1 or arr[mid+1] <= arr[mid]): return(arr[mid]) elif mid > 0 and arr[mid-1] > arr[mid]: high = mid - 1 else: low = mid + 1 arr = [1, 3, 20, 4, 1, 0] print(peak(arr, 0, len(arr) - 1))
# -*- coding: utf-8 -*- # @Author: 何睿 # @Create Date: 2018-12-23 21:18:30 # @Last Modified by: 何睿 # @Last Modified time: 2018-12-23 21:19:39 class Solution: def deleteDuplicates(self, head): if head == None or head.next == None: return head p = head while p.next: # 如果相等则删除 if p.val == p.next.val: p.next = p.next.next else: # 否则p指向下一个元素 p = p.next return head
# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. def main(client, routine_id): # [START bigquery_update_routine] # TODO(developer): Import the client library. # from google.cloud import bigquery # TODO(developer): Construct a BigQuery client object. # client = bigquery.Client() # TODO(developer): Set the fully-qualified ID for the routine. # routine_id = "my-project.my_dataset.my_routine" routine = client.get_routine(routine_id) routine.body = "x * 4" routine = client.update_routine( routine, [ "body", # Due to a limitation of the API, all fields are required, not just # those that have been updated. "arguments", "language", "type_", "return_type", ], ) # [END bigquery_update_routine] return routine
def vsota(mat1, mat2): vsota = [] for i in range(len(mat1)): nova_vrsta = [] for j in range(len(mat1[0])): nova_vrsta.append((mat1[i][j] + mat2[i][j])) vsota.append(nova_vrsta) return vsota def razlika(mat1, mat2): razlika = [] for i in range(len(mat1)): nova_vrsta = [] for j in range(len(mat1[0])): nova_vrsta.append((mat1[i][j] - mat2[i][j])) razlika.append(nova_vrsta) return razlika def mnozi_s_skalarjem(mat, skal): for i in range(len(mat)): for j in range(len(mat[0])): mat[i][j] = skal * mat[i][j] return mat def zmnozek(mat1, mat2): zmnozek = [] for i in range(len(mat1)): nova_vrsta = [] for j in range(len(mat2[0])): element = 0 for k in range(len(mat2)): element += (mat1[i][k] * mat2[k][j]) nova_vrsta.append(element) zmnozek.append(nova_vrsta) return zmnozek def potenca(mat, stopnja): potencirana_mat = mat s = 1 while s < stopnja: potencirana_mat = zmnozek(potencirana_mat, mat) s += 1 return potencirana_mat def sled(mat): sled = 0 for i in range(len(mat)): sled += mat[i][i] return sled def transponiraj(mat): transponiranka = [[0 for i in range(len(mat[0]))] for j in range(len(mat))] for j in range(len(mat)): for k in range(len(mat[0])): transponiranka[k][j] = mat[j][k] return transponiranka #vrne matriko brez a-te vrstica in b-tega stolpca def podmatrika(mat, a, b): return [vrstica[:b - 1] + vrstica[b:] for vrstica in (mat[: a - 1] + mat[a:])] def determinanta(mat): if len(mat) == 1: return mat[0][0] elif len(mat) == 2: return mat[0][0] * mat[1][1] - mat[0][1] * mat[1][0] else: #razvoj po 1. vrstici det = 0 for i in range(len(mat)): det += ((-1) ** i) * mat[0][i] * determinanta(podmatrika(mat, 1, i + 1)) return det def zamenjaj_vrstici(mat, a, b): nova_a = mat[b - 1] mat[b - 1] = mat[a - 1] mat[a - 1] = nova_a return mat def uredi_v_zgornjetrikotno(mat): nova_mat = [] for j in range(len(mat[0])): for i in range(len(mat)): if mat[i][j] != 0: nova_mat += [mat[i]] mat = [x for x in mat if x not in nova_mat] return nova_mat + mat def Gaussova_eliminacija(mat): n = min(len(mat), len(mat[0])) for j in range(n): if mat[j][j] != 0: for i in range(j + 1, len(mat)): mat[i] = razlika([mat[i]], mnozi_s_skalarjem([mat[j]], mat[i][j] / mat[j][j]))[0] return uredi_v_zgornjetrikotno(mat) def rang(mat): gauss = Gaussova_eliminacija(mat) rang = 0 nicelna = [0 for i in range(len(mat[0]))] for i in range(len(mat)): if gauss[i] != nicelna: rang += 1 return rang
class CaseInsensitiveDict(dict): """ A dictionary in which the keys are case-insensitive. It is initialized the same way as a typical dict, but the values can be accessed without regard to key case. The value associated with key "Key" can also be accessed with "key" or "KEY" or "kEy". Parameters ---------- seq: iterable or mapping, optional The key-value pairs of the dictionary. Can either be a mapping object with (key, value) pairs, or an iterable of tuples of the form (key, value). **kwargs: keyword args, optional An alternative way of initializing the dictionary with key-value pairs. Example: CaseInsensitiveDict(one=1, two="two"). """ def __init__(self, seq=None, **kwargs): super().__init__(seq or {}, **kwargs) self.lowercase_dict = {} for key in self: self._register_key(key) def __getitem__(self, key: str): return super().__getitem__(self.lowercase_dict[key.lower()]) def get(self, key: str, default=None): """ Get the value for a given case-insensitive key. Parameters ---------- key: str The key to look up (possibly with a different casing). default: Any The result to return if the key is not present. Returns ------- Any The value associated with the case-insensitive version of `key`, or None if `key` is not present. """ if self.__contains__(key): return self.__getitem__(key) else: return default def __setitem__(self, key: str, value): self._register_key(key) super().__setitem__(key, value) def __contains__(self, key: str): return self.lowercase_dict.__contains__(key.lower()) def _register_key(self, key: str): """ Register a key to the dictionary. Check to make sure it doesn't already exist in a different case. Parameters ---------- key: str The key to register. """ prev = self.lowercase_dict.get(key.lower()) if prev is not None and prev != key: raise ValueError( "Key '{}' already exists in dict with different case: '{}'".format(key, prev)) self.lowercase_dict[key.lower()] = key
# Testing configurations config = {} training_opt = {} training_opt['dataset'] = 'iNaturalist18' training_opt['log_dir'] = './logs/iNaturalist18' training_opt['num_classes'] = 8142 training_opt['batch_size'] = 64 training_opt['num_workers'] = 8 training_opt['num_epochs'] = 90 training_opt['display_step'] = 10 training_opt['feature_dim'] = 2048 training_opt['open_threshold'] = 0.1 training_opt['sampler'] = None#{'def_file': './data/ClassAwareSampler.py', 'num_samples_cls': 4, 'type': 'ClassAwareSampler'} training_opt['scheduler_params'] = {'step_size':int(training_opt['num_epochs']/3), 'gamma': 0.1} # every 10 epochs decrease lr by 0.1 config['training_opt'] = training_opt networks = {} feature_param = {'use_modulatedatt': False, 'use_fc': False, 'dropout': None, 'stage1_weights': False, 'dataset': training_opt['dataset']} feature_optim_param = {'lr': 0.05, 'momentum': 0.9, 'weight_decay': 0.0005} networks['feat_model'] = {'def_file': './models/ResNet50Feature.py', 'params': feature_param, 'optim_params': feature_optim_param, 'fix': False} classifier_param = {'in_dim': training_opt['feature_dim'], 'num_classes': training_opt['num_classes'], 'stage1_weights': False, 'dataset': training_opt['dataset']} classifier_optim_param = {'lr': 0.05, 'momentum': 0.9, 'weight_decay': 0.0005} networks['classifier'] = {'def_file': './models/DotProductClassifier.py', 'params': classifier_param, 'optim_params': classifier_optim_param} config['networks'] = networks criterions = {} perf_loss_param = {} criterions['PerformanceLoss'] = {'def_file': './loss/SoftmaxLoss.py', 'loss_params': perf_loss_param, 'optim_params': None, 'weight': 1.0} config['criterions'] = criterions memory = {} memory['centroids'] = False memory['init_centroids'] = False config['memory'] = memory
#!/usr/bin/env python3 # This file is part of the kambpf project (https://github.com/zdule/part_ii_project). # It is file is offered under two licenses GPLv2 and Apache License Version 2. # For more information see the LICENSE file at the root of the project. # # Copyright 2020 Dusan Zivanovic first_dummy = """ noinline int kambpf_test_dummy_0(int a) { return a; } """ dummy_template = """ noinline int kambpf_test_dummy_$0(int a) { return kambpf_test_dummy_$1(a+1); } """ print(first_dummy) for i in range(1,5000): print(dummy_template.replace("$0",str(i)).replace("$1",str(i-1)))
# -*- coding: utf-8 -*- # # Copyright 2019-2021 BigML # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. """Options for BigMLer PCA """ def get_pca_options(defaults=None): """Adding arguments for the pca subcommand """ if defaults is None: defaults = {} options = { # Input fields to include in the PCA. '--pca-fields': { "action": 'store', "dest": 'pca_fields', "default": defaults.get('pca_fields', None), "help": ("Comma-separated list of input fields" " (predictors) to create the PCA.")}, # If a BigML PCA is provided, the script will # use it to generate projections '--pca': { 'action': 'store', 'dest': 'pca', 'default': defaults.get('pca', None), 'help': "BigML PCA Id."}, # The path to a file containing PCA ids. '--pcas': { 'action': 'store', 'dest': 'pcas', 'default': defaults.get('pcas', None), 'help': ("Path to a file containing pca/ids." " One PCA" " per line (e.g., " "pca/50a206a8035d0706dc000376" ").")}, # If a BigML json file containing a PCA # structure is provided, # the script will use it. '--pca-file': { 'action': 'store', 'dest': 'pca_file', 'default': defaults.get('pca_file', None), 'help': "BigML PCA JSON structure file."}, # Does not create a PCA just a dataset. '--no-pca': { 'action': 'store_true', 'dest': 'no_pca', 'default': defaults.get('no_pca', False), 'help': "Do not create a PCA."}, # The path to a file containing PCA attributes. '--pca-attributes': { 'action': 'store', 'dest': 'pca_attributes', 'default': defaults.get('pca_attributes', None), 'help': ("Path to a json file describing PCA" " attributes.")}, # The maximum number of components used to project '--max-components': { 'action': 'store', 'dest': 'max_components', 'type':int, 'default': defaults.get('max_components', None), 'help': ("Maximum number of components used as projections.")}, # The variance used as threshold in to generate the projection '--variance-threshold': { 'action': 'store', 'dest': 'variance_threshold', 'type': float, 'default': defaults.get('variance_threshold', None), 'help': ("Variance used as threshold to generate projections.")}, # Excludes the objective field of the dataset from the PCA input fields. '--exclude-objective': { 'action': 'store_true', 'dest': 'exclude_objective', 'default': defaults.get('exclude_objective', False), 'help': "Excludes the objective field from the PCA inputs."}, # The path to a file containing batch projection attributes. '--batch-projection-attributes': { 'action': 'store', 'dest': 'batch_projection_attributes', 'default': defaults.get('batch_projection_attributes', None), 'help': ("Path to a json file describing batch projection" " attributes.")}, # The path to a file containing projection attributes. '--projection-attributes': { 'action': 'store', 'dest': 'projection_attributes', 'default': defaults.get('projection_attributes', None), 'help': ("Path to a json file describing projection" " attributes.")}, # Projection header. If set, headers are added to the projection file. '--projection-header': { 'action': 'store_true', 'dest': 'projection_header', 'default': defaults.get('projection_header', False), 'help': "Headers are added to the projections file."}, # Projection fields. A comma-separated list of the fields that should # be included in the projections file. '--projection-fields': { 'action': 'store', 'dest': 'projection_fields', 'default': defaults.get('projection_fields', None), 'help': "Fields added to the projections file."}, # Create a PCA, not just a dataset. '--no-no-pca': { 'action': 'store_false', 'dest': 'no_pca', 'default': defaults.get('no_pca', False), 'help': "Create a PCA."}} return options
TESTING = True POSTGRESQL_DATABASE_URI = "" URLS = 'app.urls'
""" * Assignment: Type Float Distance * Required: yes * Complexity: easy * Lines of code: 4 lines * Time: 5 min English: 1. Convert units 2. Instead `...` substitute calculated and converted values 3. Note the number of decimal places 4. Run doctests - all must succeed Polish: 1. Przekonwertuj jednostki 2. Zamiast `...` podstaw wyliczone i przekonwertowane wartości 3. Zwróć uwagę na ilość miejsc po przecinku 4. Uruchom doctesty - wszystkie muszą się powieść Tests: >>> import sys; sys.tracebacklimit = 0 >>> assert meters is not Ellipsis, \ 'Assign result to variable: `meters`' >>> assert kilometers is not Ellipsis, \ 'Assign result to variable: `kilometers`' >>> assert miles is not Ellipsis, \ 'Assign result to variable: `miles`' >>> assert nautical_miles is not Ellipsis, \ 'Assign result to variable: `nautical_miles`' >>> assert all_units is not Ellipsis, \ 'Assign result to variable: `all_units`' >>> assert type(meters) is str, \ 'Variable `volume` has invalid type, should be str' >>> assert type(kilometers) is str, \ 'Variable `volume` has invalid type, should be str' >>> assert type(miles) is str, \ 'Variable `volume` has invalid type, should be str' >>> assert type(nautical_miles) is str, \ 'Variable `volume` has invalid type, should be str' >>> assert type(all_units) is str, \ 'Variable `volume` has invalid type, should be str' >>> meters 'Meters: 1337' >>> kilometers 'Kilometers: 1' >>> miles 'Miles: 0.83' >>> nautical_miles 'Nautical Miles: 0.722' >>> all_units 'km: 1, mi: 0.8, NM: 0.72' """ m = 1 km = 1000 * m mi = 1609.344 * m NM = 1852 * m distance = 1337 * m distance_m = distance / m distance_km = distance / km distance_mi = distance / mi distance_NM = distance / NM # str: distance in meters 0 decimal places meters = f'Meters: {...}' # str: distance in kilometers with 0 decimal places kilometers = f'Kilometers: {...}' # str: distance in miles with 2 decimal places miles = f'Miles: {...}' # str: distance in nautical miles with 3 decimal places nautical_miles = f'Nautical Miles: {...}' # str: distance in km, mi, NM with 0, 1, 2 decimal places all_units = (f'km: {...}, ' f'mi: {...}, ' f'NM: {...}')
text = input() cipher = [] for char in text: new_char = chr(ord(char) + 3) cipher.append(new_char) print(''.join(cipher))
a, b, c = map(int, input().split()) if c - b <= 0: result = -1 else: result = a // (c - b) result += 1 print(result)
JAZZMIN_SETTINGS = { # title of the window (Will default to current_admin_site.site_title if absent or None) 'site_title': 'Администрирование УМНОЦ', # Title on the login screen (19 chars max) (defaults to current_admin_site.site_header if absent or None) 'site_header': 'Платформа УМНОЦ', # Title on the brand (19 chars max) (defaults to current_admin_site.site_header if absent or None) 'site_brand': 'Платформа УМНОЦ', # Logo to use for your site, must be present in static files, used for brand on top left 'site_logo': 'images/logo-grey.png', # CSS classes that are applied to the logo above 'site_logo_classes': 'img-lg img-circle elevation-0', # Relative path to a favicon for your site, will default to site_logo if absent (ideally 32x32 px) 'site_icon': 'images/favicon.ico', # Welcome text on the login screen 'welcome_sign': 'Для входа введите имя пользователя и пароль.', # Copyright on the footer 'copyright': 'ЦНОТ УрФУ', # The model admin to search from the search bar, search bar omitted if excluded 'search_model': 'auth.User', # Field name on user model that contains avatar ImageField/URLField/Charfield or a callable that receives the user 'user_avatar': None, ############ # Top Menu # ############ # Links to put along the top menu 'topmenu_links': [ # Url that gets reversed (Permissions can be added) {'name': 'Home', 'url': 'admin:index', 'permissions': ['auth.view_user']}, # external url that opens in a new window (Permissions can be added) {'name': 'Support', 'url': 'https://github.com/farridav/django-jazzmin/issues', 'new_window': True}, # model admin to link to (Permissions checked against model) {'model': 'auth.User'}, # App with dropdown menu to all its models pages (Permissions checked against models) # {'app': 'books'}, ], ############# # User Menu # ############# # Additional links to include in the user menu on the top right ('app' url type is not allowed) 'usermenu_links': [ {'name': 'Support', 'url': 'https://github.com/farridav/django-jazzmin/issues', 'new_window': True}, {'model': 'auth.user'} ], ############# # Side Menu # ############# # Whether to display the side menu 'show_sidebar': True, # Whether to aut expand the menu 'navigation_expanded': False, # Hide these apps when generating side menu e.g (auth) 'hide_apps': [], # Hide these models when generating side menu (e.g auth.user) 'hide_models': [], # List of apps (and/or models) to base side menu ordering off of (does not need to contain all apps/models) 'order_with_respect_to': ['umnoc', ], # Custom links to append to app groups, keyed on app name # 'custom_links': { # 'books': [{ # 'name': 'Make Messages', # 'url': 'make_messages', # 'icon': 'fas fa-comments', # 'permissions': ['books.view_book'] # }] # }, # Custom icons for side menu apps/models See https://fontawesome.com/icons?d=gallery&m=free&v=5.0.0,5.0.1,5.0.10,5.0.11,5.0.12,5.0.13,5.0.2,5.0.3,5.0.4,5.0.5,5.0.6,5.0.7,5.0.8,5.0.9,5.1.0,5.1.1,5.2.0,5.3.0,5.3.1,5.4.0,5.4.1,5.4.2,5.13.0,5.12.0,5.11.2,5.11.1,5.10.0,5.9.0,5.8.2,5.8.1,5.7.2,5.7.1,5.7.0,5.6.3,5.5.0,5.4.2 # for the full list of 5.13.0 free icon classes 'icons': { 'auth': 'fas fa-users-cog', 'auth.user': 'fas fa-user', 'auth.Group': 'fas fa-users', }, # Icons that are used when one is not manually specified 'default_icon_parents': 'fas fa-folder', 'default_icon_children': 'fas fa-file', ################# # Related Modal # ################# # Use modals instead of popups 'related_modal_active': False, ############# # UI Tweaks # ############# # Relative paths to custom CSS/JS scripts (must be present in static files) 'custom_css': None, 'custom_js': None, # Whether to show the UI customizer on the sidebar 'show_ui_builder': False, ############### # Change view # ############### # Render out the change view as a single form, or in tabs, current options are # - single # - horizontal_tabs (default) # - vertical_tabs # - collapsible # - carousel 'changeform_format': 'horizontal_tabs', # override change forms on a per modeladmin basis 'changeform_format_overrides': {'auth.user': 'collapsible', 'auth.group': 'vertical_tabs'}, # Add a language dropdown into the admin 'language_chooser': False, } JAZZMIN_UI_TWEAKS = { 'theme': 'superhero', 'body_small_text': True, 'navbar': 'navbar-dark', 'sidebar_nav_flat_style': True, } LOGO_IMAGE_EXTRA_TEXT = 'Уральский межрегиональный научно-образовательный центр мирового уровня' UMNOC_LOGO_URL = 'https://edu.umnoc.ru/' LOGOUT_REDIRECT_URL = UMNOC_LOGO_URL
class ListControls: def com(self, comment="", **kwargs): """Places a comment in the output. APDL Command: /COM Parameters ---------- comment Comment string, up to 75 characters. Notes ----- The output from this command consists of the comment string. This command is similar to C*** except that the comment produced by C*** is more easily identified in the output. Parameter substitution within the comment occurs for every valid expression delimited by percent (%) signs. Enclosing such an expression in single quotes prevents parameter substitution. Another way to include a comment is to precede it with a ! character (on the same line). The ! may be placed anywhere on the line, and any input following it is ignored as a comment. No output is produced by such a comment, but the comment line is included on the log file. This is a convenient way to annotate the log file. This command is valid anywhere. """ command = "/COM,%s" % (str(comment)) if self.print_com and not self.mute and not kwargs.get("mute", False): print(command) return self.run(command, **kwargs) def golist(self, **kwargs): """Reactivates the suppressed data input listing. APDL Command: /GOLIST Notes ----- Reactivates printout of the data input listing suppressed with /NOLIST. This command is valid in any processor, but only within a batch run [/BATCH]. """ command = "/GOLIST," return self.run(command, **kwargs) def gopr(self, **kwargs): """Reactivates suppressed printout. APDL Command: /GOPR Notes ----- Reactivates printout suppressed with the /NOPR command. The /GO command has the same function except that it does not produce a command response from the program. This command is valid in any processor. """ command = "/GOPR," return self.run(command, **kwargs) def nolist(self, **kwargs): """Suppresses the data input listing. APDL Command: /NOLIST Notes ----- Printout is suppressed until a /GOLIST command is read or the end of the listing is encountered. This command is valid in any processor, but only within a batch run [/BATCH]. """ command = "/NOLIST," return self.run(command, **kwargs) def nopr(self, **kwargs): """Suppresses the expanded interpreted input data listing. APDL Command: /NOPR Notes ----- Suppresses printout of interpreted input data, including information labeled as "Notes." When this printout is not suppressed, the data input to the analysis is echoed to the output file in an expanded format. Printout is suppressed until a /GOPR or /GO command is read. Use of /NOPR is not recommended when the graphical user interface (GUI) is active. The GUI sometimes issues "hidden" /NOPR and /GOPR command sequences, which will countermand user-issued /NOPR commands, thus making the use of /NOPR in the GUI environment unpredictable. This command is valid in any processor. """ command = "/NOPR," return self.run(command, **kwargs)
def checkPassword(data): return (data["password"][data["pos1"] - 1] == data["char"]) != (data["password"][data["pos2"] -1 ] == data["char"]) passwords = [] with open("./2/input.txt") as inputFile: for line in inputFile: tokens = line.split(" ") minMax = tokens[0].split("-") data = { "pos1": int(minMax[0]), "pos2": int(minMax[1]), "char": tokens[1][:-1], "password": tokens[2][:-1] } passwords.append(data) countOfValidPasswords = 0 for password in passwords: if checkPassword(password): countOfValidPasswords += 1 print("{} passwords are valid of {} total passwords".format(countOfValidPasswords, len(passwords)))
# Difficulty: Easy # Problem Statement: https://leetcode.com/problems/add-binary/ class Solution: def addBinary(self, a: str, b: str) -> str: return bin(int(a, 2) + int(b, 2))[2:]
# -*- coding: utf-8 -*- """ Top-level package for Variational GCN """ __author__ = """anonymous due to blind submission to ICML 2020""" __email__ = '' __version__ = '0.1.0'
# Het is so simpel als het toevoegen van een save commando aan het stuk # code die de chart daadwerkelijk genereert. In bovenstand voorbeeld dus: alt.vconcat(points, bars, data=data.seattle_weather.url, title="Seattle Weather: 2012-2015" ).save('Seattle.html') # De interactiviteit zit in je html file besloten!
class Logedit: """ This object handles writing text outputs into a log file and to the screen as well. Class methods: -------------- init(logname, read=None): Creates a log instance into file logname. If read specified copies it's content into log. writelog(message): Prints message to terminal and to the log file. closelog: Closes an existing log file. writeclose(message): Prints message to terminal and to log, then closes the log file. Examples: --------- >>> from logedit import Logedit >>> message1 = 'This message will be logged and displayed.' >>> message2 = 'This message too.' >>> message3 = 'This one is Not going to delete previous lines.' >>> message4 = 'This one copies previous lines and keeps previous log, but saves to new log.' >>> message5 = 'This one deletes previous lines.' >>> logname = 'out.log' >>> logname2 = 'out2.log' >>> # Create and print lines to a log >>> log = Logedit(logname) >>> log.writelog(message1) This message will be logged and displayed. >>> log.writelog(message2) This message too. >>> log.closelog() >>> # Edit log without overiding previous lines >>> log = Logedit(logname, read=logname) >>> log.writelog(message3) This one is Not going to delete previous lines. >>> log.closelog() >>> # copy a pre-existing log on a new log, and edit it. >>> log = Logedit(logname2, read=logname) >>> log.writelog(message4) This one copies previous lines and keeps previous log, but saves to new log. >>> log.closelog() >>> # overite a pre-existing log >>> log = Logedit(logname) >>> log.writelog(message5) This one deletes previous lines. >>> log.closelog() >>> # See the output files: 'out.log' and 'out2.log' to see the results. Revisions --------- 2010-07-10 patricio Writen by Patricio Cubillos. [email protected] 2010-11-24 patricio logedit converted to a class. """ def __init__(self, logname, read=None): """ Creates a new log file with name logname. If a logfile is specified in read, copies the content from that log. Parameters: ----------- logname: String The name of the file where to save the log. read: String Name of an existing logfile. If specified, its content will be written to the log. """ # Read from previous log content = [] if read != None: try: old = open(read, 'r') content = old.readlines() old.close() except: pass # Initiate log self.log = open(logname, 'w') # Append content if there is something if content != []: self.log.writelines(content) def writelog(self, message, mute=False, end='\n'): """ Prints message in the terminal and stores it in the log file. """ # print to screen: if not mute: print(message, end=end, flush=True) # print to file: print(message, file=self.log) def closelog(self): """ Closes an existing log file. """ self.log.close() def writeclose(self, message, mute=False, end='\n'): """ Print message in terminal and log, then close log. """ self.writelog(message, mute, end) self.closelog()
test = { 'name': 'q5_3', 'points': 1, 'suites': [ { 'cases': [ { 'code': '>>> # The statistic should be between 0 and 13 face cards for a sample size of 13;\n' '>>> num_face = deck_simulation_and_statistic(13, deck_model_probabilities);\n' '>>> 0 <= num_face <= 13\n' 'True', 'hidden': False, 'locked': False}], 'scored': True, 'setup': '', 'teardown': '', 'type': 'doctest'}]}
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # NOTE: This class is auto generated by the jdcloud code generator program. class DescribeUrlBlockRegulationResp(object): def __init__(self, id=None, userPin=None, regulationName=None, blockUrl=None, zoneId=None, filterId=None, firewallRuleId=None, opType=None, enableRegulation=None, createTime=None, createUser=None, updateTime=None, updateUser=None): """ :param id: (Optional) 封禁URL规则id :param userPin: (Optional) url对应的用户pin :param regulationName: (Optional) 封禁URL规则名称 :param blockUrl: (Optional) 封禁的url :param zoneId: (Optional) zone id :param filterId: (Optional) filter id :param firewallRuleId: (Optional) firewall rule id :param opType: (Optional) 操作类型(0->阻断) :param enableRegulation: (Optional) 规则开启状态(0->关闭 1->开启) :param createTime: (Optional) 规则创建时间 :param createUser: (Optional) 规则创建者 :param updateTime: (Optional) 规则更新时间 :param updateUser: (Optional) 规则更新者 """ self.id = id self.userPin = userPin self.regulationName = regulationName self.blockUrl = blockUrl self.zoneId = zoneId self.filterId = filterId self.firewallRuleId = firewallRuleId self.opType = opType self.enableRegulation = enableRegulation self.createTime = createTime self.createUser = createUser self.updateTime = updateTime self.updateUser = updateUser
pkg_dnf = { 'collectd': {}, } svc_systemd = { 'collectd': { 'needs': ['pkg_dnf:collectd'], }, } files = { '/etc/collectd.conf': { 'mode': '0600', 'content_type': 'mako', 'context': { 'collectd': node.metadata.get('collectd', {}), }, 'needs': ['pkg_dnf:collectd'], 'triggers': ['svc_systemd:collectd:restart'], }, '/etc/collectd.d/nut.conf': { 'delete': True, 'needs': ['pkg_dnf:collectd'], }, } if node.metadata.get('collectd', {}).get('client'): files['/etc/collectd.d/client.conf'] = { 'mode': '0600', 'content_type': 'mako', 'context': { 'client': node.metadata.get('collectd', {}).get('client', {}), }, 'needs': ['pkg_dnf:collectd'], 'triggers': ['svc_systemd:collectd:restart'], }
class Aggrhapolicy(basestring): """ sfo|cfo Possible values: <ul> <li> "cfo" , <li> "sfo" </ul> """ @staticmethod def get_api_name(): return "aggrhapolicy"
"""3. Extracting video features from pre-trained models ======================================================= Feature extraction is a very useful tool when you don't have large annotated dataset or don't have the computing resources to train a model from scratch for your use case. It's also useful to visualize what the model have learned. In this tutorial, we provide a simple unified solution. The only thing you need to prepare is a text file containing the information of your videos (e.g., the path to your videos), we will take care of the rest. You can extract strong video features from many popular pre-trained models in the GluonCV video model zoo using a single command line. .. note:: Feel free to skip the tutorial because the feature extraction script is self-complete and ready to launch. :download:`Download Full Python Script: feat_extract_pytorch.py<../../../scripts/action-recognition/feat_extract_pytorch.py>` Please checkout the `model_zoo <../model_zoo/index.html#action_recognition>`_ to select your preferred pretrained model. ``python feat_extract_pytorch.py --config-file CONFIG`` """ ###################################################################### # Prepare Data # ------------ # # Your data can be stored in any hierarchy. # Just use the format we adopt for training models in the previous tutorial and save the data annotation file as ``video.txt``. # :: # # /home/ubuntu/your_data/video_001.mp4 200 0 # /home/ubuntu/your_data/video_001.mp4 300 1 # /home/ubuntu/your_data/video_002.mp4 100 2 # /home/ubuntu/your_data/video_003.mp4 400 2 # /home/ubuntu/your_data/video_004.mp4 200 1 # ...... # /home/ubuntu/your_data/video_100.mp4.100 3 # # Each line has three things, the path to each video, the number of video frames and the video label. # However, the second and third things are not gonna used in the code, they are just a placeholder. # So you can put any postive number in these two places. # # Note that, at this moment, we only support extracting features from videos directly. ###################################################################### # Once you prepare the ``video.txt``, you can start extracting feature by: # # :: # # python feat_extract_pytorch.py --config-file ./scripts/action-recognition/configuration/i3d_resnet50_v1_feat.yaml ###################################################################### # The extracted features will be saved to a directory defined in the config file. Each video will have one feature file. # For example, ``video_001.mp4`` will have a feature named ``i3d_resnet50_v1_kinetics400_video_001_feat.npy``. # The feature is extracted from the center of the video by using a 32-frames clip. ###################################################################### # There are many other options and other models you can choose, # e.g., `resnet50_v1b_feat.yaml <https://raw.githubusercontent.com/dmlc/gluon-cv/master/scripts/action-recognition/configuration/resnet50_v1b_feat.yaml>`_, # `slowfast_4x16_resnet50_feat.yaml <https://raw.githubusercontent.com/dmlc/gluon-cv/master/scripts/action-recognition/configuration/slowfast_4x16_resnet50_feat.yaml>`_, # `tpn_resnet50_f32s2_feat.yaml <https://raw.githubusercontent.com/dmlc/gluon-cv/master/scripts/action-recognition/configuration/tpn_resnet50_f32s2_feat.yaml>`_, # `r2plus1d_v1_resnet50_feat.yaml <https://raw.githubusercontent.com/dmlc/gluon-cv/master/scripts/action-recognition/configuration/r2plus1d_v1_resnet50_feat.yaml>`_, # `i3d_slow_resnet50_f32s2_feat.yaml <https://raw.githubusercontent.com/dmlc/gluon-cv/master/scripts/action-recognition/configuration/i3d_slow_resnet50_f32s2_feat.yaml>`_. # Try extracting features from these SOTA video models on your own dataset and see which one performs better.
#Fibonacci Fibonacci.py # Fibonacci numbers module #n = int(input('Please enter a number: ')) def fib(n): a, b = 0, 1 while a < n: print(a, end=' ') a, b = b, a+b print() # Go to fibonacci Powerpoint def fib2(n): # return Fibonacci series result = [] a, b = 0, 1 while a < n: result.append(a) a, b = b, a+b return result #>>> fib #import
#Parameters given at the beginning of the APP zid_min = 1E06 #1Mohm zic_min = 10E06 #10Mohm GM_min = 10 #dB PM_min = 30 #deg CL_min = 0 #0uF CL_max = 1E-06 #1uF Rl = 10 #10ohm Fc_low = 0 #DC Fc_high = 100E03 #100kHz CMRR_min = 100 #dB AvCL = 10 #V/V THD = 0.01 #env. 1% 10kHz & Vout = 10Vcrete Dyn_range = 10 # V crete CM_min = -2 # V CM_max = 2 # V
# # PySNMP MIB module IPFIX-SELECTOR-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/IPFIX-SELECTOR-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 19:44:48 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") ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") ObjectIdentity, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, Bits, ModuleIdentity, Counter64, Gauge32, MibIdentifier, Integer32, IpAddress, mib_2, Counter32, iso, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "Bits", "ModuleIdentity", "Counter64", "Gauge32", "MibIdentifier", "Integer32", "IpAddress", "mib-2", "Counter32", "iso", "NotificationType") TextualConvention, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TruthValue", "DisplayString") ipfixSelectorMIB = ModuleIdentity((1, 3, 6, 1, 2, 1, 194)) ipfixSelectorMIB.setRevisions(('2012-06-11 00:00', '2010-03-15 00:00',)) if mibBuilder.loadTexts: ipfixSelectorMIB.setLastUpdated('201206110000Z') if mibBuilder.loadTexts: ipfixSelectorMIB.setOrganization('IETF IPFIX Working Group') ipfixSelectorObjects = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 1)) ipfixSelectorConformance = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 2)) ipfixSelectorFunctions = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 1, 1)) ipfixFuncSelectAll = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 1, 1, 1)) ipfixFuncSelectAllAvail = MibScalar((1, 3, 6, 1, 2, 1, 194, 1, 1, 1, 1), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipfixFuncSelectAllAvail.setStatus('current') ipfixSelectorCompliances = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 2, 1)) ipfixSelectorGroups = MibIdentifier((1, 3, 6, 1, 2, 1, 194, 2, 2)) ipfixSelectorBasicCompliance = ModuleCompliance((1, 3, 6, 1, 2, 1, 194, 2, 1, 1)).setObjects(("IPFIX-SELECTOR-MIB", "ipfixSelectorBasicGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ipfixSelectorBasicCompliance = ipfixSelectorBasicCompliance.setStatus('current') ipfixSelectorBasicGroup = ObjectGroup((1, 3, 6, 1, 2, 1, 194, 2, 2, 1)).setObjects(("IPFIX-SELECTOR-MIB", "ipfixFuncSelectAllAvail")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ipfixSelectorBasicGroup = ipfixSelectorBasicGroup.setStatus('current') mibBuilder.exportSymbols("IPFIX-SELECTOR-MIB", ipfixFuncSelectAllAvail=ipfixFuncSelectAllAvail, ipfixSelectorBasicCompliance=ipfixSelectorBasicCompliance, ipfixSelectorGroups=ipfixSelectorGroups, ipfixSelectorConformance=ipfixSelectorConformance, PYSNMP_MODULE_ID=ipfixSelectorMIB, ipfixSelectorObjects=ipfixSelectorObjects, ipfixFuncSelectAll=ipfixFuncSelectAll, ipfixSelectorCompliances=ipfixSelectorCompliances, ipfixSelectorMIB=ipfixSelectorMIB, ipfixSelectorBasicGroup=ipfixSelectorBasicGroup, ipfixSelectorFunctions=ipfixSelectorFunctions)
grid_view_field_options_schema = { 'type': 'object', 'description': 'An object containing the field id as key and the ' 'properties related to view as value.', 'properties': { '1': { 'type': 'object', 'description': 'Properties of field with id 1 of the related view.', 'properties': { 'width': { 'type': 'integer', 'example': 200, 'description': 'The width of the table field in the related view.' }, 'hidden': { 'type': 'boolean', 'example': True, 'description': 'Whether or not the field should be hidden in the ' 'current view.' } } }, } }
classmates = {'Петя': 9, 'Вася': 7, 'Ваня': 5, 'Толя': 3, 'Маша': 1, 'Саша': -1, 'Учитель': 11} names = ['Петя', 'Вася', 'Ваня', 'Толя', 'Маша', 'Саша', 'Учитель'] for name in names: print(name, ': ', classmates[name])
#!/usr/bin/env python3 # vim: set ai et ts=4 sw=4: def gen(arg, begin, pixels, arr): for i in range(0, int(2**len(arr))): if i > 0: print("else"); if i != int(2**len(arr)) - 1: print("if({} < ({} + ({}/{})*{}))".format( arg, begin, pixels, int(2**len(arr)), i+1)) print("begin") for j in range(0, len(arr)): print((" " * 4) + "{} <= {};".format( arr[j], "1" if i & (1 << j) else "0")) print("end") gen("hctr", "horiz_vis_begin", "horiz_active_pixels", ["r[0]", "r[1]", "r[2]", "g[0]"]) gen("vctr", "vert_vis_begin", "vert_active_pixels", ["g[1]", "g[2]", "b[0]", "b[1]"])
# Time: O(m * nlogn) # Space: O(n) class Solution(object): def longestCommonSubpath(self, n, paths): """ :type n: int :type paths: List[List[int]] :rtype: int """ def RabinKarp(arr, x): # double hashing hashes = tuple([reduce(lambda h,x: (h*p+x)%MOD, (arr[i] for i in xrange(x)), 0) for p in P]) powers = [pow(p, x, MOD) for p in P] lookup = {hashes} for i in xrange(x, len(arr)): hashes = tuple([(hashes[j]*P[j] - arr[i-x]*powers[j] + arr[i])%MOD for j in xrange(len(P))]) # in smaller datasets, tuple from list is much faster than tuple from generator, see https://stackoverflow.com/questions/16940293/why-is-there-no-tuple-comprehension-in-python lookup.add(hashes) return lookup def check(paths, x): intersect = RabinKarp(paths[0], x) for i in xrange(1, len(paths)): intersect = set.intersection(intersect, RabinKarp(paths[i], x)) if not intersect: return False return True MOD, P = 10**9+7, (113, 109) # MOD could be the min prime of 7-digit number (10**6+3), P could be (2, 3) left, right = 1, min(len(p) for p in paths) while left <= right: mid = left + (right-left)//2 if not check(paths, mid): right = mid-1 else: left = mid+1 return right # Time: O(m * nlogn) # Space: O(n) class Solution2(object): def longestCommonSubpath(self, n, paths): """ :type n: int :type paths: List[List[int]] :rtype: int """ def RabinKarp(arr, x): h = reduce(lambda h,x: (h*P+x)%MOD, (arr[i] for i in xrange(x)), 0) power = pow(P, x, MOD) lookup = {h} for i in xrange(x, len(arr)): h = (h*P - arr[i-x]*power + arr[i])%MOD lookup.add(h) return lookup def check(paths, x): intersect = RabinKarp(paths[0], x) for i in xrange(1, len(paths)): intersect = set.intersection(intersect, RabinKarp(paths[i], x)) if not intersect: return False return True MOD, P = 10**11+19, max(x for p in paths for x in p)+1 # MOD is the min prime of 12-digit number left, right = 1, min(len(p) for p in paths) while left <= right: mid = left + (right-left)//2 if not check(paths, mid): right = mid-1 else: left = mid+1 return right
class Song: def __init__(self, json): # playlist tracks not queryable over API if not json: raise LookupError self.name = json['name'] self.artists = list(map(lambda artist: artist['name'], json['artists'])) self.album = json['album']['name'] def __str__(self) -> str: return self.name + ' - ' + ', '.join(self.artists) + ' (' + self.album + ')'
# test with with open("test.txt") as f: f.write("hello worlds") f.read()
class Solution: """ @param numbers : An array of Integer @param target : target = numbers[index1] + numbers[index2] @return : [index1 + 1, index2 + 1] (index1 < index2) """ def twoSum(self, numbers, target): # Hash map # map = {} # for i, n in enumerate(numbers): # map[n] = i + 1 # for i, n in enumerate(numbers): # rest = target - n # if(rest in map and map[rest] > i): # return [i + 1, map[rest]] # Two pointer sorted_numbers = sorted(numbers) l = 0 r = len(numbers) - 1 while (l < r): res = sorted_numbers[l] + sorted_numbers[r] if (res == target): i = 0 l_index = None r_index = None while (i < len(numbers)): if (numbers[i] == sorted_numbers[l]): l_index = i + 1 break elif (numbers[i] == sorted_numbers[r]): r_index = i + 1 break else: i += 1 i += 1 while (i < len(numbers)): if (l_index and numbers[i] == sorted_numbers[r]): r_index = i + 1 break elif (r_index and numbers[i] == sorted_numbers[l]): l_index = i + 1 break else: i += 1 return [l_index, r_index] if l_index < r_index else [r_index, l_index] elif (res < target): l += 1 else: r -= 1
class File(object): def __init__(self): self.filename = '' self.server_filename = '' self.rotate = 0 self.password = None # file_encryption_key TBD self.file_encryption_key = None self.metas = {} @property def metas_values(self): return "Title", "Author", "Subject", "Keywords", "Creator", "Producer", "CreationDate", "ModDate", "Trapped" def get_file_options(self): pass def set_metas(self, key, value): if key in self.metas_values: self.metas[key] = value else: raise ValueError("'%s' is not a meta tag: %s" % (key, self.metas)) def as_dict(self): for k in dir(self): if getattr(self, k) and \ 'set_metas' not in k and 'get_file_options' not in k and 'as_dict' not in k \ and '__' not in k and '_values' not in k: yield(k, getattr(self, k))
windowWidth = 500 windowHeight = 500 ellipseSize = 200 def setup(): size(windowWidth , windowHeight) smooth() background(255) fill(50, 80) stroke(100) strokeWeight(3) noLoop() def draw(): ellipse(windowWidth/2, windowHeight/2 - ellipseSize/2, ellipseSize , ellipseSize); ellipse(windowWidth/2 - ellipseSize/2, windowHeight/2, ellipseSize , ellipseSize); ellipse(windowWidth/2 + ellipseSize/2, windowHeight/2, ellipseSize , ellipseSize); ellipse(windowWidth/2, windowHeight/2 + ellipseSize/2, ellipseSize , ellipseSize);
# Given an integer n, return the number of structurally unique BST's (binary search trees) which has exactly n nodes of unique values from 1 to n. # Example 1: # Input: n = 3 # Output: 5 #FORMULA is 2nCn/ n+1 catelon number class Solution: def numTrees(self, n: int) -> int: res = 1 x = 2*n for i in range(n): res = res * (x-1) res = res // (i+1) return res // (n+1) if __name__ == '__main__': n = 3 print(Solution().numTrees(n))
'''Constants used by TRender. :copyright: 2015, Jeroen van der Heijden (Cesbit) ''' LINE_IF = 1 LINE_ELSE = 2 LINE_ELIF = 4 LINE_END = 8 LINE_MACRO = 16 LINE_COMMENT = 32 LINE_BLOCK = 64 LINE_FOR = 128 LINE_PASTE = 256 LINE_TEXT = 512 LINE_INCLUDE = 1024 LINE_EXTEND = 2048 LINE_EMPTY = 4096 EOF_TEXT = 8192 ALWAYS_ALLOWED = ( LINE_IF | LINE_MACRO | LINE_PASTE | LINE_TEXT | LINE_COMMENT | LINE_FOR | LINE_BLOCK | LINE_INCLUDE | LINE_EXTEND | LINE_EMPTY) MAP_LINE_TYPE = { True: LINE_TEXT, None: LINE_EMPTY, 'if': LINE_IF, 'else': LINE_ELSE, 'elif': LINE_ELIF, 'end': LINE_END, 'for': LINE_FOR, 'macro': LINE_MACRO, 'block': LINE_BLOCK, 'include': LINE_INCLUDE, 'extend': LINE_EXTEND, '': LINE_COMMENT } VAR = 'a-zA-Z0-9_' VAR_DOTS = VAR + r'\.' FILENAME = r'a-zA-Z0-9_\-\./'
test_cases = int(input()) sol = [] for test in range(test_cases): budget = int(input()) useless = input() prices = list(map(int,input().split())) for i in range(len(prices)): for j in range(i+1,len(prices)): if prices[i]+prices[j] == budget: sol.append(str(i+1)+' '+str(j+1)) for ans in sol: print(ans)
def pytest_assertrepr_compare(config, op, left, right): """Hook for PyCharm full diff References: https://stackoverflow.com/a/50625086/4249707""" if op in ("==", "!="): return ["{0} {1} {2}".format(left, op, right)]
its = [] for re in range(1, 6): peso = float(input(f'peso da {re}º pessoa: ')) its += [peso] print(f'maior peso lido {max(its)}kilos.') print(f'menor peso lido {min(its)}kilos.')
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # def power(x, n=2): # s = 1 # while n > 0: # n = n - 1 # s = s * x # return s # # print(power(5)) # def add_end(L=[]): # L.append('END') # return L # # print(add_end([1, 2, 3])) # print(add_end(['x', 'y', 'z'])) # # print(add_end()) # ['END'] # print(add_end()) # ['END','END'] # print(add_end()) # ['END','END','END'] # Python函数在定义的时候,默认参数L的值就被计算出来了,即[],因为默认参数L也是一个变量,它指向对象[], # 每次调用该函数,如果改变了L的内容,则下次调用时,默认参数的内容就变了,不再是函数定义时的[]了。 # 定义默认参数要牢记一点:默认参数必须指向不变对象! # def add_end(L=None): # if L is None: # L = [] # L.append('END') # return L # # print(add_end()) # ['END'] # print(add_end()) # ['END'] # print(add_end()) # ['END'] # def calc(numbers): # sum = 0 # for n in numbers: # sum = sum + n * n # return sum # # print(calc([1,2,3])) # print(calc((1,3,5,7))) # def calc(*numbers): # sum = 0 # for n in numbers: # sum = sum + n * n # return sum # # print(calc(1,2)) # print(calc(*[1,2,3])) # def person(name, age, **kw): # print('name:', name, 'age:', age, 'other:', kw) # # person('Adam', 45, gender='M', job='Engineer') # # extra = {'city': 'Beijing', 'job': 'Engineer'} # person('Jack', 24, **extra) # 命名关键字参数 # def person(name, age, **kw): # if 'city' in kw: # # 有city参数 # pass # if 'job' in kw: # # 有job参数 # pass # print('name:', name, 'age:', age, 'other:', kw) # # person('Jack', 24, city='Beijing', addr='Chaoyang', zipcode=123456) # def person(name, age, *, city, job): # print(name, age, city, job) # # person('Jack', 24, city='Beijing', job='Engineer') # def person(name, age, *args, city, job): # print(name, age, args, city, job) # # person('Jack', 24, 'Beijing', 'Engineer') # def person(name, age, *, city='Beijing', job): # print(name, age, city, job) # # person('Jack', 24, job='Engineer') # 参数定义的顺序必须是:必选参数、默认参数、可变参数、命名关键字参数和关键字参数。 def product(*nums): sum = 1 if nums == (): raise TypeError('Empty Input') for num in nums: if not isinstance(num, (int, float)): raise TypeError("bad operand type") sum = sum * num return sum print('product(5) =', product(5)) print('product(5, 6) =', product(5, 6)) print('product(5, 6, 7) =', product(5, 6, 7)) print('product(5, 6, 7, 9) =', product(5, 6, 7, 9)) if product(5) != 5: print('测试失败!') elif product(5, 6) != 30: print('测试失败!') elif product(5, 6, 7) != 210: print('测试失败!') elif product(5, 6, 7, 9) != 1890: print('测试失败!') else: try: product() print('测试失败!') except TypeError: print('测试成功!')
n = int(input()) t = 0 a = 0 for _ in range(n): s = input() t += s.count('R') a += s.count('B') if t > a: print('TAKAHASHI') elif a > t: print('AOKI') else: print('DRAW')
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Fri Oct 20 14:55:39 2017 @author: ishxiao ~Email~: [email protected] """