content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
ENV = 'testing' DEBUG = True TESTING = True SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/flask_example_test' SQLALCHEMY_TRACK_MODIFICATIONS = False ERROR_404_HELP = False
env = 'testing' debug = True testing = True sqlalchemy_database_uri = 'postgresql://localhost/flask_example_test' sqlalchemy_track_modifications = False error_404_help = False
# Copyright (C) 2018 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This is needed due to https://github.com/bazelbuild/bazel/issues/914 load("//tools/build/rules:cc.bzl", "cc_stripped_binary") def _symbol_exports(name, exports): # Creates an assembly file that references all the exported symbols, so the linker won't trim them. native.genrule( name = name + "_syms", srcs = [exports], outs = [name + "_syms.S"], cmd = "cat $< | awk '{print \".global\",$$0}' > $@", ) # Creates a linker script to export the public symbols/hide the rest. native.genrule( name = name + "_ldscript", srcs = [exports], outs = [name + ".ldscript"], cmd = "(" + ";".join([ "echo '{ global:'", "cat $< | awk '{print $$0\";\"}'", "echo 'local: *;};'", "echo", ]) + ") > $@", ) # Creates a OSX linker script to export the public symbols/hide the rest. native.genrule( name = name + "_osx_ldscript", srcs = [exports], outs = [name + "_osx.ldscript"], cmd = "cat $< | awk '{print \"_\"$$0}' > $@", ) def cc_dynamic_library(name, exports = "", visibility = ["//visibility:private"], deps = [], linkopts = [], **kwargs): _symbol_exports(name, exports) # All but one of these will fail, but the select in the filegroup # will pick up the correct one. cc_stripped_binary( name = name + ".so", srcs = [":" + name + "_syms"], deps = deps + [name + ".ldscript"], linkopts = linkopts + ["-Wl,--version-script", "$(location " + name + ".ldscript)"], linkshared = 1, visibility = ["//visibility:private"], **kwargs ) cc_stripped_binary( name = name + ".dylib", deps = deps + [name + "_osx.ldscript"], linkopts = linkopts + [ "-Wl,-exported_symbols_list", "$(location " + name + "_osx.ldscript)", "-Wl,-dead_strip", ], linkshared = 1, visibility = ["//visibility:private"], **kwargs ) cc_stripped_binary( name = name + ".dll", srcs = [":" + name + "_syms"], deps = deps + [name + ".ldscript"], linkopts = linkopts + ["-Wl,--version-script", "$(location " + name + ".ldscript)"], linkshared = 1, visibility = ["//visibility:private"], **kwargs ) native.filegroup( name = name, visibility = visibility, srcs = select({ "//tools/build:linux": [":" + name + ".so"], "//tools/build:darwin": [":" + name + ".dylib"], "//tools/build:windows": [":" + name + ".dll"], # Android "//conditions:default": [":" + name + ".so"], }) ) def android_dynamic_library(name, exports = "", deps = [], linkopts = [], **kwargs): _symbol_exports(name, exports) # This doesn't actually create a dynamic library, but sets up the linking # correctly for when the android_binary actually creates the .so. native.cc_library( name = name, deps = deps + [name + ".ldscript"], linkopts = linkopts + [ "-Wl,--version-script", "$(location " + name + ".ldscript)", "-Wl,--unresolved-symbols=report-all", "-Wl,--gc-sections", "-Wl,--exclude-libs,libgcc.a", "-Wl,-z,noexecstack,-z,relro,-z,now,-z,nocopyreloc", ], **kwargs )
load('//tools/build/rules:cc.bzl', 'cc_stripped_binary') def _symbol_exports(name, exports): native.genrule(name=name + '_syms', srcs=[exports], outs=[name + '_syms.S'], cmd='cat $< | awk \'{print ".global",$$0}\' > $@') native.genrule(name=name + '_ldscript', srcs=[exports], outs=[name + '.ldscript'], cmd='(' + ';'.join(["echo '{ global:'", 'cat $< | awk \'{print $$0";"}\'', "echo 'local: *;};'", 'echo']) + ') > $@') native.genrule(name=name + '_osx_ldscript', srcs=[exports], outs=[name + '_osx.ldscript'], cmd='cat $< | awk \'{print "_"$$0}\' > $@') def cc_dynamic_library(name, exports='', visibility=['//visibility:private'], deps=[], linkopts=[], **kwargs): _symbol_exports(name, exports) cc_stripped_binary(name=name + '.so', srcs=[':' + name + '_syms'], deps=deps + [name + '.ldscript'], linkopts=linkopts + ['-Wl,--version-script', '$(location ' + name + '.ldscript)'], linkshared=1, visibility=['//visibility:private'], **kwargs) cc_stripped_binary(name=name + '.dylib', deps=deps + [name + '_osx.ldscript'], linkopts=linkopts + ['-Wl,-exported_symbols_list', '$(location ' + name + '_osx.ldscript)', '-Wl,-dead_strip'], linkshared=1, visibility=['//visibility:private'], **kwargs) cc_stripped_binary(name=name + '.dll', srcs=[':' + name + '_syms'], deps=deps + [name + '.ldscript'], linkopts=linkopts + ['-Wl,--version-script', '$(location ' + name + '.ldscript)'], linkshared=1, visibility=['//visibility:private'], **kwargs) native.filegroup(name=name, visibility=visibility, srcs=select({'//tools/build:linux': [':' + name + '.so'], '//tools/build:darwin': [':' + name + '.dylib'], '//tools/build:windows': [':' + name + '.dll'], '//conditions:default': [':' + name + '.so']})) def android_dynamic_library(name, exports='', deps=[], linkopts=[], **kwargs): _symbol_exports(name, exports) native.cc_library(name=name, deps=deps + [name + '.ldscript'], linkopts=linkopts + ['-Wl,--version-script', '$(location ' + name + '.ldscript)', '-Wl,--unresolved-symbols=report-all', '-Wl,--gc-sections', '-Wl,--exclude-libs,libgcc.a', '-Wl,-z,noexecstack,-z,relro,-z,now,-z,nocopyreloc'], **kwargs)
class TwythonError(Exception): @property def msg(self) -> str: ... class TwythonRateLimitError(TwythonError): @property def retry_after(self) -> int: ... class TwythonAuthError(TwythonError): ...
class Twythonerror(Exception): @property def msg(self) -> str: ... class Twythonratelimiterror(TwythonError): @property def retry_after(self) -> int: ... class Twythonautherror(TwythonError): ...
try: sc = input("Enter your score between 0.0 and 1.0: ") #sc = 0.85 score = float(sc) except: if score > 1.0 or score < 0.0: print("Error, input should be between 0.0 and 1.0") quit() if score >= 0.9: print('A') elif score >= 0.8: print('B') elif score >= 0.7: print('C') elif score < 0.6: print('F') #Write a program to prompt for a score between 0.0 and 1.0. # If the score is out of range, print an error. # If the score is between 0.0 and 1.0, print a grade using the following table: #Score Grade #>= 0.9 A #>= 0.8 B #>= 0.7 C #>= 0.6 D #< 0.6 F #If the user enters a value out of range, print a suitable error message and exit. For the test, enter a score of 0.85.
try: sc = input('Enter your score between 0.0 and 1.0: ') score = float(sc) except: if score > 1.0 or score < 0.0: print('Error, input should be between 0.0 and 1.0') quit() if score >= 0.9: print('A') elif score >= 0.8: print('B') elif score >= 0.7: print('C') elif score < 0.6: print('F')
passw = input() def Is_Valid(password): valid_length = False two_digits = False only = True digit = 0 let_dig = 0 if len(password) >= 6 and len(password) <= 10: valid_length = True else: print('Password must be between 6 and 10 characters') for i in password: if ((ord(i) >= 48 and ord(i) <= 57) or (ord(i) >= 65 and ord(i) <= 90) or (ord(i) >= 97 and ord(i) <= 122)): let_dig +=1 if let_dig != len(password): only = False if not only: print('Password must consist only of letters and digits') for i in password: if ord(i) >= 48 and ord(i) <= 57: digit += 1 if digit >= 2: two_digits = True else: print('Password must have at least 2 digits') if valid_length and two_digits and only: print('Password is valid.') Is_Valid(passw)
passw = input() def is__valid(password): valid_length = False two_digits = False only = True digit = 0 let_dig = 0 if len(password) >= 6 and len(password) <= 10: valid_length = True else: print('Password must be between 6 and 10 characters') for i in password: if ord(i) >= 48 and ord(i) <= 57 or (ord(i) >= 65 and ord(i) <= 90) or (ord(i) >= 97 and ord(i) <= 122): let_dig += 1 if let_dig != len(password): only = False if not only: print('Password must consist only of letters and digits') for i in password: if ord(i) >= 48 and ord(i) <= 57: digit += 1 if digit >= 2: two_digits = True else: print('Password must have at least 2 digits') if valid_length and two_digits and only: print('Password is valid.') is__valid(passw)
# Algebraic-only implementation of two's complement in pure Python # # Written by: Patrizia Favaron def raw_to_compl2(iRaw, iNumBits): # Establish minimum and maximum possible raw values iMinRaw = 0 iMaxRaw = 2**iNumBits - 1 # Clip value arithmetically if iRaw < iMinRaw: iRaw = iMinRaw if iRaw > iMaxRaw: iRaw = iMaxRaw # Set useful two's complement value(s) iMaxValue = 2**(iNumBits-1) - 1 # Check cases and act accordingly if iRaw <= iMaxValue: iValue = iRaw else: iValue = iRaw - 2**iNumBits return iValue def compl2_to_raw(iCompl2, iNumBits): # Set minimum and maximum two's complement values iMinValue = -2**(iNumBits-1) iMaxValue = 2**(iNumBits-1) - 1 # Clip value arithmetically if iCompl2 < iMinValue: iCompl2 = iMinValue if iCompl2 > iMaxValue: iCompl2 = iMaxValue # Check cases and set accordingly if iCompl2 >= 0: iRaw = iCompl2 else: iRaw = iCompl2 + 2**iNumBits return iRaw if __name__ == "__main__": iRaw = 0 print(iRaw) print(raw_to_compl2(iRaw,16)) print() iRaw = 32767 print(iRaw) print(raw_to_compl2(iRaw,16)) print() iRaw = 32768 print(iRaw) print(raw_to_compl2(iRaw,16)) print() iRaw = 65535 print(iRaw) print(raw_to_compl2(iRaw,16)) print() iCompl2 = -1 print(iCompl2) print(compl2_to_raw(iCompl2,10)) print() iCompl2 = -2**9 print(iCompl2) print(compl2_to_raw(iCompl2,10)) print() iCompl2 = -2**9 + 1 print(iCompl2) print(compl2_to_raw(iCompl2,10)) print()
def raw_to_compl2(iRaw, iNumBits): i_min_raw = 0 i_max_raw = 2 ** iNumBits - 1 if iRaw < iMinRaw: i_raw = iMinRaw if iRaw > iMaxRaw: i_raw = iMaxRaw i_max_value = 2 ** (iNumBits - 1) - 1 if iRaw <= iMaxValue: i_value = iRaw else: i_value = iRaw - 2 ** iNumBits return iValue def compl2_to_raw(iCompl2, iNumBits): i_min_value = -2 ** (iNumBits - 1) i_max_value = 2 ** (iNumBits - 1) - 1 if iCompl2 < iMinValue: i_compl2 = iMinValue if iCompl2 > iMaxValue: i_compl2 = iMaxValue if iCompl2 >= 0: i_raw = iCompl2 else: i_raw = iCompl2 + 2 ** iNumBits return iRaw if __name__ == '__main__': i_raw = 0 print(iRaw) print(raw_to_compl2(iRaw, 16)) print() i_raw = 32767 print(iRaw) print(raw_to_compl2(iRaw, 16)) print() i_raw = 32768 print(iRaw) print(raw_to_compl2(iRaw, 16)) print() i_raw = 65535 print(iRaw) print(raw_to_compl2(iRaw, 16)) print() i_compl2 = -1 print(iCompl2) print(compl2_to_raw(iCompl2, 10)) print() i_compl2 = -2 ** 9 print(iCompl2) print(compl2_to_raw(iCompl2, 10)) print() i_compl2 = -2 ** 9 + 1 print(iCompl2) print(compl2_to_raw(iCompl2, 10)) print()
with open('./input.txt') as input: hits = {} for line in input: (x1, y1), (x2, y2) = [ map(int, point.split(',')) for point in line.strip().split(' -> ')] if x1 == x2: for y in range(min(y1, y2), max(y1, y2) + 1): if (x1, y) in hits: hits[(x1, y)] += 1 else: hits[(x1, y)] = 1 if y1 == y2: for x in range(min(x1, x2), max(x1, x2) + 1): if (x, y1) in hits: hits[(x, y1)] += 1 else: hits[(x, y1)] = 1 print(len([val for val in hits.values() if val > 1])) # 5147
with open('./input.txt') as input: hits = {} for line in input: ((x1, y1), (x2, y2)) = [map(int, point.split(',')) for point in line.strip().split(' -> ')] if x1 == x2: for y in range(min(y1, y2), max(y1, y2) + 1): if (x1, y) in hits: hits[x1, y] += 1 else: hits[x1, y] = 1 if y1 == y2: for x in range(min(x1, x2), max(x1, x2) + 1): if (x, y1) in hits: hits[x, y1] += 1 else: hits[x, y1] = 1 print(len([val for val in hits.values() if val > 1]))
def get_cat_vars_dict(df, categorical_cols, feature_names, target_name): cat_vars_dict = {} for col in [ col for col in categorical_cols if col != target_name]: cat_vars_dict[feature_names.index(col)] = len(df[col].unique()) return cat_vars_dict
def get_cat_vars_dict(df, categorical_cols, feature_names, target_name): cat_vars_dict = {} for col in [col for col in categorical_cols if col != target_name]: cat_vars_dict[feature_names.index(col)] = len(df[col].unique()) return cat_vars_dict
class RestApi(object): def __init__(self, app): self.app = app self.frefix_url = self.app.config.get("API_URL_PREFIX") or "" self.views = [] def register_api(self, bleuprint, view, endpoint, url): view_func = view.as_view(endpoint) links = {} # detail_url = "{}<{}:{}>".format(url, pk_type, pk) links['self'] = url view.links = links # if 'GET' in view.allowed_methods: # bleuprint.add_url_rule(url, defaults={pk: None}, # view_func=view_func, methods=['GET',]) # if 'POST' in view.allowed_methods: # bleuprint.add_url_rule(url, view_func=view_func, methods=['POST',]) methods = [method for method in view.allowed_methods if method != 'POST'] bleuprint.add_url_rule(url, view_func=view_func, methods=view.allowed_methods) self.views.append({"view_func": view_func, "endpoint": endpoint}) def register_blueprint(self, blueprint): self.app.register_blueprint(blueprint, url_prefix=self.frefix_url)
class Restapi(object): def __init__(self, app): self.app = app self.frefix_url = self.app.config.get('API_URL_PREFIX') or '' self.views = [] def register_api(self, bleuprint, view, endpoint, url): view_func = view.as_view(endpoint) links = {} links['self'] = url view.links = links methods = [method for method in view.allowed_methods if method != 'POST'] bleuprint.add_url_rule(url, view_func=view_func, methods=view.allowed_methods) self.views.append({'view_func': view_func, 'endpoint': endpoint}) def register_blueprint(self, blueprint): self.app.register_blueprint(blueprint, url_prefix=self.frefix_url)
class Kanji(): def __init__(self): self.kanji = None self.strokes = 0 self.pronunciation = None self.definition = "" self.kanji_shinjitai = None self.strokes_shinjitai = 0 def __unicode__(self): if self.kanji_shinjitai: ks = " (%s)" % self.kanji_shinjitai if self.strokes_shinjitai: ss = " (%s)" % self.strokes_shinjitai return u"<kanji: %s%s, strokes: %s%s, pronunciation: %s, definition: %s>" % (self.kanji, ks, self.strokes, ss, self.pronunciation, self.definition)
class Kanji: def __init__(self): self.kanji = None self.strokes = 0 self.pronunciation = None self.definition = '' self.kanji_shinjitai = None self.strokes_shinjitai = 0 def __unicode__(self): if self.kanji_shinjitai: ks = ' (%s)' % self.kanji_shinjitai if self.strokes_shinjitai: ss = ' (%s)' % self.strokes_shinjitai return u'<kanji: %s%s, strokes: %s%s, pronunciation: %s, definition: %s>' % (self.kanji, ks, self.strokes, ss, self.pronunciation, self.definition)
def p_error( p ): print print( "SYNTAX ERROR %s" % str( p ) ) print raise Exception
def p_error(p): print print('SYNTAX ERROR %s' % str(p)) print raise Exception
numeros = [] par = [] impar = [] while True: n = (int(input('Digite um numero: '))) numeros.append(n) if n % 2 == 0: par.append(n) else: impar.append(n) resp = str(input('Deseja continuar [S/N]: ')).strip().upper()[0] while resp not in 'SN': resp = str(input('Tente novamente, Deseja continuar [S/N]: ')).strip().upper()[0] if resp == 'N': break if resp == 'N': break print('=-' * 30) print('Os nomeros digtados foram: ', numeros) par.sort() print(f'Numeros pares {par}') impar.sort() print(f'Nomeros impares {impar}')
numeros = [] par = [] impar = [] while True: n = int(input('Digite um numero: ')) numeros.append(n) if n % 2 == 0: par.append(n) else: impar.append(n) resp = str(input('Deseja continuar [S/N]: ')).strip().upper()[0] while resp not in 'SN': resp = str(input('Tente novamente, Deseja continuar [S/N]: ')).strip().upper()[0] if resp == 'N': break if resp == 'N': break print('=-' * 30) print('Os nomeros digtados foram: ', numeros) par.sort() print(f'Numeros pares {par}') impar.sort() print(f'Nomeros impares {impar}')
def get_label_dict(dataset_name): label_dict = None if dataset_name == 'PASCAL': label_dict = { 'back_ground': 0, 'aeroplane': 1, 'bicycle': 2, 'bird': 3, 'boat': 4, 'bottle': 5, 'bus': 6, 'car': 7, 'cat': 8, 'chair': 9, 'cow': 10, 'diningtable': 11, 'dog': 12, 'horse': 13, 'motorbike': 14, 'person': 15, 'pottedplant': 16, 'sheep': 17, 'sofa': 18, 'train': 19, 'tvmonitor': 20 } elif dataset_name == 'COCO': pass elif dataset_name == 'ROOF': label_dict = { 'back_ground': 0, 'flatroof': 1, 'solarpanel_slope': 2, 'solarpanel_flat': 3, 'parkinglot': 4, 'facility': 5, 'rooftop': 6, 'heliport_r': 7, 'heliport_h': 8 } return label_dict
def get_label_dict(dataset_name): label_dict = None if dataset_name == 'PASCAL': label_dict = {'back_ground': 0, 'aeroplane': 1, 'bicycle': 2, 'bird': 3, 'boat': 4, 'bottle': 5, 'bus': 6, 'car': 7, 'cat': 8, 'chair': 9, 'cow': 10, 'diningtable': 11, 'dog': 12, 'horse': 13, 'motorbike': 14, 'person': 15, 'pottedplant': 16, 'sheep': 17, 'sofa': 18, 'train': 19, 'tvmonitor': 20} elif dataset_name == 'COCO': pass elif dataset_name == 'ROOF': label_dict = {'back_ground': 0, 'flatroof': 1, 'solarpanel_slope': 2, 'solarpanel_flat': 3, 'parkinglot': 4, 'facility': 5, 'rooftop': 6, 'heliport_r': 7, 'heliport_h': 8} return label_dict
start = 0 end = 1781 instance = 0 for i in range(150): f = open(f"ec2files/ec2file{i}.py", "w") f.write(f"from scraper import * \ns = Scraper(start={start}, end={end}, max_iter=30, scraper_instance={instance}) \ns.scrape_letterboxd()") start = end + 1 end = start + 1781 instance += 1 f.close()
start = 0 end = 1781 instance = 0 for i in range(150): f = open(f'ec2files/ec2file{i}.py', 'w') f.write(f'from scraper import * \ns = Scraper(start={start}, end={end}, max_iter=30, scraper_instance={instance}) \ns.scrape_letterboxd()') start = end + 1 end = start + 1781 instance += 1 f.close()
class Config(object): SECRET_KEY = "aaaaaaa" debug = False class Production(Config): debug = True CSRF_ENABLED = False SQLALCHEMY_DATABASE_URI = "mysql://username:password@127.0.0.1/DBname" migration_directory = "migrations"
class Config(object): secret_key = 'aaaaaaa' debug = False class Production(Config): debug = True csrf_enabled = False sqlalchemy_database_uri = 'mysql://username:password@127.0.0.1/DBname' migration_directory = 'migrations'
# This program creates an object of the pet class # and asks the user to enter the name, type, and age of pet. # The program retrieves the pet's name, type, and age and # displays the data. class Pet: def __init__(self, name, animal_type, age): # Gets the pets name self.__name = name # Gets the animal type self.__animal_type = animal_type # Gets the animals age self.__age = age def set_name(self, name): self.__name = name def set_type(self, animal_type): self.__animal_type = animal_type def set_age(self, age): self.__age = age # Displays the pets name def get_name(self): return self.__name # Displays the animal type def get_animal_type(self): return self.__animal_type # Displays the pets age def get_age(self): return self.__age # The main function def main(): # Get the pets name name = input('What is the name of the pet? ') # Get the animal type animal_type = input('What type of animal is it? ') # Get the animals age age = int(input('How old is the pet? ')) pets = Pet(name, animal_type, age) # Display the inputs print('This information will be added to our records.') print('Here is the data you entered: ') print('------------------------------') print('Pet Name:', pets.get_name()) print('Animal Type:', pets.get_animal_type()) print('Age:', pets.get_age()) # Call the main function main()
class Pet: def __init__(self, name, animal_type, age): self.__name = name self.__animal_type = animal_type self.__age = age def set_name(self, name): self.__name = name def set_type(self, animal_type): self.__animal_type = animal_type def set_age(self, age): self.__age = age def get_name(self): return self.__name def get_animal_type(self): return self.__animal_type def get_age(self): return self.__age def main(): name = input('What is the name of the pet? ') animal_type = input('What type of animal is it? ') age = int(input('How old is the pet? ')) pets = pet(name, animal_type, age) print('This information will be added to our records.') print('Here is the data you entered: ') print('------------------------------') print('Pet Name:', pets.get_name()) print('Animal Type:', pets.get_animal_type()) print('Age:', pets.get_age()) main()
# # PySNMP MIB module SCSPATMARP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SCSPATMARP-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:01:23 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") ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "SingleValueConstraint") AtmConnKind, AtmAddr = mibBuilder.importSymbols("ATM-TC-MIB", "AtmConnKind", "AtmAddr") scspLSID, ScspHFSMStateType, scspServerGroupPID, SCSPVCIInteger, SCSPVPIInteger, scspServerGroupID, scspDCSID = mibBuilder.importSymbols("SCSP-MIB", "scspLSID", "ScspHFSMStateType", "scspServerGroupPID", "SCSPVCIInteger", "SCSPVPIInteger", "scspServerGroupID", "scspDCSID") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") ModuleIdentity, TimeTicks, Counter32, Counter64, NotificationType, Unsigned32, experimental, iso, Bits, MibIdentifier, Integer32, Gauge32, IpAddress, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "ModuleIdentity", "TimeTicks", "Counter32", "Counter64", "NotificationType", "Unsigned32", "experimental", "iso", "Bits", "MibIdentifier", "Integer32", "Gauge32", "IpAddress", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity") DisplayString, RowStatus, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "RowStatus", "TextualConvention") scspAtmarpMIB = ModuleIdentity((1, 3, 6, 1, 3, 2002)) if mibBuilder.loadTexts: scspAtmarpMIB.setLastUpdated('9808020000Z') if mibBuilder.loadTexts: scspAtmarpMIB.setOrganization('IETF Internetworking Over NBMA Working Group (ion)') if mibBuilder.loadTexts: scspAtmarpMIB.setContactInfo('Jim Luciani (jliciani@BayNetworks.com Bay Networks Cliff X. Wang (cliff_wang@vnet.ibm.com) Colin Verrilli (verrilli@vnet.ibm.com) IBM Corp.') if mibBuilder.loadTexts: scspAtmarpMIB.setDescription('This module defines a portion of the management information base (MIB) for managing Server Cache Synchronizatio protocol applied to ATMARP servers.') scspAtmarpObjects = MibIdentifier((1, 3, 6, 1, 3, 2002, 1)) scspAtmarpNotifications = MibIdentifier((1, 3, 6, 1, 3, 2002, 2)) scspAtmarpConformance = MibIdentifier((1, 3, 6, 1, 3, 2002, 3)) scspAtmarpServerGroupTable = MibTable((1, 3, 6, 1, 3, 2002, 1, 1), ) if mibBuilder.loadTexts: scspAtmarpServerGroupTable.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupTable.setDescription('The objects defined in this table are used to for the management of SCSP server groups with application to IP over ATM operation (Classic IP). These objects SHOULD be used along with the protocol independent part objects to support the management of the SCSP protocol applied to synchronizing the atmarp servers in a LIS. There is one entry in this table for each server group. In the case of IP over ATM, each server group corresponds to a Logical IP Subnet.') scspAtmarpServerGroupEntry = MibTableRow((1, 3, 6, 1, 3, 2002, 1, 1, 1), ).setIndexNames((0, "SCSP-MIB", "scspServerGroupID"), (0, "SCSP-MIB", "scspServerGroupPID")) if mibBuilder.loadTexts: scspAtmarpServerGroupEntry.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupEntry.setDescription('Information about SCSP server group running IP over ATM operation. This table is indexed by scspServerGroupID and scspServerGroupPID. The two indeces point to a corresponding entry in the scspServerGroupTable.') scspAtmarpServerGroupNetMask = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 1, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpServerGroupNetMask.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupNetMask.setDescription('The subnet mask associated with this Server Group.') scspAtmarpServerGroupSubnetAddr = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 1, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpServerGroupSubnetAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupSubnetAddr.setDescription('The IP subnet address associated with this Server Group.') scspAtmarpServerGroupRowStatus = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 1, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: scspAtmarpServerGroupRowStatus.setReference("RFC 1903, 'Textual Conventions for version 2 of the Simple Network Management Protocol (SNMPv2).'") if mibBuilder.loadTexts: scspAtmarpServerGroupRowStatus.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupRowStatus.setDescription('This object allows Atmarp Server Group Table entries to be created and deleted from the scspAtmarpServerGroupTable. Note that scspAtmarpServerGroupTable entry creation and deletion is coupled with scspServerGroupTable entry creation and deletion. A scspAtmarpServerGroupTable entry cannot be created until its corresponding scspServerGroupTable entry is created. When a scspServerGroupTable entry is deleted, it also removes the corresponding scspAtmarpServerGroupTable entry.') scspAtmarpLSTable = MibTable((1, 3, 6, 1, 3, 2002, 1, 2), ) if mibBuilder.loadTexts: scspAtmarpLSTable.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSTable.setDescription('The objects defined in this table are used to for the management of the Atmarp Local server in a SCSP server group for IP over ATM operation. These objects SHOULD be used along with the protocol independent part objects to support the management of the SCSP protocol applied to synchronizing the IP over ATM servers.') scspAtmarpLSEntry = MibTableRow((1, 3, 6, 1, 3, 2002, 1, 2, 1), ).setIndexNames((0, "SCSP-MIB", "scspServerGroupID"), (0, "SCSP-MIB", "scspServerGroupPID"), (0, "SCSP-MIB", "scspLSID")) if mibBuilder.loadTexts: scspAtmarpLSEntry.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSEntry.setDescription('Information about Atmarp Local Server in a SCSP server group. This table is indexed by scspServerGroupID, scspServerGroupPID, and scspLSID. The three indeces point to a corresponding entry in the scspLSTable.') scspAtmarpLSLSIPAddr = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 2, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpLSLSIPAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSLSIPAddr.setDescription('The IP address of the Atmarp Local Server. Since an Atmarp server does not have to be assigned an IP address, this object is optional.') scspAtmarpLSLSAtmAddr = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 2, 1, 2), AtmAddr()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpLSLSAtmAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSLSAtmAddr.setDescription('The ATM address of the Atmarp Local Server.') scspAtmarpLSRowStatus = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 2, 1, 3), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: scspAtmarpLSRowStatus.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSRowStatus.setDescription('This object allows Atmarp Local Server Table entries to be created and deleted from the scspAtmarpLSTable. Note that scspAtmarpLSTable entry creation and deletion is coupled with scspLSTable entry creation and deletion. A scspAtmarpLSTable entry cannot be created until its corresponding scspLSTable entry is created. When a scspLSTable entry is deleted, it also removes the corresponding scspAtmarpLSTable entry.') scspAtmarpPeerTable = MibTable((1, 3, 6, 1, 3, 2002, 1, 3), ) if mibBuilder.loadTexts: scspAtmarpPeerTable.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerTable.setDescription('The objects defined in this table are used to for the management of the ATMARP sever peers.') scspAtmarpPeerEntry = MibTableRow((1, 3, 6, 1, 3, 2002, 1, 3, 1), ).setIndexNames((0, "SCSP-MIB", "scspServerGroupID"), (0, "SCSP-MIB", "scspServerGroupPID"), (0, "SCSPATMARP-MIB", "scspAtmarpPeerIndex")) if mibBuilder.loadTexts: scspAtmarpPeerEntry.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerEntry.setDescription('Information about each peer ATMARP server participated in the scsp Server group. The table is indexed by scspServerGroupID, scspServerGroupPID, and scspAtmarpPeerIndex.') scspAtmarpPeerIndex = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 3, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpPeerIndex.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerIndex.setDescription('The table index of the peer Atmarp server table.') scspAtmarpPeerIPAddr = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 3, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpPeerIPAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerIPAddr.setDescription('The IP address of the peer Atmarp server. Since an Atmarp server does not have to be assigned an IP address, this object is optional.') scspAtmarpPeerAtmAddr = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 3, 1, 3), AtmAddr()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpPeerAtmAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerAtmAddr.setDescription("The ATM address of the Peer. If SVC is used between LS and Peer, Peer's ATM address should be valid. However, if PVC is used instead SVC, the Peer's ATM address may be a Null OCTET STRING.") scspAtmarpPeerVCType = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 3, 1, 4), AtmConnKind()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpPeerVCType.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerVCType.setDescription('The type of the virtual circuit between LS and Peer.') scspAtmarpPeerVPI = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 3, 1, 5), SCSPVPIInteger()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpPeerVPI.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerVPI.setDescription('The VPI value for the virtual circuit between LS and Peer.') scspAtmarpPeerVCI = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 3, 1, 6), SCSPVCIInteger()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpPeerVCI.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerVCI.setDescription('The VCI value for the virtual circuit between LS and Peer.') scspAtmarpPeerDCSID = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 3, 1, 7), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readonly") if mibBuilder.loadTexts: scspAtmarpPeerDCSID.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerDCSID.setDescription('The DCS ID for this peer. When the peer tabel is created, DCS ID may not have been discovered. Tt is set to a Null string. It will be update when the DCS ID associated with this peer (ATM address) is discovered.') scspAtmarpPeerRowStatus = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 3, 1, 8), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: scspAtmarpPeerRowStatus.setReference("RFC 1903, 'Textual Conventions for version 2 of the Simple Network Management Protocol (SNMPv2).'") if mibBuilder.loadTexts: scspAtmarpPeerRowStatus.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerRowStatus.setDescription('This object allows Atmarp Peer table entries to be created and deleted from the scspAtmarpPeerTable. Note that scspAtmarpPeerTable entry is created when a peer is configured loaclly or when a peer not previously configured connects to LS.') scspAtmarpHFSMTable = MibTable((1, 3, 6, 1, 3, 2002, 1, 4), ) if mibBuilder.loadTexts: scspAtmarpHFSMTable.setStatus('current') if mibBuilder.loadTexts: scspAtmarpHFSMTable.setDescription('The objects defined in this table are used to for the management of the HFSM between the LS and the DCS.') scspAtmarpHFSMEntry = MibTableRow((1, 3, 6, 1, 3, 2002, 1, 4, 1), ).setIndexNames((0, "SCSP-MIB", "scspServerGroupID"), (0, "SCSP-MIB", "scspServerGroupPID"), (0, "SCSPATMARP-MIB", "scspAtmarpPeerIndex")) if mibBuilder.loadTexts: scspAtmarpHFSMEntry.setStatus('current') if mibBuilder.loadTexts: scspAtmarpHFSMEntry.setDescription('Information about SCSP HFSM session between the LS and its HFSMs. The table is indexed by scspServerGroupID, scspServerGroupPID, and scspAtmarpPeerIndex.') scspHFSMHFSMState = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 4, 1, 1), ScspHFSMStateType()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspHFSMHFSMState.setReference('SCSP draft, Section 2.1') if mibBuilder.loadTexts: scspHFSMHFSMState.setStatus('current') if mibBuilder.loadTexts: scspHFSMHFSMState.setDescription('The current state of the Hello Finite State Machine. The allowable states are: down(1), waiting(2), uniConn(3), biConn(4).') scspHFSMHelloIn = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 4, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspHFSMHelloIn.setStatus('current') if mibBuilder.loadTexts: scspHFSMHelloIn.setDescription("The number of 'Hello' messages received from this HFSM.") scspHFSMHelloOut = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 4, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspHFSMHelloOut.setStatus('current') if mibBuilder.loadTexts: scspHFSMHelloOut.setDescription("The number of 'Hello' messages sent from LS to this HFSM.") scspHFSMHelloInvalidIn = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 4, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: scspHFSMHelloInvalidIn.setStatus('current') if mibBuilder.loadTexts: scspHFSMHelloInvalidIn.setDescription("The number of invalid 'Hello' messages received from this HFSM. Possible message errors include: Hello message when the HFSM is in 'Down' state; Hello message is too short to contain the number of Receiver ID records specified in the header, etc. Other common errors include failed authentication if applicable, errors in the message fields, etc.") scspHFSMHelloInterval = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 4, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: scspHFSMHelloInterval.setStatus('current') if mibBuilder.loadTexts: scspHFSMHelloInterval.setDescription('This object contains the value for HelloInterval with the associated HFSM. It is the time (in seconds) between sending of consecutive Hello messages from the HFSM.') scspHFSMDeadFactor = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 4, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readcreate") if mibBuilder.loadTexts: scspHFSMDeadFactor.setStatus('current') if mibBuilder.loadTexts: scspHFSMDeadFactor.setDescription("This object contains the value for DeadFactor with this associated server. The DeadFactor along with HelloInterval are contained in 'Hello' messages sent from this HFSM. If 'Hello' messages are not received from this HFSM within the time out interval 'HelloInterval*DeadFactor' (in seconds), then the HFSM MUST be considered to be stalled.") scspHFSMFamilyID = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 4, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: scspHFSMFamilyID.setReference('SCSP draft, Sec.2 and Sec. B.2.5') if mibBuilder.loadTexts: scspHFSMFamilyID.setStatus('current') if mibBuilder.loadTexts: scspHFSMFamilyID.setDescription('The family ID is used to refer an aggregate of Protocol ID/SGID pairs. Only a single HFSM is run for all Protocol ID/SGID pairs assigned to a Family ID. When the HFSM is not shared by an aggregate of Protocol ID/SGID pairs, this object should be set to 0.') scspAtmarpHFSMRowStatus = MibTableColumn((1, 3, 6, 1, 3, 2002, 1, 4, 1, 8), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: scspAtmarpHFSMRowStatus.setReference("RFC 1903, 'Textual Conventions for version 2 of the Simple Network Management Protocol (SNMPv2).'") if mibBuilder.loadTexts: scspAtmarpHFSMRowStatus.setStatus('current') if mibBuilder.loadTexts: scspAtmarpHFSMRowStatus.setDescription('This object allows Atmarp HFSM table entries to be created and deleted from the scspAtmarpHFSMTable. Note that scspAtmarpHFSMTable entry creation and deletion is closely coupled with scspHFSMTable entry creation. A scspAtmarpHFSMTable entry cannot be created until its corresponding scspHFSMTable entry is created. When a scspHFSMTable entry is deleted, it also removes the corresponding scspAtmarpHFSMTable entry.') scspHFSMDown = NotificationType((1, 3, 6, 1, 3, 2002, 2, 1)).setObjects(("SCSP-MIB", "scspServerGroupID"), ("SCSP-MIB", "scspServerGroupPID"), ("SCSPATMARP-MIB", "scspAtmarpPeerIndex")) if mibBuilder.loadTexts: scspHFSMDown.setStatus('current') if mibBuilder.loadTexts: scspHFSMDown.setDescription("The Hello Finite State Machine associated with this LS/DCS pair enters 'Down' state.") scspHFSMWaiting = NotificationType((1, 3, 6, 1, 3, 2002, 2, 2)).setObjects(("SCSP-MIB", "scspServerGroupID"), ("SCSP-MIB", "scspServerGroupPID"), ("SCSPATMARP-MIB", "scspAtmarpPeerIndex")) if mibBuilder.loadTexts: scspHFSMWaiting.setStatus('current') if mibBuilder.loadTexts: scspHFSMWaiting.setDescription("The Hello Finite State Machine associated with this LS/DCS pair enters 'Waiting' state.") scspHFSMBiConn = NotificationType((1, 3, 6, 1, 3, 2002, 2, 3)).setObjects(("SCSP-MIB", "scspServerGroupID"), ("SCSP-MIB", "scspServerGroupPID"), ("SCSPATMARP-MIB", "scspAtmarpPeerIndex")) if mibBuilder.loadTexts: scspHFSMBiConn.setStatus('current') if mibBuilder.loadTexts: scspHFSMBiConn.setDescription("The Hello Finite State Machine associated with this LS/DCS pair enters 'Bidirectional connection' state.") scspAtmarpCompliances = MibIdentifier((1, 3, 6, 1, 3, 2002, 3, 1)) scspAtmarpGroups = MibIdentifier((1, 3, 6, 1, 3, 2002, 3, 2)) scspAtmarpCompliance = ModuleCompliance((1, 3, 6, 1, 3, 2002, 3, 1, 1)).setObjects(("SCSPATMARP-MIB", "scspAtmarpGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): scspAtmarpCompliance = scspAtmarpCompliance.setStatus('current') if mibBuilder.loadTexts: scspAtmarpCompliance.setDescription('The compliance statement for entities that are required for the management of SCSP when applied to ATMARP servers.') scspAtmarpGroup = ObjectGroup((1, 3, 6, 1, 3, 2002, 3, 2, 1)).setObjects(("SCSPATMARP-MIB", "scspAtmarpServerGroupNetMask"), ("SCSPATMARP-MIB", "scspAtmarpServerGroupSubnetAddr"), ("SCSPATMARP-MIB", "scspAtmarpLSLSIPAddr"), ("SCSPATMARP-MIB", "scspAtmarpLSLSAtmAddr"), ("SCSPATMARP-MIB", "scspAtmarpPeerIndex"), ("SCSPATMARP-MIB", "scspAtmarpPeerAtmAddr"), ("SCSPATMARP-MIB", "scspAtmarpPeerVCType"), ("SCSPATMARP-MIB", "scspAtmarpPeerVPI"), ("SCSPATMARP-MIB", "scspAtmarpPeerVCI"), ("SCSPATMARP-MIB", "scspAtmarpPeerDCSID"), ("SCSPATMARP-MIB", "scspHFSMHFSMState"), ("SCSPATMARP-MIB", "scspHFSMHelloIn"), ("SCSPATMARP-MIB", "scspHFSMHelloOut"), ("SCSPATMARP-MIB", "scspHFSMHelloInvalidIn"), ("SCSPATMARP-MIB", "scspHFSMHelloInterval"), ("SCSPATMARP-MIB", "scspHFSMDeadFactor"), ("SCSPATMARP-MIB", "scspHFSMFamilyID")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): scspAtmarpGroup = scspAtmarpGroup.setStatus('current') if mibBuilder.loadTexts: scspAtmarpGroup.setDescription('This group is mandatory when Atmarp is the client/server protocol running SCSP.') mibBuilder.exportSymbols("SCSPATMARP-MIB", scspAtmarpObjects=scspAtmarpObjects, scspHFSMHelloOut=scspHFSMHelloOut, scspHFSMWaiting=scspHFSMWaiting, scspAtmarpGroups=scspAtmarpGroups, scspAtmarpPeerVCI=scspAtmarpPeerVCI, scspAtmarpCompliance=scspAtmarpCompliance, scspAtmarpConformance=scspAtmarpConformance, scspAtmarpLSRowStatus=scspAtmarpLSRowStatus, scspAtmarpServerGroupNetMask=scspAtmarpServerGroupNetMask, scspAtmarpPeerRowStatus=scspAtmarpPeerRowStatus, scspAtmarpHFSMTable=scspAtmarpHFSMTable, scspAtmarpPeerDCSID=scspAtmarpPeerDCSID, scspAtmarpServerGroupEntry=scspAtmarpServerGroupEntry, scspAtmarpPeerTable=scspAtmarpPeerTable, scspAtmarpLSLSAtmAddr=scspAtmarpLSLSAtmAddr, scspHFSMFamilyID=scspHFSMFamilyID, scspAtmarpServerGroupTable=scspAtmarpServerGroupTable, scspAtmarpLSTable=scspAtmarpLSTable, scspHFSMDeadFactor=scspHFSMDeadFactor, scspHFSMHelloInterval=scspHFSMHelloInterval, scspAtmarpLSEntry=scspAtmarpLSEntry, scspAtmarpPeerEntry=scspAtmarpPeerEntry, scspHFSMHFSMState=scspHFSMHFSMState, scspAtmarpLSLSIPAddr=scspAtmarpLSLSIPAddr, scspAtmarpPeerAtmAddr=scspAtmarpPeerAtmAddr, scspHFSMHelloIn=scspHFSMHelloIn, scspAtmarpGroup=scspAtmarpGroup, scspAtmarpNotifications=scspAtmarpNotifications, scspAtmarpServerGroupRowStatus=scspAtmarpServerGroupRowStatus, scspAtmarpMIB=scspAtmarpMIB, scspAtmarpHFSMEntry=scspAtmarpHFSMEntry, scspAtmarpPeerIndex=scspAtmarpPeerIndex, PYSNMP_MODULE_ID=scspAtmarpMIB, scspAtmarpServerGroupSubnetAddr=scspAtmarpServerGroupSubnetAddr, scspHFSMHelloInvalidIn=scspHFSMHelloInvalidIn, scspHFSMBiConn=scspHFSMBiConn, scspAtmarpHFSMRowStatus=scspAtmarpHFSMRowStatus, scspAtmarpPeerVCType=scspAtmarpPeerVCType, scspAtmarpPeerIPAddr=scspAtmarpPeerIPAddr, scspAtmarpCompliances=scspAtmarpCompliances, scspHFSMDown=scspHFSMDown, scspAtmarpPeerVPI=scspAtmarpPeerVPI)
(octet_string, integer, object_identifier) = mibBuilder.importSymbols('ASN1', 'OctetString', 'Integer', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_range_constraint, constraints_intersection, value_size_constraint, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueRangeConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint', 'SingleValueConstraint') (atm_conn_kind, atm_addr) = mibBuilder.importSymbols('ATM-TC-MIB', 'AtmConnKind', 'AtmAddr') (scsp_lsid, scsp_hfsm_state_type, scsp_server_group_pid, scspvci_integer, scspvpi_integer, scsp_server_group_id, scsp_dcsid) = mibBuilder.importSymbols('SCSP-MIB', 'scspLSID', 'ScspHFSMStateType', 'scspServerGroupPID', 'SCSPVCIInteger', 'SCSPVPIInteger', 'scspServerGroupID', 'scspDCSID') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (module_identity, time_ticks, counter32, counter64, notification_type, unsigned32, experimental, iso, bits, mib_identifier, integer32, gauge32, ip_address, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'ModuleIdentity', 'TimeTicks', 'Counter32', 'Counter64', 'NotificationType', 'Unsigned32', 'experimental', 'iso', 'Bits', 'MibIdentifier', 'Integer32', 'Gauge32', 'IpAddress', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity') (display_string, row_status, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'RowStatus', 'TextualConvention') scsp_atmarp_mib = module_identity((1, 3, 6, 1, 3, 2002)) if mibBuilder.loadTexts: scspAtmarpMIB.setLastUpdated('9808020000Z') if mibBuilder.loadTexts: scspAtmarpMIB.setOrganization('IETF Internetworking Over NBMA Working Group (ion)') if mibBuilder.loadTexts: scspAtmarpMIB.setContactInfo('Jim Luciani (jliciani@BayNetworks.com Bay Networks Cliff X. Wang (cliff_wang@vnet.ibm.com) Colin Verrilli (verrilli@vnet.ibm.com) IBM Corp.') if mibBuilder.loadTexts: scspAtmarpMIB.setDescription('This module defines a portion of the management information base (MIB) for managing Server Cache Synchronizatio protocol applied to ATMARP servers.') scsp_atmarp_objects = mib_identifier((1, 3, 6, 1, 3, 2002, 1)) scsp_atmarp_notifications = mib_identifier((1, 3, 6, 1, 3, 2002, 2)) scsp_atmarp_conformance = mib_identifier((1, 3, 6, 1, 3, 2002, 3)) scsp_atmarp_server_group_table = mib_table((1, 3, 6, 1, 3, 2002, 1, 1)) if mibBuilder.loadTexts: scspAtmarpServerGroupTable.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupTable.setDescription('The objects defined in this table are used to for the management of SCSP server groups with application to IP over ATM operation (Classic IP). These objects SHOULD be used along with the protocol independent part objects to support the management of the SCSP protocol applied to synchronizing the atmarp servers in a LIS. There is one entry in this table for each server group. In the case of IP over ATM, each server group corresponds to a Logical IP Subnet.') scsp_atmarp_server_group_entry = mib_table_row((1, 3, 6, 1, 3, 2002, 1, 1, 1)).setIndexNames((0, 'SCSP-MIB', 'scspServerGroupID'), (0, 'SCSP-MIB', 'scspServerGroupPID')) if mibBuilder.loadTexts: scspAtmarpServerGroupEntry.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupEntry.setDescription('Information about SCSP server group running IP over ATM operation. This table is indexed by scspServerGroupID and scspServerGroupPID. The two indeces point to a corresponding entry in the scspServerGroupTable.') scsp_atmarp_server_group_net_mask = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 1, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpServerGroupNetMask.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupNetMask.setDescription('The subnet mask associated with this Server Group.') scsp_atmarp_server_group_subnet_addr = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 1, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpServerGroupSubnetAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupSubnetAddr.setDescription('The IP subnet address associated with this Server Group.') scsp_atmarp_server_group_row_status = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 1, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: scspAtmarpServerGroupRowStatus.setReference("RFC 1903, 'Textual Conventions for version 2 of the Simple Network Management Protocol (SNMPv2).'") if mibBuilder.loadTexts: scspAtmarpServerGroupRowStatus.setStatus('current') if mibBuilder.loadTexts: scspAtmarpServerGroupRowStatus.setDescription('This object allows Atmarp Server Group Table entries to be created and deleted from the scspAtmarpServerGroupTable. Note that scspAtmarpServerGroupTable entry creation and deletion is coupled with scspServerGroupTable entry creation and deletion. A scspAtmarpServerGroupTable entry cannot be created until its corresponding scspServerGroupTable entry is created. When a scspServerGroupTable entry is deleted, it also removes the corresponding scspAtmarpServerGroupTable entry.') scsp_atmarp_ls_table = mib_table((1, 3, 6, 1, 3, 2002, 1, 2)) if mibBuilder.loadTexts: scspAtmarpLSTable.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSTable.setDescription('The objects defined in this table are used to for the management of the Atmarp Local server in a SCSP server group for IP over ATM operation. These objects SHOULD be used along with the protocol independent part objects to support the management of the SCSP protocol applied to synchronizing the IP over ATM servers.') scsp_atmarp_ls_entry = mib_table_row((1, 3, 6, 1, 3, 2002, 1, 2, 1)).setIndexNames((0, 'SCSP-MIB', 'scspServerGroupID'), (0, 'SCSP-MIB', 'scspServerGroupPID'), (0, 'SCSP-MIB', 'scspLSID')) if mibBuilder.loadTexts: scspAtmarpLSEntry.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSEntry.setDescription('Information about Atmarp Local Server in a SCSP server group. This table is indexed by scspServerGroupID, scspServerGroupPID, and scspLSID. The three indeces point to a corresponding entry in the scspLSTable.') scsp_atmarp_lslsip_addr = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 2, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpLSLSIPAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSLSIPAddr.setDescription('The IP address of the Atmarp Local Server. Since an Atmarp server does not have to be assigned an IP address, this object is optional.') scsp_atmarp_lsls_atm_addr = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 2, 1, 2), atm_addr()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpLSLSAtmAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSLSAtmAddr.setDescription('The ATM address of the Atmarp Local Server.') scsp_atmarp_ls_row_status = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 2, 1, 3), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: scspAtmarpLSRowStatus.setStatus('current') if mibBuilder.loadTexts: scspAtmarpLSRowStatus.setDescription('This object allows Atmarp Local Server Table entries to be created and deleted from the scspAtmarpLSTable. Note that scspAtmarpLSTable entry creation and deletion is coupled with scspLSTable entry creation and deletion. A scspAtmarpLSTable entry cannot be created until its corresponding scspLSTable entry is created. When a scspLSTable entry is deleted, it also removes the corresponding scspAtmarpLSTable entry.') scsp_atmarp_peer_table = mib_table((1, 3, 6, 1, 3, 2002, 1, 3)) if mibBuilder.loadTexts: scspAtmarpPeerTable.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerTable.setDescription('The objects defined in this table are used to for the management of the ATMARP sever peers.') scsp_atmarp_peer_entry = mib_table_row((1, 3, 6, 1, 3, 2002, 1, 3, 1)).setIndexNames((0, 'SCSP-MIB', 'scspServerGroupID'), (0, 'SCSP-MIB', 'scspServerGroupPID'), (0, 'SCSPATMARP-MIB', 'scspAtmarpPeerIndex')) if mibBuilder.loadTexts: scspAtmarpPeerEntry.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerEntry.setDescription('Information about each peer ATMARP server participated in the scsp Server group. The table is indexed by scspServerGroupID, scspServerGroupPID, and scspAtmarpPeerIndex.') scsp_atmarp_peer_index = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 3, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpPeerIndex.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerIndex.setDescription('The table index of the peer Atmarp server table.') scsp_atmarp_peer_ip_addr = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 3, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpPeerIPAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerIPAddr.setDescription('The IP address of the peer Atmarp server. Since an Atmarp server does not have to be assigned an IP address, this object is optional.') scsp_atmarp_peer_atm_addr = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 3, 1, 3), atm_addr()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpPeerAtmAddr.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerAtmAddr.setDescription("The ATM address of the Peer. If SVC is used between LS and Peer, Peer's ATM address should be valid. However, if PVC is used instead SVC, the Peer's ATM address may be a Null OCTET STRING.") scsp_atmarp_peer_vc_type = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 3, 1, 4), atm_conn_kind()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpPeerVCType.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerVCType.setDescription('The type of the virtual circuit between LS and Peer.') scsp_atmarp_peer_vpi = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 3, 1, 5), scspvpi_integer()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpPeerVPI.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerVPI.setDescription('The VPI value for the virtual circuit between LS and Peer.') scsp_atmarp_peer_vci = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 3, 1, 6), scspvci_integer()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpPeerVCI.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerVCI.setDescription('The VCI value for the virtual circuit between LS and Peer.') scsp_atmarp_peer_dcsid = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 3, 1, 7), octet_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readonly') if mibBuilder.loadTexts: scspAtmarpPeerDCSID.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerDCSID.setDescription('The DCS ID for this peer. When the peer tabel is created, DCS ID may not have been discovered. Tt is set to a Null string. It will be update when the DCS ID associated with this peer (ATM address) is discovered.') scsp_atmarp_peer_row_status = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 3, 1, 8), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: scspAtmarpPeerRowStatus.setReference("RFC 1903, 'Textual Conventions for version 2 of the Simple Network Management Protocol (SNMPv2).'") if mibBuilder.loadTexts: scspAtmarpPeerRowStatus.setStatus('current') if mibBuilder.loadTexts: scspAtmarpPeerRowStatus.setDescription('This object allows Atmarp Peer table entries to be created and deleted from the scspAtmarpPeerTable. Note that scspAtmarpPeerTable entry is created when a peer is configured loaclly or when a peer not previously configured connects to LS.') scsp_atmarp_hfsm_table = mib_table((1, 3, 6, 1, 3, 2002, 1, 4)) if mibBuilder.loadTexts: scspAtmarpHFSMTable.setStatus('current') if mibBuilder.loadTexts: scspAtmarpHFSMTable.setDescription('The objects defined in this table are used to for the management of the HFSM between the LS and the DCS.') scsp_atmarp_hfsm_entry = mib_table_row((1, 3, 6, 1, 3, 2002, 1, 4, 1)).setIndexNames((0, 'SCSP-MIB', 'scspServerGroupID'), (0, 'SCSP-MIB', 'scspServerGroupPID'), (0, 'SCSPATMARP-MIB', 'scspAtmarpPeerIndex')) if mibBuilder.loadTexts: scspAtmarpHFSMEntry.setStatus('current') if mibBuilder.loadTexts: scspAtmarpHFSMEntry.setDescription('Information about SCSP HFSM session between the LS and its HFSMs. The table is indexed by scspServerGroupID, scspServerGroupPID, and scspAtmarpPeerIndex.') scsp_hfsmhfsm_state = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 4, 1, 1), scsp_hfsm_state_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspHFSMHFSMState.setReference('SCSP draft, Section 2.1') if mibBuilder.loadTexts: scspHFSMHFSMState.setStatus('current') if mibBuilder.loadTexts: scspHFSMHFSMState.setDescription('The current state of the Hello Finite State Machine. The allowable states are: down(1), waiting(2), uniConn(3), biConn(4).') scsp_hfsm_hello_in = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 4, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspHFSMHelloIn.setStatus('current') if mibBuilder.loadTexts: scspHFSMHelloIn.setDescription("The number of 'Hello' messages received from this HFSM.") scsp_hfsm_hello_out = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 4, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspHFSMHelloOut.setStatus('current') if mibBuilder.loadTexts: scspHFSMHelloOut.setDescription("The number of 'Hello' messages sent from LS to this HFSM.") scsp_hfsm_hello_invalid_in = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 4, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: scspHFSMHelloInvalidIn.setStatus('current') if mibBuilder.loadTexts: scspHFSMHelloInvalidIn.setDescription("The number of invalid 'Hello' messages received from this HFSM. Possible message errors include: Hello message when the HFSM is in 'Down' state; Hello message is too short to contain the number of Receiver ID records specified in the header, etc. Other common errors include failed authentication if applicable, errors in the message fields, etc.") scsp_hfsm_hello_interval = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 4, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readcreate') if mibBuilder.loadTexts: scspHFSMHelloInterval.setStatus('current') if mibBuilder.loadTexts: scspHFSMHelloInterval.setDescription('This object contains the value for HelloInterval with the associated HFSM. It is the time (in seconds) between sending of consecutive Hello messages from the HFSM.') scsp_hfsm_dead_factor = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 4, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readcreate') if mibBuilder.loadTexts: scspHFSMDeadFactor.setStatus('current') if mibBuilder.loadTexts: scspHFSMDeadFactor.setDescription("This object contains the value for DeadFactor with this associated server. The DeadFactor along with HelloInterval are contained in 'Hello' messages sent from this HFSM. If 'Hello' messages are not received from this HFSM within the time out interval 'HelloInterval*DeadFactor' (in seconds), then the HFSM MUST be considered to be stalled.") scsp_hfsm_family_id = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 4, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: scspHFSMFamilyID.setReference('SCSP draft, Sec.2 and Sec. B.2.5') if mibBuilder.loadTexts: scspHFSMFamilyID.setStatus('current') if mibBuilder.loadTexts: scspHFSMFamilyID.setDescription('The family ID is used to refer an aggregate of Protocol ID/SGID pairs. Only a single HFSM is run for all Protocol ID/SGID pairs assigned to a Family ID. When the HFSM is not shared by an aggregate of Protocol ID/SGID pairs, this object should be set to 0.') scsp_atmarp_hfsm_row_status = mib_table_column((1, 3, 6, 1, 3, 2002, 1, 4, 1, 8), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: scspAtmarpHFSMRowStatus.setReference("RFC 1903, 'Textual Conventions for version 2 of the Simple Network Management Protocol (SNMPv2).'") if mibBuilder.loadTexts: scspAtmarpHFSMRowStatus.setStatus('current') if mibBuilder.loadTexts: scspAtmarpHFSMRowStatus.setDescription('This object allows Atmarp HFSM table entries to be created and deleted from the scspAtmarpHFSMTable. Note that scspAtmarpHFSMTable entry creation and deletion is closely coupled with scspHFSMTable entry creation. A scspAtmarpHFSMTable entry cannot be created until its corresponding scspHFSMTable entry is created. When a scspHFSMTable entry is deleted, it also removes the corresponding scspAtmarpHFSMTable entry.') scsp_hfsm_down = notification_type((1, 3, 6, 1, 3, 2002, 2, 1)).setObjects(('SCSP-MIB', 'scspServerGroupID'), ('SCSP-MIB', 'scspServerGroupPID'), ('SCSPATMARP-MIB', 'scspAtmarpPeerIndex')) if mibBuilder.loadTexts: scspHFSMDown.setStatus('current') if mibBuilder.loadTexts: scspHFSMDown.setDescription("The Hello Finite State Machine associated with this LS/DCS pair enters 'Down' state.") scsp_hfsm_waiting = notification_type((1, 3, 6, 1, 3, 2002, 2, 2)).setObjects(('SCSP-MIB', 'scspServerGroupID'), ('SCSP-MIB', 'scspServerGroupPID'), ('SCSPATMARP-MIB', 'scspAtmarpPeerIndex')) if mibBuilder.loadTexts: scspHFSMWaiting.setStatus('current') if mibBuilder.loadTexts: scspHFSMWaiting.setDescription("The Hello Finite State Machine associated with this LS/DCS pair enters 'Waiting' state.") scsp_hfsm_bi_conn = notification_type((1, 3, 6, 1, 3, 2002, 2, 3)).setObjects(('SCSP-MIB', 'scspServerGroupID'), ('SCSP-MIB', 'scspServerGroupPID'), ('SCSPATMARP-MIB', 'scspAtmarpPeerIndex')) if mibBuilder.loadTexts: scspHFSMBiConn.setStatus('current') if mibBuilder.loadTexts: scspHFSMBiConn.setDescription("The Hello Finite State Machine associated with this LS/DCS pair enters 'Bidirectional connection' state.") scsp_atmarp_compliances = mib_identifier((1, 3, 6, 1, 3, 2002, 3, 1)) scsp_atmarp_groups = mib_identifier((1, 3, 6, 1, 3, 2002, 3, 2)) scsp_atmarp_compliance = module_compliance((1, 3, 6, 1, 3, 2002, 3, 1, 1)).setObjects(('SCSPATMARP-MIB', 'scspAtmarpGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): scsp_atmarp_compliance = scspAtmarpCompliance.setStatus('current') if mibBuilder.loadTexts: scspAtmarpCompliance.setDescription('The compliance statement for entities that are required for the management of SCSP when applied to ATMARP servers.') scsp_atmarp_group = object_group((1, 3, 6, 1, 3, 2002, 3, 2, 1)).setObjects(('SCSPATMARP-MIB', 'scspAtmarpServerGroupNetMask'), ('SCSPATMARP-MIB', 'scspAtmarpServerGroupSubnetAddr'), ('SCSPATMARP-MIB', 'scspAtmarpLSLSIPAddr'), ('SCSPATMARP-MIB', 'scspAtmarpLSLSAtmAddr'), ('SCSPATMARP-MIB', 'scspAtmarpPeerIndex'), ('SCSPATMARP-MIB', 'scspAtmarpPeerAtmAddr'), ('SCSPATMARP-MIB', 'scspAtmarpPeerVCType'), ('SCSPATMARP-MIB', 'scspAtmarpPeerVPI'), ('SCSPATMARP-MIB', 'scspAtmarpPeerVCI'), ('SCSPATMARP-MIB', 'scspAtmarpPeerDCSID'), ('SCSPATMARP-MIB', 'scspHFSMHFSMState'), ('SCSPATMARP-MIB', 'scspHFSMHelloIn'), ('SCSPATMARP-MIB', 'scspHFSMHelloOut'), ('SCSPATMARP-MIB', 'scspHFSMHelloInvalidIn'), ('SCSPATMARP-MIB', 'scspHFSMHelloInterval'), ('SCSPATMARP-MIB', 'scspHFSMDeadFactor'), ('SCSPATMARP-MIB', 'scspHFSMFamilyID')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): scsp_atmarp_group = scspAtmarpGroup.setStatus('current') if mibBuilder.loadTexts: scspAtmarpGroup.setDescription('This group is mandatory when Atmarp is the client/server protocol running SCSP.') mibBuilder.exportSymbols('SCSPATMARP-MIB', scspAtmarpObjects=scspAtmarpObjects, scspHFSMHelloOut=scspHFSMHelloOut, scspHFSMWaiting=scspHFSMWaiting, scspAtmarpGroups=scspAtmarpGroups, scspAtmarpPeerVCI=scspAtmarpPeerVCI, scspAtmarpCompliance=scspAtmarpCompliance, scspAtmarpConformance=scspAtmarpConformance, scspAtmarpLSRowStatus=scspAtmarpLSRowStatus, scspAtmarpServerGroupNetMask=scspAtmarpServerGroupNetMask, scspAtmarpPeerRowStatus=scspAtmarpPeerRowStatus, scspAtmarpHFSMTable=scspAtmarpHFSMTable, scspAtmarpPeerDCSID=scspAtmarpPeerDCSID, scspAtmarpServerGroupEntry=scspAtmarpServerGroupEntry, scspAtmarpPeerTable=scspAtmarpPeerTable, scspAtmarpLSLSAtmAddr=scspAtmarpLSLSAtmAddr, scspHFSMFamilyID=scspHFSMFamilyID, scspAtmarpServerGroupTable=scspAtmarpServerGroupTable, scspAtmarpLSTable=scspAtmarpLSTable, scspHFSMDeadFactor=scspHFSMDeadFactor, scspHFSMHelloInterval=scspHFSMHelloInterval, scspAtmarpLSEntry=scspAtmarpLSEntry, scspAtmarpPeerEntry=scspAtmarpPeerEntry, scspHFSMHFSMState=scspHFSMHFSMState, scspAtmarpLSLSIPAddr=scspAtmarpLSLSIPAddr, scspAtmarpPeerAtmAddr=scspAtmarpPeerAtmAddr, scspHFSMHelloIn=scspHFSMHelloIn, scspAtmarpGroup=scspAtmarpGroup, scspAtmarpNotifications=scspAtmarpNotifications, scspAtmarpServerGroupRowStatus=scspAtmarpServerGroupRowStatus, scspAtmarpMIB=scspAtmarpMIB, scspAtmarpHFSMEntry=scspAtmarpHFSMEntry, scspAtmarpPeerIndex=scspAtmarpPeerIndex, PYSNMP_MODULE_ID=scspAtmarpMIB, scspAtmarpServerGroupSubnetAddr=scspAtmarpServerGroupSubnetAddr, scspHFSMHelloInvalidIn=scspHFSMHelloInvalidIn, scspHFSMBiConn=scspHFSMBiConn, scspAtmarpHFSMRowStatus=scspAtmarpHFSMRowStatus, scspAtmarpPeerVCType=scspAtmarpPeerVCType, scspAtmarpPeerIPAddr=scspAtmarpPeerIPAddr, scspAtmarpCompliances=scspAtmarpCompliances, scspHFSMDown=scspHFSMDown, scspAtmarpPeerVPI=scspAtmarpPeerVPI)
# coding=utf-8 __author__ = 'lxn3032' class ControllerBase(object): def __init__(self, period, ValueType=float): self.ValueType = ValueType self.T = period self.error_1 = ValueType(0) self.error_2 = ValueType(0) self.current_value = ValueType(0) self.target_value = ValueType(0) def delta_closed_loop_gain(self, feedback): raise NotImplementedError def close_loop_gain(self, feedback): raise NotImplementedError def set_target_value(self, val): self.target_value = val def get_current_value(self): return self.current_value def reset_errors(self): self.error_1 = self.error_2 = self.ValueType(0) class PIDController(ControllerBase): def __init__(self, period, Kp=1, Ki=0, Kd=0, ValueType=float): super(PIDController, self).__init__(period, ValueType) self.Kp = Kp self.Ki = Ki self.Kd = Kd self.sum_error = ValueType(0) def delta_closed_loop_gain(self, feedback): self.current_value = feedback error = self.target_value - self.current_value d_error = error - self.error_1 d2_error = error - 2 * self.error_1 + self.error_2 delta_output = self.Kp * d_error + self.Ki * error + self.Kd * d2_error self.error_2 = self.error_1 self.error_1 = error return delta_output def closed_loop_gain(self, feedback): self.current_value = feedback error = self.target_value - self.current_value self.sum_error += error d_error = error - self.error_1 output = self.Kp * error + self.Ki * self.sum_error + self.Kd * d_error self.error_2 = self.error_1 self.error_1 = error return output
__author__ = 'lxn3032' class Controllerbase(object): def __init__(self, period, ValueType=float): self.ValueType = ValueType self.T = period self.error_1 = value_type(0) self.error_2 = value_type(0) self.current_value = value_type(0) self.target_value = value_type(0) def delta_closed_loop_gain(self, feedback): raise NotImplementedError def close_loop_gain(self, feedback): raise NotImplementedError def set_target_value(self, val): self.target_value = val def get_current_value(self): return self.current_value def reset_errors(self): self.error_1 = self.error_2 = self.ValueType(0) class Pidcontroller(ControllerBase): def __init__(self, period, Kp=1, Ki=0, Kd=0, ValueType=float): super(PIDController, self).__init__(period, ValueType) self.Kp = Kp self.Ki = Ki self.Kd = Kd self.sum_error = value_type(0) def delta_closed_loop_gain(self, feedback): self.current_value = feedback error = self.target_value - self.current_value d_error = error - self.error_1 d2_error = error - 2 * self.error_1 + self.error_2 delta_output = self.Kp * d_error + self.Ki * error + self.Kd * d2_error self.error_2 = self.error_1 self.error_1 = error return delta_output def closed_loop_gain(self, feedback): self.current_value = feedback error = self.target_value - self.current_value self.sum_error += error d_error = error - self.error_1 output = self.Kp * error + self.Ki * self.sum_error + self.Kd * d_error self.error_2 = self.error_1 self.error_1 = error return output
{ "cells": [ { "cell_type": "code", "execution_count": 20, "id": "informative-england", "metadata": {}, "outputs": [], "source": [ "### This is the interworkings and mathematics behind the equity models\n", "\n", "### Gordon (Constant) Growth Model module ###\n", "def Gordongrowth(dividend, costofequity, growthrate):\n", " price = dividend / (costofequity - growthrate)\n", " price1 = round(price * .95, 2)\n", " price2 = round(price * 1.05, 2)\n", " print(f\"Based on the Gordon Growth Model, this stock's price is valued between: {price1} and {price2}.\")\n", " \n", "### One Year Holding Perid\n", "def oneyearmodel(saleprice, dividend, costofequity):\n", " price = (dividend + saleprice) / (1 + costofequity)\n", " price1 = round(price * .95, 2)\n", " price2 = round(price * 1.05, 2)\n", " print(f\"Based on the One Year Holding Model, this stock's price is valued between: {price1} and {price2}.\")\n", "\n", "### Multi-Stage (Double Year Holding Period) Dividend Discount Model module ###\n", "def doubleyearmodel(saleprice, dividend1, dividend2, costofequity):\n", " price = (dividend1 / (1 + costofequity)) + (dividend2 / (1 + costofequity)**2) + (saleprice / (1 + costofequity)**2)\n", " price1 = round(price * .95, 2)\n", " price2 = round(price * 1.05, 2)\n", " print(f\"Based on the Two Year Holding Model, this stock's price is valued between: {price1} and {price2}.\")" ] }, { "cell_type": "code", "execution_count": 25, "id": "postal-title", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Based on the Gordon Growth Model, this stock's price is valued between: 158.33 and 175.0.\n" ] } ], "source": [ "Gordongrowth(5, .08, 0.05)" ] }, { "cell_type": "code", "execution_count": 26, "id": "thrown-length", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Based on the Two Year Holding Model, this stock's price is valued between: 194.09 and 214.52.\n" ] } ], "source": [ "doubleyearmodel(200, 5, 20,.05)" ] }, { "cell_type": "code", "execution_count": 27, "id": "hungarian-symbol", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Based on the One Year Holding Model, this stock's price is valued between: 185.48 and 205.0.\n" ] } ], "source": [ "oneyearmodel(200, 5, .05)" ] }, { "cell_type": "code", "execution_count": 24, "id": "impossible-coral", "metadata": {}, "outputs": [ { "ename": "TypeError", "evalue": "oneyearmodel() missing 1 required positional argument: 'costofequity'", "output_type": "error", "traceback": [ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m", "\u001b[1;31mTypeError\u001b[0m Traceback (most recent call last)", "\u001b[1;32m<ipython-input-24-e0f7cbe98c62>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0moneyearmodel\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;36m2\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;36m4\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m", "\u001b[1;31mTypeError\u001b[0m: oneyearmodel() missing 1 required positional argument: 'costofequity'" ] } ], "source": [ "oneyearmodel(2,4)" ] }, { "cell_type": "code", "execution_count": null, "id": "binary-glass", "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.9.1" } }, "nbformat": 4, "nbformat_minor": 5 }
{'cells': [{'cell_type': 'code', 'execution_count': 20, 'id': 'informative-england', 'metadata': {}, 'outputs': [], 'source': ['### This is the interworkings and mathematics behind the equity models\n', '\n', '### Gordon (Constant) Growth Model module ###\n', 'def Gordongrowth(dividend, costofequity, growthrate):\n', ' price = dividend / (costofequity - growthrate)\n', ' price1 = round(price * .95, 2)\n', ' price2 = round(price * 1.05, 2)\n', ' print(f"Based on the Gordon Growth Model, this stock\'s price is valued between: {price1} and {price2}.")\n', ' \n', '### One Year Holding Perid\n', 'def oneyearmodel(saleprice, dividend, costofequity):\n', ' price = (dividend + saleprice) / (1 + costofequity)\n', ' price1 = round(price * .95, 2)\n', ' price2 = round(price * 1.05, 2)\n', ' print(f"Based on the One Year Holding Model, this stock\'s price is valued between: {price1} and {price2}.")\n', '\n', '### Multi-Stage (Double Year Holding Period) Dividend Discount Model module ###\n', 'def doubleyearmodel(saleprice, dividend1, dividend2, costofequity):\n', ' price = (dividend1 / (1 + costofequity)) + (dividend2 / (1 + costofequity)**2) + (saleprice / (1 + costofequity)**2)\n', ' price1 = round(price * .95, 2)\n', ' price2 = round(price * 1.05, 2)\n', ' print(f"Based on the Two Year Holding Model, this stock\'s price is valued between: {price1} and {price2}.")']}, {'cell_type': 'code', 'execution_count': 25, 'id': 'postal-title', 'metadata': {}, 'outputs': [{'name': 'stdout', 'output_type': 'stream', 'text': ["Based on the Gordon Growth Model, this stock's price is valued between: 158.33 and 175.0.\n"]}], 'source': ['Gordongrowth(5, .08, 0.05)']}, {'cell_type': 'code', 'execution_count': 26, 'id': 'thrown-length', 'metadata': {}, 'outputs': [{'name': 'stdout', 'output_type': 'stream', 'text': ["Based on the Two Year Holding Model, this stock's price is valued between: 194.09 and 214.52.\n"]}], 'source': ['doubleyearmodel(200, 5, 20,.05)']}, {'cell_type': 'code', 'execution_count': 27, 'id': 'hungarian-symbol', 'metadata': {}, 'outputs': [{'name': 'stdout', 'output_type': 'stream', 'text': ["Based on the One Year Holding Model, this stock's price is valued between: 185.48 and 205.0.\n"]}], 'source': ['oneyearmodel(200, 5, .05)']}, {'cell_type': 'code', 'execution_count': 24, 'id': 'impossible-coral', 'metadata': {}, 'outputs': [{'ename': 'TypeError', 'evalue': "oneyearmodel() missing 1 required positional argument: 'costofequity'", 'output_type': 'error', 'traceback': ['\x1b[1;31m---------------------------------------------------------------------------\x1b[0m', '\x1b[1;31mTypeError\x1b[0m Traceback (most recent call last)', '\x1b[1;32m<ipython-input-24-e0f7cbe98c62>\x1b[0m in \x1b[0;36m<module>\x1b[1;34m\x1b[0m\n\x1b[1;32m----> 1\x1b[1;33m \x1b[0moneyearmodel\x1b[0m\x1b[1;33m(\x1b[0m\x1b[1;36m2\x1b[0m\x1b[1;33m,\x1b[0m\x1b[1;36m4\x1b[0m\x1b[1;33m)\x1b[0m\x1b[1;33m\x1b[0m\x1b[1;33m\x1b[0m\x1b[0m\n\x1b[0m', "\x1b[1;31mTypeError\x1b[0m: oneyearmodel() missing 1 required positional argument: 'costofequity'"]}], 'source': ['oneyearmodel(2,4)']}, {'cell_type': 'code', 'execution_count': null, 'id': 'binary-glass', '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.9.1'}}, 'nbformat': 4, 'nbformat_minor': 5}
class SYCSException(Exception): pass class CredentialsException(SYCSException): def __init__(self): super(SYCSException, self).__init__('username or password not provided.') class InvalidCredentialsException(SYCSException): def __init__(self): super(SYCSException, self).__init__('wrong username or password.') class WrongRangeException(SYCSException): def __init__(self): super(SYCSException, self).__init__("start or end must be equal or greater than 1 and start must be equal or " "lower than end") class ForbiddenException(SYCSException): def __init__(self): super(SYCSException, self).__init__("access forbidden, perhaps unpaid subscription o_0 ?") class CourseNotFoundException(SYCSException): def __init__(self): super(SYCSException, self).__init__("invalid course") class TooManyException(SYCSException): def __init__(self): super(SYCSException, self).__init__("on auth server response: too many, slow down the process")
class Sycsexception(Exception): pass class Credentialsexception(SYCSException): def __init__(self): super(SYCSException, self).__init__('username or password not provided.') class Invalidcredentialsexception(SYCSException): def __init__(self): super(SYCSException, self).__init__('wrong username or password.') class Wrongrangeexception(SYCSException): def __init__(self): super(SYCSException, self).__init__('start or end must be equal or greater than 1 and start must be equal or lower than end') class Forbiddenexception(SYCSException): def __init__(self): super(SYCSException, self).__init__('access forbidden, perhaps unpaid subscription o_0 ?') class Coursenotfoundexception(SYCSException): def __init__(self): super(SYCSException, self).__init__('invalid course') class Toomanyexception(SYCSException): def __init__(self): super(SYCSException, self).__init__('on auth server response: too many, slow down the process')
def solution(A, B, s): A.sort() B.sort() i = len(A) - 1 j = len(B) - 1 while 0 <= j <= len(B) - 1 and i: pass
def solution(A, B, s): A.sort() B.sort() i = len(A) - 1 j = len(B) - 1 while 0 <= j <= len(B) - 1 and i: pass
a = int(input()) for i in range(1, a+1): if a % i == 0: print(i)
a = int(input()) for i in range(1, a + 1): if a % i == 0: print(i)
class When_we_have_a_test: @classmethod def examples(cls): yield 1 yield 3 def when_things_happen(self): pass def it_should_do_this_test(self, arg): assert arg < 3
class When_We_Have_A_Test: @classmethod def examples(cls): yield 1 yield 3 def when_things_happen(self): pass def it_should_do_this_test(self, arg): assert arg < 3
class Solution: def validTree(self, n: int, edges: list[list[int]]) -> bool: if not n: return True adj = {i: [] for i in range(n)} for n1, n2 in edges: adj[n1].append(n2) adj[n2].append(n1) visit = set() def dfs(i, prev): if i in visit: return False visit.add(i) for j in adj[i]: if j == prev: continue if not dfs(j, i): return False return True return dfs(0, -1) and n == len(visit)
class Solution: def valid_tree(self, n: int, edges: list[list[int]]) -> bool: if not n: return True adj = {i: [] for i in range(n)} for (n1, n2) in edges: adj[n1].append(n2) adj[n2].append(n1) visit = set() def dfs(i, prev): if i in visit: return False visit.add(i) for j in adj[i]: if j == prev: continue if not dfs(j, i): return False return True return dfs(0, -1) and n == len(visit)
def get_accounts_for_path(client, path): ou = client.convert_path_to_ou(path) response = client.list_children_nested(ParentId=ou, ChildType="ACCOUNT") return ",".join([r.get("Id") for r in response]) # Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 macros = {"get_accounts_for_path": get_accounts_for_path}
def get_accounts_for_path(client, path): ou = client.convert_path_to_ou(path) response = client.list_children_nested(ParentId=ou, ChildType='ACCOUNT') return ','.join([r.get('Id') for r in response]) macros = {'get_accounts_for_path': get_accounts_for_path}
# Busiest Time in The Mall def find_busiest_period(data): peak_time = peak_vis = cur_vis = i = 0 while i < len(data): time, v, enter = data[i] cur_vis += v if enter else -v if i == len(data)-1 or time != data[i+1][0]: if cur_vis > peak_vis: peak_vis = cur_vis peak_time = time i += 1 return peak_time
def find_busiest_period(data): peak_time = peak_vis = cur_vis = i = 0 while i < len(data): (time, v, enter) = data[i] cur_vis += v if enter else -v if i == len(data) - 1 or time != data[i + 1][0]: if cur_vis > peak_vis: peak_vis = cur_vis peak_time = time i += 1 return peak_time
def test__delete__401_when_no_auth_headers(client): r = client.delete('/themes/1') assert r.status_code == 401, r.get_json() def test__delete__401_when_incorrect_auth(client, faker): r = client.delete('/themes/1', headers={ 'Authentication': 'some_incorrect_token'}) assert r.status_code == 401, r.get_json() # TODO # def test__delete__403_when_incorrect_role(client, faker): # r = client.delete('/themes/1', headers={ # 'Authentication': 'some_incorrect_token'}) # assert r.status_code == 401, r.get_json()
def test__delete__401_when_no_auth_headers(client): r = client.delete('/themes/1') assert r.status_code == 401, r.get_json() def test__delete__401_when_incorrect_auth(client, faker): r = client.delete('/themes/1', headers={'Authentication': 'some_incorrect_token'}) assert r.status_code == 401, r.get_json()
# Python 3.8.3 with open("input.txt", "r") as f: puzzle_input = [int(i) for i in f.read().split()] def fuel_needed(mass): fuel = mass // 3 - 2 return fuel + fuel_needed(fuel) if fuel > 0 else 0 sum = 0 for mass in puzzle_input: sum += fuel_needed(mass) print(sum)
with open('input.txt', 'r') as f: puzzle_input = [int(i) for i in f.read().split()] def fuel_needed(mass): fuel = mass // 3 - 2 return fuel + fuel_needed(fuel) if fuel > 0 else 0 sum = 0 for mass in puzzle_input: sum += fuel_needed(mass) print(sum)
# Date: 2020/11/12 # Author: Luis Marquez # Description: # This is a simple program in which the binary search will be implemented to calculate a square root result # #BINARY_SEARCH(): This function realize a binary search def binary_search(): #objective: The number in which the root will be calculated objective = int(input(f"\nType a number: ")) print(f"\n") #epilson: Margin of error epsilon = 0.01 #low: The lowest number of the current binary search range low = 0.0 #high: The highest number of the currente binary search range high = max(1.0, objective) #answer: answer = ((high + low)/(2)) #while: on this wile we will do a walk throught, cutting the numerical set in half while (abs(answer**2 - objective) >= (epsilon)): print(f"Low={round(low, 2)} \t high={round(high, 2)} \t Answer={round(answer, 2)}\n") if (answer**2 < objective): low = answer else: high = answer answer = ((high + low)/(2)) #printing the answer print(f"The square root of {objective} is {answer}") #RUN(): On this function the program run def run(): binary_search() #MAIN: Main function if __name__ == "__main__": run()
def binary_search(): objective = int(input(f'\nType a number: ')) print(f'\n') epsilon = 0.01 low = 0.0 high = max(1.0, objective) answer = (high + low) / 2 while abs(answer ** 2 - objective) >= epsilon: print(f'Low={round(low, 2)} \t high={round(high, 2)} \t Answer={round(answer, 2)}\n') if answer ** 2 < objective: low = answer else: high = answer answer = (high + low) / 2 print(f'The square root of {objective} is {answer}') def run(): binary_search() if __name__ == '__main__': run()
class Config(object): DESCRIPTION = 'Mock generator for c code' VERSION = '0.5' AUTHOR = 'Freddy Hurkmans' LICENSE = 'BSD 3-Clause' # set defaults for parameters verbose = False max_nr_function_calls = '25' charstar_is_input_string = False UNITY_INCLUDE = '#include "unity.h"' # CUSTOM_INCLUDES = ['#include "resource_detector.h"'] CUSTOM_INCLUDES = [] # List of all supported c types and the matching unity ASSERT macro's # If these types have different sizes on your system, you can simply # correct the macros. If you have missing types, you can simply add # your type/macro pairs CTYPE_TO_UNITY_ASSERT_MACRO = [ ['char', 'TEST_ASSERT_EQUAL_INT8_MESSAGE'], ['signed char', 'TEST_ASSERT_EQUAL_INT8_MESSAGE'], ['unsigned char', 'TEST_ASSERT_EQUAL_UINT8_MESSAGE'], ['short', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['short int', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['signed short', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['signed short int', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['unsigned short', 'TEST_ASSERT_EQUAL_UINT16_MESSAGE'], ['unsigned short int', 'TEST_ASSERT_EQUAL_UINT16_MESSAGE'], ['int', 'TEST_ASSERT_EQUAL_INT_MESSAGE'], ['signed int', 'TEST_ASSERT_EQUAL_INT_MESSAGE'], ['unsigned', 'TEST_ASSERT_EQUAL_UINT_MESSAGE'], ['unsigned int', 'TEST_ASSERT_EQUAL_UINT_MESSAGE'], ['long', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['long int', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['signed long', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['signed long int', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['unsigned long', 'TEST_ASSERT_EQUAL_UINT64_MESSAGE'], ['unsigned long int', 'TEST_ASSERT_EQUAL_UINT64_MESSAGE'], ['float', 'TEST_ASSERT_EQUAL_FLOAT_MESSAGE'], ['double', 'TEST_ASSERT_EQUAL_FLOAT_MESSAGE'], ['long double', 'TEST_ASSERT_EQUAL_FLOAT_MESSAGE'], ['int8_t', 'TEST_ASSERT_EQUAL_INT8_MESSAGE'], ['int16_t', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['int32_t', 'TEST_ASSERT_EQUAL_INT32_MESSAGE'], ['int64_t', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['uint8_t', 'TEST_ASSERT_EQUAL_UINT8_MESSAGE'], ['uint16_t', 'TEST_ASSERT_EQUAL_UINT16_MESSAGE'], ['uint32_t', 'TEST_ASSERT_EQUAL_UINT32_MESSAGE'], ['uint64_t', 'TEST_ASSERT_EQUAL_UINT64_MESSAGE'] ] CTAGS_EXECUTABLE = 'ctags'
class Config(object): description = 'Mock generator for c code' version = '0.5' author = 'Freddy Hurkmans' license = 'BSD 3-Clause' verbose = False max_nr_function_calls = '25' charstar_is_input_string = False unity_include = '#include "unity.h"' custom_includes = [] ctype_to_unity_assert_macro = [['char', 'TEST_ASSERT_EQUAL_INT8_MESSAGE'], ['signed char', 'TEST_ASSERT_EQUAL_INT8_MESSAGE'], ['unsigned char', 'TEST_ASSERT_EQUAL_UINT8_MESSAGE'], ['short', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['short int', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['signed short', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['signed short int', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['unsigned short', 'TEST_ASSERT_EQUAL_UINT16_MESSAGE'], ['unsigned short int', 'TEST_ASSERT_EQUAL_UINT16_MESSAGE'], ['int', 'TEST_ASSERT_EQUAL_INT_MESSAGE'], ['signed int', 'TEST_ASSERT_EQUAL_INT_MESSAGE'], ['unsigned', 'TEST_ASSERT_EQUAL_UINT_MESSAGE'], ['unsigned int', 'TEST_ASSERT_EQUAL_UINT_MESSAGE'], ['long', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['long int', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['signed long', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['signed long int', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['unsigned long', 'TEST_ASSERT_EQUAL_UINT64_MESSAGE'], ['unsigned long int', 'TEST_ASSERT_EQUAL_UINT64_MESSAGE'], ['float', 'TEST_ASSERT_EQUAL_FLOAT_MESSAGE'], ['double', 'TEST_ASSERT_EQUAL_FLOAT_MESSAGE'], ['long double', 'TEST_ASSERT_EQUAL_FLOAT_MESSAGE'], ['int8_t', 'TEST_ASSERT_EQUAL_INT8_MESSAGE'], ['int16_t', 'TEST_ASSERT_EQUAL_INT16_MESSAGE'], ['int32_t', 'TEST_ASSERT_EQUAL_INT32_MESSAGE'], ['int64_t', 'TEST_ASSERT_EQUAL_INT64_MESSAGE'], ['uint8_t', 'TEST_ASSERT_EQUAL_UINT8_MESSAGE'], ['uint16_t', 'TEST_ASSERT_EQUAL_UINT16_MESSAGE'], ['uint32_t', 'TEST_ASSERT_EQUAL_UINT32_MESSAGE'], ['uint64_t', 'TEST_ASSERT_EQUAL_UINT64_MESSAGE']] ctags_executable = 'ctags'
left_eye_connection = [ # Left eye. (263, 249), (249, 390), (390, 373), (373, 374), (374, 380), (380, 381), (381, 382), (382, 362), (263, 466), (466, 388), (388, 387), (387, 386), (386, 385), (385, 384), (384, 398), (398, 362) ] left_eyebrow_connection = [ # Left eyebrow. (276, 283), (283, 282), (282, 295), (295, 285), (300, 293), (293, 334), (334, 296), (296, 336) ] right_eye_connection = [ # Right eye. (33, 7), (7, 163), (163, 144), (144, 145), (145, 153), (153, 154), (154, 155), (155, 133), (33, 246), (246, 161), (161, 160), (160, 159), (159, 158), (158, 157), (157, 173), (173, 133) ] right_eyebrow_connection = [ # Right eyebrow. (46, 53), (53, 52), (52, 65), (65, 55), (70, 63), (63, 105), (105, 66), (66, 107) ] all_eye_connection = frozenset(left_eye_connection + right_eye_connection) face_features = { 'silhouette': [ 10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288, 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136, 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109 ], 'lipsUpperOuter': [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291], 'lipsLowerOuter': [146, 91, 181, 84, 17, 314, 405, 321, 375, 291], 'lipsUpperInner': [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308], 'lipsLowerInner': [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308], 'rightEyeUpper0': [246, 161, 160, 159, 158, 157, 173], 'rightEyeLower0': [33, 7, 163, 144, 145, 153, 154, 155, 133], 'rightEyeUpper1': [247, 30, 29, 27, 28, 56, 190], 'rightEyeLower1': [130, 25, 110, 24, 23, 22, 26, 112, 243], 'rightEyeUpper2': [113, 225, 224, 223, 222, 221, 189], 'rightEyeLower2': [226, 31, 228, 229, 230, 231, 232, 233, 244], 'rightEyeLower3': [143, 111, 117, 118, 119, 120, 121, 128, 245], 'rightEyebrowUpper': [156, 70, 63, 105, 66, 107, 55, 193], 'rightEyebrowLower': [35, 124, 46, 53, 52, 65], 'leftEyeUpper0': [466, 388, 387, 386, 385, 384, 398], 'leftEyeLower0': [263, 249, 390, 373, 374, 380, 381, 382, 362], 'leftEyeUpper1': [467, 260, 259, 257, 258, 286, 414], 'leftEyeLower1': [359, 255, 339, 254, 253, 252, 256, 341, 463], 'leftEyeUpper2': [342, 445, 444, 443, 442, 441, 413], 'leftEyeLower2': [446, 261, 448, 449, 450, 451, 452, 453, 464], 'leftEyeLower3': [372, 340, 346, 347, 348, 349, 350, 357, 465], 'leftEyebrowUpper': [383, 300, 293, 334, 296, 336, 285, 417], 'leftEyebrowLower': [265, 353, 276, 283, 282, 295], 'midwayBetweenEyes': [168], 'noseTip': [1], 'noseBottom': [2], 'noseRightCorner': [98], 'noseLeftCorner': [327], 'rightCheek': [205], 'leftCheek': [425] }
left_eye_connection = [(263, 249), (249, 390), (390, 373), (373, 374), (374, 380), (380, 381), (381, 382), (382, 362), (263, 466), (466, 388), (388, 387), (387, 386), (386, 385), (385, 384), (384, 398), (398, 362)] left_eyebrow_connection = [(276, 283), (283, 282), (282, 295), (295, 285), (300, 293), (293, 334), (334, 296), (296, 336)] right_eye_connection = [(33, 7), (7, 163), (163, 144), (144, 145), (145, 153), (153, 154), (154, 155), (155, 133), (33, 246), (246, 161), (161, 160), (160, 159), (159, 158), (158, 157), (157, 173), (173, 133)] right_eyebrow_connection = [(46, 53), (53, 52), (52, 65), (65, 55), (70, 63), (63, 105), (105, 66), (66, 107)] all_eye_connection = frozenset(left_eye_connection + right_eye_connection) face_features = {'silhouette': [10, 338, 297, 332, 284, 251, 389, 356, 454, 323, 361, 288, 397, 365, 379, 378, 400, 377, 152, 148, 176, 149, 150, 136, 172, 58, 132, 93, 234, 127, 162, 21, 54, 103, 67, 109], 'lipsUpperOuter': [61, 185, 40, 39, 37, 0, 267, 269, 270, 409, 291], 'lipsLowerOuter': [146, 91, 181, 84, 17, 314, 405, 321, 375, 291], 'lipsUpperInner': [78, 191, 80, 81, 82, 13, 312, 311, 310, 415, 308], 'lipsLowerInner': [78, 95, 88, 178, 87, 14, 317, 402, 318, 324, 308], 'rightEyeUpper0': [246, 161, 160, 159, 158, 157, 173], 'rightEyeLower0': [33, 7, 163, 144, 145, 153, 154, 155, 133], 'rightEyeUpper1': [247, 30, 29, 27, 28, 56, 190], 'rightEyeLower1': [130, 25, 110, 24, 23, 22, 26, 112, 243], 'rightEyeUpper2': [113, 225, 224, 223, 222, 221, 189], 'rightEyeLower2': [226, 31, 228, 229, 230, 231, 232, 233, 244], 'rightEyeLower3': [143, 111, 117, 118, 119, 120, 121, 128, 245], 'rightEyebrowUpper': [156, 70, 63, 105, 66, 107, 55, 193], 'rightEyebrowLower': [35, 124, 46, 53, 52, 65], 'leftEyeUpper0': [466, 388, 387, 386, 385, 384, 398], 'leftEyeLower0': [263, 249, 390, 373, 374, 380, 381, 382, 362], 'leftEyeUpper1': [467, 260, 259, 257, 258, 286, 414], 'leftEyeLower1': [359, 255, 339, 254, 253, 252, 256, 341, 463], 'leftEyeUpper2': [342, 445, 444, 443, 442, 441, 413], 'leftEyeLower2': [446, 261, 448, 449, 450, 451, 452, 453, 464], 'leftEyeLower3': [372, 340, 346, 347, 348, 349, 350, 357, 465], 'leftEyebrowUpper': [383, 300, 293, 334, 296, 336, 285, 417], 'leftEyebrowLower': [265, 353, 276, 283, 282, 295], 'midwayBetweenEyes': [168], 'noseTip': [1], 'noseBottom': [2], 'noseRightCorner': [98], 'noseLeftCorner': [327], 'rightCheek': [205], 'leftCheek': [425]}
# -------------------------------------------------------- # GA3C for Dragon # Copyright(c) 2017 SeetaTech # Written by Ting Pan # -------------------------------------------------------- class Config(object): ######################################################################### # Game configuration # Name of the game, with version (e.g. PongDeterministic-v0) ATARI_GAME = 'PongDeterministic-v0' # Enable to see the trained agent in action PLAY_MODE = False # Enable to train TRAIN_MODELS = True # Load old models. Throws if the model doesn't exist LOAD_CHECKPOINT = False # If 0, the latest checkpoint is loaded LOAD_EPISODE = 32000 ######################################################################### # Number of agents, predictors, trainers and other system settings # If the dynamic configuration is on, these are the initial values. # Number of Agents AGENTS = 32 # Number of Predictors PREDICTORS = 2 # Number of Trainers TRAINERS = 2 # Device DEVICE = 'gpu:0' # Enable the dynamic adjustment (+ waiting time to start it) DYNAMIC_SETTINGS = True DYNAMIC_SETTINGS_STEP_WAIT = 20 DYNAMIC_SETTINGS_INITIAL_WAIT = 10 ######################################################################### # Algorithm parameters # Discount factor DISCOUNT = 0.99 # Tmax TIME_MAX = 5 # Reward Clipping REWARD_MIN = -1 REWARD_MAX = 1 # Max size of the queue MAX_QUEUE_SIZE = 100 PREDICTION_BATCH_SIZE = 128 # Input of the DNN STACKED_FRAMES = 4 IMAGE_WIDTH = 84 IMAGE_HEIGHT = 84 # Total number of episodes and annealing frequency EPISODES = 400000 ANNEALING_EPISODE_COUNT = 400000 # Entropy regualrization hyper-parameter BETA_START = 0.01 BETA_END = 0.01 # Learning rate LEARNING_RATE_START = 0.0003 LEARNING_RATE_END = 0.0003 # RMSProp parameters RMSPROP_DECAY = 0.99 RMSPROP_MOMENTUM = 0.0 RMSPROP_EPSILON = 0.1 # Dual RMSProp - we found that using a single RMSProp for the two cost function works better and faster DUAL_RMSPROP = False # Gradient clipping USE_GRAD_CLIP = True GRAD_CLIP_NORM = 40.0 # Epsilon (regularize policy lag in GA3C) LOG_EPSILON = 1e-6 # Training min batch size - increasing the batch size increases the stability of the algorithm, but make learning slower TRAINING_MIN_BATCH_SIZE = 0 ######################################################################### # Log and save # Enable TensorBoard TENSORBOARD = False # Update TensorBoard every X training steps TENSORBOARD_UPDATE_FREQUENCY = 1000 # Enable to save models every SAVE_FREQUENCY episodes SAVE_MODELS = True # Save every SAVE_FREQUENCY episodes SAVE_FREQUENCY = 2000 # Print stats every PRINT_STATS_FREQUENCY episodes PRINT_STATS_FREQUENCY = 1 # The window to average stats STAT_ROLLING_MEAN_WINDOW = 1000 # Results filename RESULTS_FILENAME = 'results.txt' # Network checkpoint name NETWORK_NAME = 'network' ######################################################################### # More experimental parameters here # Minimum policy MIN_POLICY = 0.0 # Use log_softmax() instead of log(softmax()) USE_LOG_SOFTMAX = False
class Config(object): atari_game = 'PongDeterministic-v0' play_mode = False train_models = True load_checkpoint = False load_episode = 32000 agents = 32 predictors = 2 trainers = 2 device = 'gpu:0' dynamic_settings = True dynamic_settings_step_wait = 20 dynamic_settings_initial_wait = 10 discount = 0.99 time_max = 5 reward_min = -1 reward_max = 1 max_queue_size = 100 prediction_batch_size = 128 stacked_frames = 4 image_width = 84 image_height = 84 episodes = 400000 annealing_episode_count = 400000 beta_start = 0.01 beta_end = 0.01 learning_rate_start = 0.0003 learning_rate_end = 0.0003 rmsprop_decay = 0.99 rmsprop_momentum = 0.0 rmsprop_epsilon = 0.1 dual_rmsprop = False use_grad_clip = True grad_clip_norm = 40.0 log_epsilon = 1e-06 training_min_batch_size = 0 tensorboard = False tensorboard_update_frequency = 1000 save_models = True save_frequency = 2000 print_stats_frequency = 1 stat_rolling_mean_window = 1000 results_filename = 'results.txt' network_name = 'network' min_policy = 0.0 use_log_softmax = False
INPUT_BUCKET = 'input-image-files' OUTPUT_BUCKET = 'output-image-files' INPUT_QUEUE = 'https://sqs.us-east-1.amazonaws.com/378107157540/Request-Queue' OUTPUT_QUEUE = 'https://sqs.us-east-1.amazonaws.com/378107157540/Response-Queue'
input_bucket = 'input-image-files' output_bucket = 'output-image-files' input_queue = 'https://sqs.us-east-1.amazonaws.com/378107157540/Request-Queue' output_queue = 'https://sqs.us-east-1.amazonaws.com/378107157540/Response-Queue'
f='11' for i in range(5): c=1 s='' for j in range(len(f)-1): if f[j]==f[j+1]: c+=1 else: s=(str(c)+(f[j])) s=str(c)+(f[j]) f=str(s) print(f)
f = '11' for i in range(5): c = 1 s = '' for j in range(len(f) - 1): if f[j] == f[j + 1]: c += 1 else: s = str(c) + f[j] s = str(c) + f[j] f = str(s) print(f)
a=input("ENTER THE NUMBER\n") if a[0]==a[1] or a[0]==a[2] or a[0]==a[3] or a[0]==a[4] or a[1]==a[2] or a[1]==a[3] or a[1]==a[4] or a[2]==a[3] or a[2]==a[4]: print("THE ENTERED NUMBER IS NOT A UNIQUE NUMBER") else: print(a,"IS AN UNIQUE NUMBER")
a = input('ENTER THE NUMBER\n') if a[0] == a[1] or a[0] == a[2] or a[0] == a[3] or (a[0] == a[4]) or (a[1] == a[2]) or (a[1] == a[3]) or (a[1] == a[4]) or (a[2] == a[3]) or (a[2] == a[4]): print('THE ENTERED NUMBER IS NOT A UNIQUE NUMBER') else: print(a, 'IS AN UNIQUE NUMBER')
# The goal of this exercise is to get hands-on experience working with # list comprehensions, and other comprehensions. Write a complementary # function to each of the below, which accomplishes the same logic in # a one-liner (using list/set/dict comprehensions). # Exercise 1 # Adds 5 to each element def add_five(numbers): out = [] for num in numbers: out.append(num + 5) return out # TODO Complete this function def add_five_one_liner(numbers): pass # Exercise 2 # Drops any small numbers (strictly less than 4) def drop_small(numbers): out = [] for num in numbers: if not num < 4: out.append(num) return out # TODO Complete this function def drop_small_one_liner(numbers): pass # Exercise 3 # Returns a *set* of all distinct numbers (i.e. no repeats) def get_distinct(numbers): out = set() for num in numbers: out.add(num) return out # TODO Complete this function def get_distinct_one_liner(numbers): pass ## Helper testing functions, for your convienence ## def test_add_five(numbers): out1 = add_five(numbers) out2 = add_five_one_liner(numbers) assert(out1 == out2) def test_drop_small(numbers): out1 = drop_small(numbers) out2 = drop_small_one_liner(numbers) assert(out1 == out2) def test_get_distinct(numbers): out1 = get_distinct(numbers) out2 = get_distinct_one_liner(numbers) assert(out1 == out2) # Main method def main(): # Feel free to add anything you need to test your solutions here pass if __name__ == "__main__": main()
def add_five(numbers): out = [] for num in numbers: out.append(num + 5) return out def add_five_one_liner(numbers): pass def drop_small(numbers): out = [] for num in numbers: if not num < 4: out.append(num) return out def drop_small_one_liner(numbers): pass def get_distinct(numbers): out = set() for num in numbers: out.add(num) return out def get_distinct_one_liner(numbers): pass def test_add_five(numbers): out1 = add_five(numbers) out2 = add_five_one_liner(numbers) assert out1 == out2 def test_drop_small(numbers): out1 = drop_small(numbers) out2 = drop_small_one_liner(numbers) assert out1 == out2 def test_get_distinct(numbers): out1 = get_distinct(numbers) out2 = get_distinct_one_liner(numbers) assert out1 == out2 def main(): pass if __name__ == '__main__': main()
n = len(x) if n % 2: median_ = sorted(x)[round(0.5*(n-1))] else: x_ord, index = sorted(x), round(0.5 * n) median_ = 0.5 * (x_ord[index-1] + x_ord[index]) median_
n = len(x) if n % 2: median_ = sorted(x)[round(0.5 * (n - 1))] else: (x_ord, index) = (sorted(x), round(0.5 * n)) median_ = 0.5 * (x_ord[index - 1] + x_ord[index]) median_
def agreeanswer(): i01.disableRobotRandom(30) i01.setHandSpeed("left", 1.0, 1.0, 1.0, 1.0, 1.0, 1.0) i01.setHandSpeed("right", 1.0, 1.0, 1.0, 1.0, 1.0, 1.0) i01.setArmSpeed("left", 1.0, 1.0, 1.0, 1.0) i01.setArmSpeed("right", 1.0, 1.0, 1.0, 1.0) i01.setHeadSpeed(1.0, 0.90) i01.setTorsoSpeed(1.0, 1.0, 1.0) i01.moveHead(120,90) sleep(0.5) i01.moveHead(20,90) sleep(0.5) i01.moveArm("left",20,93,42,16) i01.moveArm("right",20,93,37,18) i01.moveHand("left",180,180,65,81,41,143) i01.moveHand("right",180,180,18,61,36,21) i01.moveTorso(90,90,90) sleep(0.5) i01.moveHead(90,90) sleep(0.2) relax()
def agreeanswer(): i01.disableRobotRandom(30) i01.setHandSpeed('left', 1.0, 1.0, 1.0, 1.0, 1.0, 1.0) i01.setHandSpeed('right', 1.0, 1.0, 1.0, 1.0, 1.0, 1.0) i01.setArmSpeed('left', 1.0, 1.0, 1.0, 1.0) i01.setArmSpeed('right', 1.0, 1.0, 1.0, 1.0) i01.setHeadSpeed(1.0, 0.9) i01.setTorsoSpeed(1.0, 1.0, 1.0) i01.moveHead(120, 90) sleep(0.5) i01.moveHead(20, 90) sleep(0.5) i01.moveArm('left', 20, 93, 42, 16) i01.moveArm('right', 20, 93, 37, 18) i01.moveHand('left', 180, 180, 65, 81, 41, 143) i01.moveHand('right', 180, 180, 18, 61, 36, 21) i01.moveTorso(90, 90, 90) sleep(0.5) i01.moveHead(90, 90) sleep(0.2) relax()
database_path = "{projects}/brewmaster/server/data/" heater_port = 12 port_number = 5000 stirrer_port = 13 temp_sensor_path = "/sys/bus/w1/devices/{your_sensor_id}/w1_slave" use_fake = True
database_path = '{projects}/brewmaster/server/data/' heater_port = 12 port_number = 5000 stirrer_port = 13 temp_sensor_path = '/sys/bus/w1/devices/{your_sensor_id}/w1_slave' use_fake = True
# def favcolors(mameet,qj,mustafa): # print(mameet, qj,mustafa) # favcolors(qj='green',mameet='black',mustafa='blue') # # ,, def favcolors(**kwargs): print(kwargs) for key,val in kwargs.items(): print('Favourite color of',key,'is',val) # favcolors(qj='green',mameet='black',mustafa='blue',fatima='orange',taher='yellow') # Both * and ** # ordering def favcolors2(num1,*args,qj,**kwargs): print('num1:',num1) print('args:',args) print('def arguments:',qj) print('kwargs:',kwargs) # for key,val in kwargs.items(): # print('Favourite color of',key,'is',val) favcolors2(10,20,'aaaa',qj='green',mameet='black',mustafa='blue',fatima='orange',taher='yellow')
def favcolors(**kwargs): print(kwargs) for (key, val) in kwargs.items(): print('Favourite color of', key, 'is', val) def favcolors2(num1, *args, qj, **kwargs): print('num1:', num1) print('args:', args) print('def arguments:', qj) print('kwargs:', kwargs) favcolors2(10, 20, 'aaaa', qj='green', mameet='black', mustafa='blue', fatima='orange', taher='yellow')
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date # Formatting for date objects. DATE_FORMAT = 'N j, Y' # Formatting for time objects. TIME_FORMAT = 'P' # Formatting for datetime objects. DATETIME_FORMAT = 'N j, Y, P' # Formatting for date objects when only the year and month are relevant. YEAR_MONTH_FORMAT = 'F Y' # Formatting for date objects when only the month and day are relevant. MONTH_DAY_FORMAT = 'F j' # Short formatting for date objects. SHORT_DATE_FORMAT = 'm/d/Y' # Short formatting for datetime objects. SHORT_DATETIME_FORMAT = 'm/d/Y P' # First day of week, to be used on calendars. # 0 means Sunday, 1 means Monday... FIRST_DAY_OF_WEEK = 0 # Formats to be used when parsing dates from input boxes, in order. # The *_INPUT_FORMATS strings use the Python strftime format syntax, # see https://docs.python.org/library/datetime.html#strftime-strptime-behavior # Note that these format strings are different from the ones to display dates. # Kept ISO formats as they are in first position DATE_INPUT_FORMATS = [ '%Y-%m-%d', # '2006-10-25' '%m/%d/%Y', # '10/25/2006' '%m/%d/%y', # '10/25/06' '%b %d %Y', # 'Oct 25 2006' '%b %d, %Y', # 'Oct 25, 2006' '%d %b %Y', # '25 Oct 2006' '%d %b, %Y', # '25 Oct, 2006' '%B %d %Y', # 'October 25 2006' '%B %d, %Y', # 'October 25, 2006' '%d %B %Y', # '25 October 2006' '%d %B, %Y', # '25 October, 2006' ] DATETIME_INPUT_FORMATS = [ '%Y-%m-%d %H:%M:%S', # '2006-10-25 14:30:59' '%Y-%m-%d %H:%M:%S.%f', # '2006-10-25 14:30:59.000200' '%Y-%m-%d %H:%M', # '2006-10-25 14:30' '%m/%d/%Y %H:%M:%S', # '10/25/2006 14:30:59' '%m/%d/%Y %H:%M:%S.%f', # '10/25/2006 14:30:59.000200' '%m/%d/%Y %H:%M', # '10/25/2006 14:30' '%m/%d/%y %H:%M:%S', # '10/25/06 14:30:59' '%m/%d/%y %H:%M:%S.%f', # '10/25/06 14:30:59.000200' '%m/%d/%y %H:%M', # '10/25/06 14:30' ] TIME_INPUT_FORMATS = [ '%H:%M:%S', # '14:30:59' '%H:%M:%S.%f', # '14:30:59.000200' '%H:%M', # '14:30' ] # Decimal separator symbol. DECIMAL_SEPARATOR = '.' # Thousand separator symbol. THOUSAND_SEPARATOR = ',' # Number of digits that will be together, when splitting them by # THOUSAND_SEPARATOR. 0 means no grouping, 3 means splitting by thousands. NUMBER_GROUPING = 3
date_format = 'N j, Y' time_format = 'P' datetime_format = 'N j, Y, P' year_month_format = 'F Y' month_day_format = 'F j' short_date_format = 'm/d/Y' short_datetime_format = 'm/d/Y P' first_day_of_week = 0 date_input_formats = ['%Y-%m-%d', '%m/%d/%Y', '%m/%d/%y', '%b %d %Y', '%b %d, %Y', '%d %b %Y', '%d %b, %Y', '%B %d %Y', '%B %d, %Y', '%d %B %Y', '%d %B, %Y'] datetime_input_formats = ['%Y-%m-%d %H:%M:%S', '%Y-%m-%d %H:%M:%S.%f', '%Y-%m-%d %H:%M', '%m/%d/%Y %H:%M:%S', '%m/%d/%Y %H:%M:%S.%f', '%m/%d/%Y %H:%M', '%m/%d/%y %H:%M:%S', '%m/%d/%y %H:%M:%S.%f', '%m/%d/%y %H:%M'] time_input_formats = ['%H:%M:%S', '%H:%M:%S.%f', '%H:%M'] decimal_separator = '.' thousand_separator = ',' number_grouping = 3
number_of_rooms = int(input()) free_chairs = 0 insufficiency = False for i in range(1, number_of_rooms + 1): list_of_chairs_and_people = input().split() chairs = len(list_of_chairs_and_people[0]) needed_ones = int(list_of_chairs_and_people[1]) if chairs >= needed_ones: free_chairs += chairs - needed_ones else: insufficiency = True print(f"{needed_ones-chairs} more chairs needed in room {i}") if not insufficiency: print(f"Game On, {free_chairs} free chairs left")
number_of_rooms = int(input()) free_chairs = 0 insufficiency = False for i in range(1, number_of_rooms + 1): list_of_chairs_and_people = input().split() chairs = len(list_of_chairs_and_people[0]) needed_ones = int(list_of_chairs_and_people[1]) if chairs >= needed_ones: free_chairs += chairs - needed_ones else: insufficiency = True print(f'{needed_ones - chairs} more chairs needed in room {i}') if not insufficiency: print(f'Game On, {free_chairs} free chairs left')
def funcion(): return 5 def generador(): yield 1,2,3,4,5,6,7,8,9 print(generador()) print(generador()) print(generador())
def funcion(): return 5 def generador(): yield (1, 2, 3, 4, 5, 6, 7, 8, 9) print(generador()) print(generador()) print(generador())
# vim: set ts=8 sts=4 sw=4 tw=99 et: # # This file is part of AMBuild. # # AMBuild is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # AMBuild is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with AMBuild. If not, see <http://www.gnu.org/licenses/>. class BaseGenerator(object): def __init__(self, cm): self.cm = cm @property def backend(self): raise Exception('Must be implemented!') def addSymlink(self, context, source, output_path): raise Exception('Must be implemented!') def addFolder(self, context, folder): raise Exception('Must be implemented!') def addCopy(self, context, source, output_path): raise Exception('Must be implemented!') def addShellCommand(self, context, inputs, argv, outputs, folder = -1, dep_type = None, weak_inputs = [], shared_outputs = [], env_data = None): raise Exception('Must be implemented!') def addConfigureFile(self, context, path): raise Exception('Must be implemented!') # The following methods are only needed to implement v2.2 generators. def newProgramProject(self, context, name): raise NotImplementedError() def newLibraryProject(self, context, name): raise NotImplementedError() def newStaticLibraryProject(self, context, name): raise NotImplementedError()
class Basegenerator(object): def __init__(self, cm): self.cm = cm @property def backend(self): raise exception('Must be implemented!') def add_symlink(self, context, source, output_path): raise exception('Must be implemented!') def add_folder(self, context, folder): raise exception('Must be implemented!') def add_copy(self, context, source, output_path): raise exception('Must be implemented!') def add_shell_command(self, context, inputs, argv, outputs, folder=-1, dep_type=None, weak_inputs=[], shared_outputs=[], env_data=None): raise exception('Must be implemented!') def add_configure_file(self, context, path): raise exception('Must be implemented!') def new_program_project(self, context, name): raise not_implemented_error() def new_library_project(self, context, name): raise not_implemented_error() def new_static_library_project(self, context, name): raise not_implemented_error()
# Copyright 2020 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 # # 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. def one_level_function(): # dummy comment # to take up # three lines return 0 def multiline_args_tuple( a, b, c ): # dummy comment # to take up # three lines return 0 def nested_if_statements(): if True: if True: # dummy comment # to take up # three lines return 0 def nested_for_statements(): for x in range(1): for y in range(1): # dummy comment # to take up # three lines return 0 def nested_with_statements(): with open(__file__, 'r') as _: # dummy comment to take up a line return 0 def ending_tuple(): return ( # dummy comment # to take up # three lines 1, 2, 3 ) def ending_dict(): return { # dummy comment # to take up # three lines 'a': 1, 'b': 2, 'c': 3 } def ending_array(): return [ # dummy comment # to take up # three lines 1, 2, 3 ] def ending_list_comp(): return [x for x # dummy comment # to take up # three lines in range(2)] def ending_if_else(): if 1 == 2: return True else: # dummy comment # to take up # three lines return False def ending_if_elif(): if 1 == 2: return True elif True: # dummy comment # to take up # three lines return False def one_line_if(): return 1 if True else 2
def one_level_function(): return 0 def multiline_args_tuple(a, b, c): return 0 def nested_if_statements(): if True: if True: return 0 def nested_for_statements(): for x in range(1): for y in range(1): return 0 def nested_with_statements(): with open(__file__, 'r') as _: return 0 def ending_tuple(): return (1, 2, 3) def ending_dict(): return {'a': 1, 'b': 2, 'c': 3} def ending_array(): return [1, 2, 3] def ending_list_comp(): return [x for x in range(2)] def ending_if_else(): if 1 == 2: return True else: return False def ending_if_elif(): if 1 == 2: return True elif True: return False def one_line_if(): return 1 if True else 2
class BusInPOZ: def __init__(self, intersection, check_in_bus_info, check_in_phase, check_in_phasetime, check_in_time, last_check_in): self.intersection_of_interest = intersection self.bus_id = check_in_bus_info.idVeh self.check_in_time = check_in_time self.check_in_phase = check_in_phase self.check_in_phasetime = check_in_phasetime self.last_check_in = last_check_in # previous bus check in time self.check_in_headway = check_in_time - last_check_in self.check_out_time = -1 self.check_out_headway = -1 self.last_update_time = check_in_time self.original_action = None self.original_state = None # state generated at check in def check_out(self, check_out_time, last_check_out=0): self.check_out_time = check_out_time self.check_out_headway = check_out_time - last_check_out self.last_update_time = check_out_time def set_action(self, action): if self.original_action is None: self.original_action = action else: print("duplicate set original action, check to make sure implementation is correct") def set_state(self, state): if self.original_state is None: self.original_state = state else: print("duplicate set original state, check to make sure implementation is correct")
class Businpoz: def __init__(self, intersection, check_in_bus_info, check_in_phase, check_in_phasetime, check_in_time, last_check_in): self.intersection_of_interest = intersection self.bus_id = check_in_bus_info.idVeh self.check_in_time = check_in_time self.check_in_phase = check_in_phase self.check_in_phasetime = check_in_phasetime self.last_check_in = last_check_in self.check_in_headway = check_in_time - last_check_in self.check_out_time = -1 self.check_out_headway = -1 self.last_update_time = check_in_time self.original_action = None self.original_state = None def check_out(self, check_out_time, last_check_out=0): self.check_out_time = check_out_time self.check_out_headway = check_out_time - last_check_out self.last_update_time = check_out_time def set_action(self, action): if self.original_action is None: self.original_action = action else: print('duplicate set original action, check to make sure implementation is correct') def set_state(self, state): if self.original_state is None: self.original_state = state else: print('duplicate set original state, check to make sure implementation is correct')
# -*- coding: utf-8 -*- __version__ = '0.5.0.dev0' PROJECT_NAME = "gx-tool-db" PROJECT_OWNER = PROJECT_USERAME = "galaxyproject" PROJECT_AUTHOR = 'Galaxy Project and Community' PROJECT_EMAIL = 'jmchilton@gmail.com' PROJECT_URL = "https://github.com/galaxyproject/gx-tool-db" RAW_CONTENT_URL = "https://raw.github.com/%s/%s/main/" % ( PROJECT_USERAME, PROJECT_NAME )
__version__ = '0.5.0.dev0' project_name = 'gx-tool-db' project_owner = project_userame = 'galaxyproject' project_author = 'Galaxy Project and Community' project_email = 'jmchilton@gmail.com' project_url = 'https://github.com/galaxyproject/gx-tool-db' raw_content_url = 'https://raw.github.com/%s/%s/main/' % (PROJECT_USERAME, PROJECT_NAME)
class Vertex: def __init__(self, x=None, y=None): self.pos = [x, y] self.x = x self.y = y self.data = None def __str__(self): return f"{self.pos}" def __repr__(self): return f"{self.pos}" def __hash__(self): return hash(''.join([str(x) for x in self.pos])) @property def id(self): return self.__hash__()
class Vertex: def __init__(self, x=None, y=None): self.pos = [x, y] self.x = x self.y = y self.data = None def __str__(self): return f'{self.pos}' def __repr__(self): return f'{self.pos}' def __hash__(self): return hash(''.join([str(x) for x in self.pos])) @property def id(self): return self.__hash__()
#$Header: /nfs/slac/g/glast/ground/cvs/GlastRelease-scons/xmlBase/xmlBaseLib.py,v 1.4 2009/01/23 00:21:04 ecephas Exp $ def generate(env, **kw): if not kw.get('depsOnly',0): env.Tool('addLibrary', library = ['xmlBase'], package = 'xmlBase') if env['PLATFORM']=='win32' and env.get('CONTAINERNAME','')=='GlastRelease': env.Tool('findPkgPath', package = 'xmlBase') env.Tool('facilitiesLib') env.Tool('addLibrary', library = env['xercesLibs']) def exists(env): return 1
def generate(env, **kw): if not kw.get('depsOnly', 0): env.Tool('addLibrary', library=['xmlBase'], package='xmlBase') if env['PLATFORM'] == 'win32' and env.get('CONTAINERNAME', '') == 'GlastRelease': env.Tool('findPkgPath', package='xmlBase') env.Tool('facilitiesLib') env.Tool('addLibrary', library=env['xercesLibs']) def exists(env): return 1
# Python program to print the first non-repeating character NO_OF_CHARS = 256 # Returns an array of size 256 containg count # of characters in the passed char array def getCharCountArray(string): count = [0] * NO_OF_CHARS for i in string: count[ord(i)] += 1 return count # The function returns index of first non-repeating # character in a string. If all characters are repeating # then returns -1 def firstNonRepeating(string): count = getCharCountArray(string) index = -1 k = 0 for i in string: if count[ord(i)] == 1: index = k break k += 1 print(count) return index # Driver program to test above function string = input("Introduce string: ") index = firstNonRepeating(string) if index == 1: print("Either all characters are repeating or string is empty") else: print("First non-repeating character is ", index) # This code is contributed by Bhavya Jain
no_of_chars = 256 def get_char_count_array(string): count = [0] * NO_OF_CHARS for i in string: count[ord(i)] += 1 return count def first_non_repeating(string): count = get_char_count_array(string) index = -1 k = 0 for i in string: if count[ord(i)] == 1: index = k break k += 1 print(count) return index string = input('Introduce string: ') index = first_non_repeating(string) if index == 1: print('Either all characters are repeating or string is empty') else: print('First non-repeating character is ', index)
class Solution: def reverse(self, x: int) -> int: if x < 0 and x >= (-2**31): # x_str = str(x) # x_str_rev = '-' # access from the 2nd last element excluding "-" sign x_str_rev = '-' + str(x)[len(str(x)):0:-1] if int(x_str_rev) < (-2**31): return_value = 0 else: return_value = int(x_str_rev) elif x >= 0 and x <= ((2**31)-1): # x_str = str(x) # convert the int into str x_str_rev = str(x)[::-1] if int(x_str_rev) > (2**31)-1: return_value = 0 else: return_value = int(x_str_rev) else: return 0 return return_value
class Solution: def reverse(self, x: int) -> int: if x < 0 and x >= -2 ** 31: x_str_rev = '-' + str(x)[len(str(x)):0:-1] if int(x_str_rev) < -2 ** 31: return_value = 0 else: return_value = int(x_str_rev) elif x >= 0 and x <= 2 ** 31 - 1: x_str_rev = str(x)[::-1] if int(x_str_rev) > 2 ** 31 - 1: return_value = 0 else: return_value = int(x_str_rev) else: return 0 return return_value
# This problem was asked by Palantir. # Given a number represented by a list of digits, find the next greater permutation of a # number, in terms of lexicographic ordering. If there is not greater permutation possible, # return the permutation with the lowest value/ordering. # For example, the list [1,2,3] should return [1,3,2]. The list [1,3,2] should return [2,1,3]. # The list [3,2,1] should return [1,2,3]. # Can you perform the operation without allocating extra memory (disregarding the input memory)? #### def next_perm(arr): n = len(arr) i = n-1 while i > 0: arr[i], arr[i-1] = arr[i-1], arr[i] if arr[i-1] > arr[i]: return arr i -= 1 return sorted(arr) #### print(next_perm([1, 4, 3, 2]))
def next_perm(arr): n = len(arr) i = n - 1 while i > 0: (arr[i], arr[i - 1]) = (arr[i - 1], arr[i]) if arr[i - 1] > arr[i]: return arr i -= 1 return sorted(arr) print(next_perm([1, 4, 3, 2]))
def length_of_longest_substring(s): dici = {} max_s_rep = repeticao_na_fila = 0 for i, value in enumerate(s): if value in dici: num_repetidos = dici[value] + 1 if num_repetidos > repeticao_na_fila: repeticao_na_fila = num_repetidos num_repeticoes = i + 1 - repeticao_na_fila if num_repeticoes > max_s_rep: max_s_rep = num_repeticoes dici[value] = i return max_s_rep
def length_of_longest_substring(s): dici = {} max_s_rep = repeticao_na_fila = 0 for (i, value) in enumerate(s): if value in dici: num_repetidos = dici[value] + 1 if num_repetidos > repeticao_na_fila: repeticao_na_fila = num_repetidos num_repeticoes = i + 1 - repeticao_na_fila if num_repeticoes > max_s_rep: max_s_rep = num_repeticoes dici[value] = i return max_s_rep
#!/usr/bin/python3 f = open("/home/bccue/Cores-SweRV/testbench/asm/hello_world.s", "r") g = open("/home/bccue/Cores-SweRV/testbench/asm/hello_world_c.c", "w") for data in f: data = data.strip("\n") if (data == "") or ("//" in data): continue #New text to print to terminal if (".ascii" in data): print("__asm (\".ascii \\\"========================================\\n\\\"\");", file=g) print("__asm (\".ascii \\\"Technically C, but really just assembly.\\n\\\"\");", file=g) print("__asm (\".ascii \\\"========================================\\n\\\"\");", file=g) print("__asm (\".byte 0\");", file=g) break #Format the string print('__asm (\"', end="", file=g) for i in range(len(data)): if data[i] == '"': print("\\\"", end="", file=g) else: print(data[i], end="", file=g) print('\");', file=g) #Add .equ directives as #define doesn't work for some reason if (".text" in data): print("__asm (\".equ STDOUT, 0xd0580000\");", file=g) print("__asm (\".equ RV_ICCM_SADR, 0xee000000\");", file=g) f.close() g.close()
f = open('/home/bccue/Cores-SweRV/testbench/asm/hello_world.s', 'r') g = open('/home/bccue/Cores-SweRV/testbench/asm/hello_world_c.c', 'w') for data in f: data = data.strip('\n') if data == '' or '//' in data: continue if '.ascii' in data: print('__asm (".ascii \\"========================================\\n\\"");', file=g) print('__asm (".ascii \\"Technically C, but really just assembly.\\n\\"");', file=g) print('__asm (".ascii \\"========================================\\n\\"");', file=g) print('__asm (".byte 0");', file=g) break print('__asm ("', end='', file=g) for i in range(len(data)): if data[i] == '"': print('\\"', end='', file=g) else: print(data[i], end='', file=g) print('");', file=g) if '.text' in data: print('__asm (".equ STDOUT, 0xd0580000");', file=g) print('__asm (".equ RV_ICCM_SADR, 0xee000000");', file=g) f.close() g.close()
#!/usr/bin/python # ex:set fileencoding=utf-8: default_app_config = 'mosquitto.apps.Config'
default_app_config = 'mosquitto.apps.Config'
#Loading one line from file and starting a dictionary for line in open('rosalind_ini6.txt', 'r').readlines(): contents = line.split() dictionary = dict() #Checking if a word from line is in dictionary, then sum the occurrences for i in range(0, len(contents), 1): if (contents[i] not in dictionary): dictionary[contents[i]] = 1 else: dictionary[contents[i]] += 1 #Printing all the words with respective occurrences amount for key, value in dictionary.items(): print(key, value)
for line in open('rosalind_ini6.txt', 'r').readlines(): contents = line.split() dictionary = dict() for i in range(0, len(contents), 1): if contents[i] not in dictionary: dictionary[contents[i]] = 1 else: dictionary[contents[i]] += 1 for (key, value) in dictionary.items(): print(key, value)
# Python file # Save this with extension .py # Made By Arnav Naik # A beginner's guide to Python print("Welcome To The Trivia!!") # Scoring total_q = 4 print("Total Questions: ", total_q) def question_1(): global score score = int(0) # Question1 question1 = str(input("1. What's the best programming language? ")) ans1u = "python" ans1 = "Python" if question1 == ans1u or question1 == ans1: question_1() print("Correct!!") score = score + 1 print("Your Updated Score Is: ", score) else: print("Wrong!!, the correct answer is ",ans1u,"/",ans1) # Question2 question2 = str(input("2. What's 2+2? ")) ans2 = "4" if question2 == ans2: print("Correct!!") score = score + 1 print("Your Updated Score Is: ", score) else: print("Wrong, the correct answer is: ", ans2) # Question3 question3 = str(input("3. What's 4-5? ")) ans3 = "-1" if question3 == ans3: print("Correct!!") score = score + 1 print("Your Updated Score Is: ", score) else: print("Wrong, the correct answer is: ", ans3) # Question4 question4 = str(input("4. What's Java-Script? ")) ans4u = "programming language" ans4 = "Programming Language" if question4 == ans4u or question4 == ans4: print("Correct!!") score = score + 1 print("Your Updated Score Is: ", score) else: print("Wrong!!, the correct answer is",ans4,"/",ans4u) print("Thank You For Playing! You Scored: ", score) print("Credits: Arnav Naik") print("Check Out My GitHub: https://github.com/code643/Stable-Release-of-Trivia")
print('Welcome To The Trivia!!') total_q = 4 print('Total Questions: ', total_q) def question_1(): global score score = int(0) question1 = str(input("1. What's the best programming language? ")) ans1u = 'python' ans1 = 'Python' if question1 == ans1u or question1 == ans1: question_1() print('Correct!!') score = score + 1 print('Your Updated Score Is: ', score) else: print('Wrong!!, the correct answer is ', ans1u, '/', ans1) question2 = str(input("2. What's 2+2? ")) ans2 = '4' if question2 == ans2: print('Correct!!') score = score + 1 print('Your Updated Score Is: ', score) else: print('Wrong, the correct answer is: ', ans2) question3 = str(input("3. What's 4-5? ")) ans3 = '-1' if question3 == ans3: print('Correct!!') score = score + 1 print('Your Updated Score Is: ', score) else: print('Wrong, the correct answer is: ', ans3) question4 = str(input("4. What's Java-Script? ")) ans4u = 'programming language' ans4 = 'Programming Language' if question4 == ans4u or question4 == ans4: print('Correct!!') score = score + 1 print('Your Updated Score Is: ', score) else: print('Wrong!!, the correct answer is', ans4, '/', ans4u) print('Thank You For Playing! You Scored: ', score) print('Credits: Arnav Naik') print('Check Out My GitHub: https://github.com/code643/Stable-Release-of-Trivia')
class Solution: def toLowerCase(self, str: str) -> str: res = [] for i in range(len(str)): if 65 <= ord(str[i]) <= 92: res.append(chr(ord(str[i]) + 32)) else: res.append(str[i]) return "".join(res) def toLowerCase2(self, str: str) -> str: s = "".join([chr(i) for i in range(65, 91)]) t = "".join([chr(i) for i in range(97,123)]) res = [] for i in range(len(str)): # ind = s.index(str[i]) if str[i] in s: ind = s.index(str[i]) res.append(t[ind]) else: res.append(str[i]) return "".join(res) str = "Hello" str = "here" # str = "i797" str = "" s = Solution() print(s.toLowerCase(str)) print(s.toLowerCase2(str))
class Solution: def to_lower_case(self, str: str) -> str: res = [] for i in range(len(str)): if 65 <= ord(str[i]) <= 92: res.append(chr(ord(str[i]) + 32)) else: res.append(str[i]) return ''.join(res) def to_lower_case2(self, str: str) -> str: s = ''.join([chr(i) for i in range(65, 91)]) t = ''.join([chr(i) for i in range(97, 123)]) res = [] for i in range(len(str)): if str[i] in s: ind = s.index(str[i]) res.append(t[ind]) else: res.append(str[i]) return ''.join(res) str = 'Hello' str = 'here' str = '' s = solution() print(s.toLowerCase(str)) print(s.toLowerCase2(str))
# -------------- # Code starts here # Create the lists class_1 = ['Geoffrey Hinton','Andrew Ng','Sebastian Raschka','Yoshua Bengio' ] class_2 = ['Hilary Mason','Carla Gentry','Corinna Cortes'] # Concatenate both the strings new_class = (class_1 + class_2) print (new_class) # Append the list new_class.append('Peter Warden') # Print updated list print(new_class) # Remove the element from the list new_class.remove('Carla Gentry') # Print the list print(new_class) # Code ends here # -------------- # Code starts here mathematics = {'Geoffrey Hinton' : 78,'Andrew Ng' : 95, 'Sebastian Raschka' : 65, 'Yoshua Benjio': 50, 'Hilary Mason' : 70, 'Corinna Cortes' : 66, 'Peter Warden' : 75} topper = max(mathematics,key = mathematics.get) print(topper) # Code ends here # -------------- # Given string topper = 'andrew ng' # Code starts here #printing first name first_name = (topper.split()[0]) print(first_name) #printing last name last_name = (topper.split()[1]) print(last_name) # Displaying full name full_name = last_name + ' ' + first_name print(full_name) # Displaying Certificate Name certificate_name = full_name.upper() print(certificate_name) # Code ends here # -------------- # Code starts here courses = {'Math' : 65,'English' : 70, 'History' : 80, 'French': 70, 'Science' : 60} print(courses['Math']) print(courses['English']) print(courses['History']) print(courses['French']) print(courses['Science']) total = ((courses['Math']) + (courses['English']) + (courses['History']) + (courses['French']) + (courses['Science'])) print(total) percentage = (total *100 /500) print(percentage) # Code ends here
class_1 = ['Geoffrey Hinton', 'Andrew Ng', 'Sebastian Raschka', 'Yoshua Bengio'] class_2 = ['Hilary Mason', 'Carla Gentry', 'Corinna Cortes'] new_class = class_1 + class_2 print(new_class) new_class.append('Peter Warden') print(new_class) new_class.remove('Carla Gentry') print(new_class) mathematics = {'Geoffrey Hinton': 78, 'Andrew Ng': 95, 'Sebastian Raschka': 65, 'Yoshua Benjio': 50, 'Hilary Mason': 70, 'Corinna Cortes': 66, 'Peter Warden': 75} topper = max(mathematics, key=mathematics.get) print(topper) topper = 'andrew ng' first_name = topper.split()[0] print(first_name) last_name = topper.split()[1] print(last_name) full_name = last_name + ' ' + first_name print(full_name) certificate_name = full_name.upper() print(certificate_name) courses = {'Math': 65, 'English': 70, 'History': 80, 'French': 70, 'Science': 60} print(courses['Math']) print(courses['English']) print(courses['History']) print(courses['French']) print(courses['Science']) total = courses['Math'] + courses['English'] + courses['History'] + courses['French'] + courses['Science'] print(total) percentage = total * 100 / 500 print(percentage)
#!/usr/bin/env python3 # Created by Tiago Minuzzi, 2020. # Files in_fasta = "teste.fasta" in_ids = "ids.txt" out_fasta = "res_fas.fa" # Empty dictionary to store sequences fas_dict = {} # Read reference fasta file with open(in_fasta, "r") as fasta: fasta=fasta.readlines() for linha in fasta: linha = linha.strip() if linha.startswith(">"): kl = linha[1:] fas_dict[kl] = '' else: fas_dict[kl] = linha.upper() # Open ids file and create output file with open(in_ids,"r") as ides, open(out_fasta,'w') as fas_out: ides = ides.read() for sid, sseq in fas_dict.items(): # Search ids from dict in ids file if sid in ides: # Write wanted sequences to file fas_out.write(f'>{sid}'+'\n'+f'{sseq}'+'\n')
in_fasta = 'teste.fasta' in_ids = 'ids.txt' out_fasta = 'res_fas.fa' fas_dict = {} with open(in_fasta, 'r') as fasta: fasta = fasta.readlines() for linha in fasta: linha = linha.strip() if linha.startswith('>'): kl = linha[1:] fas_dict[kl] = '' else: fas_dict[kl] = linha.upper() with open(in_ids, 'r') as ides, open(out_fasta, 'w') as fas_out: ides = ides.read() for (sid, sseq) in fas_dict.items(): if sid in ides: fas_out.write(f'>{sid}' + '\n' + f'{sseq}' + '\n')
class State: def __init__(self, goal, task, visual, ): self.goal = None self.task = None self.visual = None self.features = None
class State: def __init__(self, goal, task, visual): self.goal = None self.task = None self.visual = None self.features = None
for i in range(1, 10): print(i, end=', ') print() for i in range(0, 10, 2): print(i, ' ', end='') print() for i in range(10, 1, -2): print(i, ' ', end='')
for i in range(1, 10): print(i, end=', ') print() for i in range(0, 10, 2): print(i, ' ', end='') print() for i in range(10, 1, -2): print(i, ' ', end='')
# Copyright 2017-2019 Sergej Schumilo, Cornelius Aschermann, Tim Blazytko # Copyright 2019-2020 Intel Corporation # # SPDX-License-Identifier: AGPL-3.0-or-later HEADER = '\033[95m' OKBLUE = '\033[94m' OKGREEN = '\033[92m' WARNING = '\033[0;33m' FAIL = '\033[91m' ENDC = '\033[0m' CLRSCR = '\x1b[1;1H' REALCLRSCR = '\x1b[2J' BOLD = '\033[1m' FLUSH_LINE = '\r\x1b[K' def MOVE_CURSOR_UP(num): return "\033[" + str(num) + "A" def MOVE_CURSOR_DOWN(num): return "\033[" + str(num) + "B" def MOVE_CURSOR_LEFT(num): return "\033[" + str(num) + "C" def MOVE_CURSOR_RIGHT(num): return "\033[" + str(num) + "D" HLINE = chr(0x2500) VLINE = chr(0x2502) VLLINE = chr(0x2524) VRLINE = chr(0x251c) LBEDGE = chr(0x2514) RBEDGE = chr(0x2518) HULINE = chr(0x2534) HDLINE = chr(0x252c) LTEDGE = chr(0x250c) RTEDGE = chr(0x2510) INFO_PREFIX = "[INFO] " ERROR_PREFIX = "[ERROR] " WARNING_PREFIX = "[WARNING] "
header = '\x1b[95m' okblue = '\x1b[94m' okgreen = '\x1b[92m' warning = '\x1b[0;33m' fail = '\x1b[91m' endc = '\x1b[0m' clrscr = '\x1b[1;1H' realclrscr = '\x1b[2J' bold = '\x1b[1m' flush_line = '\r\x1b[K' def move_cursor_up(num): return '\x1b[' + str(num) + 'A' def move_cursor_down(num): return '\x1b[' + str(num) + 'B' def move_cursor_left(num): return '\x1b[' + str(num) + 'C' def move_cursor_right(num): return '\x1b[' + str(num) + 'D' hline = chr(9472) vline = chr(9474) vlline = chr(9508) vrline = chr(9500) lbedge = chr(9492) rbedge = chr(9496) huline = chr(9524) hdline = chr(9516) ltedge = chr(9484) rtedge = chr(9488) info_prefix = '[INFO] ' error_prefix = '[ERROR] ' warning_prefix = '[WARNING] '
# Longest Increasing Subsequence # We have discussed Overlapping Subproblems and Optimal Substructure properties. # Let us discuss Longest Increasing Subsequence (LIS) problem as an example # problem that can be solved using Dynamic Programming. # The Longest Increasing Subsequence (LIS) problem is to find the length of # the longest subsequence of a given sequence such that all elements of the # subsequence are sorted in increasing order. For example, the length of LIS # for {10, 22, 9, 33, 21, 50, 41, 60, 80} is 6 and LIS # is {10, 22, 33, 50, 60, 80}. # longest-increasing-subsequence # More Examples: # Input : arr[] = {3, 10, 2, 1, 20} # Output : Length of LIS = 3 # The longest increasing subsequence is 3, 10, 20 # Input : arr[] = {3, 2} # Output : Length of LIS = 1 # The longest increasing subsequences are {3} and {2} # Input : arr[] = {50, 3, 10, 7, 40, 80} # Output : Length of LIS = 4 # The longest increasing subsequence is {3, 7, 40, 80} #Method 1 :https://youtu.be/Ns4LCeeOFS4 #(nlogn) def LongestIncreasingSequence(list1): n=len(list1) list2=[1 for i in range(n)] for i in range(1,n): for j in range(i): if list1[i]>list1[j] and list2[i]<list2[j]+1: list2[i]=list2[j]+1 return max(list2) print(LongestIncreasingSequence([50, 3, 10, 7, 40, 80]))
def longest_increasing_sequence(list1): n = len(list1) list2 = [1 for i in range(n)] for i in range(1, n): for j in range(i): if list1[i] > list1[j] and list2[i] < list2[j] + 1: list2[i] = list2[j] + 1 return max(list2) print(longest_increasing_sequence([50, 3, 10, 7, 40, 80]))
##Ejercicio 2 # el siguiente codigo busca la raiz entera de un numero dado usando BS # Busqueda Binaria # Entrada: # 16 (si se desea encontrar de un numero # mayor 20 incrementar el tamanio del array) # Salida: # Does not exist #or # "The element was found " +48 # # El ejercicio incluye el ordenamiento del array creado # Autor: Yeimy Huanca def binarySearch(list ,n): baja = 0 alta = len(list) - 1 while baja <= alta: middle = (alta + baja) // 2 middle_element = list[middle] cuadrado = middle_element*middle_element if cuadrado == n: return middle if cuadrado < n: baja = middle + 1 else: alta = middle - 1 return middle def createList(n): lst = [] for i in range(n+1): lst.append(i) return(lst) #length = int(input("length: ")) #list = list(range(length, 0, -1)) n = int(input("search?: ")) list = createList(20) #list = [1,5,9,7,15,19,20,40,48,50,90,91,100,150,151] print(list) #insertion_sort(list) #print(list) q= binarySearch(list, n) if q == -1: print("Does not exist") else: print("The element was found ",list[q])
def binary_search(list, n): baja = 0 alta = len(list) - 1 while baja <= alta: middle = (alta + baja) // 2 middle_element = list[middle] cuadrado = middle_element * middle_element if cuadrado == n: return middle if cuadrado < n: baja = middle + 1 else: alta = middle - 1 return middle def create_list(n): lst = [] for i in range(n + 1): lst.append(i) return lst n = int(input('search?: ')) list = create_list(20) print(list) q = binary_search(list, n) if q == -1: print('Does not exist') else: print('The element was found ', list[q])
number = input("Type a number: ") try: number = float(number) print("The number is: ", number) except: print("Invalid number")
number = input('Type a number: ') try: number = float(number) print('The number is: ', number) except: print('Invalid number')
def show_banner(value: str, times: int): print(value * times) def validate_loan_eligibility(has_income: bool, credit_report: bool, payment_default: bool) -> str: if(has_income and (credit_report and (not payment_default))): return "Eligible for loan" else: return "Not Eligible for loan" def get_applicants_details(switch: int): if(switch == 1): return True, True, True elif(switch == 2): return True, False, True elif(switch == 3): return True, True, False def main(): # Assume we got the parameters from other method income, credit, payment_default = get_applicants_details(3) results = validate_loan_eligibility(income, credit, payment_default) print(results) income, credit, payment_default = get_applicants_details(1) results = validate_loan_eligibility(income, credit, payment_default) print(results) income, credit, payment_default = get_applicants_details(3) results = validate_loan_eligibility(income, credit, payment_default) print(results) income, credit, payment_default = get_applicants_details(2) results = validate_loan_eligibility(income, credit, payment_default) print(results) main()
def show_banner(value: str, times: int): print(value * times) def validate_loan_eligibility(has_income: bool, credit_report: bool, payment_default: bool) -> str: if has_income and (credit_report and (not payment_default)): return 'Eligible for loan' else: return 'Not Eligible for loan' def get_applicants_details(switch: int): if switch == 1: return (True, True, True) elif switch == 2: return (True, False, True) elif switch == 3: return (True, True, False) def main(): (income, credit, payment_default) = get_applicants_details(3) results = validate_loan_eligibility(income, credit, payment_default) print(results) (income, credit, payment_default) = get_applicants_details(1) results = validate_loan_eligibility(income, credit, payment_default) print(results) (income, credit, payment_default) = get_applicants_details(3) results = validate_loan_eligibility(income, credit, payment_default) print(results) (income, credit, payment_default) = get_applicants_details(2) results = validate_loan_eligibility(income, credit, payment_default) print(results) main()
#!/usr/bin/env python3 shifted_serial = ''' 0000000000400d00 db 0x96 ; '.' 0000000000400d01 db 0x9e ; '.' 0000000000400d02 db 0x86 ; '.' 0000000000400d03 db 0xb0 ; '.' 0000000000400d04 db 0xb4 ; '.' 0000000000400d05 db 0x8c ; '.' 0000000000400d06 db 0x5a ; 'Z' 0000000000400d07 db 0xac ; '.' 0000000000400d08 db 0x88 ; '.' 0000000000400d09 db 0x96 ; '.' 0000000000400d0a db 0xaa ; '.' 0000000000400d0b db 0x94 ; '.' 0000000000400d0c db 0xae ; '.' 0000000000400d0d db 0x5a ; 'Z' 0000000000400d0e db 0x88 ; '.' 0000000000400d0f db 0x9c ; '.' 0000000000400d10 db 0xa4 ; '.' 0000000000400d11 db 0x86 ; '.' 0000000000400d12 db 0xac ; '.' 0000000000400d13 db 0x8a ; '.' 0000000000400d14 db 0x5a ; 'Z' 0000000000400d15 db 0x8c ; '.' 0000000000400d16 db 0x9c ; '.' 0000000000400d17 db 0x8e ; '.' 0000000000400d18 db 0x9c ; '.' 0000000000400d19 db 0xa8 ; '.' 0000000000400d1a db 0xb4 ; '.' 0000000000400d1b db 0x5a ; 'Z' 0000000000400d1c db 0xb0 ; '.' 0000000000400d1d db 0xb4 ; '.' 0000000000400d1e db 0x86 ; '.' 0000000000400d1f db 0x8e ; '.' 0000000000400d20 db 0xac ; '.' 0000000000400d21 db 0xb0 ; '.' ''' shifted_flag = ''' 0000000000400dc0 db 0xdc ; '.' 0000000000400dc1 db 0x60 ; '`' 0000000000400dc2 db 0xbe ; '.' 0000000000400dc3 db 0xc8 ; '.' 0000000000400dc4 db 0xe4 ; '.' 0000000000400dc5 db 0xda ; '.' 0000000000400dc6 db 0xbe ; '.' 0000000000400dc7 db 0x62 ; 'b' 0000000000400dc8 db 0xe6 ; '.' 0000000000400dc9 db 0xbe ; '.' 0000000000400dca db 0xea ; '.' 0000000000400dcb db 0x9c ; '.' 0000000000400dcc db 0x84 ; '.' 0000000000400dcd db 0xe4 ; '.' 0000000000400dce db 0xca ; '.' 0000000000400dcf db 0x82 ; '.' 0000000000400dd0 db 0xd6 ; '.' 0000000000400dd1 db 0xc2 ; '.' 0000000000400dd2 db 0xc4 ; '.' 0000000000400dd3 db 0xd8 ; '.' 0000000000400dd4 db 0xca ; '.' ''' # Extract the hex part from the dissassembled strings shifted_serial = "".join(x[31:33] for x in shifted_serial.split("\n")) shifted_flag = "".join(x[31:33] for x in shifted_flag.split("\n")) # Bitwise right-shift once and convert to string serial = bytes.fromhex(hex(int(shifted_serial, 16) >> 1)[2:]).decode() flag = bytes.fromhex(hex(int(shifted_flag, 16) >> 1)[2:]).decode() # Print the results print(f"Shifted serial: {shifted_serial}\nShifted flag: {shifted_flag}") print(f"Serial: {serial}\nFlag: {flag}")
shifted_serial = "\n0000000000400d00 db 0x96 ; '.'\n0000000000400d01 db 0x9e ; '.'\n0000000000400d02 db 0x86 ; '.'\n0000000000400d03 db 0xb0 ; '.'\n0000000000400d04 db 0xb4 ; '.'\n0000000000400d05 db 0x8c ; '.'\n0000000000400d06 db 0x5a ; 'Z'\n0000000000400d07 db 0xac ; '.'\n0000000000400d08 db 0x88 ; '.'\n0000000000400d09 db 0x96 ; '.'\n0000000000400d0a db 0xaa ; '.'\n0000000000400d0b db 0x94 ; '.'\n0000000000400d0c db 0xae ; '.'\n0000000000400d0d db 0x5a ; 'Z'\n0000000000400d0e db 0x88 ; '.'\n0000000000400d0f db 0x9c ; '.'\n0000000000400d10 db 0xa4 ; '.'\n0000000000400d11 db 0x86 ; '.'\n0000000000400d12 db 0xac ; '.'\n0000000000400d13 db 0x8a ; '.'\n0000000000400d14 db 0x5a ; 'Z'\n0000000000400d15 db 0x8c ; '.'\n0000000000400d16 db 0x9c ; '.'\n0000000000400d17 db 0x8e ; '.'\n0000000000400d18 db 0x9c ; '.'\n0000000000400d19 db 0xa8 ; '.'\n0000000000400d1a db 0xb4 ; '.'\n0000000000400d1b db 0x5a ; 'Z'\n0000000000400d1c db 0xb0 ; '.'\n0000000000400d1d db 0xb4 ; '.'\n0000000000400d1e db 0x86 ; '.'\n0000000000400d1f db 0x8e ; '.'\n0000000000400d20 db 0xac ; '.'\n0000000000400d21 db 0xb0 ; '.'\n" shifted_flag = "\n0000000000400dc0 db 0xdc ; '.'\n0000000000400dc1 db 0x60 ; '`'\n0000000000400dc2 db 0xbe ; '.'\n0000000000400dc3 db 0xc8 ; '.'\n0000000000400dc4 db 0xe4 ; '.'\n0000000000400dc5 db 0xda ; '.'\n0000000000400dc6 db 0xbe ; '.'\n0000000000400dc7 db 0x62 ; 'b'\n0000000000400dc8 db 0xe6 ; '.'\n0000000000400dc9 db 0xbe ; '.'\n0000000000400dca db 0xea ; '.'\n0000000000400dcb db 0x9c ; '.'\n0000000000400dcc db 0x84 ; '.'\n0000000000400dcd db 0xe4 ; '.'\n0000000000400dce db 0xca ; '.'\n0000000000400dcf db 0x82 ; '.'\n0000000000400dd0 db 0xd6 ; '.'\n0000000000400dd1 db 0xc2 ; '.'\n0000000000400dd2 db 0xc4 ; '.'\n0000000000400dd3 db 0xd8 ; '.'\n0000000000400dd4 db 0xca ; '.'\n" shifted_serial = ''.join((x[31:33] for x in shifted_serial.split('\n'))) shifted_flag = ''.join((x[31:33] for x in shifted_flag.split('\n'))) serial = bytes.fromhex(hex(int(shifted_serial, 16) >> 1)[2:]).decode() flag = bytes.fromhex(hex(int(shifted_flag, 16) >> 1)[2:]).decode() print(f'Shifted serial: {shifted_serial}\nShifted flag: {shifted_flag}') print(f'Serial: {serial}\nFlag: {flag}')
class Node: hostname = None username = None key_file = None def __init__(self, hostname, username, key_file): self.hostname = hostname self.username = username self.key_file = key_file def __repr__(self): return self.__str__() def __str__(self): return "<Server(%s@%s using key %s)>" % (self.username, self.hostname, self.key_file)
class Node: hostname = None username = None key_file = None def __init__(self, hostname, username, key_file): self.hostname = hostname self.username = username self.key_file = key_file def __repr__(self): return self.__str__() def __str__(self): return '<Server(%s@%s using key %s)>' % (self.username, self.hostname, self.key_file)
def sub(s): # print(s) a = list(map(int, s.split('-'))) print(a) return a[0]*2 - sum(a) def main(): s = input() add = s.split('+') print(add) print(sum(map(sub, add))) if __name__ == "__main__": print(main())
def sub(s): a = list(map(int, s.split('-'))) print(a) return a[0] * 2 - sum(a) def main(): s = input() add = s.split('+') print(add) print(sum(map(sub, add))) if __name__ == '__main__': print(main())
# File system, where one can create and edit files protected with Login system. You can call it Personal Diary. def menu(): print("***Menu***") inp = input("Welcome user... \nWant to Login(lgn) or Register(reg) (lgn/reg)? ") if inp == 'lgn': loginAcct() elif inp == 'reg': regAcct() else: print("\nInvalid choice...") menu() def regAcct(): print("\n*** Registration ***\nPlease fill the details to Register") uname = input("\nEnter your name: ") password = input("\nEnter your password: ") cpassword = input("\nRe-enter your password: ") if password != cpassword: print("Passwords donot match. Try again...") regAcct() elif password == cpassword: reg(uname,password) def loginAcct(): print("\n*** Login ***\nPlease fill the details to Login") uname = input("\nEnter your name: ") password = input("\nEnter your password: ") login(uname,password) def reg(uname,password): exists = False file = open("login_details.txt","r") for i in file: a,b = i.split(",") b = b.strip() if a == uname and b == password: exists = True file.close() break if exists == True: print("User already exists. Login to continue...") loginAcct() elif exists == False: file = open("login_details.txt","a") file.write("\n"+uname+","+password) print("User Registration successful. Login to continue...") file.close() loginAcct() def login(uname,password): global login login = False file = open("login_details.txt","r") for i in file: a,b = i.split(",") b = b.strip() if a==uname and b==password: login = True break file.close() if login == True: print(f"\nLogged in successfully as {uname}...") elif login == False: print("Invalid credentials. Try again") loginAcct() def userMenu(): print("*** Your Personal Diary ***") print("1.Create new file. \n2.Read or Edit existing file.") uinp = int(input("Enter your choice: ")) if uinp == 1: createFile() elif uinp == 2: editFile() else: print("Invalid Choice...") userMenu() def createFile(): fname = input("Enter the file name to create: ") fcontent = input("Enter the content of the file: ") try: cfile = open(f"{fname}.txt","x") cfile.write(fcontent) cfile.close() print(f"File {fname} created successfully") except Exception as e: e = "File already exists. Try editing it.\n" print(e) userMenu() def editFile(): fname = input("Enter the file name to edit: ") uchoice = input("Want to read(r) or add content(a) to the file (r/a)?: ") if uchoice == 'r': try: cfile = open(f"{fname}.txt","r") f1 = cfile.read() print(f1) cfile.close() except Exception as e: e = "File doesnot exist. Try creating one.\n" print(e) userMenu() elif uchoice == 'a': fcontent = input("Enter the content to be added: "+"\n") try: cfile = open(f"{fname}.txt","r+") cfile.write(fcontent) cfile.close() print(f"File {fname} edited successfully") except Exception as e: e = "File doesnot exists. Try creating one.\n" print(e) userMenu() if __name__ == "__main__": print("Welcome to Samhith's Login System...") menu() if login == True: while True: userMenu() code = input("\nWant to exit (y/n): ") if code=='y': print("Thank you") exit() elif code=='n': continue
def menu(): print('***Menu***') inp = input('Welcome user... \nWant to Login(lgn) or Register(reg) (lgn/reg)? ') if inp == 'lgn': login_acct() elif inp == 'reg': reg_acct() else: print('\nInvalid choice...') menu() def reg_acct(): print('\n*** Registration ***\nPlease fill the details to Register') uname = input('\nEnter your name: ') password = input('\nEnter your password: ') cpassword = input('\nRe-enter your password: ') if password != cpassword: print('Passwords donot match. Try again...') reg_acct() elif password == cpassword: reg(uname, password) def login_acct(): print('\n*** Login ***\nPlease fill the details to Login') uname = input('\nEnter your name: ') password = input('\nEnter your password: ') login(uname, password) def reg(uname, password): exists = False file = open('login_details.txt', 'r') for i in file: (a, b) = i.split(',') b = b.strip() if a == uname and b == password: exists = True file.close() break if exists == True: print('User already exists. Login to continue...') login_acct() elif exists == False: file = open('login_details.txt', 'a') file.write('\n' + uname + ',' + password) print('User Registration successful. Login to continue...') file.close() login_acct() def login(uname, password): global login login = False file = open('login_details.txt', 'r') for i in file: (a, b) = i.split(',') b = b.strip() if a == uname and b == password: login = True break file.close() if login == True: print(f'\nLogged in successfully as {uname}...') elif login == False: print('Invalid credentials. Try again') login_acct() def user_menu(): print('*** Your Personal Diary ***') print('1.Create new file. \n2.Read or Edit existing file.') uinp = int(input('Enter your choice: ')) if uinp == 1: create_file() elif uinp == 2: edit_file() else: print('Invalid Choice...') user_menu() def create_file(): fname = input('Enter the file name to create: ') fcontent = input('Enter the content of the file: ') try: cfile = open(f'{fname}.txt', 'x') cfile.write(fcontent) cfile.close() print(f'File {fname} created successfully') except Exception as e: e = 'File already exists. Try editing it.\n' print(e) user_menu() def edit_file(): fname = input('Enter the file name to edit: ') uchoice = input('Want to read(r) or add content(a) to the file (r/a)?: ') if uchoice == 'r': try: cfile = open(f'{fname}.txt', 'r') f1 = cfile.read() print(f1) cfile.close() except Exception as e: e = 'File doesnot exist. Try creating one.\n' print(e) user_menu() elif uchoice == 'a': fcontent = input('Enter the content to be added: ' + '\n') try: cfile = open(f'{fname}.txt', 'r+') cfile.write(fcontent) cfile.close() print(f'File {fname} edited successfully') except Exception as e: e = 'File doesnot exists. Try creating one.\n' print(e) user_menu() if __name__ == '__main__': print("Welcome to Samhith's Login System...") menu() if login == True: while True: user_menu() code = input('\nWant to exit (y/n): ') if code == 'y': print('Thank you') exit() elif code == 'n': continue
m3 = range(0,1000,3) m5 = range(0,1000,5) m15 = range(0,1000,15) answer = sum(m3)+sum(m5)-sum(m15) print (answer)
m3 = range(0, 1000, 3) m5 = range(0, 1000, 5) m15 = range(0, 1000, 15) answer = sum(m3) + sum(m5) - sum(m15) print(answer)
__all__=["layer", "fflayers", "convnet" "model", "optimize" "cost", "train", "util", "nnfuns", "dataset"]
__all__ = ['layer', 'fflayers', 'convnetmodel', 'optimizecost', 'train', 'util', 'nnfuns', 'dataset']
[ [ 0.20155604, 0.13307383, 0.12784087, float("NaN"), 0.06557849, 0.07970277, float("NaN"), 0.05212981, ], [ 0.24451376, 0.14168013, 0.12661545, float("NaN"), 0.10445491, 0.10288933, float("NaN"), 0.07330904, ], [ 0.23630201, 0.15291979, 0.13264396, float("NaN"), 0.10157328, 0.09673594, float("NaN"), 0.07012212, ], [ 0.20088469, 0.11451218, 0.09949508, float("NaN"), 0.06129263, 0.04774053, float("NaN"), 0.03813685, ], [ 0.14546176, 0.0782024, 0.069234, float("NaN"), 0.06278306, 0.05737995, float("NaN"), 0.04238377, ], ]
[[0.20155604, 0.13307383, 0.12784087, float('NaN'), 0.06557849, 0.07970277, float('NaN'), 0.05212981], [0.24451376, 0.14168013, 0.12661545, float('NaN'), 0.10445491, 0.10288933, float('NaN'), 0.07330904], [0.23630201, 0.15291979, 0.13264396, float('NaN'), 0.10157328, 0.09673594, float('NaN'), 0.07012212], [0.20088469, 0.11451218, 0.09949508, float('NaN'), 0.06129263, 0.04774053, float('NaN'), 0.03813685], [0.14546176, 0.0782024, 0.069234, float('NaN'), 0.06278306, 0.05737995, float('NaN'), 0.04238377]]
def compares_expressions(exp1, exp2) -> bool: def compile_exp(exp): return exp.compile(compile_kwargs={"literal_binds": True}) return str(compile_exp(exp1)) == str(compile_exp(exp2))
def compares_expressions(exp1, exp2) -> bool: def compile_exp(exp): return exp.compile(compile_kwargs={'literal_binds': True}) return str(compile_exp(exp1)) == str(compile_exp(exp2))
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isMirror(self,t1,t2): if not t1 and not t2: return True elif not t1 or not t2: return False return (t1.val==t2.val and self.isMirror(t1.left, t2.rigt) and self.isMirror(t1.right, t2.left)) def isSymmetric(self, root: TreeNode) -> bool: return self.isMirror(root,root)
class Solution: def is_mirror(self, t1, t2): if not t1 and (not t2): return True elif not t1 or not t2: return False return t1.val == t2.val and self.isMirror(t1.left, t2.rigt) and self.isMirror(t1.right, t2.left) def is_symmetric(self, root: TreeNode) -> bool: return self.isMirror(root, root)
class BaseParagraphElement(object): def __init__(self, element: dict, document): self._element = element self._document = document @property def start_index(self) -> int: return self._element.get("startIndex") @property def end_index(self) -> int: return self._element.get("endIndex")
class Baseparagraphelement(object): def __init__(self, element: dict, document): self._element = element self._document = document @property def start_index(self) -> int: return self._element.get('startIndex') @property def end_index(self) -> int: return self._element.get('endIndex')
#Bottle deposits x = float(input('Enter the number of containers holding 1 litre or less: ')) y = float(input('Enter the number of containers holding more than 1 litre: ')) refund = float((x*.10)+(y*.25)) print('The refund received will be $',refund)
x = float(input('Enter the number of containers holding 1 litre or less: ')) y = float(input('Enter the number of containers holding more than 1 litre: ')) refund = float(x * 0.1 + y * 0.25) print('The refund received will be $', refund)
__SEPARATOR = '/' __LAYER_TEMPLATE = '...../...../..?../...../.....' __INNER_BORDER = set([(1,2), (3,2), (2,1), (2,3)]) def calculateBiodiversityRating(layout): layoutString = layout.replace(__SEPARATOR, '') biodiveristyRating = 0 for i in range(0, len(layoutString)): if layoutString[i] == '#': biodiveristyRating += pow(2, i) return biodiveristyRating def getFirstLayoutToAppearTwice(layout): allLayouts = set() allLayouts.add(layout) currentLayout = layout while True: nextLayout = __calculateNextLayout(currentLayout) if nextLayout in allLayouts: return nextLayout else: allLayouts.add(nextLayout) currentLayout = nextLayout def countBugsAfterMinutes(initialLayout, numberOfMinutes): layoutLevels = {} layoutLevels[0] = initialLayout maxLevel = 0 minLevel = 0 for _ in range(0, numberOfMinutes): # Add possible new levels maxLevel += 1 minLevel -= 1 layoutLevels[maxLevel] = __LAYER_TEMPLATE layoutLevels[minLevel] = __LAYER_TEMPLATE layoutLevels = __calculateNextLayoutRecursively(layoutLevels, minLevel, maxLevel) # Remove outside levels if no bugs if __countBugsInLayout(layoutLevels[maxLevel]) == 0: del layoutLevels[maxLevel] maxLevel -= 1 if __countBugsInLayout(layoutLevels[minLevel]) == 0: del layoutLevels[minLevel] minLevel += 1 totalBugs = 0 for layerIndex in layoutLevels.keys(): totalBugs += __countBugsInLayout(layoutLevels[layerIndex]) return totalBugs def __calculateNextLayout(currentLayout): currentLayoutMatrix = currentLayout.split(__SEPARATOR) columnLength, rowLength = __getDimensions(currentLayoutMatrix) nextLayoutMatrix = ['' * rowLength] * columnLength for y in range(0, columnLength): for x in range(0, rowLength): adjacentBugCount = __calculateAdjacentBugCountOnLevel(currentLayoutMatrix, rowLength, columnLength, x, y) currentSpace = currentLayoutMatrix[y][x] nextLayoutMatrix[y] += __getNextSpace(currentSpace, adjacentBugCount) return __SEPARATOR.join(nextLayoutMatrix) def __calculateNextLayoutRecursively(layoutGrid, minLevel, maxLevel): newLayoutGrid = layoutGrid.copy() for layoutLevel in layoutGrid.keys(): layout = layoutGrid[layoutLevel] currentLayoutMatrix = layout.split(__SEPARATOR) columnLength, rowLength = __getDimensions(currentLayoutMatrix) nextLayoutMatrix = ['' * rowLength] * columnLength for y in range(0, columnLength): for x in range(0, rowLength): adjacentBugCount = __calculateAdjacentBugCountOnLevel(currentLayoutMatrix, rowLength, columnLength, x, y) if (x, y) in __INNER_BORDER and layoutLevel != maxLevel: adjacentBugCount += __calculateAdjacentBugCountFromInnerLevel(layoutGrid[layoutLevel + 1], x, y) if (x == 0 or x == 4 or y == 0 or y == 4) and layoutLevel != minLevel: adjacentBugCount += __calculateAdjacentBugCountFromOuterLevel(layoutGrid[layoutLevel - 1], x, y) currentSpace = currentLayoutMatrix[y][x] nextLayoutMatrix[y] += __getNextSpace(currentSpace, adjacentBugCount) newLayoutGrid[layoutLevel] = __SEPARATOR.join(nextLayoutMatrix) return newLayoutGrid def __calculateAdjacentBugCountOnLevel(currentLayoutMatrix, rowLength, columnLength, x, y): adjacentBugCount = 0 if (x > 0 and currentLayoutMatrix[y][x - 1] == '#'): adjacentBugCount += 1 if (x < rowLength - 1 and currentLayoutMatrix[y][x + 1] == '#'): adjacentBugCount += 1 if (y > 0 and currentLayoutMatrix[y - 1][x] == '#'): adjacentBugCount += 1 if (y < columnLength - 1 and currentLayoutMatrix[y + 1][x] == '#'): adjacentBugCount += 1 return adjacentBugCount def __calculateAdjacentBugCountFromInnerLevel(innerLayout, x, y): adjacentBugCount = 0 currentLayoutMatrix = innerLayout.split(__SEPARATOR) columnLength, rowLength = __getDimensions(currentLayoutMatrix) if (x,y) == (1,2): for i in range(0, columnLength): if currentLayoutMatrix[i][0] == '#': adjacentBugCount += 1 elif (x,y) == (3,2): for i in range(0, columnLength): if currentLayoutMatrix[i][4] == '#': adjacentBugCount += 1 elif (x,y) == (2,1): for i in range(0, rowLength): if currentLayoutMatrix[0][i] == '#': adjacentBugCount += 1 elif (x,y) == (2,3): for i in range(0, rowLength): if currentLayoutMatrix[4][i] == '#': adjacentBugCount += 1 return adjacentBugCount def __calculateAdjacentBugCountFromOuterLevel(outerLayout, x, y): adjacentBugCount = 0 outerMatrix = outerLayout.split(__SEPARATOR) if x == 0 and outerMatrix[2][1] == '#': adjacentBugCount += 1 if x == 4 and outerMatrix[2][3] == '#': adjacentBugCount += 1 if y == 0 and outerMatrix[1][2] == '#': adjacentBugCount += 1 if y == 4 and outerMatrix[3][2] == '#': adjacentBugCount += 1 return adjacentBugCount def __getNextSpace(currentSpace, adjacentBugCount): if currentSpace == '#' and adjacentBugCount != 1: return '.' elif currentSpace == '.' and (adjacentBugCount == 1 or adjacentBugCount == 2): return '#' else: return currentSpace def __getDimensions(matrix): return len(matrix), len(matrix[0]) def __countBugsInLayout(layoutString): return layoutString.count('#')
__separator = '/' __layer_template = '...../...../..?../...../.....' __inner_border = set([(1, 2), (3, 2), (2, 1), (2, 3)]) def calculate_biodiversity_rating(layout): layout_string = layout.replace(__SEPARATOR, '') biodiveristy_rating = 0 for i in range(0, len(layoutString)): if layoutString[i] == '#': biodiveristy_rating += pow(2, i) return biodiveristyRating def get_first_layout_to_appear_twice(layout): all_layouts = set() allLayouts.add(layout) current_layout = layout while True: next_layout = __calculate_next_layout(currentLayout) if nextLayout in allLayouts: return nextLayout else: allLayouts.add(nextLayout) current_layout = nextLayout def count_bugs_after_minutes(initialLayout, numberOfMinutes): layout_levels = {} layoutLevels[0] = initialLayout max_level = 0 min_level = 0 for _ in range(0, numberOfMinutes): max_level += 1 min_level -= 1 layoutLevels[maxLevel] = __LAYER_TEMPLATE layoutLevels[minLevel] = __LAYER_TEMPLATE layout_levels = __calculate_next_layout_recursively(layoutLevels, minLevel, maxLevel) if __count_bugs_in_layout(layoutLevels[maxLevel]) == 0: del layoutLevels[maxLevel] max_level -= 1 if __count_bugs_in_layout(layoutLevels[minLevel]) == 0: del layoutLevels[minLevel] min_level += 1 total_bugs = 0 for layer_index in layoutLevels.keys(): total_bugs += __count_bugs_in_layout(layoutLevels[layerIndex]) return totalBugs def __calculate_next_layout(currentLayout): current_layout_matrix = currentLayout.split(__SEPARATOR) (column_length, row_length) = __get_dimensions(currentLayoutMatrix) next_layout_matrix = ['' * rowLength] * columnLength for y in range(0, columnLength): for x in range(0, rowLength): adjacent_bug_count = __calculate_adjacent_bug_count_on_level(currentLayoutMatrix, rowLength, columnLength, x, y) current_space = currentLayoutMatrix[y][x] nextLayoutMatrix[y] += __get_next_space(currentSpace, adjacentBugCount) return __SEPARATOR.join(nextLayoutMatrix) def __calculate_next_layout_recursively(layoutGrid, minLevel, maxLevel): new_layout_grid = layoutGrid.copy() for layout_level in layoutGrid.keys(): layout = layoutGrid[layoutLevel] current_layout_matrix = layout.split(__SEPARATOR) (column_length, row_length) = __get_dimensions(currentLayoutMatrix) next_layout_matrix = ['' * rowLength] * columnLength for y in range(0, columnLength): for x in range(0, rowLength): adjacent_bug_count = __calculate_adjacent_bug_count_on_level(currentLayoutMatrix, rowLength, columnLength, x, y) if (x, y) in __INNER_BORDER and layoutLevel != maxLevel: adjacent_bug_count += __calculate_adjacent_bug_count_from_inner_level(layoutGrid[layoutLevel + 1], x, y) if (x == 0 or x == 4 or y == 0 or (y == 4)) and layoutLevel != minLevel: adjacent_bug_count += __calculate_adjacent_bug_count_from_outer_level(layoutGrid[layoutLevel - 1], x, y) current_space = currentLayoutMatrix[y][x] nextLayoutMatrix[y] += __get_next_space(currentSpace, adjacentBugCount) newLayoutGrid[layoutLevel] = __SEPARATOR.join(nextLayoutMatrix) return newLayoutGrid def __calculate_adjacent_bug_count_on_level(currentLayoutMatrix, rowLength, columnLength, x, y): adjacent_bug_count = 0 if x > 0 and currentLayoutMatrix[y][x - 1] == '#': adjacent_bug_count += 1 if x < rowLength - 1 and currentLayoutMatrix[y][x + 1] == '#': adjacent_bug_count += 1 if y > 0 and currentLayoutMatrix[y - 1][x] == '#': adjacent_bug_count += 1 if y < columnLength - 1 and currentLayoutMatrix[y + 1][x] == '#': adjacent_bug_count += 1 return adjacentBugCount def __calculate_adjacent_bug_count_from_inner_level(innerLayout, x, y): adjacent_bug_count = 0 current_layout_matrix = innerLayout.split(__SEPARATOR) (column_length, row_length) = __get_dimensions(currentLayoutMatrix) if (x, y) == (1, 2): for i in range(0, columnLength): if currentLayoutMatrix[i][0] == '#': adjacent_bug_count += 1 elif (x, y) == (3, 2): for i in range(0, columnLength): if currentLayoutMatrix[i][4] == '#': adjacent_bug_count += 1 elif (x, y) == (2, 1): for i in range(0, rowLength): if currentLayoutMatrix[0][i] == '#': adjacent_bug_count += 1 elif (x, y) == (2, 3): for i in range(0, rowLength): if currentLayoutMatrix[4][i] == '#': adjacent_bug_count += 1 return adjacentBugCount def __calculate_adjacent_bug_count_from_outer_level(outerLayout, x, y): adjacent_bug_count = 0 outer_matrix = outerLayout.split(__SEPARATOR) if x == 0 and outerMatrix[2][1] == '#': adjacent_bug_count += 1 if x == 4 and outerMatrix[2][3] == '#': adjacent_bug_count += 1 if y == 0 and outerMatrix[1][2] == '#': adjacent_bug_count += 1 if y == 4 and outerMatrix[3][2] == '#': adjacent_bug_count += 1 return adjacentBugCount def __get_next_space(currentSpace, adjacentBugCount): if currentSpace == '#' and adjacentBugCount != 1: return '.' elif currentSpace == '.' and (adjacentBugCount == 1 or adjacentBugCount == 2): return '#' else: return currentSpace def __get_dimensions(matrix): return (len(matrix), len(matrix[0])) def __count_bugs_in_layout(layoutString): return layoutString.count('#')
{ "targets": [ { "target_name": "aacencoder", "sources": [ "aacencoder.cc" ], "include_dirs": [ ], "libraries": [ "-lfaac" ] } ] }
{'targets': [{'target_name': 'aacencoder', 'sources': ['aacencoder.cc'], 'include_dirs': [], 'libraries': ['-lfaac']}]}
def main(): my_tuple = (4, 4, 3, 2, 5, 7, 8, 8, 8, 7) evens = tuple([ item for item in my_tuple if item & 1 == 0 ]) odds = tuple([ item for item in my_tuple if item & 1 == 1 ]) print("Evens :", evens); print("Odds :", odds); if __name__ == '__main__': main()
def main(): my_tuple = (4, 4, 3, 2, 5, 7, 8, 8, 8, 7) evens = tuple([item for item in my_tuple if item & 1 == 0]) odds = tuple([item for item in my_tuple if item & 1 == 1]) print('Evens :', evens) print('Odds :', odds) if __name__ == '__main__': main()
# http://codeforces.com/problemset/problem/263/A matrix = [list(map(int, input().split())) for i in range(5)] # x = [x for x in matrix if 1 in x][0] # print(x.index(1)) row_counter = 0 for i in range(5): if sum(matrix[i]) > 0: break row_counter += 1 col_counter = 0 for i in range(5): if matrix[row_counter][i] == 1: break col_counter += 1 row = abs(row_counter - 2) col = abs(col_counter - 2) print(row + col)
matrix = [list(map(int, input().split())) for i in range(5)] row_counter = 0 for i in range(5): if sum(matrix[i]) > 0: break row_counter += 1 col_counter = 0 for i in range(5): if matrix[row_counter][i] == 1: break col_counter += 1 row = abs(row_counter - 2) col = abs(col_counter - 2) print(row + col)
N = int(input()) K = int(input()) M = int(input()) def mul(m1, m2): m = [[0,0],[0,0]] for i in range(0,2): for j in range(0,2): for k in range(0,2): m[i][j] = m[i][j]+m1[i][k]*m2[k][j] m[i][j] = m[i][j] % M return m def mpow(m, p): res = [[1,0],[0,1]] while p > 0: if p & 1: res = mul(res, m) m = mul(m, m) p = p >> 1 return res m = [[K-1,K-1],[1,0]] r = mpow(m, N) print(r[0][0])
n = int(input()) k = int(input()) m = int(input()) def mul(m1, m2): m = [[0, 0], [0, 0]] for i in range(0, 2): for j in range(0, 2): for k in range(0, 2): m[i][j] = m[i][j] + m1[i][k] * m2[k][j] m[i][j] = m[i][j] % M return m def mpow(m, p): res = [[1, 0], [0, 1]] while p > 0: if p & 1: res = mul(res, m) m = mul(m, m) p = p >> 1 return res m = [[K - 1, K - 1], [1, 0]] r = mpow(m, N) print(r[0][0])
# options NO = 0 YES = 1 def translate_option(options): option_list = [] for option in options: option_list.append((option[0], option[1])) return option_list yes_no_options = translate_option([("No", NO), ("Yes", YES)])
no = 0 yes = 1 def translate_option(options): option_list = [] for option in options: option_list.append((option[0], option[1])) return option_list yes_no_options = translate_option([('No', NO), ('Yes', YES)])
# Default url patters for the engine. urlpatterns = []
urlpatterns = []
# # @lc app=leetcode id=15 lang=python3 # # [15] 3Sum # # O(n^2) time | O(n) space class Solution: def threeSum(self, array, k=0): array.sort() ans = [] for i in range(len(array) - 1): left = i + 1 right = len(array) - 1 if i > 0 and array[i] == array[i-1]: continue while left < right: potentialSum = array[i] + array[left] + array[right] if potentialSum == k: ans.append([array[i], array[left], array[right]]) while left < right and array[left] == array[left+1]: left += 1 while right > left and array[right] == array[right - 1]: right -= 1 left += 1 right -= 1 elif potentialSum < k: left += 1 else: right -= 1 return ans
class Solution: def three_sum(self, array, k=0): array.sort() ans = [] for i in range(len(array) - 1): left = i + 1 right = len(array) - 1 if i > 0 and array[i] == array[i - 1]: continue while left < right: potential_sum = array[i] + array[left] + array[right] if potentialSum == k: ans.append([array[i], array[left], array[right]]) while left < right and array[left] == array[left + 1]: left += 1 while right > left and array[right] == array[right - 1]: right -= 1 left += 1 right -= 1 elif potentialSum < k: left += 1 else: right -= 1 return ans
# Copyright (c) 2015-2022 Adam Karpierz # Licensed under the MIT License # https://opensource.org/licenses/MIT __import__("pkg_about").about("jtypes.pyjava") __copyright__ = f"Copyright (c) 2015-2022 {__author__}" # noqa
__import__('pkg_about').about('jtypes.pyjava') __copyright__ = f'Copyright (c) 2015-2022 {__author__}'
INVALID_VALUE = -1 ## @brief Captures an intraday best quote,i.e. the bid/ask prices/sizes class Quote( object ): def __init__( self, bid_price, bid_size, ask_price, ask_size ): self.bid_price = bid_price self.bid_size = bid_size self.ask_price = ask_price self.ask_size = ask_size def initialize( self ): self.bid_price = INVALID_VALUE self.bid_size = INVALID_VALUE self.ask_price = INVALID_VALUE self.ask_size = INVALID_VALUE def is_valid( self ): return ( self.bid_price > 0 and self.ask_price > 0 and self.bid_size > 0 and self.ask_size > 0 ) class PeriodicBar( object ): def __init__( self, open, close, high, low, volume, ts ): self.open = open self.close = close self.high = high self.low = low self.volume = volume self.ts = ts def initialize( self ): self.open.initialize( ) self.close.initialize( ) self.high = INVALID_VALUE self.low = INVALID_VALUE self.volume = INVALID_VALUE self.ts = 0 def is_valid( self ): return ( self.low > 0 and self.high > 0 and self.open.is_valid( ) and self.close.is_valid( ) and self.volume >= 0 )
invalid_value = -1 class Quote(object): def __init__(self, bid_price, bid_size, ask_price, ask_size): self.bid_price = bid_price self.bid_size = bid_size self.ask_price = ask_price self.ask_size = ask_size def initialize(self): self.bid_price = INVALID_VALUE self.bid_size = INVALID_VALUE self.ask_price = INVALID_VALUE self.ask_size = INVALID_VALUE def is_valid(self): return self.bid_price > 0 and self.ask_price > 0 and (self.bid_size > 0) and (self.ask_size > 0) class Periodicbar(object): def __init__(self, open, close, high, low, volume, ts): self.open = open self.close = close self.high = high self.low = low self.volume = volume self.ts = ts def initialize(self): self.open.initialize() self.close.initialize() self.high = INVALID_VALUE self.low = INVALID_VALUE self.volume = INVALID_VALUE self.ts = 0 def is_valid(self): return self.low > 0 and self.high > 0 and self.open.is_valid() and self.close.is_valid() and (self.volume >= 0)
##python program to print a pattern n=int(input("No of rows\n")) for i in range(0,n): for j in range (0,i+1): print("*", end="") print()
n = int(input('No of rows\n')) for i in range(0, n): for j in range(0, i + 1): print('*', end='') print()
# DomirScire A1=[1,4,9] A2=[9,9,9] def plus_one(A): A[-1] += 1 for i in reversed(range(1, len(A))): if A[i] != 10: break A[i]=0 A[i-1] += 1 if A[0] == 10: A[0]=1 A.append(0) return A if __name__ == "__main__": print(plus_one(A1)) print(plus_one(A2))
a1 = [1, 4, 9] a2 = [9, 9, 9] def plus_one(A): A[-1] += 1 for i in reversed(range(1, len(A))): if A[i] != 10: break A[i] = 0 A[i - 1] += 1 if A[0] == 10: A[0] = 1 A.append(0) return A if __name__ == '__main__': print(plus_one(A1)) print(plus_one(A2))
def main(): a = int(input("first number: ")) b = int(input("second number: ")) c = int(input("third number: ")) if a == b or b == c or c == a: message = "\ngood bye" else: if a > b: if a > c: largest_number = a else: largest_number = c elif b > c: if b > a: largest_number = b else: largest_number = a elif c > a: if c > b: largest_number = c else: largest_number = b message = "\nThe largest number is " + str(largest_number) + "." print(message) main()
def main(): a = int(input('first number: ')) b = int(input('second number: ')) c = int(input('third number: ')) if a == b or b == c or c == a: message = '\ngood bye' else: if a > b: if a > c: largest_number = a else: largest_number = c elif b > c: if b > a: largest_number = b else: largest_number = a elif c > a: if c > b: largest_number = c else: largest_number = b message = '\nThe largest number is ' + str(largest_number) + '.' print(message) main()
BLACK = 1 WHITE = -1 EMPTY = 0 symbols = {BLACK: 'X', WHITE: 'O', EMPTY: '.'}
black = 1 white = -1 empty = 0 symbols = {BLACK: 'X', WHITE: 'O', EMPTY: '.'}
#!/usr/bin/env python # -*- encoding: utf-8 -*- ## # Copyright 2018 FIWARE Foundation, e.V. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. ## class FilterData: @staticmethod def filter(data): result = list(map(lambda x: FilterData.__filter__(x), data)) return result @staticmethod def __filter__(data): result = dict() result['key'] = data['key'] result['comments'] = list(map(lambda x: FilterData.__get_data__(x), data['body'])) return result @staticmethod def __get_data__(data): result = data['body'] index = result.find('----') if index > -1: result = result[index+6:] result = result.replace('\n', '\\n').replace('\r', '\\r') return result
class Filterdata: @staticmethod def filter(data): result = list(map(lambda x: FilterData.__filter__(x), data)) return result @staticmethod def __filter__(data): result = dict() result['key'] = data['key'] result['comments'] = list(map(lambda x: FilterData.__get_data__(x), data['body'])) return result @staticmethod def __get_data__(data): result = data['body'] index = result.find('----') if index > -1: result = result[index + 6:] result = result.replace('\n', '\\n').replace('\r', '\\r') return result
#!/usr/bin/env python3 # create list proto = ["ssh", "http", "https"] # print entire list print(proto) # print second list item print(proto[1]) # line add d, n, s proto.extend("dns") print(proto)
proto = ['ssh', 'http', 'https'] print(proto) print(proto[1]) proto.extend('dns') print(proto)
print("Welcome to Hangman") name=input("What's your name?") print("Hi "+name) print("_ _ _ _ _") firstletter=input("What's your first letter?") if firstletter==("a"): print("a _ _ _ _") secondletter=input("What's your second letter?") if firstletter==("a"): if secondletter==("p"): print("app_ _") elif secondletter==("e"): print("a_ _ _e") elif secondletter==("l"): print("a_ _ l _") elif firstletter==("p"): if secondletter==("a"): print("app_ _") elif secondletter==("e"): print("_ pp _ e") elif secondletter==("l"): print("_ ppl _") elif firstletter==("l"): if secondletter==("a"): print("a_ _ l _") elif secondletter==("p"): print("_ ppl _") elif secondletter==("e"): print("_ _ _ le") elif firstletter==("e"): if secondletter==("a"): print("a_ _ _ e") elif secondletter==("p"): print("_ pp _ e") elif secondletter==("l"): print("_ _ _ le") elif firstletter==("p"): print("_ p p _ _") secondletter=input("What's your second letter?") if firstletter==("a"): if secondletter==("p"): print("app_ _") elif secondletter==("e"): print("a_ _ _e") elif secondletter==("l"): print("a_ _ l _") elif firstletter==("p"): if secondletter==("a"): print("app_ _") elif secondletter==("e"): print("_ pp _ e") elif secondletter==("l"): print("_ ppl _") elif firstletter==("l"): if secondletter==("a"): print("a_ _ l _") elif secondletter==("p"): print("_ ppl _") elif secondletter==("e"): print("_ _ _ le") elif firstletter==("e"): if secondletter==("a"): print("a_ _ _ e") elif secondletter==("p"): print("_ pp _ e") elif secondletter==("l"): print("_ _ _ le") elif firstletter==("l"): print("_ _ _ l _") secondletter=input("What's your second letter?") if firstletter==("a"): if secondletter==("p"): print("app_ _") elif secondletter==("e"): print("a_ _ _e") elif secondletter==("l"): print("a_ _ l _") elif firstletter==("p"): if secondletter==("a"): print("app_ _") elif secondletter==("e"): print("_ pp _ e") elif secondletter==("l"): print("_ ppl _") elif firstletter==("l"): if secondletter==("a"): print("a_ _ l _") elif secondletter==("p"): print("_ ppl _") elif secondletter==("e"): print("_ _ _ le") elif firstletter==("e"): if secondletter==("a"): print("a_ _ _ e") elif secondletter==("p"): print("_ pp _ e") elif secondletter==("l"): print("_ _ _ le") elif firstletter==("e"): print("_ _ _ _ e") secondletter=input("What's your second letter?") if firstletter==("a"): if secondletter==("p"): print("app_ _") elif secondletter==("e"): print("a_ _ _e") elif secondletter==("l"): print("a_ _ l _") elif firstletter==("p"): if secondletter==("a"): print("app_ _") elif secondletter==("e"): print("_ pp _ e") elif secondletter==("l"): print("_ ppl _") elif firstletter==("l"): if secondletter==("a"): print("a_ _ l _") elif secondletter==("p"): print("_ ppl _") elif secondletter==("e"): print("_ _ _ le") elif firstletter==("e"): if secondletter==("a"): print("a_ _ _ e") elif secondletter==("p"): print("_ pp _ e") elif secondletter==("l"): print("_ _ _ le") else: print("Sorry, no!")
print('Welcome to Hangman') name = input("What's your name?") print('Hi ' + name) print('_ _ _ _ _') firstletter = input("What's your first letter?") if firstletter == 'a': print('a _ _ _ _') secondletter = input("What's your second letter?") if firstletter == 'a': if secondletter == 'p': print('app_ _') elif secondletter == 'e': print('a_ _ _e') elif secondletter == 'l': print('a_ _ l _') elif firstletter == 'p': if secondletter == 'a': print('app_ _') elif secondletter == 'e': print('_ pp _ e') elif secondletter == 'l': print('_ ppl _') elif firstletter == 'l': if secondletter == 'a': print('a_ _ l _') elif secondletter == 'p': print('_ ppl _') elif secondletter == 'e': print('_ _ _ le') elif firstletter == 'e': if secondletter == 'a': print('a_ _ _ e') elif secondletter == 'p': print('_ pp _ e') elif secondletter == 'l': print('_ _ _ le') elif firstletter == 'p': print('_ p p _ _') secondletter = input("What's your second letter?") if firstletter == 'a': if secondletter == 'p': print('app_ _') elif secondletter == 'e': print('a_ _ _e') elif secondletter == 'l': print('a_ _ l _') elif firstletter == 'p': if secondletter == 'a': print('app_ _') elif secondletter == 'e': print('_ pp _ e') elif secondletter == 'l': print('_ ppl _') elif firstletter == 'l': if secondletter == 'a': print('a_ _ l _') elif secondletter == 'p': print('_ ppl _') elif secondletter == 'e': print('_ _ _ le') elif firstletter == 'e': if secondletter == 'a': print('a_ _ _ e') elif secondletter == 'p': print('_ pp _ e') elif secondletter == 'l': print('_ _ _ le') elif firstletter == 'l': print('_ _ _ l _') secondletter = input("What's your second letter?") if firstletter == 'a': if secondletter == 'p': print('app_ _') elif secondletter == 'e': print('a_ _ _e') elif secondletter == 'l': print('a_ _ l _') elif firstletter == 'p': if secondletter == 'a': print('app_ _') elif secondletter == 'e': print('_ pp _ e') elif secondletter == 'l': print('_ ppl _') elif firstletter == 'l': if secondletter == 'a': print('a_ _ l _') elif secondletter == 'p': print('_ ppl _') elif secondletter == 'e': print('_ _ _ le') elif firstletter == 'e': if secondletter == 'a': print('a_ _ _ e') elif secondletter == 'p': print('_ pp _ e') elif secondletter == 'l': print('_ _ _ le') elif firstletter == 'e': print('_ _ _ _ e') secondletter = input("What's your second letter?") if firstletter == 'a': if secondletter == 'p': print('app_ _') elif secondletter == 'e': print('a_ _ _e') elif secondletter == 'l': print('a_ _ l _') elif firstletter == 'p': if secondletter == 'a': print('app_ _') elif secondletter == 'e': print('_ pp _ e') elif secondletter == 'l': print('_ ppl _') elif firstletter == 'l': if secondletter == 'a': print('a_ _ l _') elif secondletter == 'p': print('_ ppl _') elif secondletter == 'e': print('_ _ _ le') elif firstletter == 'e': if secondletter == 'a': print('a_ _ _ e') elif secondletter == 'p': print('_ pp _ e') elif secondletter == 'l': print('_ _ _ le') else: print('Sorry, no!')
# # PySNMP MIB module DLINK-3100-IpRouter (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DLINK-3100-IpRouter # Produced by pysmi-0.3.4 at Mon Apr 29 18:33:36 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # Integer, OctetString, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "Integer", "OctetString", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueRangeConstraint") ipRouteLeaking, rip2Spec, rlOspf, ipRipFilter, ipRedundancy, ipSpec, rlIpRoutingProtPreference = mibBuilder.importSymbols("DLINK-3100-IP", "ipRouteLeaking", "rip2Spec", "rlOspf", "ipRipFilter", "ipRedundancy", "ipSpec", "rlIpRoutingProtPreference") RouterID, ospfVirtIfEntry, ospfIfEntry, AreaID = mibBuilder.importSymbols("OSPF-MIB", "RouterID", "ospfVirtIfEntry", "ospfIfEntry", "AreaID") rip2IfConfEntry, = mibBuilder.importSymbols("RFC1389-MIB", "rip2IfConfEntry") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Integer32, IpAddress, Gauge32, Unsigned32, Bits, Counter32, ObjectIdentity, MibIdentifier, ModuleIdentity, Counter64, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, TimeTicks, NotificationType = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "IpAddress", "Gauge32", "Unsigned32", "Bits", "Counter32", "ObjectIdentity", "MibIdentifier", "ModuleIdentity", "Counter64", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "TimeTicks", "NotificationType") TextualConvention, RowStatus, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "RowStatus", "TruthValue", "DisplayString") rlIpRouter = ModuleIdentity((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 18)) rlIpRouter.setRevisions(('2004-06-01 00:00',)) if mibBuilder.loadTexts: rlIpRouter.setLastUpdated('200406010000Z') if mibBuilder.loadTexts: rlIpRouter.setOrganization('Dlink, Inc.') rsRip2IfConfTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1), ) if mibBuilder.loadTexts: rsRip2IfConfTable.setStatus('current') rsRip2IfConfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1), ).setIndexNames((0, "DLINK-3100-IpRouter", "rsRip2IfConfAddress")) if mibBuilder.loadTexts: rsRip2IfConfEntry.setStatus('current') rsRip2IfConfAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rsRip2IfConfAddress.setStatus('current') rsRip2IfConfVirtualDis = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1, 2), Integer32().clone(1)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsRip2IfConfVirtualDis.setStatus('current') rsRip2IfConfAutoSend = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsRip2IfConfAutoSend.setStatus('current') rlRip2IfConfKeyChain = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1, 4), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlRip2IfConfKeyChain.setStatus('current') rlRip2AutoInterfaceCreation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlRip2AutoInterfaceCreation.setStatus('current') rlRip2MibVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlRip2MibVersion.setStatus('current') ipRedundAdminStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRedundAdminStatus.setStatus('current') ipRedundOperStatus = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("inactive", 2))).clone('inactive')).setMaxAccess("readonly") if mibBuilder.loadTexts: ipRedundOperStatus.setStatus('current') ipRedundRoutersTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3), ) if mibBuilder.loadTexts: ipRedundRoutersTable.setStatus('current') ipRedundRoutersEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1), ).setIndexNames((0, "DLINK-3100-IpRouter", "ipRedundRoutersIfAddr"), (0, "DLINK-3100-IpRouter", "ipRedundRoutersMainRouterAddr")) if mibBuilder.loadTexts: ipRedundRoutersEntry.setStatus('current') ipRedundRoutersIfAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipRedundRoutersIfAddr.setStatus('current') ipRedundRoutersMainRouterAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: ipRedundRoutersMainRouterAddr.setStatus('current') ipRedundRoutersOperStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("active", 1), ("inactive", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: ipRedundRoutersOperStatus.setStatus('current') ipRedundRoutersPollInterval = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 4), Integer32().clone(3)).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRedundRoutersPollInterval.setStatus('current') ipRedundRoutersTimeout = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 5), Integer32().clone(12)).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRedundRoutersTimeout.setStatus('current') ipRedundRoutersStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("active", 1), ("notInService", 2), ("notReady", 3), ("createAndGo", 4), ("createAndWait", 5), ("destroy", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipRedundRoutersStatus.setStatus('current') ipLeakStaticToRip = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipLeakStaticToRip.setStatus('current') ipLeakStaticToOspf = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipLeakStaticToOspf.setStatus('current') ipLeakOspfToRip = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipLeakOspfToRip.setStatus('current') ipLeakRipToOspf = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipLeakRipToOspf.setStatus('current') ipLeakExtDirectToOspf = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2))).clone('enable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: ipLeakExtDirectToOspf.setStatus('current') rsIpRipFilterGlbTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1), ) if mibBuilder.loadTexts: rsIpRipFilterGlbTable.setStatus('current') rsIpRipFilterGlbEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1), ).setIndexNames((0, "DLINK-3100-IpRouter", "rsIpRipFilterGlbType"), (0, "DLINK-3100-IpRouter", "rsIpRipFilterGlbNumber")) if mibBuilder.loadTexts: rsIpRipFilterGlbEntry.setStatus('current') rsIpRipFilterGlbType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("input", 1), ("output", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rsIpRipFilterGlbType.setStatus('current') rsIpRipFilterGlbNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rsIpRipFilterGlbNumber.setStatus('current') rsIpRipFilterGlbStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2), ("underCreation", 3))).clone('valid')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterGlbStatus.setStatus('current') rsIpRipFilterGlbIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 4), IpAddress().clone(hexValue="00000000")).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterGlbIpAddr.setStatus('current') rsIpRipFilterGlbNetworkMaskBits = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 5), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterGlbNetworkMaskBits.setStatus('current') rsIpRipFilterGlbMatchBits = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 6), Integer32().clone(32)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterGlbMatchBits.setStatus('current') rsIpRipFilterGlbAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("deny", 1), ("permit", 2))).clone('permit')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterGlbAction.setStatus('current') rsIpRipFilterLclTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2), ) if mibBuilder.loadTexts: rsIpRipFilterLclTable.setStatus('current') rsIpRipFilterLclEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1), ).setIndexNames((0, "DLINK-3100-IpRouter", "rsIpRipFilterLclIpIntf"), (0, "DLINK-3100-IpRouter", "rsIpRipFilterLclType"), (0, "DLINK-3100-IpRouter", "rsIpRipFilterLclNumber")) if mibBuilder.loadTexts: rsIpRipFilterLclEntry.setStatus('current') rsIpRipFilterLclIpIntf = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rsIpRipFilterLclIpIntf.setStatus('current') rsIpRipFilterLclType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("input", 1), ("output", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rsIpRipFilterLclType.setStatus('current') rsIpRipFilterLclNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rsIpRipFilterLclNumber.setStatus('current') rsIpRipFilterLclStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("valid", 1), ("invalid", 2), ("underCreation", 3))).clone('valid')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterLclStatus.setStatus('current') rsIpRipFilterLclIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 5), IpAddress().clone(hexValue="00000000")).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterLclIpAddr.setStatus('current') rsIpRipFilterLclNetworkMaskBits = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 6), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterLclNetworkMaskBits.setStatus('current') rsIpRipFilterLclMatchBits = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 7), Integer32().clone(32)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterLclMatchBits.setStatus('current') rsIpRipFilterLclAction = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("deny", 1), ("permit", 2))).clone('permit')).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsIpRipFilterLclAction.setStatus('current') rlIpRoutingProtPreferenceDirect = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 254)).clone(20)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpRoutingProtPreferenceDirect.setStatus('current') rlIpRoutingProtPreferenceStatic = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(10)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpRoutingProtPreferenceStatic.setStatus('current') rlIpRoutingProtPreferenceOspfInter = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(30)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpRoutingProtPreferenceOspfInter.setStatus('current') rlIpRoutingProtPreferenceOspfExt = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(60)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpRoutingProtPreferenceOspfExt.setStatus('current') rlIpRoutingProtPreferenceOspfReject = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(254)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpRoutingProtPreferenceOspfReject.setStatus('current') rlIpRoutingProtPreferenceRipNormal = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(60)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpRoutingProtPreferenceRipNormal.setStatus('current') rlIpRoutingProtPreferenceRipAggregate = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(254)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpRoutingProtPreferenceRipAggregate.setStatus('current') rlIpRoutingProtPreferenceBgp = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255)).clone(80)).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlIpRoutingProtPreferenceBgp.setStatus('current') rlOspfMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfMibVersion.setStatus('current') rlOspfAutoInterfaceCreation = MibScalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enable", 1), ("disable", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAutoInterfaceCreation.setStatus('current') rlOspfIfExtTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 3), ) if mibBuilder.loadTexts: rlOspfIfExtTable.setStatus('current') rlOspfIfExtEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 3, 1), ) ospfIfEntry.registerAugmentions(("DLINK-3100-IpRouter", "rlOspfIfExtEntry")) rlOspfIfExtEntry.setIndexNames(*ospfIfEntry.getIndexNames()) if mibBuilder.loadTexts: rlOspfIfExtEntry.setStatus('current') rlOspfifKeyChain = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 3, 1, 1), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlOspfifKeyChain.setStatus('current') rlOspfRtrLnkTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4), ) if mibBuilder.loadTexts: rlOspfRtrLnkTable.setStatus('current') rlOspfRtrLnkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1), ).setIndexNames((0, "DLINK-3100-IpRouter", "rlOspfRtrLnkAreaId"), (0, "DLINK-3100-IpRouter", "rlOspfRtrLnkLsid"), (0, "DLINK-3100-IpRouter", "rlOspfRtrLnkRouterId"), (0, "DLINK-3100-IpRouter", "rlOspfRtrLnkIdx")) if mibBuilder.loadTexts: rlOspfRtrLnkEntry.setStatus('current') rlOspfRtrLnkAreaId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 1), AreaID()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkAreaId.setStatus('current') rlOspfRtrLnkLsid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkLsid.setStatus('current') rlOspfRtrLnkRouterId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 3), RouterID()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkRouterId.setStatus('current') rlOspfRtrLnkIdx = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkIdx.setStatus('current') rlOspfRtrLnkSequence = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkSequence.setStatus('current') rlOspfRtrLnkAge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkAge.setStatus('current') rlOspfRtrLnkChecksum = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkChecksum.setStatus('current') rlOspfRtrLnkLength = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkLength.setStatus('current') rlOspfRtrLnkBitV = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkBitV.setStatus('current') rlOspfRtrLnkBitE = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkBitE.setStatus('current') rlOspfRtrLnkBitB = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkBitB.setStatus('current') rlOspfRtrLnkLinks = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 12), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkLinks.setStatus('current') rlOspfRtrLnkLinkID = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 13), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkLinkID.setStatus('current') rlOspfRtrLnkLinkData = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 14), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkLinkData.setStatus('current') rlOspfRtrLnkType = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("pointToPoint", 1), ("transitNetwork", 2), ("stubNetwork", 3), ("virtualLink", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkType.setStatus('current') rlOspfRtrLnkMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 16), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfRtrLnkMetric.setStatus('current') rlOspfNetLnkTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5), ) if mibBuilder.loadTexts: rlOspfNetLnkTable.setStatus('current') rlOspfNetLnkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1), ).setIndexNames((0, "DLINK-3100-IpRouter", "rlOspfNetLnkAreaId"), (0, "DLINK-3100-IpRouter", "rlOspfNetLnkLsid"), (0, "DLINK-3100-IpRouter", "rlOspfNetLnkRouterId"), (0, "DLINK-3100-IpRouter", "rlOspfNetLnkIdx")) if mibBuilder.loadTexts: rlOspfNetLnkEntry.setStatus('current') rlOspfNetLnkAreaId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 1), AreaID()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkAreaId.setStatus('current') rlOspfNetLnkLsid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkLsid.setStatus('current') rlOspfNetLnkRouterId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 3), RouterID()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkRouterId.setStatus('current') rlOspfNetLnkIdx = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkIdx.setStatus('current') rlOspfNetLnkSequence = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkSequence.setStatus('current') rlOspfNetLnkAge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkAge.setStatus('current') rlOspfNetLnkChecksum = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkChecksum.setStatus('current') rlOspfNetLnkLength = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkLength.setStatus('current') rlOspfNetLnkMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 9), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkMask.setStatus('current') rlOspfNetLnkAttRouter = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfNetLnkAttRouter.setStatus('current') rlOspfSumLnkTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6), ) if mibBuilder.loadTexts: rlOspfSumLnkTable.setStatus('current') rlOspfSumLnkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1), ).setIndexNames((0, "DLINK-3100-IpRouter", "rlOspfSumLnkAreaId"), (0, "DLINK-3100-IpRouter", "rlOspfSumLnkLsid"), (0, "DLINK-3100-IpRouter", "rlOspfSumLnkRouterId")) if mibBuilder.loadTexts: rlOspfSumLnkEntry.setStatus('current') rlOspfSumLnkAreaId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 1), AreaID()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfSumLnkAreaId.setStatus('current') rlOspfSumLnkLsid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfSumLnkLsid.setStatus('current') rlOspfSumLnkRouterId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 3), RouterID()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfSumLnkRouterId.setStatus('current') rlOspfSumLnkSequence = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfSumLnkSequence.setStatus('current') rlOspfSumLnkAge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfSumLnkAge.setStatus('current') rlOspfSumLnkChecksum = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfSumLnkChecksum.setStatus('current') rlOspfSumLnkLength = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfSumLnkLength.setStatus('current') rlOspfSumLnkMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfSumLnkMask.setStatus('current') rlOspfSumLnkMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 9), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfSumLnkMetric.setStatus('current') rlOspfAsbLnkTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7), ) if mibBuilder.loadTexts: rlOspfAsbLnkTable.setStatus('current') rlOspfAsbLnkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1), ).setIndexNames((0, "DLINK-3100-IpRouter", "rlOspfAsbLnkAreaId"), (0, "DLINK-3100-IpRouter", "rlOspfAsbLnkLsid"), (0, "DLINK-3100-IpRouter", "rlOspfAsbLnkRouterId")) if mibBuilder.loadTexts: rlOspfAsbLnkEntry.setStatus('current') rlOspfAsbLnkAreaId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 1), AreaID()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAsbLnkAreaId.setStatus('current') rlOspfAsbLnkLsid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAsbLnkLsid.setStatus('current') rlOspfAsbLnkRouterId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 3), RouterID()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAsbLnkRouterId.setStatus('current') rlOspfAsbLnkSequence = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAsbLnkSequence.setStatus('current') rlOspfAsbLnkAge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAsbLnkAge.setStatus('current') rlOspfAsbLnkChecksum = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAsbLnkChecksum.setStatus('current') rlOspfAsbLnkLength = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAsbLnkLength.setStatus('current') rlOspfAsbLnkMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAsbLnkMetric.setStatus('current') rlOspfAseLnkTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8), ) if mibBuilder.loadTexts: rlOspfAseLnkTable.setStatus('current') rlOspfAseLnkEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1), ).setIndexNames((0, "DLINK-3100-IpRouter", "rlOspfAseLnkLsid"), (0, "DLINK-3100-IpRouter", "rlOspfAseLnkRouterId")) if mibBuilder.loadTexts: rlOspfAseLnkEntry.setStatus('current') rlOspfAseLnkLsid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkLsid.setStatus('current') rlOspfAseLnkRouterId = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 2), RouterID()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkRouterId.setStatus('current') rlOspfAseLnkSequence = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkSequence.setStatus('current') rlOspfAseLnkAge = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkAge.setStatus('current') rlOspfAseLnkChecksum = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkChecksum.setStatus('current') rlOspfAseLnkLength = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 6), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkLength.setStatus('current') rlOspfAseLnkMask = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 7), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkMask.setStatus('current') rlOspfAseLnkFrwAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkFrwAddress.setStatus('current') rlOspfAseLnkBitE = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 9), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("off", 1), ("on", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkBitE.setStatus('current') rlOspfAseLnkMetric = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 10), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkMetric.setStatus('current') rlOspfAseLnkTag = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 11), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlOspfAseLnkTag.setStatus('current') rlospfVirtIfExtTable = MibTable((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 9), ) if mibBuilder.loadTexts: rlospfVirtIfExtTable.setStatus('current') rlospfVirtIfExtEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 9, 1), ) ospfVirtIfEntry.registerAugmentions(("DLINK-3100-IpRouter", "rlospfVirtIfExtEntry")) rlospfVirtIfExtEntry.setIndexNames(*ospfVirtIfEntry.getIndexNames()) if mibBuilder.loadTexts: rlospfVirtIfExtEntry.setStatus('current') rlospfVirtifKeyChain = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 9, 1, 1), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlospfVirtifKeyChain.setStatus('current') mibBuilder.exportSymbols("DLINK-3100-IpRouter", rsIpRipFilterGlbNumber=rsIpRipFilterGlbNumber, rlOspfifKeyChain=rlOspfifKeyChain, rlIpRoutingProtPreferenceOspfInter=rlIpRoutingProtPreferenceOspfInter, rlIpRoutingProtPreferenceStatic=rlIpRoutingProtPreferenceStatic, rlOspfAseLnkMask=rlOspfAseLnkMask, rlOspfNetLnkAge=rlOspfNetLnkAge, rsIpRipFilterGlbMatchBits=rsIpRipFilterGlbMatchBits, rlOspfNetLnkTable=rlOspfNetLnkTable, rlOspfNetLnkAttRouter=rlOspfNetLnkAttRouter, ipRedundRoutersOperStatus=ipRedundRoutersOperStatus, rlOspfRtrLnkRouterId=rlOspfRtrLnkRouterId, rlOspfAseLnkLength=rlOspfAseLnkLength, rlOspfNetLnkIdx=rlOspfNetLnkIdx, rlOspfRtrLnkLinkID=rlOspfRtrLnkLinkID, ipRedundRoutersTimeout=ipRedundRoutersTimeout, rlOspfAseLnkAge=rlOspfAseLnkAge, rsRip2IfConfAutoSend=rsRip2IfConfAutoSend, rlospfVirtIfExtTable=rlospfVirtIfExtTable, rlOspfSumLnkAreaId=rlOspfSumLnkAreaId, rsIpRipFilterLclMatchBits=rsIpRipFilterLclMatchBits, rlOspfSumLnkLength=rlOspfSumLnkLength, rsRip2IfConfAddress=rsRip2IfConfAddress, rlospfVirtIfExtEntry=rlospfVirtIfExtEntry, rlIpRoutingProtPreferenceRipNormal=rlIpRoutingProtPreferenceRipNormal, rlOspfRtrLnkTable=rlOspfRtrLnkTable, ipLeakOspfToRip=ipLeakOspfToRip, rlOspfNetLnkMask=rlOspfNetLnkMask, rsIpRipFilterLclNetworkMaskBits=rsIpRipFilterLclNetworkMaskBits, rlOspfIfExtTable=rlOspfIfExtTable, rlOspfRtrLnkEntry=rlOspfRtrLnkEntry, rlOspfAsbLnkLength=rlOspfAsbLnkLength, rsRip2IfConfEntry=rsRip2IfConfEntry, rlIpRoutingProtPreferenceBgp=rlIpRoutingProtPreferenceBgp, rlOspfSumLnkRouterId=rlOspfSumLnkRouterId, ipRedundRoutersMainRouterAddr=ipRedundRoutersMainRouterAddr, rlOspfRtrLnkLength=rlOspfRtrLnkLength, rlOspfAseLnkEntry=rlOspfAseLnkEntry, rlOspfNetLnkLength=rlOspfNetLnkLength, ipLeakExtDirectToOspf=ipLeakExtDirectToOspf, rsIpRipFilterGlbType=rsIpRipFilterGlbType, rlOspfAseLnkFrwAddress=rlOspfAseLnkFrwAddress, rlOspfRtrLnkMetric=rlOspfRtrLnkMetric, rlOspfSumLnkChecksum=rlOspfSumLnkChecksum, rsRip2IfConfTable=rsRip2IfConfTable, rlOspfRtrLnkLinkData=rlOspfRtrLnkLinkData, rlOspfSumLnkMetric=rlOspfSumLnkMetric, rlOspfAsbLnkEntry=rlOspfAsbLnkEntry, rlOspfAsbLnkRouterId=rlOspfAsbLnkRouterId, ipLeakStaticToOspf=ipLeakStaticToOspf, rlOspfRtrLnkSequence=rlOspfRtrLnkSequence, rsIpRipFilterGlbNetworkMaskBits=rsIpRipFilterGlbNetworkMaskBits, rlOspfSumLnkLsid=rlOspfSumLnkLsid, ipRedundRoutersPollInterval=ipRedundRoutersPollInterval, rlOspfNetLnkAreaId=rlOspfNetLnkAreaId, rlOspfRtrLnkIdx=rlOspfRtrLnkIdx, rlOspfAsbLnkMetric=rlOspfAsbLnkMetric, rsIpRipFilterLclIpIntf=rsIpRipFilterLclIpIntf, rlOspfNetLnkChecksum=rlOspfNetLnkChecksum, ipLeakStaticToRip=ipLeakStaticToRip, rsIpRipFilterGlbAction=rsIpRipFilterGlbAction, rlOspfAsbLnkLsid=rlOspfAsbLnkLsid, ipRedundRoutersTable=ipRedundRoutersTable, rlOspfAseLnkChecksum=rlOspfAseLnkChecksum, rlIpRoutingProtPreferenceRipAggregate=rlIpRoutingProtPreferenceRipAggregate, rlOspfRtrLnkAge=rlOspfRtrLnkAge, rlOspfSumLnkAge=rlOspfSumLnkAge, rsIpRipFilterLclNumber=rsIpRipFilterLclNumber, rlOspfRtrLnkBitE=rlOspfRtrLnkBitE, ipLeakRipToOspf=ipLeakRipToOspf, PYSNMP_MODULE_ID=rlIpRouter, rlOspfAsbLnkAge=rlOspfAsbLnkAge, rsIpRipFilterLclTable=rsIpRipFilterLclTable, rlOspfAsbLnkSequence=rlOspfAsbLnkSequence, rlIpRoutingProtPreferenceOspfExt=rlIpRoutingProtPreferenceOspfExt, rlOspfNetLnkEntry=rlOspfNetLnkEntry, rlOspfSumLnkEntry=rlOspfSumLnkEntry, rsIpRipFilterLclStatus=rsIpRipFilterLclStatus, rsRip2IfConfVirtualDis=rsRip2IfConfVirtualDis, rlOspfRtrLnkLsid=rlOspfRtrLnkLsid, rlOspfSumLnkMask=rlOspfSumLnkMask, ipRedundAdminStatus=ipRedundAdminStatus, rlOspfNetLnkSequence=rlOspfNetLnkSequence, rlOspfRtrLnkAreaId=rlOspfRtrLnkAreaId, rlOspfAseLnkTable=rlOspfAseLnkTable, rlOspfMibVersion=rlOspfMibVersion, rlOspfAseLnkLsid=rlOspfAseLnkLsid, rlOspfNetLnkRouterId=rlOspfNetLnkRouterId, rlIpRouter=rlIpRouter, rsIpRipFilterLclType=rsIpRipFilterLclType, rlOspfRtrLnkBitB=rlOspfRtrLnkBitB, ipRedundRoutersStatus=ipRedundRoutersStatus, rlOspfAsbLnkAreaId=rlOspfAsbLnkAreaId, rlOspfAsbLnkTable=rlOspfAsbLnkTable, rlOspfAsbLnkChecksum=rlOspfAsbLnkChecksum, rlIpRoutingProtPreferenceDirect=rlIpRoutingProtPreferenceDirect, rlOspfAseLnkTag=rlOspfAseLnkTag, rsIpRipFilterGlbTable=rsIpRipFilterGlbTable, rlOspfRtrLnkBitV=rlOspfRtrLnkBitV, ipRedundRoutersIfAddr=ipRedundRoutersIfAddr, rsIpRipFilterGlbEntry=rsIpRipFilterGlbEntry, rlOspfIfExtEntry=rlOspfIfExtEntry, rlOspfAseLnkBitE=rlOspfAseLnkBitE, rsIpRipFilterGlbIpAddr=rsIpRipFilterGlbIpAddr, rlRip2MibVersion=rlRip2MibVersion, rlIpRoutingProtPreferenceOspfReject=rlIpRoutingProtPreferenceOspfReject, rlOspfSumLnkTable=rlOspfSumLnkTable, rlOspfAseLnkSequence=rlOspfAseLnkSequence, rlOspfSumLnkSequence=rlOspfSumLnkSequence, rlOspfAseLnkMetric=rlOspfAseLnkMetric, rlospfVirtifKeyChain=rlospfVirtifKeyChain, rsIpRipFilterLclAction=rsIpRipFilterLclAction, ipRedundRoutersEntry=ipRedundRoutersEntry, rlOspfRtrLnkChecksum=rlOspfRtrLnkChecksum, rlOspfAutoInterfaceCreation=rlOspfAutoInterfaceCreation, rsIpRipFilterLclIpAddr=rsIpRipFilterLclIpAddr, ipRedundOperStatus=ipRedundOperStatus, rsIpRipFilterGlbStatus=rsIpRipFilterGlbStatus, rlRip2AutoInterfaceCreation=rlRip2AutoInterfaceCreation, rlOspfAseLnkRouterId=rlOspfAseLnkRouterId, rlRip2IfConfKeyChain=rlRip2IfConfKeyChain, rsIpRipFilterLclEntry=rsIpRipFilterLclEntry, rlOspfRtrLnkLinks=rlOspfRtrLnkLinks, rlOspfNetLnkLsid=rlOspfNetLnkLsid, rlOspfRtrLnkType=rlOspfRtrLnkType)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_union, value_size_constraint, constraints_intersection, single_value_constraint, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsUnion', 'ValueSizeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueRangeConstraint') (ip_route_leaking, rip2_spec, rl_ospf, ip_rip_filter, ip_redundancy, ip_spec, rl_ip_routing_prot_preference) = mibBuilder.importSymbols('DLINK-3100-IP', 'ipRouteLeaking', 'rip2Spec', 'rlOspf', 'ipRipFilter', 'ipRedundancy', 'ipSpec', 'rlIpRoutingProtPreference') (router_id, ospf_virt_if_entry, ospf_if_entry, area_id) = mibBuilder.importSymbols('OSPF-MIB', 'RouterID', 'ospfVirtIfEntry', 'ospfIfEntry', 'AreaID') (rip2_if_conf_entry,) = mibBuilder.importSymbols('RFC1389-MIB', 'rip2IfConfEntry') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (integer32, ip_address, gauge32, unsigned32, bits, counter32, object_identity, mib_identifier, module_identity, counter64, mib_scalar, mib_table, mib_table_row, mib_table_column, iso, time_ticks, notification_type) = mibBuilder.importSymbols('SNMPv2-SMI', 'Integer32', 'IpAddress', 'Gauge32', 'Unsigned32', 'Bits', 'Counter32', 'ObjectIdentity', 'MibIdentifier', 'ModuleIdentity', 'Counter64', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'iso', 'TimeTicks', 'NotificationType') (textual_convention, row_status, truth_value, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'RowStatus', 'TruthValue', 'DisplayString') rl_ip_router = module_identity((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 18)) rlIpRouter.setRevisions(('2004-06-01 00:00',)) if mibBuilder.loadTexts: rlIpRouter.setLastUpdated('200406010000Z') if mibBuilder.loadTexts: rlIpRouter.setOrganization('Dlink, Inc.') rs_rip2_if_conf_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1)) if mibBuilder.loadTexts: rsRip2IfConfTable.setStatus('current') rs_rip2_if_conf_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1)).setIndexNames((0, 'DLINK-3100-IpRouter', 'rsRip2IfConfAddress')) if mibBuilder.loadTexts: rsRip2IfConfEntry.setStatus('current') rs_rip2_if_conf_address = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rsRip2IfConfAddress.setStatus('current') rs_rip2_if_conf_virtual_dis = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1, 2), integer32().clone(1)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsRip2IfConfVirtualDis.setStatus('current') rs_rip2_if_conf_auto_send = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsRip2IfConfAutoSend.setStatus('current') rl_rip2_if_conf_key_chain = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 1, 1, 4), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlRip2IfConfKeyChain.setStatus('current') rl_rip2_auto_interface_creation = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlRip2AutoInterfaceCreation.setStatus('current') rl_rip2_mib_version = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 3, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlRip2MibVersion.setStatus('current') ip_redund_admin_status = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ipRedundAdminStatus.setStatus('current') ip_redund_oper_status = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('active', 1), ('inactive', 2))).clone('inactive')).setMaxAccess('readonly') if mibBuilder.loadTexts: ipRedundOperStatus.setStatus('current') ip_redund_routers_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3)) if mibBuilder.loadTexts: ipRedundRoutersTable.setStatus('current') ip_redund_routers_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1)).setIndexNames((0, 'DLINK-3100-IpRouter', 'ipRedundRoutersIfAddr'), (0, 'DLINK-3100-IpRouter', 'ipRedundRoutersMainRouterAddr')) if mibBuilder.loadTexts: ipRedundRoutersEntry.setStatus('current') ip_redund_routers_if_addr = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ipRedundRoutersIfAddr.setStatus('current') ip_redund_routers_main_router_addr = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: ipRedundRoutersMainRouterAddr.setStatus('current') ip_redund_routers_oper_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('active', 1), ('inactive', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: ipRedundRoutersOperStatus.setStatus('current') ip_redund_routers_poll_interval = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 4), integer32().clone(3)).setMaxAccess('readwrite') if mibBuilder.loadTexts: ipRedundRoutersPollInterval.setStatus('current') ip_redund_routers_timeout = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 5), integer32().clone(12)).setMaxAccess('readwrite') if mibBuilder.loadTexts: ipRedundRoutersTimeout.setStatus('current') ip_redund_routers_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 6, 3, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('active', 1), ('notInService', 2), ('notReady', 3), ('createAndGo', 4), ('createAndWait', 5), ('destroy', 6)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: ipRedundRoutersStatus.setStatus('current') ip_leak_static_to_rip = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ipLeakStaticToRip.setStatus('current') ip_leak_static_to_ospf = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ipLeakStaticToOspf.setStatus('current') ip_leak_ospf_to_rip = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ipLeakOspfToRip.setStatus('current') ip_leak_rip_to_ospf = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('disable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ipLeakRipToOspf.setStatus('current') ip_leak_ext_direct_to_ospf = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 7, 5), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2))).clone('enable')).setMaxAccess('readwrite') if mibBuilder.loadTexts: ipLeakExtDirectToOspf.setStatus('current') rs_ip_rip_filter_glb_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1)) if mibBuilder.loadTexts: rsIpRipFilterGlbTable.setStatus('current') rs_ip_rip_filter_glb_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1)).setIndexNames((0, 'DLINK-3100-IpRouter', 'rsIpRipFilterGlbType'), (0, 'DLINK-3100-IpRouter', 'rsIpRipFilterGlbNumber')) if mibBuilder.loadTexts: rsIpRipFilterGlbEntry.setStatus('current') rs_ip_rip_filter_glb_type = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('input', 1), ('output', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rsIpRipFilterGlbType.setStatus('current') rs_ip_rip_filter_glb_number = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rsIpRipFilterGlbNumber.setStatus('current') rs_ip_rip_filter_glb_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('valid', 1), ('invalid', 2), ('underCreation', 3))).clone('valid')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterGlbStatus.setStatus('current') rs_ip_rip_filter_glb_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 4), ip_address().clone(hexValue='00000000')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterGlbIpAddr.setStatus('current') rs_ip_rip_filter_glb_network_mask_bits = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 5), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterGlbNetworkMaskBits.setStatus('current') rs_ip_rip_filter_glb_match_bits = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 6), integer32().clone(32)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterGlbMatchBits.setStatus('current') rs_ip_rip_filter_glb_action = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('deny', 1), ('permit', 2))).clone('permit')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterGlbAction.setStatus('current') rs_ip_rip_filter_lcl_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2)) if mibBuilder.loadTexts: rsIpRipFilterLclTable.setStatus('current') rs_ip_rip_filter_lcl_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1)).setIndexNames((0, 'DLINK-3100-IpRouter', 'rsIpRipFilterLclIpIntf'), (0, 'DLINK-3100-IpRouter', 'rsIpRipFilterLclType'), (0, 'DLINK-3100-IpRouter', 'rsIpRipFilterLclNumber')) if mibBuilder.loadTexts: rsIpRipFilterLclEntry.setStatus('current') rs_ip_rip_filter_lcl_ip_intf = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rsIpRipFilterLclIpIntf.setStatus('current') rs_ip_rip_filter_lcl_type = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('input', 1), ('output', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rsIpRipFilterLclType.setStatus('current') rs_ip_rip_filter_lcl_number = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rsIpRipFilterLclNumber.setStatus('current') rs_ip_rip_filter_lcl_status = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('valid', 1), ('invalid', 2), ('underCreation', 3))).clone('valid')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterLclStatus.setStatus('current') rs_ip_rip_filter_lcl_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 5), ip_address().clone(hexValue='00000000')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterLclIpAddr.setStatus('current') rs_ip_rip_filter_lcl_network_mask_bits = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 6), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterLclNetworkMaskBits.setStatus('current') rs_ip_rip_filter_lcl_match_bits = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 7), integer32().clone(32)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterLclMatchBits.setStatus('current') rs_ip_rip_filter_lcl_action = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 8, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('deny', 1), ('permit', 2))).clone('permit')).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsIpRipFilterLclAction.setStatus('current') rl_ip_routing_prot_preference_direct = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 254)).clone(20)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlIpRoutingProtPreferenceDirect.setStatus('current') rl_ip_routing_prot_preference_static = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(10)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlIpRoutingProtPreferenceStatic.setStatus('current') rl_ip_routing_prot_preference_ospf_inter = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 3), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(30)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlIpRoutingProtPreferenceOspfInter.setStatus('current') rl_ip_routing_prot_preference_ospf_ext = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(60)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlIpRoutingProtPreferenceOspfExt.setStatus('current') rl_ip_routing_prot_preference_ospf_reject = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(254)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlIpRoutingProtPreferenceOspfReject.setStatus('current') rl_ip_routing_prot_preference_rip_normal = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(60)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlIpRoutingProtPreferenceRipNormal.setStatus('current') rl_ip_routing_prot_preference_rip_aggregate = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(254)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlIpRoutingProtPreferenceRipAggregate.setStatus('current') rl_ip_routing_prot_preference_bgp = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 13, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 255)).clone(80)).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlIpRoutingProtPreferenceBgp.setStatus('current') rl_ospf_mib_version = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfMibVersion.setStatus('current') rl_ospf_auto_interface_creation = mib_scalar((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 2), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('enable', 1), ('disable', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAutoInterfaceCreation.setStatus('current') rl_ospf_if_ext_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 3)) if mibBuilder.loadTexts: rlOspfIfExtTable.setStatus('current') rl_ospf_if_ext_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 3, 1)) ospfIfEntry.registerAugmentions(('DLINK-3100-IpRouter', 'rlOspfIfExtEntry')) rlOspfIfExtEntry.setIndexNames(*ospfIfEntry.getIndexNames()) if mibBuilder.loadTexts: rlOspfIfExtEntry.setStatus('current') rl_ospfif_key_chain = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 3, 1, 1), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlOspfifKeyChain.setStatus('current') rl_ospf_rtr_lnk_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4)) if mibBuilder.loadTexts: rlOspfRtrLnkTable.setStatus('current') rl_ospf_rtr_lnk_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1)).setIndexNames((0, 'DLINK-3100-IpRouter', 'rlOspfRtrLnkAreaId'), (0, 'DLINK-3100-IpRouter', 'rlOspfRtrLnkLsid'), (0, 'DLINK-3100-IpRouter', 'rlOspfRtrLnkRouterId'), (0, 'DLINK-3100-IpRouter', 'rlOspfRtrLnkIdx')) if mibBuilder.loadTexts: rlOspfRtrLnkEntry.setStatus('current') rl_ospf_rtr_lnk_area_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 1), area_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkAreaId.setStatus('current') rl_ospf_rtr_lnk_lsid = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkLsid.setStatus('current') rl_ospf_rtr_lnk_router_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 3), router_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkRouterId.setStatus('current') rl_ospf_rtr_lnk_idx = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkIdx.setStatus('current') rl_ospf_rtr_lnk_sequence = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkSequence.setStatus('current') rl_ospf_rtr_lnk_age = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkAge.setStatus('current') rl_ospf_rtr_lnk_checksum = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkChecksum.setStatus('current') rl_ospf_rtr_lnk_length = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 8), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkLength.setStatus('current') rl_ospf_rtr_lnk_bit_v = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkBitV.setStatus('current') rl_ospf_rtr_lnk_bit_e = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkBitE.setStatus('current') rl_ospf_rtr_lnk_bit_b = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkBitB.setStatus('current') rl_ospf_rtr_lnk_links = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 12), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkLinks.setStatus('current') rl_ospf_rtr_lnk_link_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 13), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkLinkID.setStatus('current') rl_ospf_rtr_lnk_link_data = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 14), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkLinkData.setStatus('current') rl_ospf_rtr_lnk_type = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('pointToPoint', 1), ('transitNetwork', 2), ('stubNetwork', 3), ('virtualLink', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkType.setStatus('current') rl_ospf_rtr_lnk_metric = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 4, 1, 16), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfRtrLnkMetric.setStatus('current') rl_ospf_net_lnk_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5)) if mibBuilder.loadTexts: rlOspfNetLnkTable.setStatus('current') rl_ospf_net_lnk_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1)).setIndexNames((0, 'DLINK-3100-IpRouter', 'rlOspfNetLnkAreaId'), (0, 'DLINK-3100-IpRouter', 'rlOspfNetLnkLsid'), (0, 'DLINK-3100-IpRouter', 'rlOspfNetLnkRouterId'), (0, 'DLINK-3100-IpRouter', 'rlOspfNetLnkIdx')) if mibBuilder.loadTexts: rlOspfNetLnkEntry.setStatus('current') rl_ospf_net_lnk_area_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 1), area_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkAreaId.setStatus('current') rl_ospf_net_lnk_lsid = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkLsid.setStatus('current') rl_ospf_net_lnk_router_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 3), router_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkRouterId.setStatus('current') rl_ospf_net_lnk_idx = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkIdx.setStatus('current') rl_ospf_net_lnk_sequence = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkSequence.setStatus('current') rl_ospf_net_lnk_age = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkAge.setStatus('current') rl_ospf_net_lnk_checksum = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkChecksum.setStatus('current') rl_ospf_net_lnk_length = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 8), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkLength.setStatus('current') rl_ospf_net_lnk_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 9), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkMask.setStatus('current') rl_ospf_net_lnk_att_router = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 5, 1, 10), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfNetLnkAttRouter.setStatus('current') rl_ospf_sum_lnk_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6)) if mibBuilder.loadTexts: rlOspfSumLnkTable.setStatus('current') rl_ospf_sum_lnk_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1)).setIndexNames((0, 'DLINK-3100-IpRouter', 'rlOspfSumLnkAreaId'), (0, 'DLINK-3100-IpRouter', 'rlOspfSumLnkLsid'), (0, 'DLINK-3100-IpRouter', 'rlOspfSumLnkRouterId')) if mibBuilder.loadTexts: rlOspfSumLnkEntry.setStatus('current') rl_ospf_sum_lnk_area_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 1), area_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfSumLnkAreaId.setStatus('current') rl_ospf_sum_lnk_lsid = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfSumLnkLsid.setStatus('current') rl_ospf_sum_lnk_router_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 3), router_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfSumLnkRouterId.setStatus('current') rl_ospf_sum_lnk_sequence = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfSumLnkSequence.setStatus('current') rl_ospf_sum_lnk_age = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfSumLnkAge.setStatus('current') rl_ospf_sum_lnk_checksum = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfSumLnkChecksum.setStatus('current') rl_ospf_sum_lnk_length = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 7), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfSumLnkLength.setStatus('current') rl_ospf_sum_lnk_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 8), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfSumLnkMask.setStatus('current') rl_ospf_sum_lnk_metric = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 6, 1, 9), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfSumLnkMetric.setStatus('current') rl_ospf_asb_lnk_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7)) if mibBuilder.loadTexts: rlOspfAsbLnkTable.setStatus('current') rl_ospf_asb_lnk_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1)).setIndexNames((0, 'DLINK-3100-IpRouter', 'rlOspfAsbLnkAreaId'), (0, 'DLINK-3100-IpRouter', 'rlOspfAsbLnkLsid'), (0, 'DLINK-3100-IpRouter', 'rlOspfAsbLnkRouterId')) if mibBuilder.loadTexts: rlOspfAsbLnkEntry.setStatus('current') rl_ospf_asb_lnk_area_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 1), area_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAsbLnkAreaId.setStatus('current') rl_ospf_asb_lnk_lsid = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 2), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAsbLnkLsid.setStatus('current') rl_ospf_asb_lnk_router_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 3), router_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAsbLnkRouterId.setStatus('current') rl_ospf_asb_lnk_sequence = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAsbLnkSequence.setStatus('current') rl_ospf_asb_lnk_age = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAsbLnkAge.setStatus('current') rl_ospf_asb_lnk_checksum = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAsbLnkChecksum.setStatus('current') rl_ospf_asb_lnk_length = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 7), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAsbLnkLength.setStatus('current') rl_ospf_asb_lnk_metric = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 7, 1, 8), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAsbLnkMetric.setStatus('current') rl_ospf_ase_lnk_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8)) if mibBuilder.loadTexts: rlOspfAseLnkTable.setStatus('current') rl_ospf_ase_lnk_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1)).setIndexNames((0, 'DLINK-3100-IpRouter', 'rlOspfAseLnkLsid'), (0, 'DLINK-3100-IpRouter', 'rlOspfAseLnkRouterId')) if mibBuilder.loadTexts: rlOspfAseLnkEntry.setStatus('current') rl_ospf_ase_lnk_lsid = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkLsid.setStatus('current') rl_ospf_ase_lnk_router_id = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 2), router_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkRouterId.setStatus('current') rl_ospf_ase_lnk_sequence = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkSequence.setStatus('current') rl_ospf_ase_lnk_age = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkAge.setStatus('current') rl_ospf_ase_lnk_checksum = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkChecksum.setStatus('current') rl_ospf_ase_lnk_length = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 6), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkLength.setStatus('current') rl_ospf_ase_lnk_mask = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 7), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkMask.setStatus('current') rl_ospf_ase_lnk_frw_address = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 8), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkFrwAddress.setStatus('current') rl_ospf_ase_lnk_bit_e = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 9), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('off', 1), ('on', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkBitE.setStatus('current') rl_ospf_ase_lnk_metric = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 10), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkMetric.setStatus('current') rl_ospf_ase_lnk_tag = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 8, 1, 11), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlOspfAseLnkTag.setStatus('current') rlospf_virt_if_ext_table = mib_table((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 9)) if mibBuilder.loadTexts: rlospfVirtIfExtTable.setStatus('current') rlospf_virt_if_ext_entry = mib_table_row((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 9, 1)) ospfVirtIfEntry.registerAugmentions(('DLINK-3100-IpRouter', 'rlospfVirtIfExtEntry')) rlospfVirtIfExtEntry.setIndexNames(*ospfVirtIfEntry.getIndexNames()) if mibBuilder.loadTexts: rlospfVirtIfExtEntry.setStatus('current') rlospf_virtif_key_chain = mib_table_column((1, 3, 6, 1, 4, 1, 171, 10, 94, 89, 89, 26, 14, 9, 1, 1), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlospfVirtifKeyChain.setStatus('current') mibBuilder.exportSymbols('DLINK-3100-IpRouter', rsIpRipFilterGlbNumber=rsIpRipFilterGlbNumber, rlOspfifKeyChain=rlOspfifKeyChain, rlIpRoutingProtPreferenceOspfInter=rlIpRoutingProtPreferenceOspfInter, rlIpRoutingProtPreferenceStatic=rlIpRoutingProtPreferenceStatic, rlOspfAseLnkMask=rlOspfAseLnkMask, rlOspfNetLnkAge=rlOspfNetLnkAge, rsIpRipFilterGlbMatchBits=rsIpRipFilterGlbMatchBits, rlOspfNetLnkTable=rlOspfNetLnkTable, rlOspfNetLnkAttRouter=rlOspfNetLnkAttRouter, ipRedundRoutersOperStatus=ipRedundRoutersOperStatus, rlOspfRtrLnkRouterId=rlOspfRtrLnkRouterId, rlOspfAseLnkLength=rlOspfAseLnkLength, rlOspfNetLnkIdx=rlOspfNetLnkIdx, rlOspfRtrLnkLinkID=rlOspfRtrLnkLinkID, ipRedundRoutersTimeout=ipRedundRoutersTimeout, rlOspfAseLnkAge=rlOspfAseLnkAge, rsRip2IfConfAutoSend=rsRip2IfConfAutoSend, rlospfVirtIfExtTable=rlospfVirtIfExtTable, rlOspfSumLnkAreaId=rlOspfSumLnkAreaId, rsIpRipFilterLclMatchBits=rsIpRipFilterLclMatchBits, rlOspfSumLnkLength=rlOspfSumLnkLength, rsRip2IfConfAddress=rsRip2IfConfAddress, rlospfVirtIfExtEntry=rlospfVirtIfExtEntry, rlIpRoutingProtPreferenceRipNormal=rlIpRoutingProtPreferenceRipNormal, rlOspfRtrLnkTable=rlOspfRtrLnkTable, ipLeakOspfToRip=ipLeakOspfToRip, rlOspfNetLnkMask=rlOspfNetLnkMask, rsIpRipFilterLclNetworkMaskBits=rsIpRipFilterLclNetworkMaskBits, rlOspfIfExtTable=rlOspfIfExtTable, rlOspfRtrLnkEntry=rlOspfRtrLnkEntry, rlOspfAsbLnkLength=rlOspfAsbLnkLength, rsRip2IfConfEntry=rsRip2IfConfEntry, rlIpRoutingProtPreferenceBgp=rlIpRoutingProtPreferenceBgp, rlOspfSumLnkRouterId=rlOspfSumLnkRouterId, ipRedundRoutersMainRouterAddr=ipRedundRoutersMainRouterAddr, rlOspfRtrLnkLength=rlOspfRtrLnkLength, rlOspfAseLnkEntry=rlOspfAseLnkEntry, rlOspfNetLnkLength=rlOspfNetLnkLength, ipLeakExtDirectToOspf=ipLeakExtDirectToOspf, rsIpRipFilterGlbType=rsIpRipFilterGlbType, rlOspfAseLnkFrwAddress=rlOspfAseLnkFrwAddress, rlOspfRtrLnkMetric=rlOspfRtrLnkMetric, rlOspfSumLnkChecksum=rlOspfSumLnkChecksum, rsRip2IfConfTable=rsRip2IfConfTable, rlOspfRtrLnkLinkData=rlOspfRtrLnkLinkData, rlOspfSumLnkMetric=rlOspfSumLnkMetric, rlOspfAsbLnkEntry=rlOspfAsbLnkEntry, rlOspfAsbLnkRouterId=rlOspfAsbLnkRouterId, ipLeakStaticToOspf=ipLeakStaticToOspf, rlOspfRtrLnkSequence=rlOspfRtrLnkSequence, rsIpRipFilterGlbNetworkMaskBits=rsIpRipFilterGlbNetworkMaskBits, rlOspfSumLnkLsid=rlOspfSumLnkLsid, ipRedundRoutersPollInterval=ipRedundRoutersPollInterval, rlOspfNetLnkAreaId=rlOspfNetLnkAreaId, rlOspfRtrLnkIdx=rlOspfRtrLnkIdx, rlOspfAsbLnkMetric=rlOspfAsbLnkMetric, rsIpRipFilterLclIpIntf=rsIpRipFilterLclIpIntf, rlOspfNetLnkChecksum=rlOspfNetLnkChecksum, ipLeakStaticToRip=ipLeakStaticToRip, rsIpRipFilterGlbAction=rsIpRipFilterGlbAction, rlOspfAsbLnkLsid=rlOspfAsbLnkLsid, ipRedundRoutersTable=ipRedundRoutersTable, rlOspfAseLnkChecksum=rlOspfAseLnkChecksum, rlIpRoutingProtPreferenceRipAggregate=rlIpRoutingProtPreferenceRipAggregate, rlOspfRtrLnkAge=rlOspfRtrLnkAge, rlOspfSumLnkAge=rlOspfSumLnkAge, rsIpRipFilterLclNumber=rsIpRipFilterLclNumber, rlOspfRtrLnkBitE=rlOspfRtrLnkBitE, ipLeakRipToOspf=ipLeakRipToOspf, PYSNMP_MODULE_ID=rlIpRouter, rlOspfAsbLnkAge=rlOspfAsbLnkAge, rsIpRipFilterLclTable=rsIpRipFilterLclTable, rlOspfAsbLnkSequence=rlOspfAsbLnkSequence, rlIpRoutingProtPreferenceOspfExt=rlIpRoutingProtPreferenceOspfExt, rlOspfNetLnkEntry=rlOspfNetLnkEntry, rlOspfSumLnkEntry=rlOspfSumLnkEntry, rsIpRipFilterLclStatus=rsIpRipFilterLclStatus, rsRip2IfConfVirtualDis=rsRip2IfConfVirtualDis, rlOspfRtrLnkLsid=rlOspfRtrLnkLsid, rlOspfSumLnkMask=rlOspfSumLnkMask, ipRedundAdminStatus=ipRedundAdminStatus, rlOspfNetLnkSequence=rlOspfNetLnkSequence, rlOspfRtrLnkAreaId=rlOspfRtrLnkAreaId, rlOspfAseLnkTable=rlOspfAseLnkTable, rlOspfMibVersion=rlOspfMibVersion, rlOspfAseLnkLsid=rlOspfAseLnkLsid, rlOspfNetLnkRouterId=rlOspfNetLnkRouterId, rlIpRouter=rlIpRouter, rsIpRipFilterLclType=rsIpRipFilterLclType, rlOspfRtrLnkBitB=rlOspfRtrLnkBitB, ipRedundRoutersStatus=ipRedundRoutersStatus, rlOspfAsbLnkAreaId=rlOspfAsbLnkAreaId, rlOspfAsbLnkTable=rlOspfAsbLnkTable, rlOspfAsbLnkChecksum=rlOspfAsbLnkChecksum, rlIpRoutingProtPreferenceDirect=rlIpRoutingProtPreferenceDirect, rlOspfAseLnkTag=rlOspfAseLnkTag, rsIpRipFilterGlbTable=rsIpRipFilterGlbTable, rlOspfRtrLnkBitV=rlOspfRtrLnkBitV, ipRedundRoutersIfAddr=ipRedundRoutersIfAddr, rsIpRipFilterGlbEntry=rsIpRipFilterGlbEntry, rlOspfIfExtEntry=rlOspfIfExtEntry, rlOspfAseLnkBitE=rlOspfAseLnkBitE, rsIpRipFilterGlbIpAddr=rsIpRipFilterGlbIpAddr, rlRip2MibVersion=rlRip2MibVersion, rlIpRoutingProtPreferenceOspfReject=rlIpRoutingProtPreferenceOspfReject, rlOspfSumLnkTable=rlOspfSumLnkTable, rlOspfAseLnkSequence=rlOspfAseLnkSequence, rlOspfSumLnkSequence=rlOspfSumLnkSequence, rlOspfAseLnkMetric=rlOspfAseLnkMetric, rlospfVirtifKeyChain=rlospfVirtifKeyChain, rsIpRipFilterLclAction=rsIpRipFilterLclAction, ipRedundRoutersEntry=ipRedundRoutersEntry, rlOspfRtrLnkChecksum=rlOspfRtrLnkChecksum, rlOspfAutoInterfaceCreation=rlOspfAutoInterfaceCreation, rsIpRipFilterLclIpAddr=rsIpRipFilterLclIpAddr, ipRedundOperStatus=ipRedundOperStatus, rsIpRipFilterGlbStatus=rsIpRipFilterGlbStatus, rlRip2AutoInterfaceCreation=rlRip2AutoInterfaceCreation, rlOspfAseLnkRouterId=rlOspfAseLnkRouterId, rlRip2IfConfKeyChain=rlRip2IfConfKeyChain, rsIpRipFilterLclEntry=rsIpRipFilterLclEntry, rlOspfRtrLnkLinks=rlOspfRtrLnkLinks, rlOspfNetLnkLsid=rlOspfNetLnkLsid, rlOspfRtrLnkType=rlOspfRtrLnkType)
class Solution: def firstUniqChar(self, s: str) -> int: # warm-up # check the xor count = [0]*26 a = ord('a') for achar in s: position = ord(achar) - a count[position] += 1 for i in range(len(s)): position = ord(s[i]) - a if count[position] == 1: return i return -1 # Time (two pass) = O(2*n) => O(n) # Space: O(1) for count for 26 chars # count = [2]*26 # a = ord('a') # # Approach (solving hash table card) # # Optimization of the 2nd Approach # for achar in s: # position = ord(achar) - a # count[position] = (count[position] >> 1) # for i in range(len(s)): # position = ord(s[i]) - a # if count[position] & 0b00000001: # return i # return -1 # # Approach 2: # # Using count array of chars[26] # # Time: O(n) # # Space: O(1) # count = [0]*26 # a = ord('a') # for achar in s: # count[ord(achar) - a ] += 1 # for i in range(len(s)): # if count[ord(s[i])-a] == 1: # return i # return -1 # # Approach 1 # # Count the freq of each char in string # # Iterate through the dictionary and dec the freq of each met char # # return the one with 0 freq # hashmap = dict() # for achar in s: # hashmap[achar] = hashmap.get(achar, 0) + 1 # for i in range(len(s)): # if hashmap[s[i]] == 1: # return i # return -1
class Solution: def first_uniq_char(self, s: str) -> int: count = [0] * 26 a = ord('a') for achar in s: position = ord(achar) - a count[position] += 1 for i in range(len(s)): position = ord(s[i]) - a if count[position] == 1: return i return -1
def get_amble(idx, lines): return lines[idx-25:idx] def get_pair(idx, lines): amble = get_amble(idx, lines) for i in amble: for j in amble: if i > lines[idx] or j > lines[idx]: continue if i == j: continue if i + j == lines[idx]: return i, j def find_series(idx, lines): target = lines[idx] for i in range(idx - 1, 0, -1): for j in range(i - 2, -1, -1): s = lines[i:j:-1] if any([i > target for i in s]): break if sum(s) == target: return s if __name__ == '__main__': with open('input0', 'r') as file: lines = [int(i.strip()) for i in file.readlines()] # for i in range(25, 1000): # if pair := get_pair(i, lines): # print(pair) # else: # print('STOP') # print(i) # print(lines[i]) # break series = find_series(511, lines) print(min(series) + max(series))
def get_amble(idx, lines): return lines[idx - 25:idx] def get_pair(idx, lines): amble = get_amble(idx, lines) for i in amble: for j in amble: if i > lines[idx] or j > lines[idx]: continue if i == j: continue if i + j == lines[idx]: return (i, j) def find_series(idx, lines): target = lines[idx] for i in range(idx - 1, 0, -1): for j in range(i - 2, -1, -1): s = lines[i:j:-1] if any([i > target for i in s]): break if sum(s) == target: return s if __name__ == '__main__': with open('input0', 'r') as file: lines = [int(i.strip()) for i in file.readlines()] series = find_series(511, lines) print(min(series) + max(series))
arr=[0]*101 input();N=[*map(int,input().split())] ans=0 for i in N: if arr[i]==0: arr[i]=1 else: ans+=1 print(ans)
arr = [0] * 101 input() n = [*map(int, input().split())] ans = 0 for i in N: if arr[i] == 0: arr[i] = 1 else: ans += 1 print(ans)
def twos_difference(lst): slst = sorted(lst) pairs = [] for i in range(len(slst)): for j in range(1, len(slst)): if slst[j] - slst[i] == 2: pairs.append((slst[i], slst[j])) return pairs
def twos_difference(lst): slst = sorted(lst) pairs = [] for i in range(len(slst)): for j in range(1, len(slst)): if slst[j] - slst[i] == 2: pairs.append((slst[i], slst[j])) return pairs