content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
''' File: __init__.py Project: metrics File Created: Monday, 17th August 2020 3:14:39 pm Author: Sparsh Dutta (sparsh.dtt@gmail.com) ----- Last Modified: Monday, 17th August 2020 3:14:39 pm Modified By: Sparsh Dutta (sparsh.dtt@gmail.com>) ----- Copyright 2020 Sparsh Dutta '''
""" File: __init__.py Project: metrics File Created: Monday, 17th August 2020 3:14:39 pm Author: Sparsh Dutta (sparsh.dtt@gmail.com) ----- Last Modified: Monday, 17th August 2020 3:14:39 pm Modified By: Sparsh Dutta (sparsh.dtt@gmail.com>) ----- Copyright 2020 Sparsh Dutta """
x = 10 y = 20 z = x+y print('z is: %s' % z)
x = 10 y = 20 z = x + y print('z is: %s' % z)
# 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 verticalTraversal(self, root: Optional[TreeNode]) -> List[List[int]]: # method for preorder traversal def preorder(root, row, col): if col in coord: coord[col].append((row, root.val)) else: coord[col] = [(row, root.val)] if root.left: preorder(root.left, row + 1, col - 1) # for left child if root.right: preorder(root.right, row + 1, col + 1) # for left child # call the method preorder() coord = {} # dictionary to hold the node values along with row number against the column numbers if root: preorder(root, 0, 0) output = [] for key in sorted(coord.keys()): if len(coord[key]) == 1: value = coord[key][0][1] output.append([value]) else: # a column has nodes in multple rows temp = [] for item in sorted(coord[key]): temp.append(item[1]) output.append(temp) return output
class Solution: def vertical_traversal(self, root: Optional[TreeNode]) -> List[List[int]]: def preorder(root, row, col): if col in coord: coord[col].append((row, root.val)) else: coord[col] = [(row, root.val)] if root.left: preorder(root.left, row + 1, col - 1) if root.right: preorder(root.right, row + 1, col + 1) coord = {} if root: preorder(root, 0, 0) output = [] for key in sorted(coord.keys()): if len(coord[key]) == 1: value = coord[key][0][1] output.append([value]) else: temp = [] for item in sorted(coord[key]): temp.append(item[1]) output.append(temp) return output
### SET x = {1,2,3} x.add(4) print(x) x.remove(2) print(x) x.discard(100) print(x) x= {1,2,4} y ={"Three",4} print(x.intersection(y)) x.update(y) print(x) x = set('aAbcd') y =set('Ax') print(x-y) print(x|y) print(x&y) print(x^y) # Practice any other methods from SET
x = {1, 2, 3} x.add(4) print(x) x.remove(2) print(x) x.discard(100) print(x) x = {1, 2, 4} y = {'Three', 4} print(x.intersection(y)) x.update(y) print(x) x = set('aAbcd') y = set('Ax') print(x - y) print(x | y) print(x & y) print(x ^ y)
# d - cijeli broj # f - realni broj # s - string #primjer formatiranog ispisa a=3.12345 print('{0:f},{1:0.1f}'.format(a, a))
a = 3.12345 print('{0:f},{1:0.1f}'.format(a, a))
x = 1 y = 2 print("x is {}".format(x)) print("y is {}".format(y)) print("swapping... ") (x, y) = (y, x) # a, b, c = foo() returning multiple print('swapped.') print("x is {}".format(x)) print("y is {}".format(y))
x = 1 y = 2 print('x is {}'.format(x)) print('y is {}'.format(y)) print('swapping... ') (x, y) = (y, x) print('swapped.') print('x is {}'.format(x)) print('y is {}'.format(y))
# The goal is sum the digits. valor = int(input('Enter a whole number: ')) sum = 0 while valor > 0: rest = valor % 10 valor = (valor - rest) / 10 sum += rest print(int(sum))
valor = int(input('Enter a whole number: ')) sum = 0 while valor > 0: rest = valor % 10 valor = (valor - rest) / 10 sum += rest print(int(sum))
def add(filename, siglas, carrera): with open(filename, 'a') as f_obj: f_obj.write(f'\n{siglas} {carrera}') def sacacarrera(linea): siglas = '' carrera = '' counter = 0 for c in linea: if c == ' ': counter=1 if counter != 1: siglas+=c if counter == 1: carrera+=c carrera = carrera[1:] return(siglas, carrera) def search(filename, carrera): with open(filename) as f_obj: lines = f_obj.readlines() # print(lines) # Forma noob: # for line in f_obj: # # print(line) # print(line.rstrip()) for line in lines: if line.rstrip() != '': siglatxt, carreratxt = sacacarrera(line.rstrip()) if carreratxt == carrera: return siglatxt def printfile(filename): with open(filename) as f_obj: lines = f_obj.readlines() # print(lines) # Forma noob: # for line in f_obj: # # print(line) # print(line.rstrip()) for line in lines: if line.rstrip() != '': print(line.rstrip()) option=0 while option!= 4: option = int(input("Selecciona una opcion\n1 -> Ver todas las carreras con sus siglas\n2 -> Agregar una carrera dada sus siglas y su nombre\n3 -> Dado el nombre de la carrera imprimir las siglas\n4 -> Exit\n")) if option == 1: printfile("programaseducativos.txt") print() elif option == 2: siglas = input("Sigla: ") nombre = input("Nombre: ") add('programaseducativos.txt', siglas, nombre) print() elif option == 3: nombre = input("Nombre: ") siglas = search('programaseducativos.txt', nombre) print(f"Sigla: {siglas}") print() elif option == 4: print("Que tenga un buen dia\n") else: print("Opcion no disponible\n")
def add(filename, siglas, carrera): with open(filename, 'a') as f_obj: f_obj.write(f'\n{siglas} {carrera}') def sacacarrera(linea): siglas = '' carrera = '' counter = 0 for c in linea: if c == ' ': counter = 1 if counter != 1: siglas += c if counter == 1: carrera += c carrera = carrera[1:] return (siglas, carrera) def search(filename, carrera): with open(filename) as f_obj: lines = f_obj.readlines() for line in lines: if line.rstrip() != '': (siglatxt, carreratxt) = sacacarrera(line.rstrip()) if carreratxt == carrera: return siglatxt def printfile(filename): with open(filename) as f_obj: lines = f_obj.readlines() for line in lines: if line.rstrip() != '': print(line.rstrip()) option = 0 while option != 4: option = int(input('Selecciona una opcion\n1 -> Ver todas las carreras con sus siglas\n2 -> Agregar una carrera dada sus siglas y su nombre\n3 -> Dado el nombre de la carrera imprimir las siglas\n4 -> Exit\n')) if option == 1: printfile('programaseducativos.txt') print() elif option == 2: siglas = input('Sigla: ') nombre = input('Nombre: ') add('programaseducativos.txt', siglas, nombre) print() elif option == 3: nombre = input('Nombre: ') siglas = search('programaseducativos.txt', nombre) print(f'Sigla: {siglas}') print() elif option == 4: print('Que tenga un buen dia\n') else: print('Opcion no disponible\n')
NODE, EDGE, ATTR = range(3) class Node: def __init__(self, name, attrs): self.name = name self.attrs = attrs def __eq__(self, other): return self.name == other.name and self.attrs == other.attrs class Edge: def __init__(self, src, dst, attrs): self.src = src self.dst = dst self.attrs = attrs def __eq__(self, other): return (self.src == other.src and self.dst == other.dst and self.attrs == other.attrs) class Graph: def __init__(self, data=None): self.nodes = [] self.edges = [] self.attrs = {} if data is None: data = [] if not isinstance(data, list): raise TypeError("Graph data malformed") for item in data: if len(item) < 3: raise TypeError("Graph item incomplete") type_ = item[0] if type_ == ATTR: if len(item) != 3: raise ValueError("ATTR malformed") self.attrs[item[1]] = item[2] elif type_ == NODE: if len(item) != 3: raise ValueError("NODE malformed") self.nodes.append(Node(item[1], item[2])) elif type_ == EDGE: if len(item) != 4: raise ValueError("EDGE malformed") self.edges.append(Edge(item[1], item[2], item[3])) else: raise ValueError("Unknown item {}".format(item[0]))
(node, edge, attr) = range(3) class Node: def __init__(self, name, attrs): self.name = name self.attrs = attrs def __eq__(self, other): return self.name == other.name and self.attrs == other.attrs class Edge: def __init__(self, src, dst, attrs): self.src = src self.dst = dst self.attrs = attrs def __eq__(self, other): return self.src == other.src and self.dst == other.dst and (self.attrs == other.attrs) class Graph: def __init__(self, data=None): self.nodes = [] self.edges = [] self.attrs = {} if data is None: data = [] if not isinstance(data, list): raise type_error('Graph data malformed') for item in data: if len(item) < 3: raise type_error('Graph item incomplete') type_ = item[0] if type_ == ATTR: if len(item) != 3: raise value_error('ATTR malformed') self.attrs[item[1]] = item[2] elif type_ == NODE: if len(item) != 3: raise value_error('NODE malformed') self.nodes.append(node(item[1], item[2])) elif type_ == EDGE: if len(item) != 4: raise value_error('EDGE malformed') self.edges.append(edge(item[1], item[2], item[3])) else: raise value_error('Unknown item {}'.format(item[0]))
prov_cap = { "Hebei": "Shijiazhuang", "Shanxi": "Taiyuan", "Liaoning": "Shenyang", "Jilin": "Changchun", "Heilongjiang": "Harbin", "Jiangsu": "Nanjing", "Zhejiang": "Hangzhou", "Anhui": "Hefei", "Fujian": "Fuzhou", "Jiangxi": "Nanchang", "Shandong": "Jinan", "Henan": "Zhengzhou", "Hubei": "Wuhan", "Hunan": "Changsha", "Guangdong": "Guangzhou", "Hainan": "Haikou", "Sichuan": "Chengdu", "Guizhou": "Guiyang", "Yunnan": "Kunming", "Shaanxi": "Xi'an", "Gansu": "Lanzhou", "Qinghai": "Xining", "Taiwan": "Taipei" } autregion = { "Inner Mongolia": "NM", "Guangxi Zhuang": "GX", "Tibet": "XZ", "Ningxia Hui": "NX", "Xinjiang Uyghur": "XJ" } autregion_capitals = { "Inner Mongolia": "Hohhot", "Guangxi Zhuang": "Nanning", "Tibet": "Lhasa", "Ningxia Hui": "Yinchuan", "Xinjiang Uyghur": "Urumqi" } admregion = { "Hong Kong": "HK", "Macau": "MC" } admregion_capitals = { "Hong Kong": "Hong Kong", "Macau": "Macau" } municipality = { "Beijing": "BJ", "Tianjin": "TJ", "Shanghai": "SH", "Chongqing": "CQ" } mun_capitals = { "Beijing": "Beijing", "Tianjin": "Tianjin", "Shanghai": "Shanghai", "Chongqing": "Chongqing" }
prov_cap = {'Hebei': 'Shijiazhuang', 'Shanxi': 'Taiyuan', 'Liaoning': 'Shenyang', 'Jilin': 'Changchun', 'Heilongjiang': 'Harbin', 'Jiangsu': 'Nanjing', 'Zhejiang': 'Hangzhou', 'Anhui': 'Hefei', 'Fujian': 'Fuzhou', 'Jiangxi': 'Nanchang', 'Shandong': 'Jinan', 'Henan': 'Zhengzhou', 'Hubei': 'Wuhan', 'Hunan': 'Changsha', 'Guangdong': 'Guangzhou', 'Hainan': 'Haikou', 'Sichuan': 'Chengdu', 'Guizhou': 'Guiyang', 'Yunnan': 'Kunming', 'Shaanxi': "Xi'an", 'Gansu': 'Lanzhou', 'Qinghai': 'Xining', 'Taiwan': 'Taipei'} autregion = {'Inner Mongolia': 'NM', 'Guangxi Zhuang': 'GX', 'Tibet': 'XZ', 'Ningxia Hui': 'NX', 'Xinjiang Uyghur': 'XJ'} autregion_capitals = {'Inner Mongolia': 'Hohhot', 'Guangxi Zhuang': 'Nanning', 'Tibet': 'Lhasa', 'Ningxia Hui': 'Yinchuan', 'Xinjiang Uyghur': 'Urumqi'} admregion = {'Hong Kong': 'HK', 'Macau': 'MC'} admregion_capitals = {'Hong Kong': 'Hong Kong', 'Macau': 'Macau'} municipality = {'Beijing': 'BJ', 'Tianjin': 'TJ', 'Shanghai': 'SH', 'Chongqing': 'CQ'} mun_capitals = {'Beijing': 'Beijing', 'Tianjin': 'Tianjin', 'Shanghai': 'Shanghai', 'Chongqing': 'Chongqing'}
# Get the aggregated number of a specific POI category per H3 index at a given resolution def get_pois_by_category_in_polygon( dbt_controller, category, resolution, polygon_coords ): return dbt_controller.run_macro( macro_category="poi", macro_name="get_pois_in_polygon", args="{" + f"h3_resolution: {str(resolution)}, category: {category}, " f"polygon_coords: '{polygon_coords}'" + "}", ) # Get the total average popularity for H3 indexes at a given resolution def get_popularity_in_polygon(dbt_controller, resolution, polygon_coords): return dbt_controller.run_macro( macro_category="poi", macro_name="get_popularity_in_polygon", args="{" + f"h3_resolution: {resolution}, polygon_coords: '{polygon_coords}'" + "}", )
def get_pois_by_category_in_polygon(dbt_controller, category, resolution, polygon_coords): return dbt_controller.run_macro(macro_category='poi', macro_name='get_pois_in_polygon', args='{' + f"h3_resolution: {str(resolution)}, category: {category}, polygon_coords: '{polygon_coords}'" + '}') def get_popularity_in_polygon(dbt_controller, resolution, polygon_coords): return dbt_controller.run_macro(macro_category='poi', macro_name='get_popularity_in_polygon', args='{' + f"h3_resolution: {resolution}, polygon_coords: '{polygon_coords}'" + '}')
__all__ = [ "sis_vs_smc", "ekf_vs_ukf", "ekf_vs_ukf_mlp", "eekf_logistic_regression", "ekf_mlp_anim", "linreg_kf", "kf_parallel", "kf_continuous_circle", "kf_spiral", "kf_tracking", "bootstrap_filter", "pendulum_1d", "ekf_continuous" ]
__all__ = ['sis_vs_smc', 'ekf_vs_ukf', 'ekf_vs_ukf_mlp', 'eekf_logistic_regression', 'ekf_mlp_anim', 'linreg_kf', 'kf_parallel', 'kf_continuous_circle', 'kf_spiral', 'kf_tracking', 'bootstrap_filter', 'pendulum_1d', 'ekf_continuous']
n=int(input())*300 n1=int(input())*1500 n2=int(input())*600 n3=int(input())*1000 n4=int(input())*150 resp=(n+n1+n2+n3+n4)+225 print(resp)
n = int(input()) * 300 n1 = int(input()) * 1500 n2 = int(input()) * 600 n3 = int(input()) * 1000 n4 = int(input()) * 150 resp = n + n1 + n2 + n3 + n4 + 225 print(resp)
myinput=list(input("Enter a String : " )) word = "" for x in myinput: if (myinput.index(x) % 2 == 0): word += x print(word)
myinput = list(input('Enter a String : ')) word = '' for x in myinput: if myinput.index(x) % 2 == 0: word += x print(word)
def alphabet_position(text): alphabet = {} chars = [chr(x) for x in range(97, 123)] for i in range(len(chars)): alphabet[chars[i]] = str(i+1) return ' '.join([alphabet[x] for x in text.lower() if x in alphabet])
def alphabet_position(text): alphabet = {} chars = [chr(x) for x in range(97, 123)] for i in range(len(chars)): alphabet[chars[i]] = str(i + 1) return ' '.join([alphabet[x] for x in text.lower() if x in alphabet])
load("@rules_jvm_external//:defs.bzl", "maven_install") load("@rules_jvm_external//:specs.bzl", "maven") def selenium_java_deps(): netty_version = "4.1.63.Final" opentelemetry_version = "1.2.0" maven_install( artifacts = [ "com.beust:jcommander:1.81", "com.github.javaparser:javaparser-core:3.22.0", maven.artifact( group = "com.github.spotbugs", artifact = "spotbugs", version = "4.2.3", exclusions = [ "org.slf4j:slf4j-api", ], ), "com.google.code.gson:gson:2.8.6", "com.google.guava:guava:30.1.1-jre", "com.google.auto:auto-common:1.0", "com.google.auto.service:auto-service:1.0", "com.google.auto.service:auto-service-annotations:1.0", "com.graphql-java:graphql-java:16.2", "io.grpc:grpc-context:1.37.0", "io.lettuce:lettuce-core:6.1.2.RELEASE", "io.netty:netty-buffer:%s" % netty_version, "io.netty:netty-codec-haproxy:%s" % netty_version, "io.netty:netty-codec-http:%s" % netty_version, "io.netty:netty-codec-http2:%s" % netty_version, "io.netty:netty-common:%s" % netty_version, "io.netty:netty-handler:%s" % netty_version, "io.netty:netty-handler-proxy:%s" % netty_version, "io.netty:netty-transport:%s" % netty_version, "io.netty:netty-transport-native-epoll:%s" % netty_version, "io.netty:netty-transport-native-epoll:jar:linux-x86_64:%s" % netty_version, "io.netty:netty-transport-native-kqueue:%s" % netty_version, "io.netty:netty-transport-native-kqueue:jar:osx-x86_64:%s" % netty_version, "io.netty:netty-transport-native-unix-common:%s" % netty_version, "io.opentelemetry:opentelemetry-api:%s" % opentelemetry_version, "io.opentelemetry:opentelemetry-context:%s" % opentelemetry_version, "io.opentelemetry:opentelemetry-exporter-logging:%s" % opentelemetry_version, "io.opentelemetry:opentelemetry-semconv:%s" % opentelemetry_version + "-alpha", "io.opentelemetry:opentelemetry-sdk:%s" % opentelemetry_version, "io.opentelemetry:opentelemetry-sdk-common:%s" % opentelemetry_version, "io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:%s" % opentelemetry_version + "-alpha", "io.opentelemetry:opentelemetry-sdk-testing:%s" % opentelemetry_version, "io.opentelemetry:opentelemetry-sdk-trace:%s" % opentelemetry_version, "io.ous:jtoml:2.0.0", "it.ozimov:embedded-redis:0.7.3", "javax.servlet:javax.servlet-api:4.0.1", maven.artifact( group = "junit", artifact = "junit", version = "4.13.2", exclusions = [ "org.hamcrest:hamcrest-all", "org.hamcrest:hamcrest-core", "org.hamcrest:hamcrest-library", ], ), "net.bytebuddy:byte-buddy:1.11.0", "net.jodah:failsafe:2.4.0", "net.sourceforge.htmlunit:htmlunit-core-js:2.49.0", "org.apache.commons:commons-exec:1.3", "org.assertj:assertj-core:3.19.0", "org.asynchttpclient:async-http-client:2.12.3", "org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5", "org.hamcrest:hamcrest:2.2", "org.hsqldb:hsqldb:2.6.0", "org.mockito:mockito-core:3.10.0", "org.slf4j:slf4j-api:1.7.30", "org.slf4j:slf4j-jdk14:1.7.30", "org.testng:testng:7.4.0", "org.zeromq:jeromq:0.5.2", "xyz.rogfam:littleproxy:2.0.3", "org.seleniumhq.selenium:htmlunit-driver:2.49.1", "org.redisson:redisson:3.15.5", ], excluded_artifacts = [ "org.hamcrest:hamcrest-all", # Replaced by hamcrest 2 "org.hamcrest:hamcrest-core", "io.netty:netty-all", # Depend on the actual things you need ], override_targets = { "org.seleniumhq.selenium:selenium-api": "@//java/client/src/org/openqa/selenium:core", "org.seleniumhq.selenium:selenium-remote-driver": "@//java/client/src/org/openqa/selenium/remote:remote", "org.seleniumhq.selenium:selenium-support": "@//java/client/src/org/openqa/selenium/support", }, fail_on_missing_checksum = True, fail_if_repin_required = True, fetch_sources = True, strict_visibility = True, repositories = [ "https://repo1.maven.org/maven2", "https://maven.google.com", ], maven_install_json = "@selenium//java:maven_install.json", )
load('@rules_jvm_external//:defs.bzl', 'maven_install') load('@rules_jvm_external//:specs.bzl', 'maven') def selenium_java_deps(): netty_version = '4.1.63.Final' opentelemetry_version = '1.2.0' maven_install(artifacts=['com.beust:jcommander:1.81', 'com.github.javaparser:javaparser-core:3.22.0', maven.artifact(group='com.github.spotbugs', artifact='spotbugs', version='4.2.3', exclusions=['org.slf4j:slf4j-api']), 'com.google.code.gson:gson:2.8.6', 'com.google.guava:guava:30.1.1-jre', 'com.google.auto:auto-common:1.0', 'com.google.auto.service:auto-service:1.0', 'com.google.auto.service:auto-service-annotations:1.0', 'com.graphql-java:graphql-java:16.2', 'io.grpc:grpc-context:1.37.0', 'io.lettuce:lettuce-core:6.1.2.RELEASE', 'io.netty:netty-buffer:%s' % netty_version, 'io.netty:netty-codec-haproxy:%s' % netty_version, 'io.netty:netty-codec-http:%s' % netty_version, 'io.netty:netty-codec-http2:%s' % netty_version, 'io.netty:netty-common:%s' % netty_version, 'io.netty:netty-handler:%s' % netty_version, 'io.netty:netty-handler-proxy:%s' % netty_version, 'io.netty:netty-transport:%s' % netty_version, 'io.netty:netty-transport-native-epoll:%s' % netty_version, 'io.netty:netty-transport-native-epoll:jar:linux-x86_64:%s' % netty_version, 'io.netty:netty-transport-native-kqueue:%s' % netty_version, 'io.netty:netty-transport-native-kqueue:jar:osx-x86_64:%s' % netty_version, 'io.netty:netty-transport-native-unix-common:%s' % netty_version, 'io.opentelemetry:opentelemetry-api:%s' % opentelemetry_version, 'io.opentelemetry:opentelemetry-context:%s' % opentelemetry_version, 'io.opentelemetry:opentelemetry-exporter-logging:%s' % opentelemetry_version, 'io.opentelemetry:opentelemetry-semconv:%s' % opentelemetry_version + '-alpha', 'io.opentelemetry:opentelemetry-sdk:%s' % opentelemetry_version, 'io.opentelemetry:opentelemetry-sdk-common:%s' % opentelemetry_version, 'io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:%s' % opentelemetry_version + '-alpha', 'io.opentelemetry:opentelemetry-sdk-testing:%s' % opentelemetry_version, 'io.opentelemetry:opentelemetry-sdk-trace:%s' % opentelemetry_version, 'io.ous:jtoml:2.0.0', 'it.ozimov:embedded-redis:0.7.3', 'javax.servlet:javax.servlet-api:4.0.1', maven.artifact(group='junit', artifact='junit', version='4.13.2', exclusions=['org.hamcrest:hamcrest-all', 'org.hamcrest:hamcrest-core', 'org.hamcrest:hamcrest-library']), 'net.bytebuddy:byte-buddy:1.11.0', 'net.jodah:failsafe:2.4.0', 'net.sourceforge.htmlunit:htmlunit-core-js:2.49.0', 'org.apache.commons:commons-exec:1.3', 'org.assertj:assertj-core:3.19.0', 'org.asynchttpclient:async-http-client:2.12.3', 'org.eclipse.mylyn.github:org.eclipse.egit.github.core:2.1.5', 'org.hamcrest:hamcrest:2.2', 'org.hsqldb:hsqldb:2.6.0', 'org.mockito:mockito-core:3.10.0', 'org.slf4j:slf4j-api:1.7.30', 'org.slf4j:slf4j-jdk14:1.7.30', 'org.testng:testng:7.4.0', 'org.zeromq:jeromq:0.5.2', 'xyz.rogfam:littleproxy:2.0.3', 'org.seleniumhq.selenium:htmlunit-driver:2.49.1', 'org.redisson:redisson:3.15.5'], excluded_artifacts=['org.hamcrest:hamcrest-all', 'org.hamcrest:hamcrest-core', 'io.netty:netty-all'], override_targets={'org.seleniumhq.selenium:selenium-api': '@//java/client/src/org/openqa/selenium:core', 'org.seleniumhq.selenium:selenium-remote-driver': '@//java/client/src/org/openqa/selenium/remote:remote', 'org.seleniumhq.selenium:selenium-support': '@//java/client/src/org/openqa/selenium/support'}, fail_on_missing_checksum=True, fail_if_repin_required=True, fetch_sources=True, strict_visibility=True, repositories=['https://repo1.maven.org/maven2', 'https://maven.google.com'], maven_install_json='@selenium//java:maven_install.json')
### Noisy DQN Pong_ML-Agents Config ### env = {"name": "pong_mlagent", "train_mode": True} agent = { "name": "noisy", "network": "noisy", "gamma": 0.99, "explore_ratio": 0.1, "buffer_size": 50000, "batch_size": 32, "start_train_step": 25000, "target_update_period": 1000, # noisy "noise_type": "factorized", # [independent, factorized] } optim = { "name": "adam", "lr": 2.5e-4, } train = { "training": True, "load_path": None, "run_step": 200000, "print_period": 5000, "save_period": 50000, "eval_iteration": 10, # distributed setting "update_period": 8, "num_workers": 16, }
env = {'name': 'pong_mlagent', 'train_mode': True} agent = {'name': 'noisy', 'network': 'noisy', 'gamma': 0.99, 'explore_ratio': 0.1, 'buffer_size': 50000, 'batch_size': 32, 'start_train_step': 25000, 'target_update_period': 1000, 'noise_type': 'factorized'} optim = {'name': 'adam', 'lr': 0.00025} train = {'training': True, 'load_path': None, 'run_step': 200000, 'print_period': 5000, 'save_period': 50000, 'eval_iteration': 10, 'update_period': 8, 'num_workers': 16}
class Solution: def preorderTraversal(self, root: TreeNode) -> List[int]: res = [] self.traverse(root, res) return res def traverse(self, root, res) : if not root: return res.append(root.val) self.traverse(root.left, res) self.traverse(root.right, res)
class Solution: def preorder_traversal(self, root: TreeNode) -> List[int]: res = [] self.traverse(root, res) return res def traverse(self, root, res): if not root: return res.append(root.val) self.traverse(root.left, res) self.traverse(root.right, res)
CELERY_BROKER_URL_DOCKER = 'amqp://admin:mypass@rabbit:5672/' CELERY_BROKER_URL_LOCAL = 'amqp://localhost/' CM_REGISTER_Q = 'rpc_queue_CM_register' CM_NAME = 'CM - Heat load profiles' RPC_CM_ALIVE= 'rpc_queue_CM_ALIVE' RPC_Q = 'rpc_queue_CM_compute' # Do no change this value CM_ID = 9 PORT_LOCAL = int('500' + str(CM_ID)) PORT_DOCKER = 80 #TODO*********************************************************************** CELERY_BROKER_URL = CELERY_BROKER_URL_DOCKER PORT = PORT_DOCKER #TODO*********************************************************************** TRANFER_PROTOCOLE ='http://' INPUTS_CALCULATION_MODULE = [ {'input_name': 'Residential heating', 'input_type': 'input', 'input_parameter_name': 'res_heating_share', 'input_value': 0.33, 'input_unit': 'none', 'input_min': 0, 'input_max': 1, 'cm_id': CM_ID }, {'input_name': 'Industry', 'input_type': 'input', 'input_parameter_name': 'industry_share', 'input_value': 0.33, 'input_unit': 'none', 'input_min': 0, 'input_max': 1, 'cm_id': CM_ID }, {'input_name': 'Tertiary heating', 'input_type': 'input', 'input_parameter_name': 'tertiary_share', 'input_value': 0.33, 'input_unit': 'none', 'input_min': 0, 'input_max': 1, 'cm_id': CM_ID } ] SIGNATURE = { "category": "Buildings", "cm_name": CM_NAME, "layers_needed": [ "heat_tot_curr_density", "heat_res_curr_density", "heat_nonres_curr_density", "nuts_id_number", "gfa_res_curr_density", "gfa_nonres_curr_density" ], "vectors_needed": [ # "lp_residential_shw_and_heating_yearlong_2010", # "lp_industry_iron_and_steel_yearlong_2018", # "lp_industry_paper_yearlong_2018", # "lp_industry_non_metalic_minerals_yearlong_2018", # "lp_industry_food_and_tobacco_yearlong_2018", # "lp_industry_chemicals_and_petrochemicals_yearlong_2018" ], "type_layer_needed": [ "nuts_id_number", "heat", "gross_floor_area", "gross_floor_area" ], "cm_url": "Do not add something", "cm_description": "CM generating new load profiles", "cm_id": CM_ID, 'inputs_calculation_module': INPUTS_CALCULATION_MODULE }
celery_broker_url_docker = 'amqp://admin:mypass@rabbit:5672/' celery_broker_url_local = 'amqp://localhost/' cm_register_q = 'rpc_queue_CM_register' cm_name = 'CM - Heat load profiles' rpc_cm_alive = 'rpc_queue_CM_ALIVE' rpc_q = 'rpc_queue_CM_compute' cm_id = 9 port_local = int('500' + str(CM_ID)) port_docker = 80 celery_broker_url = CELERY_BROKER_URL_DOCKER port = PORT_DOCKER tranfer_protocole = 'http://' inputs_calculation_module = [{'input_name': 'Residential heating', 'input_type': 'input', 'input_parameter_name': 'res_heating_share', 'input_value': 0.33, 'input_unit': 'none', 'input_min': 0, 'input_max': 1, 'cm_id': CM_ID}, {'input_name': 'Industry', 'input_type': 'input', 'input_parameter_name': 'industry_share', 'input_value': 0.33, 'input_unit': 'none', 'input_min': 0, 'input_max': 1, 'cm_id': CM_ID}, {'input_name': 'Tertiary heating', 'input_type': 'input', 'input_parameter_name': 'tertiary_share', 'input_value': 0.33, 'input_unit': 'none', 'input_min': 0, 'input_max': 1, 'cm_id': CM_ID}] signature = {'category': 'Buildings', 'cm_name': CM_NAME, 'layers_needed': ['heat_tot_curr_density', 'heat_res_curr_density', 'heat_nonres_curr_density', 'nuts_id_number', 'gfa_res_curr_density', 'gfa_nonres_curr_density'], 'vectors_needed': [], 'type_layer_needed': ['nuts_id_number', 'heat', 'gross_floor_area', 'gross_floor_area'], 'cm_url': 'Do not add something', 'cm_description': 'CM generating new load profiles', 'cm_id': CM_ID, 'inputs_calculation_module': INPUTS_CALCULATION_MODULE}
class Box: def __init__(self, length, width, height): self.length = length self.width = width self.height = height def pack(self, something): print(f"pack {something}")
class Box: def __init__(self, length, width, height): self.length = length self.width = width self.height = height def pack(self, something): print(f'pack {something}')
# This is a python script for adding package information # To modify syntax rule, you must: # 1. modify JavaParser.g4 # 2. Execute `antlr4 JavaParser.g4` # 3. Run this script # import os # os.chdir('./src/main/java/mastery.translator/java') # import subprocess # subprocess.run(['antlr4', 'JavaParser.g4'], stdout=subprocess.PIPE) names = ["JavaParser.java", "JavaParserBaseListener.java", "JavaParserListener.java"] for filename in names: with open(filename, 'r') as f: content = f.read() with open(filename, 'w') as f: f.write('package mastery.translator.java;\n\n') f.write(content)
names = ['JavaParser.java', 'JavaParserBaseListener.java', 'JavaParserListener.java'] for filename in names: with open(filename, 'r') as f: content = f.read() with open(filename, 'w') as f: f.write('package mastery.translator.java;\n\n') f.write(content)
''' Description: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below). How many possible unique paths are there? Note: m and n will be at most 100. Example 1: Input: m = 3, n = 2 Output: 3 Explanation: From the top-left corner, there are a total of 3 ways to reach the bottom-right corner: 1. Right -> Right -> Down 2. Right -> Down -> Right 3. Down -> Right -> Right Example 2: Input: m = 7, n = 3 Output: 28 ''' class Solution: def uniquePaths(self, m: int, n: int) -> int: rows, cols = m, n path_dp = [ [ 1 for j in range(cols)] for i in range(rows) ] # Dynamic Programming relation: # Base case: # DP(0, j) = 1 , only reachable from one step left # DP(i, 0) = 1 , only reachable from one step up # General case: # DP(i,j) = number of path reach to (i, j) # = number of path reach to one step left + number of path reach to one step up # = number of path reach to (i, j-1) + number of path to (i-1, j) # = DP(i, j-1) + DP(i-1, j) for i in range(1, rows): for j in range(1, cols): path_dp[i][j] = path_dp[i][j-1] + path_dp[i-1][j] # Destination coordination = (rows-1, cols-1) return path_dp[rows-1][cols-1] # m, n : dimension of rows and columns ## Time Complexity: O( m * n ) # # The overhead in time is the nested for loops iterating on (i, j), which is of O( m * n) ## Space Complexity: O( m * n ) # # The overhead in space is the storage for table path_dp, which is of O( m * n) def test_bench(): test_data = [(3,2), (7,3), (6,8)] for m, n in test_data: print( Solution().uniquePaths( m, n) ) return if __name__ == '__main__': test_bench()
""" Description: A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below). The robot can only move either down or right at any point in time. The robot is trying to reach the bottom-right corner of the grid (marked 'Finish' in the diagram below). How many possible unique paths are there? Note: m and n will be at most 100. Example 1: Input: m = 3, n = 2 Output: 3 Explanation: From the top-left corner, there are a total of 3 ways to reach the bottom-right corner: 1. Right -> Right -> Down 2. Right -> Down -> Right 3. Down -> Right -> Right Example 2: Input: m = 7, n = 3 Output: 28 """ class Solution: def unique_paths(self, m: int, n: int) -> int: (rows, cols) = (m, n) path_dp = [[1 for j in range(cols)] for i in range(rows)] for i in range(1, rows): for j in range(1, cols): path_dp[i][j] = path_dp[i][j - 1] + path_dp[i - 1][j] return path_dp[rows - 1][cols - 1] def test_bench(): test_data = [(3, 2), (7, 3), (6, 8)] for (m, n) in test_data: print(solution().uniquePaths(m, n)) return if __name__ == '__main__': test_bench()
# Dua buah data yang tersimpan dalam tipe list data1 = [70, 70, 70, 100, 100, 100, 120, 120, 150, 150] data2 = [50, 60, 60, 50, 70, 70, 100, 80, 100, 90] # Definisikan fungsi hitng_rata_rata def hitung_rata_rata(data): jumlah = 0 for item in data: jumlah += item rata_rata = jumlah/len(data) return rata_rata # Hitung nilai rata-rata dari kedua data yang dimiliki print('Rata-rata data1:') print(hitung_rata_rata(data1)) print('Rata-rata data2:') print(hitung_rata_rata(data2))
data1 = [70, 70, 70, 100, 100, 100, 120, 120, 150, 150] data2 = [50, 60, 60, 50, 70, 70, 100, 80, 100, 90] def hitung_rata_rata(data): jumlah = 0 for item in data: jumlah += item rata_rata = jumlah / len(data) return rata_rata print('Rata-rata data1:') print(hitung_rata_rata(data1)) print('Rata-rata data2:') print(hitung_rata_rata(data2))
GITHUB_OAUTH_CLIENT_ID = "XXXXX" GITHUB_OAUTH_CLIENT_SECRET = "XXXXX" GITHUB_TOKEN = "XXXXX" DISQUS_TOKEN = "XXXXX" SECRET_KEY = "XXXXX"
github_oauth_client_id = 'XXXXX' github_oauth_client_secret = 'XXXXX' github_token = 'XXXXX' disqus_token = 'XXXXX' secret_key = 'XXXXX'
# HARD # build 2 stacks store successor and predecssor with O(H) time # merge 2 stack with O(K) time # Time: O(H) class Solution: def closestKValues(self, root: TreeNode, target: float, k: int) -> List[int]: def initSucc(root,tar): large = [] while root: if root.val == tar: large.append(root) break elif root.val > tar: large.append(root) root = root.left else : root = root.right return large def initPrev(root,tar): arr = [] while root: if root.val == tar: arr.append(root) break elif root.val < tar: arr.append(root) root = root.right else: root = root.left return arr def getNextPrev(prev): curr = prev.pop() ret = curr.val curr = curr.left while curr: prev.append(curr) curr = curr.right return ret def getNextSucc(succ): curr = succ.pop() ret = curr.val curr = curr.right while curr: succ.append(curr) curr = curr.left return ret succ,prev = initSucc(root,target),initPrev(root,target) print([r.val for r in prev]) print([r.val for r in succ]) if succ and prev and succ[-1].val == prev[-1].val: getNextPrev(prev) print([r.val for r in prev]) print([r.val for r in succ]) ret = [] while k >0 : if not succ: ret.append(getNextPrev(prev)) elif not prev: ret.append(getNextSucc(succ)) else: succDiff = abs(succ[-1].val - target) prevDiff = abs(prev[-1].val -target) if succDiff < prevDiff: ret.append(getNextSucc(succ)) else: ret.append(getNextPrev(prev)) k-= 1 return ret
class Solution: def closest_k_values(self, root: TreeNode, target: float, k: int) -> List[int]: def init_succ(root, tar): large = [] while root: if root.val == tar: large.append(root) break elif root.val > tar: large.append(root) root = root.left else: root = root.right return large def init_prev(root, tar): arr = [] while root: if root.val == tar: arr.append(root) break elif root.val < tar: arr.append(root) root = root.right else: root = root.left return arr def get_next_prev(prev): curr = prev.pop() ret = curr.val curr = curr.left while curr: prev.append(curr) curr = curr.right return ret def get_next_succ(succ): curr = succ.pop() ret = curr.val curr = curr.right while curr: succ.append(curr) curr = curr.left return ret (succ, prev) = (init_succ(root, target), init_prev(root, target)) print([r.val for r in prev]) print([r.val for r in succ]) if succ and prev and (succ[-1].val == prev[-1].val): get_next_prev(prev) print([r.val for r in prev]) print([r.val for r in succ]) ret = [] while k > 0: if not succ: ret.append(get_next_prev(prev)) elif not prev: ret.append(get_next_succ(succ)) else: succ_diff = abs(succ[-1].val - target) prev_diff = abs(prev[-1].val - target) if succDiff < prevDiff: ret.append(get_next_succ(succ)) else: ret.append(get_next_prev(prev)) k -= 1 return ret
def ex_situ_hardxray(t=1): # samples = ['PLA2','PLA1','CON6','CON5', 'CON4','CON3','CON2','CON1', # '05_Ca_1', '05_Ca_2', '05_UT_1', '05_UT_2', 'PLA6','PLA4','PLA3', # ] # samples = ['B5_1','B5_2','B5_3', 'B6_1','B6_2','B6_3','B7_1','B7_2','B7_3','B12_1','B12_2','B12_3'] # x_list = [45550, 41200, 35600, 25600, 20900, 15400, -1900, -7900, -14000, -24100, -28200, -32700, ] # y_list = [-9300, -9300, -9300, -9300, -9300, -9300, -9300, -9300, -9300, -9300, -9300, -9300] # samples = ['A1_1','A1_2','A1_3', 'A1_4','A2_5','A2_6','A2_7','A2_8','A3_9','A3_10','A3_11','A3_12','A3_13','A3_14','A4_15', 'A4_16', 'A4_17', 'A4_19'] # x_list = [45950, 43250, 37250, 31650, 24400, 18850, 12500, 8000, -3400, -7300, -11300, -16800, -20900, -26400, -33000, -37400, -41900, -45200] # y_list = [3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500, 3500] # samples = ['C8_32', 'C8_33', 'C8_34', 'C8_35', 'C9_36', 'C9_37', 'C9_38', 'C9_39', 'C10_40', 'C10_41', 'C10_42', 'C10_43', # 'C10_44', 'C10_45', 'C11_46', 'C11_47', 'C11_48', 'C11_49', 'C11_50'] # x_list = [43700, 38300, 34000, 27800, 20900, 16200, 12100, 7100, -2700, -6700, -10500, -15700, -20000, # -24200, -29300, -32700, -36700, -41000, -45000] # y_list = [3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, 3700, # 3700, 3700, 3700, 3700, 3700, 3700] samples = ['D13_51','D13_52','D13_53','D14_54','D14_55','D14_56','D15_57','D15_58','D15_59','D16_60','D16_61','D16_62','D16_63','D16_64', 'D17_65','D17_66','D17_67'] x_list = [43700, 38400, 34000, 25200, 20000, 15400, 6700, 2500, -2300, -6800, -14000, -19000, -23300, -28500, -34700, -39300, -43600] y_list = [-9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880] # Detectors, motors: dets = [pil1M, pil300KW] waxs_range = np.linspace(13, 0, 3) ypos = [0, 400, 3] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' det_exposure_time(t,t) for wa in waxs_range: yield from bps.mv(waxs, wa) for sam, x, y in zip(samples, x_list, y_list): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) name_fmt = '{sam}_wa{waxs}' sample_name = name_fmt.format(sam=sam, waxs='%2.1f'%wa) sample_id(user_name='OS', sample_name=sample_name) yield from bp.rel_scan(dets, piezo.y, *ypos) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3,0.3) def ex_situ_hardxray_2020_3(t=1): yield from bps.mv(stage.y, 0) yield from bps.mv(stage.th, 0) samples = ['F22_83','F22_84','F22_85','F23_86','F23_87','F23_88','F24_89','F24_90','F24_91','F24_92','F24_93','F24_94','F25_95','F25_96','F25_97','F25_98'] x_list = [45100, 38750, 33500, 26450, 21600, 17300, 7800, 3600, -2300, -7800, -13400, -18500, -28800, -32400, -36700, -42500] y_list = [-1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500] z_list = [ 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700] # Detectors, motors: dets = [pil1M, pil300KW] waxs_range = np.linspace(0, 32.5, 6) ypos = [0, 400, 3] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' det_exposure_time(t,t) for wa in waxs_range: yield from bps.mv(waxs, wa) for sam, x, y, z in zip(samples, x_list, y_list, z_list): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) name_fmt = '{sam}_wa{waxs}' sample_name = name_fmt.format(sam=sam, waxs='%2.1f'%wa) sample_id(user_name='OS', sample_name=sample_name) yield from bp.rel_scan(dets, piezo.y, *ypos) sample_id(user_name='test', sample_name='test') # det_exposure_time(0.3,0.3) yield from bps.mv(stage.th, 1.5) yield from bps.mv(stage.y, -11) samples = ['E18_67','E18_68','E18_69','E19_70','E19_71','E19_72','E19_73','E19_74','E19_75','E20_76','E20_77','E20_78','E21_79','E21_80','E21_81','E22_82'] x_list = [43500, 37500, 32100, 23600, 18350, 13000, 7200, 3300, -450, -9400, -14300, -19400, -25900, -31300, -36200, -43200] y_list = [-9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700] z_list = [ 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200] # Detectors, motors: dets = [pil1M, pil300KW] waxs_range = np.linspace(0, 32.5, 6) ypos = [0, 400, 3] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' det_exposure_time(t,t) for wa in waxs_range: yield from bps.mv(waxs, wa) for sam, x, y, z in zip(samples, x_list, y_list, z_list): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) name_fmt = '{sam}_16.1keV_wa{waxs}' sample_name = name_fmt.format(sam=sam, waxs='%2.1f'%wa) sample_id(user_name='OS', sample_name=sample_name) yield from bp.rel_scan(dets, piezo.y, *ypos) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3,0.3) # def ex_situ_hardxray_2021_1(t=1): # yield from bps.mv(stage.y, 0) # yield from bps.mv(stage.th, 0) # samples = ['F22_83','F22_84','F22_85','F23_86','F23_87','F23_88','F24_89','F24_90','F24_91','F24_92','F24_93','F24_94','F25_95','F25_96','F25_97','F25_98'] # x_list = [45100, 38750, 33500, 26450, 21600, 17300, 7800, 3600, -2300, -7800, -13400, -18500, -28800, -32400, -36700, -42500] # y_list = [-1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500] # z_list = [ 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700] # # Detectors, motors: # dets = [pil1M, pil300KW] # waxs_range = np.linspace(0, 32.5, 6) # ypos = [0, 400, 3] # assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' # assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' # det_exposure_time(t,t) # for wa in waxs_range: # yield from bps.mv(waxs, wa) # for sam, x, y, z in zip(samples, x_list, y_list, z_list): # yield from bps.mv(piezo.x, x) # yield from bps.mv(piezo.y, y) # yield from bps.mv(piezo.z, z) # name_fmt = '{sam}_wa{waxs}' # sample_name = name_fmt.format(sam=sam, waxs='%2.1f'%wa) # sample_id(user_name='OS', sample_name=sample_name) # yield from bp.rel_scan(dets, piezo.y, *ypos) # sample_id(user_name='test', sample_name='test') # # det_exposure_time(0.3,0.3) # yield from bps.mv(stage.th, 1.5) # yield from bps.mv(stage.y, -11) # samples = ['E18_67','E18_68','E18_69','E19_70','E19_71','E19_72','E19_73','E19_74','E19_75','E20_76','E20_77','E20_78','E21_79','E21_80','E21_81','E22_82'] # x_list = [43500, 37500, 32100, 23600, 18350, 13000, 7200, 3300, -450, -9400, -14300, -19400, -25900, -31300, -36200, -43200] # y_list = [-9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700] # z_list = [ 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200] # # Detectors, motors: # dets = [pil1M, pil300KW] # waxs_range = np.linspace(0, 32.5, 6) # ypos = [0, 400, 3] # assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' # assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' # det_exposure_time(t,t) # for wa in waxs_range: # yield from bps.mv(waxs, wa) # for sam, x, y, z in zip(samples, x_list, y_list, z_list): # yield from bps.mv(piezo.x, x) # yield from bps.mv(piezo.y, y) # yield from bps.mv(piezo.z, z) # name_fmt = '{sam}_16.1keV_wa{waxs}' # sample_name = name_fmt.format(sam=sam, waxs='%2.1f'%wa) # sample_id(user_name='OS', sample_name=sample_name) # yield from bp.rel_scan(dets, piezo.y, *ypos) # sample_id(user_name='test', sample_name='test') det_exposure_time(0.3,0.3) def ex_situ_hardxray_2021_1(t=1): yield from bps.mv(stage.th, 0) yield from bps.mv(stage.y, 0) # samples = ['P1_1', 'P1_2', 'P1_3', 'P2_1', 'P2_2', 'P2_3', 'P3_1', 'P3_2', 'P3_3', 'P4_1', 'P4_2', 'P4_3', 'P5_1', 'P5_2', 'P5_3', # 'P6_1', 'P6_2', 'P6_3', 'P7_1', 'P7_2', 'P7_3', 'P8_1', 'P8_2', 'P8_3'] # x_list = [ 45400, 41100, 37500, 32400, 29400, 25900, 20200, 16700, 13100, 6800, 3700, 200, -4600, -8400, -12000, -17200, -20600, # -24000, -29400, -33100, -36200, -40000, -42500, -45500] # y_list = [ -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, -3000, # -3000, -3000, -3000, -3000, -3000, -3000, -3000] # z_list = [ 4000, 4000, 4100, 4100, 4200, 4200, 4200, 4200, 4300, 4300, 4400, 4400, 4500, 4500, 4600, 4600, 4700, # 4700, 4800, 4800, 4900, 4900, 5000, 5000] samples = ['N1_1', 'N1_2', 'N1_3', 'N1_4', 'N2_1', 'N2_2', 'N2_3', 'N2_4', 'N3_1', 'N3_2', 'N3_3', 'N4_1', 'N4_2', 'N4_3', 'N5_1', 'N5_2', 'N5_3'] x_list = [ 45300, 41400, 38200, 34700, 29600, 26300, 22900, 18400, 7700, 3100, -1300, -9300, -14200, -19600, -28600, -35100, -41200] y_list = [ -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500] z_list = [ 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500] # Detectors, motors: dets = [pil1M, pil300KW] waxs_range = np.linspace(0, 32.5, 6) ypos = [0, 400, 3] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' det_exposure_time(t,t) for wa in waxs_range: yield from bps.mv(waxs, wa) for sam, x, y, z in zip(samples, x_list, y_list, z_list): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) name_fmt = '{sam}_wa{waxs}_sdd8.3m_16.1keV' sample_name = name_fmt.format(sam=sam, waxs='%2.1f'%wa) sample_id(user_name='OS', sample_name=sample_name) yield from bp.rel_scan(dets, piezo.y, *ypos) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3,0.3) # yield from bps.mv(stage.th, 2.5) # yield from bps.mv(stage.y, -13) # samples = ['R1_1', 'R1_2', 'R1_3', 'R2_1', 'R2_2', 'R2_3', 'R3_1', 'R3_2', 'R3_3', 'R4_1', 'R4_2', 'R4_3', 'R5_1', 'R5_2', 'R5_3'] # x_list = [ 44800, 40300, 34800, 24800, 18800, 12300, 4000, -1700, -7800, -13700, -20700, -27700, -33200, -38200, -43400] # y_list = [ -9500, -9500, -9500, -9500, -9500, -9500, -9500, -9500, -9500, -9500, -9500, -9500, -9500, -9500, -9500] # z_list = [ 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000] # for wa in waxs_range: # yield from bps.mv(waxs, wa) # for sam, x, y, z in zip(samples, x_list, y_list, z_list): # yield from bps.mv(piezo.x, x) # yield from bps.mv(piezo.y, y) # yield from bps.mv(piezo.z, z) # name_fmt = '{sam}_wa{waxs}_sdd8.3m_16.1keV' # sample_name = name_fmt.format(sam=sam, waxs='%2.1f'%wa) # sample_id(user_name='OS', sample_name=sample_name) # yield from bp.rel_scan(dets, piezo.y, *ypos) # sample_id(user_name='test', sample_name='test') # det_exposure_time(0.3,0.3) def run_saxs_nexafs(t=1): yield from waxs_prep_multisample_nov(t=0.5) # yield from bps.sleep(10) # yield from nexafs_prep_multisample_nov(t=1) def saxs_prep_multisample_nov(t=1): dets = [pil1M] energies = [4030, 4040, 4050, 4055, 4065, 4075, 4105] det_exposure_time(t,t) name_fmt = '{sample}_{energy}eV_pos{posi}_wa{wa}_xbpm{xbpm}' waxs_range = [32.5] ypos = [0, 400, 3] for wa in waxs_range: yield from bps.mv(waxs, wa) yield from bps.mv(stage.th, 3.5) yield from bps.mv(stage.y, -13) # samples = ['K5-6', 'K5-5', 'K5-4', 'K5-3', 'K5-2', 'K5-1', 'K4-3', 'K4-2', 'K4-1', 'K3-3', 'K3-2', 'K3-1', 'K2-3', 'K2-2', 'K2-1', 'K1-3', 'K1-2', 'K1-1'] # x_list = [41400, 37700,34300,26750,23800,20600,1700,-2100,-5300,-10200,-14150,-19200,-27500,-32000,-37500,-41100,-45800,-49400] # y_list = [-9500, -9500,-9500,-9500,-9500,-9500,-9500,-9500,-9500,-9500, -9500, -9500, -9500, -9500, -9500, -9500, -9700, -9500] # z_list = [ 5500, 5500, 5400, 5300, 5200, 5100, 5000, 4900, 4800, 4700, 4600, 4500, 4400, 4300, 4200, 4100, 4000, 3900] # samples = ['M14-1', 'M14-2', 'M14-3', 'M15-1', 'M15-2', 'M15-3', 'M16-1', 'M16-2', 'M16-3', 'M17-1', 'M17-2', 'M17-3', 'M18-1', 'M18-2', 'M18-3', 'M18-4', 'M18-5'] # x_list = [ 46900, 44500, 41500, 31900, 27300, 22750, 12750, 10500, 7800, -2800, -4900, -9100, -17400, -20800, -23800, -26550, -29950] # y_list = [ -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8100, -8500, -8500, -8500, -8500, -8500, -8500, -8500] # z_list = [ 4800, 4800, 4700, 4600, 4500, 4500, 4400, 4300, 4200, 4100, 4100, 4000, 3900, 3800, 3800, 3700, 3600] samples = [ 'M16-2', 'M16-3', 'M17-1', 'M17-2', 'M17-3', 'M18-1', 'M18-2', 'M18-3', 'M18-4', 'M18-5'] x_list = [ 10500, 7800, -2800, -4900, -9100, -17400, -20800, -23800, -26550, -29950] y_list = [ -8500, -8500, -8100, -8500, -8500, -8500, -8500, -8500, -8500, -8500] z_list = [ 4300, 4200, 4100, 4100, 4000, 3900, 3800, 3800, 3700, 3600] for x, y, z, name in zip(x_list, y_list, z_list, samples): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) for k, e in enumerate(energies): yield from bps.mv(energy, e) yield from bps.sleep(3) name_fmt = '{sample}_{energy}eV_5m_xbpm{xbpm}_wa{wa}' sample_name = name_fmt.format(sample=name, energy=e, xbpm = '%3.1f'%xbpm3.sumY.value, wa='%2.1f'%wa) sample_id(user_name='OS', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.rel_scan(dets, piezo.y, *ypos) yield from bps.mv(energy, 4080) yield from bps.mv(energy, 4055) yield from bps.mv(energy, 4030) # for wa in waxs_range: # yield from bps.mv(waxs, wa) # yield from bps.mv(stage.y, 0) # yield from bps.mv(stage.th, 0) # samples = ['L13-3', 'L13-2', 'L13-1', 'L12-3', 'L12-2', 'L12-1', 'L11-3', 'L11-2', 'L11-1', 'L10-3', 'L10-2', 'L10-1', 'L9-3', 'L9-2', 'L9-1', 'L8-3', 'L8-2', # 'L8-1', 'L7-3', 'L7-2', 'L7-1', 'L6-3', 'L6-2', 'L6-1'] # x_list = [40600, 37500, 34500, 29400, 25600, 22300, 17100, 14250, 10800, 5900, 3450, 550, -5050, -7250, -9100, -13900,-16200,-18500,-22300,-24700,-27050, # -34800, -38450, -42250] # y_list = [-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, # -1000, -1000, -1000] # z_list = [ 5400, 5400, 5300, 5200, 5100, 5000, 4900, 4800, 4700, 4600, 4500, 4400, 4300, 4200, 4100, 4000, 3900, 3800, 3700, 3600, 3500, # 3300, 3400, 3300] # assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' # assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' # assert len(x_list) == len(z_list), f'Number of X coordinates ({len(x_list)}) is different from number of z coord ({len(z_list)})' # for x, y, z, name in zip(x_list, y_list, z_list, samples): # yield from bps.mv(piezo.x, x) # yield from bps.mv(piezo.y, y) # yield from bps.mv(piezo.z, z) # for k, e in enumerate(energies): # yield from bps.mv(energy, e) # yield from bps.sleep(3) # name_fmt = '{sample}_{energy}eV_xbpm{xbpm}_wa{wa}' # sample_name = name_fmt.format(sample=name, energy=e, xbpm = '%3.1f'%xbpm3.sumY.value, wa='%2.1f'%wa) # sample_id(user_name='OS', sample_name=sample_name) # print(f'\n\t=== Sample: {sample_name} ===\n') # yield from bp.rel_scan(dets, piezo.y, *ypos) # yield from bps.mv(energy, 4080) # yield from bps.mv(energy, 4055) # yield from bps.mv(energy, 4030) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3,0.3) def waxs_prep_multisample_nov(t=1): dets = [pil300KW] energies = [4030, 4040, 4050, 4055, 4065, 4075, 4105] det_exposure_time(t,t) name_fmt = '{sample}_{energy}eV_pos{posi}_wa{wa}_xbpm{xbpm}' waxs_range = [0, 6.5, 13.0, 19.5, 26, 32.5, 39.0, 45.5] ypos = [0, 400, 3] # for wa in waxs_range: # yield from bps.mv(waxs, wa) # yield from bps.mv(stage.th, 3.5) # yield from bps.mv(stage.y, -13) # # samples = ['K5-6', 'K5-5', 'K5-4', 'K5-3', 'K5-2', 'K5-1', 'K4-3', 'K4-2', 'K4-1', 'K3-3', 'K3-2', 'K3-1', 'K2-3', 'K2-2', 'K2-1', 'K1-3', 'K1-2', 'K1-1'] # # x_list = [41400, 37700,34300,26750,23800,20600,1700,-2100,-5300,-10200,-14150,-19200,-27500,-32000,-37500,-41100,-45800,-49400] # # y_list = [-9500, -9500,-9500,-9500,-9500,-9500,-9500,-9500,-9500,-9500, -9500, -9500, -9500, -9500, -9500, -9500, -9700, -9500] # # z_list = [ 5500, 5500, 5400, 5300, 5200, 5100, 5000, 4900, 4800, 4700, 4600, 4500, 4400, 4300, 4200, 4100, 4000, 3900] # samples = ['M14-1', 'M14-2', 'M14-3', 'M15-1', 'M15-2', 'M15-3', 'M16-1', 'M16-2', 'M16-3', 'M17-1', 'M17-2', 'M17-3', 'M18-1', 'M18-2', 'M18-3', 'M18-4', 'M18-5'] # x_list = [ 46900, 44500, 41500, 31900, 27300, 22750, 12750, 10500, 7800, -2800, -4900, -9100, -17400, -20800, -23800, -26550, -29950] # y_list = [ -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8100, -8500, -8500, -8500, -8500, -8500, -8500, -8500] # z_list = [ 4800, 4800, 4700, 4600, 4500, 4500, 4400, 4300, 4200, 4100, 4100, 4000, 3900, 3800, 3800, 3700, 3600] # for x, y, z, name in zip(x_list, y_list, z_list, samples): # yield from bps.mv(piezo.x, x) # yield from bps.mv(piezo.y, y) # yield from bps.mv(piezo.z, z) # for k, e in enumerate(energies): # yield from bps.mv(energy, e) # yield from bps.sleep(3) # name_fmt = '{sample}_{energy}eV_xbpm{xbpm}_wa{wa}' # sample_name = name_fmt.format(sample=name, energy=e, xbpm = '%3.1f'%xbpm3.sumY.value, wa='%2.1f'%wa) # sample_id(user_name='OS', sample_name=sample_name) # print(f'\n\t=== Sample: {sample_name} ===\n') # yield from bp.rel_scan(dets, piezo.y, *ypos) # yield from bps.mv(energy, 4080) # yield from bps.mv(energy, 4055) # yield from bps.mv(energy, 4030) # energies = [4030, 4040, 4050, 4055, 4065, 4075, 4105] # waxs_range = [0, 6.5, 13.0, 19.5, 26, 32.5, 39.0, 45.5] # for wa in waxs_range: # yield from bps.mv(waxs, wa) # yield from bps.mv(stage.y, 0) # yield from bps.mv(stage.th, 0) # # samples = ['L13-3', 'L13-2', 'L13-1', 'L12-3', 'L12-2', 'L12-1', 'L11-3', 'L11-2', 'L11-1', 'L10-3', 'L10-2', 'L10-1', 'L9-3', 'L9-2', 'L9-1', 'L8-3', 'L8-2', # # 'L8-1', 'L7-3', 'L7-2', 'L7-1', 'L6-3', 'L6-2', 'L6-1'] # # x_list = [40600, 37500, 34500, 29400, 25600, 22300, 17100, 14250, 10800, 5900, 3450, 550, -5050, -7250, -9100, -13900,-16200,-18500,-22300,-24700,-27050, # # -34800, -38450, -42250] # # y_list = [-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, # # -1000, -1000, -1000] # # z_list = [ 5400, 5400, 5300, 5200, 5100, 5000, 4900, 4800, 4700, 4600, 4500, 4400, 4300, 4200, 4100, 4000, 3900, 3800, 3700, 3600, 3500, # # 3300, 3400, 3300] # samples = [ 'P1', 'P2', 'E1', 'E2', 'PG1', 'PG2'] # x_list = [11400, 6200, 200, -5200, -13200, -26200] # y_list = [-1000, -900, -900, -700, -1300, -1300] # z_list = [ 4500, 4300, 4200, 4100, 4000, 4000] # assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' # assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' # assert len(x_list) == len(z_list), f'Number of X coordinates ({len(x_list)}) is different from number of z coord ({len(z_list)})' # for x, y, z, name in zip(x_list, y_list, z_list, samples): # yield from bps.mv(piezo.x, x) # yield from bps.mv(piezo.y, y) # yield from bps.mv(piezo.z, z) # for k, e in enumerate(energies): # yield from bps.mv(energy, e) # yield from bps.sleep(3) # name_fmt = '{sample}_{energy}eV_xbpm{xbpm}_wa{wa}' # sample_name = name_fmt.format(sample=name, energy=e, xbpm = '%3.1f'%xbpm3.sumY.value, wa='%2.1f'%wa) # sample_id(user_name='OS', sample_name=sample_name) # print(f'\n\t=== Sample: {sample_name} ===\n') # yield from bp.rel_scan(dets, piezo.y, *ypos) # yield from bps.mv(energy, 4080) # yield from bps.mv(energy, 4055) # yield from bps.mv(energy, 4030) energies = np.arange(4030, 4040, 5).tolist() + np.arange(4040, 4060, 0.5).tolist() + np.arange(4060, 4080, 2).tolist() + np.arange(4080, 4150, 5).tolist() # waxs_range = [0, 6.5, 13.0, 19.5, 26, 32.5, 39.0, 45.5] waxs_range = [6.5] for wa in waxs_range: yield from bps.mv(waxs, wa) yield from bps.mv(stage.y, 0) yield from bps.mv(stage.th, 0) # samples = [ 'U1', 'U2', 'Ca1', 'Ca2'] # x_list = [43000, 31000, -36500, -44000] # y_list = [ -700, -700, -900, -900] # z_list = [ 4600, 4600, 3600, 3600] samples = [ 'Ca2'] x_list = [ -44000] y_list = [ -900] z_list = [ 3600] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' assert len(x_list) == len(z_list), f'Number of X coordinates ({len(x_list)}) is different from number of z coord ({len(z_list)})' for x, y, z, name in zip(x_list, y_list, z_list, samples): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) for k, e in enumerate(energies): yield from bps.mv(energy, e) yield from bps.sleep(3) name_fmt = '{sample}_{energy}eV_xbpm{xbpm}_wa{wa}' sample_name = name_fmt.format(sample=name, energy=e, xbpm = '%3.1f'%xbpm3.sumY.value, wa='%2.1f'%wa) sample_id(user_name='OS', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.rel_scan(dets, piezo.y, *ypos) yield from bps.mv(energy, 4120) yield from bps.mv(energy, 4090) yield from bps.mv(energy, 4060) yield from bps.mv(energy, 4030) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3,0.3) def nexafs_prep_multisample_nov(t=1): # samples = ['K5-6', 'K5-5', 'K5-4', 'K5-3', 'K5-2', 'K5-1', 'K4-3', 'K4-2', 'K4-1', 'K3-3', 'K3-2', 'K3-1', 'K2-3', 'K2-2', 'K2-1', 'K1-3', 'K1-2', 'K1-1'] # x_list = [41400, 37700, 34300, 26750, 23800, 20600, 1700, -2100, -5300, -10200,-14150,-19200,-27500,-32000,-37500,-41100,-45800,-49400] # y_list = [-9500, -9500, -9500, -9500, -9500, -9500, -9500,- 9500, -9500,-9500, -9500, -9500, -9500, -9500, -9500, -9500, -9700, -9500] # z_list = [ 5500, 5500, 5400, 5300, 5200, 5100, 5000, 4900, 4800, 4700, 4600, 4500, 4400, 4300, 4200, 4100, 4000, 3900] yield from bps.mv(stage.th, 3.5) yield from bps.mv(stage.y, -13) samples = ['M14-1', 'M14-2', 'M14-3', 'M15-1', 'M15-2', 'M15-3', 'M16-1', 'M16-2', 'M16-3', 'M17-1', 'M17-2', 'M17-3', 'M18-1', 'M18-2', 'M18-3', 'M18-4', 'M18-5'] x_list = [ 46900, 44500, 41500, 31900, 27300, 22750, 12750, 10500, 7800, -2800, -4900, -9100, -17400, -20800, -23800, -26550, -29950] y_list = [ -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8100, -8500, -8500, -8500, -8500, -8500, -8500, -8500] z_list = [ 4800, 4800, 4700, 4600, 4500, 4500, 4400, 4300, 4200, 4100, 4100, 4000, 3900, 3800, 3800, 3700, 3600] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' assert len(x_list) == len(z_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(z_list)})' for x, y, z, name in zip(x_list, y_list, z_list, samples): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) yield from NEXAFS_Ca_edge_multi(t=t, name=name) yield from bps.mv(stage.y, 0) yield from bps.mv(stage.th, 0) # samples = ['L13-3', 'L13-2', 'L13-1', 'L12-3', 'L12-2', 'L12-1', 'L11-3', 'L11-2', 'L11-1', 'L10-3', 'L10-2', 'L10-1', 'L9-3', 'L9-2', 'L9-1', 'L8-3', 'L8-2', # 'L8-1', 'L7-3', 'L7-2', 'L7-1', 'L6-3', 'L6-2', 'L6-1'] # x_list = [40600, 37500, 34500, 29400, 25600, 22300, 17100, 14250, 10800, 5900, 3450, 550, -5050, -7250, -9100, -13900,-16200,-18500,-22300,-24700,-27050, # -34800, -38450, -42250] # y_list = [-1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, # -1000, -1000, -1000] # z_list = [ 5400, 5400, 5300, 5200, 5100, 5000, 4900, 4800, 4700, 4600, 4500, 4400, 4300, 4200, 4100, 4000, 3900, 3800, 3700, 3600, 3500, # 3300, 3400, 3300] samples = [ 'C1', 'C2', 'P1', 'P2', 'E1', 'E2', 'PG1', 'PG2'] x_list = [21800, 16500, 11400, 6200, 200, -5200, -13200, -26200] y_list = [ -900, -700, -800, -700, -700, -500, -1100, -1100] z_list = [ 4600, 4600, 4500, 4300, 4200, 4100, 4000, 4000] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' assert len(x_list) == len(z_list), f'Number of X coordinates ({len(x_list)}) is different from number of z coord ({len(z_list)})' for x, y, z, name in zip(x_list, y_list, z_list, samples): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) yield from NEXAFS_Ca_edge_multi(t=t, name=name) # sample_id(user_name='test', sample_name='test') # yield from bps.mv(att2_11, 'Insert') # yield from bps.mv(GV7.open_cmd, 1 ) # yield from bps.sleep(2) # yield from bps.mv(att2_11, 'Insert') # yield from bps.mv(GV7.open_cmd, 1 ) def NEXAFS_Ca_edge_multi(t=0.5, name='test'): yield from bps.mv(waxs, 52) dets = [pil300KW] energies = np.linspace(4030, 4150, 121) det_exposure_time(t,t) name_fmt = 'nexafs_{sample}_{energy}eV_xbpm{xbpm}' for e in energies: yield from bps.mv(energy, e) yield from bps.sleep(3) sample_name = name_fmt.format(sample=name, energy=e, xbpm = '%3.1f'%xbpm3.sumY.value) RE.md['filename_amptek'] = sample_name sample_id(user_name='OS', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.count(dets, num=1) yield from bps.mv(energy, 4125) yield from bps.mv(energy, 4100) yield from bps.mv(energy, 4075) yield from bps.mv(energy, 4050) yield from bps.mv(energy, 4030) sample_id(user_name='test', sample_name='test')
def ex_situ_hardxray(t=1): samples = ['D13_51', 'D13_52', 'D13_53', 'D14_54', 'D14_55', 'D14_56', 'D15_57', 'D15_58', 'D15_59', 'D16_60', 'D16_61', 'D16_62', 'D16_63', 'D16_64', 'D17_65', 'D17_66', 'D17_67'] x_list = [43700, 38400, 34000, 25200, 20000, 15400, 6700, 2500, -2300, -6800, -14000, -19000, -23300, -28500, -34700, -39300, -43600] y_list = [-9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880, -9880] dets = [pil1M, pil300KW] waxs_range = np.linspace(13, 0, 3) ypos = [0, 400, 3] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' det_exposure_time(t, t) for wa in waxs_range: yield from bps.mv(waxs, wa) for (sam, x, y) in zip(samples, x_list, y_list): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) name_fmt = '{sam}_wa{waxs}' sample_name = name_fmt.format(sam=sam, waxs='%2.1f' % wa) sample_id(user_name='OS', sample_name=sample_name) yield from bp.rel_scan(dets, piezo.y, *ypos) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3, 0.3) def ex_situ_hardxray_2020_3(t=1): yield from bps.mv(stage.y, 0) yield from bps.mv(stage.th, 0) samples = ['F22_83', 'F22_84', 'F22_85', 'F23_86', 'F23_87', 'F23_88', 'F24_89', 'F24_90', 'F24_91', 'F24_92', 'F24_93', 'F24_94', 'F25_95', 'F25_96', 'F25_97', 'F25_98'] x_list = [45100, 38750, 33500, 26450, 21600, 17300, 7800, 3600, -2300, -7800, -13400, -18500, -28800, -32400, -36700, -42500] y_list = [-1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500, -1500] z_list = [2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700, 2700] dets = [pil1M, pil300KW] waxs_range = np.linspace(0, 32.5, 6) ypos = [0, 400, 3] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' det_exposure_time(t, t) for wa in waxs_range: yield from bps.mv(waxs, wa) for (sam, x, y, z) in zip(samples, x_list, y_list, z_list): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) name_fmt = '{sam}_wa{waxs}' sample_name = name_fmt.format(sam=sam, waxs='%2.1f' % wa) sample_id(user_name='OS', sample_name=sample_name) yield from bp.rel_scan(dets, piezo.y, *ypos) sample_id(user_name='test', sample_name='test') yield from bps.mv(stage.th, 1.5) yield from bps.mv(stage.y, -11) samples = ['E18_67', 'E18_68', 'E18_69', 'E19_70', 'E19_71', 'E19_72', 'E19_73', 'E19_74', 'E19_75', 'E20_76', 'E20_77', 'E20_78', 'E21_79', 'E21_80', 'E21_81', 'E22_82'] x_list = [43500, 37500, 32100, 23600, 18350, 13000, 7200, 3300, -450, -9400, -14300, -19400, -25900, -31300, -36200, -43200] y_list = [-9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700, -9700] z_list = [4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200, 4200] dets = [pil1M, pil300KW] waxs_range = np.linspace(0, 32.5, 6) ypos = [0, 400, 3] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' det_exposure_time(t, t) for wa in waxs_range: yield from bps.mv(waxs, wa) for (sam, x, y, z) in zip(samples, x_list, y_list, z_list): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) name_fmt = '{sam}_16.1keV_wa{waxs}' sample_name = name_fmt.format(sam=sam, waxs='%2.1f' % wa) sample_id(user_name='OS', sample_name=sample_name) yield from bp.rel_scan(dets, piezo.y, *ypos) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3, 0.3) det_exposure_time(0.3, 0.3) def ex_situ_hardxray_2021_1(t=1): yield from bps.mv(stage.th, 0) yield from bps.mv(stage.y, 0) samples = ['N1_1', 'N1_2', 'N1_3', 'N1_4', 'N2_1', 'N2_2', 'N2_3', 'N2_4', 'N3_1', 'N3_2', 'N3_3', 'N4_1', 'N4_2', 'N4_3', 'N5_1', 'N5_2', 'N5_3'] x_list = [45300, 41400, 38200, 34700, 29600, 26300, 22900, 18400, 7700, 3100, -1300, -9300, -14200, -19600, -28600, -35100, -41200] y_list = [-2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500, -2500] z_list = [4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500, 4500] dets = [pil1M, pil300KW] waxs_range = np.linspace(0, 32.5, 6) ypos = [0, 400, 3] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' det_exposure_time(t, t) for wa in waxs_range: yield from bps.mv(waxs, wa) for (sam, x, y, z) in zip(samples, x_list, y_list, z_list): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) name_fmt = '{sam}_wa{waxs}_sdd8.3m_16.1keV' sample_name = name_fmt.format(sam=sam, waxs='%2.1f' % wa) sample_id(user_name='OS', sample_name=sample_name) yield from bp.rel_scan(dets, piezo.y, *ypos) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3, 0.3) def run_saxs_nexafs(t=1): yield from waxs_prep_multisample_nov(t=0.5) def saxs_prep_multisample_nov(t=1): dets = [pil1M] energies = [4030, 4040, 4050, 4055, 4065, 4075, 4105] det_exposure_time(t, t) name_fmt = '{sample}_{energy}eV_pos{posi}_wa{wa}_xbpm{xbpm}' waxs_range = [32.5] ypos = [0, 400, 3] for wa in waxs_range: yield from bps.mv(waxs, wa) yield from bps.mv(stage.th, 3.5) yield from bps.mv(stage.y, -13) samples = ['M16-2', 'M16-3', 'M17-1', 'M17-2', 'M17-3', 'M18-1', 'M18-2', 'M18-3', 'M18-4', 'M18-5'] x_list = [10500, 7800, -2800, -4900, -9100, -17400, -20800, -23800, -26550, -29950] y_list = [-8500, -8500, -8100, -8500, -8500, -8500, -8500, -8500, -8500, -8500] z_list = [4300, 4200, 4100, 4100, 4000, 3900, 3800, 3800, 3700, 3600] for (x, y, z, name) in zip(x_list, y_list, z_list, samples): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) for (k, e) in enumerate(energies): yield from bps.mv(energy, e) yield from bps.sleep(3) name_fmt = '{sample}_{energy}eV_5m_xbpm{xbpm}_wa{wa}' sample_name = name_fmt.format(sample=name, energy=e, xbpm='%3.1f' % xbpm3.sumY.value, wa='%2.1f' % wa) sample_id(user_name='OS', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.rel_scan(dets, piezo.y, *ypos) yield from bps.mv(energy, 4080) yield from bps.mv(energy, 4055) yield from bps.mv(energy, 4030) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3, 0.3) def waxs_prep_multisample_nov(t=1): dets = [pil300KW] energies = [4030, 4040, 4050, 4055, 4065, 4075, 4105] det_exposure_time(t, t) name_fmt = '{sample}_{energy}eV_pos{posi}_wa{wa}_xbpm{xbpm}' waxs_range = [0, 6.5, 13.0, 19.5, 26, 32.5, 39.0, 45.5] ypos = [0, 400, 3] energies = np.arange(4030, 4040, 5).tolist() + np.arange(4040, 4060, 0.5).tolist() + np.arange(4060, 4080, 2).tolist() + np.arange(4080, 4150, 5).tolist() waxs_range = [6.5] for wa in waxs_range: yield from bps.mv(waxs, wa) yield from bps.mv(stage.y, 0) yield from bps.mv(stage.th, 0) samples = ['Ca2'] x_list = [-44000] y_list = [-900] z_list = [3600] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' assert len(x_list) == len(z_list), f'Number of X coordinates ({len(x_list)}) is different from number of z coord ({len(z_list)})' for (x, y, z, name) in zip(x_list, y_list, z_list, samples): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) for (k, e) in enumerate(energies): yield from bps.mv(energy, e) yield from bps.sleep(3) name_fmt = '{sample}_{energy}eV_xbpm{xbpm}_wa{wa}' sample_name = name_fmt.format(sample=name, energy=e, xbpm='%3.1f' % xbpm3.sumY.value, wa='%2.1f' % wa) sample_id(user_name='OS', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.rel_scan(dets, piezo.y, *ypos) yield from bps.mv(energy, 4120) yield from bps.mv(energy, 4090) yield from bps.mv(energy, 4060) yield from bps.mv(energy, 4030) sample_id(user_name='test', sample_name='test') det_exposure_time(0.3, 0.3) def nexafs_prep_multisample_nov(t=1): yield from bps.mv(stage.th, 3.5) yield from bps.mv(stage.y, -13) samples = ['M14-1', 'M14-2', 'M14-3', 'M15-1', 'M15-2', 'M15-3', 'M16-1', 'M16-2', 'M16-3', 'M17-1', 'M17-2', 'M17-3', 'M18-1', 'M18-2', 'M18-3', 'M18-4', 'M18-5'] x_list = [46900, 44500, 41500, 31900, 27300, 22750, 12750, 10500, 7800, -2800, -4900, -9100, -17400, -20800, -23800, -26550, -29950] y_list = [-8500, -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8500, -8100, -8500, -8500, -8500, -8500, -8500, -8500, -8500] z_list = [4800, 4800, 4700, 4600, 4500, 4500, 4400, 4300, 4200, 4100, 4100, 4000, 3900, 3800, 3800, 3700, 3600] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' assert len(x_list) == len(z_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(z_list)})' for (x, y, z, name) in zip(x_list, y_list, z_list, samples): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) yield from nexafs__ca_edge_multi(t=t, name=name) yield from bps.mv(stage.y, 0) yield from bps.mv(stage.th, 0) samples = ['C1', 'C2', 'P1', 'P2', 'E1', 'E2', 'PG1', 'PG2'] x_list = [21800, 16500, 11400, 6200, 200, -5200, -13200, -26200] y_list = [-900, -700, -800, -700, -700, -500, -1100, -1100] z_list = [4600, 4600, 4500, 4300, 4200, 4100, 4000, 4000] assert len(x_list) == len(samples), f'Number of X coordinates ({len(x_list)}) is different from number of samples ({len(samples)})' assert len(x_list) == len(y_list), f'Number of X coordinates ({len(x_list)}) is different from number of Y coord ({len(y_list)})' assert len(x_list) == len(z_list), f'Number of X coordinates ({len(x_list)}) is different from number of z coord ({len(z_list)})' for (x, y, z, name) in zip(x_list, y_list, z_list, samples): yield from bps.mv(piezo.x, x) yield from bps.mv(piezo.y, y) yield from bps.mv(piezo.z, z) yield from nexafs__ca_edge_multi(t=t, name=name) def nexafs__ca_edge_multi(t=0.5, name='test'): yield from bps.mv(waxs, 52) dets = [pil300KW] energies = np.linspace(4030, 4150, 121) det_exposure_time(t, t) name_fmt = 'nexafs_{sample}_{energy}eV_xbpm{xbpm}' for e in energies: yield from bps.mv(energy, e) yield from bps.sleep(3) sample_name = name_fmt.format(sample=name, energy=e, xbpm='%3.1f' % xbpm3.sumY.value) RE.md['filename_amptek'] = sample_name sample_id(user_name='OS', sample_name=sample_name) print(f'\n\t=== Sample: {sample_name} ===\n') yield from bp.count(dets, num=1) yield from bps.mv(energy, 4125) yield from bps.mv(energy, 4100) yield from bps.mv(energy, 4075) yield from bps.mv(energy, 4050) yield from bps.mv(energy, 4030) sample_id(user_name='test', sample_name='test')
class Sources: ''' source class that defines the news source ''' def __init__(self,id,name,description,url,category,language,country): self.id=id self.name=name self.description=description self.url=url self.category=category self.language=language self.country=country class Article: ''' Article class that defines the articles objects ''' def __init__(self,author,title,description,url,urlToImage,publishedAt,content): self.author=author self.title=title self.description=description self.url=url self.urlToImage=urlToImage self.publishedAt=publishedAt self.content=content
class Sources: """ source class that defines the news source """ def __init__(self, id, name, description, url, category, language, country): self.id = id self.name = name self.description = description self.url = url self.category = category self.language = language self.country = country class Article: """ Article class that defines the articles objects """ def __init__(self, author, title, description, url, urlToImage, publishedAt, content): self.author = author self.title = title self.description = description self.url = url self.urlToImage = urlToImage self.publishedAt = publishedAt self.content = content
# # @lc app=leetcode id=918 lang=python3 # # [918] Maximum Sum Circular Subarray # # @lc code=start class Solution: def maxSubarraySumCircular(self, A: List[int]) -> int: def ka(nums): res = float('-inf') current = float('-inf') for num in nums: current = max(0, current) + num res = max(res, current) return res if_neg = max(A) if if_neg < 0: return if_neg res1 = ka(A) res2 = sum(A) + ka([-num for num in A]) return max(res1, res2) # @lc code=end
class Solution: def max_subarray_sum_circular(self, A: List[int]) -> int: def ka(nums): res = float('-inf') current = float('-inf') for num in nums: current = max(0, current) + num res = max(res, current) return res if_neg = max(A) if if_neg < 0: return if_neg res1 = ka(A) res2 = sum(A) + ka([-num for num in A]) return max(res1, res2)
def configure(configuration_context): third_party_node = configuration_context.path.make_node('bugengine/3rdparty') for category in third_party_node.listdir(): if category[0] != '.': category_node = third_party_node.make_node(category) for third_party in category_node.listdir(): configuration_context.recurse( '%s/%s/%s/mak/configure.py' % (third_party_node.abspath(), category, third_party) )
def configure(configuration_context): third_party_node = configuration_context.path.make_node('bugengine/3rdparty') for category in third_party_node.listdir(): if category[0] != '.': category_node = third_party_node.make_node(category) for third_party in category_node.listdir(): configuration_context.recurse('%s/%s/%s/mak/configure.py' % (third_party_node.abspath(), category, third_party))
# Copyright 2021 Code Intelligence GmbH # # 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 java_fuzz_target_test( name, target_class = None, deps = [], hook_classes = [], data = [], sanitizer = None, visibility = None, tags = [], fuzzer_args = [], srcs = [], size = None, timeout = None, env = None, verify_crash_input = True, verify_crash_reproducer = True, execute_crash_reproducer = False, **kwargs): target_name = name + "_target" deploy_manifest_lines = [] if target_class: deploy_manifest_lines.append("Jazzer-Fuzz-Target-Class: %s" % target_class) if hook_classes: deploy_manifest_lines.append("Jazzer-Hook-Classes: %s" % ":".join(hook_classes)) # Deps can only be specified on java_binary targets with sources, which # excludes e.g. Kotlin libraries wrapped into java_binary via runtime_deps. target_deps = deps + ["//agent:jazzer_api_compile_only"] if srcs else [] native.java_binary( name = target_name, srcs = srcs, visibility = ["//visibility:private"], create_executable = False, deploy_manifest_lines = deploy_manifest_lines, deps = target_deps, testonly = True, **kwargs ) additional_args = [] if sanitizer == None: driver = "//driver:jazzer_driver" elif sanitizer == "address": driver = "//driver:jazzer_driver_asan" elif sanitizer == "undefined": driver = "//driver:jazzer_driver_ubsan" else: fail("Invalid sanitizer: " + sanitizer) native.java_test( name = name, runtime_deps = [ "//bazel:fuzz_target_test_wrapper", "//agent:jazzer_api_deploy.jar", ":%s_deploy.jar" % target_name, ], size = size or "enormous", timeout = timeout or "moderate", args = [ "$(rootpath %s)" % driver, "$(rootpath //agent:jazzer_api_deploy.jar)", "$(rootpath :%s_deploy.jar)" % target_name, str(verify_crash_input), str(verify_crash_reproducer), str(execute_crash_reproducer), ] + additional_args + fuzzer_args + [ # Verify the call graph functionality by enabling it for every test. "--call_graph_basepath=/tmp/icfg", ], data = [ ":%s_deploy.jar" % target_name, "//agent:jazzer_agent_deploy.jar", "//agent:jazzer_api_deploy.jar", driver, ] + data, env = env, main_class = "FuzzTargetTestWrapper", use_testrunner = False, tags = tags, visibility = visibility, )
def java_fuzz_target_test(name, target_class=None, deps=[], hook_classes=[], data=[], sanitizer=None, visibility=None, tags=[], fuzzer_args=[], srcs=[], size=None, timeout=None, env=None, verify_crash_input=True, verify_crash_reproducer=True, execute_crash_reproducer=False, **kwargs): target_name = name + '_target' deploy_manifest_lines = [] if target_class: deploy_manifest_lines.append('Jazzer-Fuzz-Target-Class: %s' % target_class) if hook_classes: deploy_manifest_lines.append('Jazzer-Hook-Classes: %s' % ':'.join(hook_classes)) target_deps = deps + ['//agent:jazzer_api_compile_only'] if srcs else [] native.java_binary(name=target_name, srcs=srcs, visibility=['//visibility:private'], create_executable=False, deploy_manifest_lines=deploy_manifest_lines, deps=target_deps, testonly=True, **kwargs) additional_args = [] if sanitizer == None: driver = '//driver:jazzer_driver' elif sanitizer == 'address': driver = '//driver:jazzer_driver_asan' elif sanitizer == 'undefined': driver = '//driver:jazzer_driver_ubsan' else: fail('Invalid sanitizer: ' + sanitizer) native.java_test(name=name, runtime_deps=['//bazel:fuzz_target_test_wrapper', '//agent:jazzer_api_deploy.jar', ':%s_deploy.jar' % target_name], size=size or 'enormous', timeout=timeout or 'moderate', args=['$(rootpath %s)' % driver, '$(rootpath //agent:jazzer_api_deploy.jar)', '$(rootpath :%s_deploy.jar)' % target_name, str(verify_crash_input), str(verify_crash_reproducer), str(execute_crash_reproducer)] + additional_args + fuzzer_args + ['--call_graph_basepath=/tmp/icfg'], data=[':%s_deploy.jar' % target_name, '//agent:jazzer_agent_deploy.jar', '//agent:jazzer_api_deploy.jar', driver] + data, env=env, main_class='FuzzTargetTestWrapper', use_testrunner=False, tags=tags, visibility=visibility)
_base_ = '/home/jj/Documents/mmdetection/configs/_base_/models/faster_rcnn_r50_fpn.py' # model settings model = dict( neck=[ dict( type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, num_outs=5), dict( type='BFP', in_channels=256, num_levels=5, refine_level=2, refine_type='non_local') ], roi_head=dict( bbox_head=dict( loss_bbox=dict( _delete_=True, type='BalancedL1Loss', alpha=0.5, gamma=1.5, beta=1.0, loss_weight=1.0)))) # model training and testing settings train_cfg = dict( rpn=dict(sampler=dict(neg_pos_ub=5), allowed_border=-1), rcnn=dict( sampler=dict( _delete_=True, type='CombinedSampler', num=512, pos_fraction=0.25, add_gt_as_proposals=True, pos_sampler=dict(type='InstanceBalancedPosSampler'), neg_sampler=dict( type='IoUBalancedNegSampler', floor_thr=-1, floor_fraction=0, num_bins=3))))
_base_ = '/home/jj/Documents/mmdetection/configs/_base_/models/faster_rcnn_r50_fpn.py' model = dict(neck=[dict(type='FPN', in_channels=[256, 512, 1024, 2048], out_channels=256, num_outs=5), dict(type='BFP', in_channels=256, num_levels=5, refine_level=2, refine_type='non_local')], roi_head=dict(bbox_head=dict(loss_bbox=dict(_delete_=True, type='BalancedL1Loss', alpha=0.5, gamma=1.5, beta=1.0, loss_weight=1.0)))) train_cfg = dict(rpn=dict(sampler=dict(neg_pos_ub=5), allowed_border=-1), rcnn=dict(sampler=dict(_delete_=True, type='CombinedSampler', num=512, pos_fraction=0.25, add_gt_as_proposals=True, pos_sampler=dict(type='InstanceBalancedPosSampler'), neg_sampler=dict(type='IoUBalancedNegSampler', floor_thr=-1, floor_fraction=0, num_bins=3))))
def print1ToN(n): if n<=1: print("1",end =" ") return 0 print1ToN(n-1) print(n,end = " ") def printNto1(n): if n<=1: print("1",end =" ") return 0 print(n,end = " ") printNto1(n-1) n = int(input("Enter Input : ")) print1ToN(n) printNto1(n)
def print1_to_n(n): if n <= 1: print('1', end=' ') return 0 print1_to_n(n - 1) print(n, end=' ') def print_nto1(n): if n <= 1: print('1', end=' ') return 0 print(n, end=' ') print_nto1(n - 1) n = int(input('Enter Input : ')) print1_to_n(n) print_nto1(n)
users = [ { 'id': 0, 'photo': 'img0.jpg', 'firstname':'calvin', 'lastname':'settachatgul', 'nickname':'cal', 'email': 'calvin.settachatgul@gmail.com', 'aboutme': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In condimentum neque a enim bibendum tempus. Proin condimentum, nisi sed sagittis suscipit, ex lacus posuere turpis, et rutrum urna velit quis libero. Proin ornare, dui in congue sagittis, lorem sapien porttitor orci, pulvinar aliquet est risus ullamcorper leo. Phasellus sagittis mi vel posuere finibus. Etiam sed diam vehicula, ultricies arcu sit amet, sagittis risus. Aenean nec feugiat neque. Proin vulputate facilisis diam non ullamcorper.' }, { 'id': 1, 'photo': 'img1.jpg', 'firstname':'stanley', 'lastname':'chan', 'nickname':'stan', 'email': 'stan@example.com', 'aboutme': 'Vivamus auctor turpis mauris, fringilla porta turpis consectetur commodo. Phasellus interdum fermentum mauris eu tincidunt. Donec nec diam pretium, dapibus ligula nec, dignissim nisl. Etiam tincidunt eget neque ac dapibus. Etiam pellentesque ac justo semper faucibus. Nulla at orci luctus, malesuada erat et, sagittis nunc. Praesent elementum urna sit amet urna cursus, ut ultrices neque commodo. Nunc et lobortis nibh. In sed dolor non lacus venenatis tempus. Sed tempus volutpat diam, sed commodo massa placerat non.' }, { 'id': 2, 'photo': 'img2.jpg', 'firstname':'tiffany', 'lastname':'tiffany lastname', 'nickname':'tiff', 'email': 'tiff@example.com', 'aboutme': 'Quisque fringilla nisi sed tellus fringilla rutrum. Sed a volutpat ligula, in tincidunt augue. Ut elementum neque orci, non finibus arcu sodales at. Aliquam lacinia auctor odio at blandit. Curabitur consequat id dui vitae semper. Cras quis felis velit. Aliquam nec iaculis purus, non commodo mauris. Proin imperdiet, sem in lacinia posuere, est metus dictum enim, et viverra mauris augue et urna. Pellentesque laoreet augue nibh, ut vehicula nisi rhoncus mattis. Fusce vestibulum a neque et pretium. Phasellus posuere libero ut enim porta, at dapibus sem condimentum. Aliquam aliquam auctor accumsan.' }, { 'id': 3, 'photo': 'img3.jpg', 'firstname':'michael', 'lastname':'michael lastname', 'nickname':'mike', 'email': 'mike@example.com', 'aboutme': 'Nam laoreet facilisis pellentesque. Integer scelerisque sapien vitae lacus pellentesque vehicula. Aliquam eget mauris quam. Aliquam viverra mi diam, at bibendum nibh placerat vitae. Sed nec mi vitae dolor placerat facilisis. Maecenas at arcu at justo venenatis posuere nec sit amet tortor. Aenean eleifend commodo sem, non facilisis sem vestibulum a. Nullam sagittis vulputate turpis, non mollis diam.' } ]
users = [{'id': 0, 'photo': 'img0.jpg', 'firstname': 'calvin', 'lastname': 'settachatgul', 'nickname': 'cal', 'email': 'calvin.settachatgul@gmail.com', 'aboutme': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. In condimentum neque a enim bibendum tempus. Proin condimentum, nisi sed sagittis suscipit, ex lacus posuere turpis, et rutrum urna velit quis libero. Proin ornare, dui in congue sagittis, lorem sapien porttitor orci, pulvinar aliquet est risus ullamcorper leo. Phasellus sagittis mi vel posuere finibus. Etiam sed diam vehicula, ultricies arcu sit amet, sagittis risus. Aenean nec feugiat neque. Proin vulputate facilisis diam non ullamcorper.'}, {'id': 1, 'photo': 'img1.jpg', 'firstname': 'stanley', 'lastname': 'chan', 'nickname': 'stan', 'email': 'stan@example.com', 'aboutme': 'Vivamus auctor turpis mauris, fringilla porta turpis consectetur commodo. Phasellus interdum fermentum mauris eu tincidunt. Donec nec diam pretium, dapibus ligula nec, dignissim nisl. Etiam tincidunt eget neque ac dapibus. Etiam pellentesque ac justo semper faucibus. Nulla at orci luctus, malesuada erat et, sagittis nunc. Praesent elementum urna sit amet urna cursus, ut ultrices neque commodo. Nunc et lobortis nibh. In sed dolor non lacus venenatis tempus. Sed tempus volutpat diam, sed commodo massa placerat non.'}, {'id': 2, 'photo': 'img2.jpg', 'firstname': 'tiffany', 'lastname': 'tiffany lastname', 'nickname': 'tiff', 'email': 'tiff@example.com', 'aboutme': 'Quisque fringilla nisi sed tellus fringilla rutrum. Sed a volutpat ligula, in tincidunt augue. Ut elementum neque orci, non finibus arcu sodales at. Aliquam lacinia auctor odio at blandit. Curabitur consequat id dui vitae semper. Cras quis felis velit. Aliquam nec iaculis purus, non commodo mauris. Proin imperdiet, sem in lacinia posuere, est metus dictum enim, et viverra mauris augue et urna. Pellentesque laoreet augue nibh, ut vehicula nisi rhoncus mattis. Fusce vestibulum a neque et pretium. Phasellus posuere libero ut enim porta, at dapibus sem condimentum. Aliquam aliquam auctor accumsan.'}, {'id': 3, 'photo': 'img3.jpg', 'firstname': 'michael', 'lastname': 'michael lastname', 'nickname': 'mike', 'email': 'mike@example.com', 'aboutme': 'Nam laoreet facilisis pellentesque. Integer scelerisque sapien vitae lacus pellentesque vehicula. Aliquam eget mauris quam. Aliquam viverra mi diam, at bibendum nibh placerat vitae. Sed nec mi vitae dolor placerat facilisis. Maecenas at arcu at justo venenatis posuere nec sit amet tortor. Aenean eleifend commodo sem, non facilisis sem vestibulum a. Nullam sagittis vulputate turpis, non mollis diam.'}]
# # PySNMP MIB module FDDI-SMT73-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/FDDI-SMT73-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 16:53:32 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsIntersection, ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsIntersection", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Counter64, MibIdentifier, Gauge32, iso, IpAddress, ModuleIdentity, Integer32, transmission, Unsigned32, NotificationType, ObjectIdentity, Bits, TimeTicks, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter64", "MibIdentifier", "Gauge32", "iso", "IpAddress", "ModuleIdentity", "Integer32", "transmission", "Unsigned32", "NotificationType", "ObjectIdentity", "Bits", "TimeTicks", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32") DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention") fddi = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15)) fddimib = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73)) class FddiTimeNano(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 2147483647) class FddiTimeMilli(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 2147483647) class FddiResourceId(Integer32): subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(0, 65535) class FddiSMTStationIdType(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(8, 8) fixedLength = 8 class FddiMACLongAddressType(OctetString): subtypeSpec = OctetString.subtypeSpec + ValueSizeConstraint(6, 6) fixedLength = 6 fddimibSMT = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 1)) fddimibMAC = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 2)) fddimibMACCounters = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 3)) fddimibPATH = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 4)) fddimibPORT = MibIdentifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 5)) fddimibSMTNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTNumber.setStatus('mandatory') fddimibSMTTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2), ) if mibBuilder.loadTexts: fddimibSMTTable.setStatus('mandatory') fddimibSMTEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibSMTIndex")) if mibBuilder.loadTexts: fddimibSMTEntry.setStatus('mandatory') fddimibSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTIndex.setStatus('mandatory') fddimibSMTStationId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 2), FddiSMTStationIdType()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTStationId.setStatus('mandatory') fddimibSMTOpVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTOpVersionId.setStatus('mandatory') fddimibSMTHiVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTHiVersionId.setStatus('mandatory') fddimibSMTLoVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTLoVersionId.setStatus('mandatory') fddimibSMTUserData = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(32, 32)).setFixedLength(32)).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibSMTUserData.setStatus('mandatory') fddimibSMTMIBVersionId = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTMIBVersionId.setStatus('mandatory') fddimibSMTMACCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTMACCts.setStatus('mandatory') fddimibSMTNonMasterCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTNonMasterCts.setStatus('mandatory') fddimibSMTMasterCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTMasterCts.setStatus('mandatory') fddimibSMTAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 11), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTAvailablePaths.setStatus('mandatory') fddimibSMTConfigCapabilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTConfigCapabilities.setStatus('mandatory') fddimibSMTConfigPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 1))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibSMTConfigPolicy.setStatus('mandatory') fddimibSMTConnectionPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(32768, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibSMTConnectionPolicy.setStatus('mandatory') fddimibSMTTNotify = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(2, 30))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibSMTTNotify.setStatus('mandatory') fddimibSMTStatRptPolicy = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 16), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibSMTStatRptPolicy.setStatus('mandatory') fddimibSMTTraceMaxExpiration = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 17), FddiTimeMilli()).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibSMTTraceMaxExpiration.setStatus('mandatory') fddimibSMTBypassPresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTBypassPresent.setStatus('mandatory') fddimibSMTECMState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 19), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("ec0", 1), ("ec1", 2), ("ec2", 3), ("ec3", 4), ("ec4", 5), ("ec5", 6), ("ec6", 7), ("ec7", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTECMState.setStatus('mandatory') fddimibSMTCFState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))).clone(namedValues=NamedValues(("cf0", 1), ("cf1", 2), ("cf2", 3), ("cf3", 4), ("cf4", 5), ("cf5", 6), ("cf6", 7), ("cf7", 8), ("cf8", 9), ("cf9", 10), ("cf10", 11), ("cf11", 12), ("cf12", 13)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTCFState.setStatus('mandatory') fddimibSMTRemoteDisconnectFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTRemoteDisconnectFlag.setStatus('mandatory') fddimibSMTStationStatus = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("concatenated", 1), ("separated", 2), ("thru", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTStationStatus.setStatus('mandatory') fddimibSMTPeerWrapFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTPeerWrapFlag.setStatus('mandatory') fddimibSMTTimeStamp = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 24), FddiTimeMilli()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTTimeStamp.setStatus('mandatory') fddimibSMTTransitionTimeStamp = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 25), FddiTimeMilli()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibSMTTransitionTimeStamp.setStatus('mandatory') fddimibSMTStationAction = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 26), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("other", 1), ("connect", 2), ("disconnect", 3), ("path-Test", 4), ("self-Test", 5), ("disable-a", 6), ("disable-b", 7), ("disable-m", 8)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibSMTStationAction.setStatus('mandatory') fddimibMACNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACNumber.setStatus('mandatory') fddimibMACTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2), ) if mibBuilder.loadTexts: fddimibMACTable.setStatus('mandatory') fddimibMACEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibMACSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibMACIndex")) if mibBuilder.loadTexts: fddimibMACEntry.setStatus('mandatory') fddimibMACSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACSMTIndex.setStatus('mandatory') fddimibMACIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACIndex.setStatus('mandatory') fddimibMACIfIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACIfIndex.setStatus('mandatory') fddimibMACFrameStatusFunctions = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACFrameStatusFunctions.setStatus('mandatory') fddimibMACTMaxCapability = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 5), FddiTimeNano()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACTMaxCapability.setStatus('mandatory') fddimibMACTVXCapability = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 6), FddiTimeNano()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACTVXCapability.setStatus('mandatory') fddimibMACAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACAvailablePaths.setStatus('mandatory') fddimibMACCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("isolated", 1), ("local", 2), ("secondary", 3), ("primary", 4), ("concatenated", 5), ("thru", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACCurrentPath.setStatus('mandatory') fddimibMACUpstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 9), FddiMACLongAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACUpstreamNbr.setStatus('mandatory') fddimibMACDownstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 10), FddiMACLongAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACDownstreamNbr.setStatus('mandatory') fddimibMACOldUpstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 11), FddiMACLongAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACOldUpstreamNbr.setStatus('mandatory') fddimibMACOldDownstreamNbr = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 12), FddiMACLongAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACOldDownstreamNbr.setStatus('mandatory') fddimibMACDupAddressTest = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("none", 1), ("pass", 2), ("fail", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACDupAddressTest.setStatus('mandatory') fddimibMACRequestedPaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibMACRequestedPaths.setStatus('mandatory') fddimibMACDownstreamPORTType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 15), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("none", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACDownstreamPORTType.setStatus('mandatory') fddimibMACSMTAddress = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 16), FddiMACLongAddressType()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACSMTAddress.setStatus('mandatory') fddimibMACTReq = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 17), FddiTimeNano()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACTReq.setStatus('mandatory') fddimibMACTNeg = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 18), FddiTimeNano()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACTNeg.setStatus('mandatory') fddimibMACTMax = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 19), FddiTimeNano()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACTMax.setStatus('mandatory') fddimibMACTvxValue = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 20), FddiTimeNano()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACTvxValue.setStatus('mandatory') fddimibMACFrameCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACFrameCts.setStatus('mandatory') fddimibMACCopiedCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACCopiedCts.setStatus('mandatory') fddimibMACTransmitCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACTransmitCts.setStatus('mandatory') fddimibMACErrorCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACErrorCts.setStatus('mandatory') fddimibMACLostCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACLostCts.setStatus('mandatory') fddimibMACFrameErrorThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 26), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibMACFrameErrorThreshold.setStatus('mandatory') fddimibMACFrameErrorRatio = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 27), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACFrameErrorRatio.setStatus('mandatory') fddimibMACRMTState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 28), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("rm0", 1), ("rm1", 2), ("rm2", 3), ("rm3", 4), ("rm4", 5), ("rm5", 6), ("rm6", 7), ("rm7", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACRMTState.setStatus('mandatory') fddimibMACDaFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 29), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACDaFlag.setStatus('mandatory') fddimibMACUnaDaFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 30), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACUnaDaFlag.setStatus('mandatory') fddimibMACFrameErrorFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 31), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACFrameErrorFlag.setStatus('mandatory') fddimibMACMAUnitdataAvailable = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACMAUnitdataAvailable.setStatus('mandatory') fddimibMACHardwarePresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 33), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACHardwarePresent.setStatus('mandatory') fddimibMACMAUnitdataEnable = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 34), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibMACMAUnitdataEnable.setStatus('mandatory') fddimibMACCountersTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1), ) if mibBuilder.loadTexts: fddimibMACCountersTable.setStatus('mandatory') fddimibMACCountersEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibMACSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibMACIndex")) if mibBuilder.loadTexts: fddimibMACCountersEntry.setStatus('mandatory') fddimibMACTokenCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACTokenCts.setStatus('mandatory') fddimibMACTvxExpiredCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACTvxExpiredCts.setStatus('mandatory') fddimibMACNotCopiedCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACNotCopiedCts.setStatus('mandatory') fddimibMACLateCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACLateCts.setStatus('mandatory') fddimibMACRingOpCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACRingOpCts.setStatus('mandatory') fddimibMACNotCopiedRatio = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACNotCopiedRatio.setStatus('mandatory') fddimibMACNotCopiedFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibMACNotCopiedFlag.setStatus('mandatory') fddimibMACNotCopiedThreshold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibMACNotCopiedThreshold.setStatus('mandatory') fddimibPATHNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPATHNumber.setStatus('mandatory') fddimibPATHTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2), ) if mibBuilder.loadTexts: fddimibPATHTable.setStatus('mandatory') fddimibPATHEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibPATHSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibPATHIndex")) if mibBuilder.loadTexts: fddimibPATHEntry.setStatus('mandatory') fddimibPATHSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPATHSMTIndex.setStatus('mandatory') fddimibPATHIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPATHIndex.setStatus('mandatory') fddimibPATHTVXLowerBound = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 3), FddiTimeNano()).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibPATHTVXLowerBound.setStatus('mandatory') fddimibPATHTMaxLowerBound = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 4), FddiTimeNano()).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibPATHTMaxLowerBound.setStatus('mandatory') fddimibPATHMaxTReq = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 5), FddiTimeNano()).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibPATHMaxTReq.setStatus('mandatory') fddimibPATHConfigTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3), ) if mibBuilder.loadTexts: fddimibPATHConfigTable.setStatus('mandatory') fddimibPATHConfigEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibPATHConfigSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibPATHConfigPATHIndex"), (0, "FDDI-SMT73-MIB", "fddimibPATHConfigTokenOrder")) if mibBuilder.loadTexts: fddimibPATHConfigEntry.setStatus('mandatory') fddimibPATHConfigSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPATHConfigSMTIndex.setStatus('mandatory') fddimibPATHConfigPATHIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPATHConfigPATHIndex.setStatus('mandatory') fddimibPATHConfigTokenOrder = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPATHConfigTokenOrder.setStatus('mandatory') fddimibPATHConfigResourceType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(2, 4))).clone(namedValues=NamedValues(("mac", 2), ("port", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPATHConfigResourceType.setStatus('mandatory') fddimibPATHConfigResourceIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPATHConfigResourceIndex.setStatus('mandatory') fddimibPATHConfigCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("isolated", 1), ("local", 2), ("secondary", 3), ("primary", 4), ("concatenated", 5), ("thru", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPATHConfigCurrentPath.setStatus('mandatory') fddimibPORTNumber = MibScalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTNumber.setStatus('mandatory') fddimibPORTTable = MibTable((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2), ) if mibBuilder.loadTexts: fddimibPORTTable.setStatus('mandatory') fddimibPORTEntry = MibTableRow((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1), ).setIndexNames((0, "FDDI-SMT73-MIB", "fddimibPORTSMTIndex"), (0, "FDDI-SMT73-MIB", "fddimibPORTIndex")) if mibBuilder.loadTexts: fddimibPORTEntry.setStatus('mandatory') fddimibPORTSMTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTSMTIndex.setStatus('mandatory') fddimibPORTIndex = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTIndex.setStatus('mandatory') fddimibPORTMyType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("none", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTMyType.setStatus('mandatory') fddimibPORTNeighborType = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("a", 1), ("b", 2), ("s", 3), ("m", 4), ("none", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTNeighborType.setStatus('mandatory') fddimibPORTConnectionPolicies = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibPORTConnectionPolicies.setStatus('mandatory') fddimibPORTMACIndicated = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("tVal9FalseRVal9False", 1), ("tVal9FalseRVal9True", 2), ("tVal9TrueRVal9False", 3), ("tVal9TrueRVal9True", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTMACIndicated.setStatus('mandatory') fddimibPORTCurrentPath = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("ce0", 1), ("ce1", 2), ("ce2", 3), ("ce3", 4), ("ce4", 5), ("ce5", 6)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTCurrentPath.setStatus('mandatory') fddimibPORTRequestedPaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 8), OctetString().subtype(subtypeSpec=ValueSizeConstraint(3, 3)).setFixedLength(3)).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibPORTRequestedPaths.setStatus('mandatory') fddimibPORTMACPlacement = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 9), FddiResourceId()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTMACPlacement.setStatus('mandatory') fddimibPORTAvailablePaths = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 7))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTAvailablePaths.setStatus('mandatory') fddimibPORTPMDClass = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=NamedValues(("multimode", 1), ("single-mode1", 2), ("single-mode2", 3), ("sonet", 4), ("low-cost-fiber", 5), ("twisted-pair", 6), ("unknown", 7), ("unspecified", 8)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTPMDClass.setStatus('mandatory') fddimibPORTConnectionCapabilities = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 12), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTConnectionCapabilities.setStatus('mandatory') fddimibPORTBSFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTBSFlag.setStatus('mandatory') fddimibPORTLCTFailCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTLCTFailCts.setStatus('mandatory') fddimibPORTLerEstimate = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 15))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTLerEstimate.setStatus('mandatory') fddimibPORTLemRejectCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTLemRejectCts.setStatus('mandatory') fddimibPORTLemCts = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTLemCts.setStatus('mandatory') fddimibPORTLerCutoff = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 18), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibPORTLerCutoff.setStatus('mandatory') fddimibPORTLerAlarm = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 19), Integer32().subtype(subtypeSpec=ValueRangeConstraint(4, 15))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibPORTLerAlarm.setStatus('mandatory') fddimibPORTConnectState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 20), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("disabled", 1), ("connecting", 2), ("standby", 3), ("active", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTConnectState.setStatus('mandatory') fddimibPORTPCMState = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 21), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=NamedValues(("pc0", 1), ("pc1", 2), ("pc2", 3), ("pc3", 4), ("pc4", 5), ("pc5", 6), ("pc6", 7), ("pc7", 8), ("pc8", 9), ("pc9", 10)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTPCMState.setStatus('mandatory') fddimibPORTPCWithhold = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 22), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("none", 1), ("m-m", 2), ("otherincompatible", 3), ("pathnotavailable", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTPCWithhold.setStatus('mandatory') fddimibPORTLerFlag = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 23), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTLerFlag.setStatus('mandatory') fddimibPORTHardwarePresent = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 24), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("true", 1), ("false", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: fddimibPORTHardwarePresent.setStatus('mandatory') fddimibPORTAction = MibTableColumn((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 25), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6))).clone(namedValues=NamedValues(("other", 1), ("maintPORT", 2), ("enablePORT", 3), ("disablePORT", 4), ("startPORT", 5), ("stopPORT", 6)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: fddimibPORTAction.setStatus('mandatory') mibBuilder.exportSymbols("FDDI-SMT73-MIB", fddimibPATHConfigSMTIndex=fddimibPATHConfigSMTIndex, fddimibMACTable=fddimibMACTable, fddimibPORTPCMState=fddimibPORTPCMState, fddimibSMTAvailablePaths=fddimibSMTAvailablePaths, fddimibPATHConfigCurrentPath=fddimibPATHConfigCurrentPath, fddimibMACLateCts=fddimibMACLateCts, fddimibMACOldDownstreamNbr=fddimibMACOldDownstreamNbr, fddimibMACCountersEntry=fddimibMACCountersEntry, fddimibMACTransmitCts=fddimibMACTransmitCts, fddimibPORTLemRejectCts=fddimibPORTLemRejectCts, fddimibSMTRemoteDisconnectFlag=fddimibSMTRemoteDisconnectFlag, fddimibSMTEntry=fddimibSMTEntry, fddimibPATH=fddimibPATH, fddimibSMTTNotify=fddimibSMTTNotify, fddimibPATHSMTIndex=fddimibPATHSMTIndex, fddimibPATHConfigTable=fddimibPATHConfigTable, fddimibMACTMax=fddimibMACTMax, fddimibSMTTraceMaxExpiration=fddimibSMTTraceMaxExpiration, fddimibSMTOpVersionId=fddimibSMTOpVersionId, fddimibSMTPeerWrapFlag=fddimibSMTPeerWrapFlag, fddimibSMTTransitionTimeStamp=fddimibSMTTransitionTimeStamp, fddimibSMTStatRptPolicy=fddimibSMTStatRptPolicy, fddimibMACTMaxCapability=fddimibMACTMaxCapability, fddimibMACCurrentPath=fddimibMACCurrentPath, fddimibPORTRequestedPaths=fddimibPORTRequestedPaths, fddimibMACCounters=fddimibMACCounters, fddimibMACFrameErrorFlag=fddimibMACFrameErrorFlag, fddimibPORTMACPlacement=fddimibPORTMACPlacement, fddimibMACCopiedCts=fddimibMACCopiedCts, fddimibPORTConnectionCapabilities=fddimibPORTConnectionCapabilities, fddimibPORTConnectionPolicies=fddimibPORTConnectionPolicies, fddimibPATHIndex=fddimibPATHIndex, fddimibMACSMTAddress=fddimibMACSMTAddress, fddimibPORTIndex=fddimibPORTIndex, fddimibPORTPMDClass=fddimibPORTPMDClass, fddimibMACFrameCts=fddimibMACFrameCts, fddimibMACDownstreamNbr=fddimibMACDownstreamNbr, fddimibPORTMyType=fddimibPORTMyType, fddimibMACAvailablePaths=fddimibMACAvailablePaths, fddimibMACLostCts=fddimibMACLostCts, fddimibMACNotCopiedThreshold=fddimibMACNotCopiedThreshold, fddimibPORTLerFlag=fddimibPORTLerFlag, fddimibMACTvxValue=fddimibMACTvxValue, fddimibPORTLCTFailCts=fddimibPORTLCTFailCts, fddimibMACFrameErrorThreshold=fddimibMACFrameErrorThreshold, fddimibMACRingOpCts=fddimibMACRingOpCts, fddimibSMTHiVersionId=fddimibSMTHiVersionId, fddimibPORTMACIndicated=fddimibPORTMACIndicated, fddimibPORTBSFlag=fddimibPORTBSFlag, fddimibPORTConnectState=fddimibPORTConnectState, fddimibPATHConfigResourceType=fddimibPATHConfigResourceType, fddimibMACDaFlag=fddimibMACDaFlag, fddimibSMTTimeStamp=fddimibSMTTimeStamp, fddimibSMT=fddimibSMT, fddimibMACNotCopiedFlag=fddimibMACNotCopiedFlag, fddimibMACDupAddressTest=fddimibMACDupAddressTest, fddimibSMTNumber=fddimibSMTNumber, fddimibSMTMIBVersionId=fddimibSMTMIBVersionId, fddimibSMTMACCts=fddimibSMTMACCts, fddimibMACHardwarePresent=fddimibMACHardwarePresent, fddimibPORTEntry=fddimibPORTEntry, fddimibSMTLoVersionId=fddimibSMTLoVersionId, fddimibPORTLemCts=fddimibPORTLemCts, FddiSMTStationIdType=FddiSMTStationIdType, fddimibMACTVXCapability=fddimibMACTVXCapability, FddiMACLongAddressType=FddiMACLongAddressType, fddimibMACOldUpstreamNbr=fddimibMACOldUpstreamNbr, fddimibMACTNeg=fddimibMACTNeg, fddimibSMTCFState=fddimibSMTCFState, fddimibMACTvxExpiredCts=fddimibMACTvxExpiredCts, fddimibMACRequestedPaths=fddimibMACRequestedPaths, fddimibSMTMasterCts=fddimibSMTMasterCts, fddimibMACRMTState=fddimibMACRMTState, fddimibPORT=fddimibPORT, fddimibPATHNumber=fddimibPATHNumber, fddimibMACUpstreamNbr=fddimibMACUpstreamNbr, fddimibMACIfIndex=fddimibMACIfIndex, fddimibMACDownstreamPORTType=fddimibMACDownstreamPORTType, fddimibPORTNumber=fddimibPORTNumber, fddimibPORTPCWithhold=fddimibPORTPCWithhold, FddiTimeNano=FddiTimeNano, fddimibPATHTMaxLowerBound=fddimibPATHTMaxLowerBound, fddimibMACFrameErrorRatio=fddimibMACFrameErrorRatio, fddimibSMTNonMasterCts=fddimibSMTNonMasterCts, fddimibSMTStationStatus=fddimibSMTStationStatus, fddimibMACTReq=fddimibMACTReq, fddimibSMTConfigCapabilities=fddimibSMTConfigCapabilities, fddimibPORTAvailablePaths=fddimibPORTAvailablePaths, fddimibMACIndex=fddimibMACIndex, fddimibPORTLerCutoff=fddimibPORTLerCutoff, fddimibSMTConnectionPolicy=fddimibSMTConnectionPolicy, fddimibPATHConfigTokenOrder=fddimibPATHConfigTokenOrder, fddimibMACNotCopiedRatio=fddimibMACNotCopiedRatio, fddimibMAC=fddimibMAC, fddimibPORTLerAlarm=fddimibPORTLerAlarm, fddimibPATHTable=fddimibPATHTable, fddimibMACCountersTable=fddimibMACCountersTable, FddiResourceId=FddiResourceId, fddimibSMTECMState=fddimibSMTECMState, fddimibPATHMaxTReq=fddimibPATHMaxTReq, fddimibMACUnaDaFlag=fddimibMACUnaDaFlag, fddimibPORTCurrentPath=fddimibPORTCurrentPath, fddimibPORTHardwarePresent=fddimibPORTHardwarePresent, fddimibPORTSMTIndex=fddimibPORTSMTIndex, fddimibMACNotCopiedCts=fddimibMACNotCopiedCts, fddimibSMTStationId=fddimibSMTStationId, fddimibSMTStationAction=fddimibSMTStationAction, fddimibPORTLerEstimate=fddimibPORTLerEstimate, fddimibPATHConfigResourceIndex=fddimibPATHConfigResourceIndex, fddimibPORTTable=fddimibPORTTable, fddimib=fddimib, fddimibMACMAUnitdataAvailable=fddimibMACMAUnitdataAvailable, fddimibMACNumber=fddimibMACNumber, fddimibMACTokenCts=fddimibMACTokenCts, fddimibSMTBypassPresent=fddimibSMTBypassPresent, fddimibPATHConfigPATHIndex=fddimibPATHConfigPATHIndex, fddimibPORTNeighborType=fddimibPORTNeighborType, fddi=fddi, fddimibSMTConfigPolicy=fddimibSMTConfigPolicy, FddiTimeMilli=FddiTimeMilli, fddimibMACMAUnitdataEnable=fddimibMACMAUnitdataEnable, fddimibMACSMTIndex=fddimibMACSMTIndex, fddimibPATHEntry=fddimibPATHEntry, fddimibSMTIndex=fddimibSMTIndex, fddimibPORTAction=fddimibPORTAction, fddimibMACErrorCts=fddimibMACErrorCts, fddimibSMTTable=fddimibSMTTable, fddimibMACFrameStatusFunctions=fddimibMACFrameStatusFunctions, fddimibPATHTVXLowerBound=fddimibPATHTVXLowerBound, fddimibPATHConfigEntry=fddimibPATHConfigEntry, fddimibMACEntry=fddimibMACEntry, fddimibSMTUserData=fddimibSMTUserData)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (constraints_intersection, value_size_constraint, constraints_union, value_range_constraint, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ConstraintsIntersection', 'ValueSizeConstraint', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (counter64, mib_identifier, gauge32, iso, ip_address, module_identity, integer32, transmission, unsigned32, notification_type, object_identity, bits, time_ticks, mib_scalar, mib_table, mib_table_row, mib_table_column, counter32) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter64', 'MibIdentifier', 'Gauge32', 'iso', 'IpAddress', 'ModuleIdentity', 'Integer32', 'transmission', 'Unsigned32', 'NotificationType', 'ObjectIdentity', 'Bits', 'TimeTicks', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Counter32') (display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention') fddi = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15)) fddimib = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73)) class Fdditimenano(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 2147483647) class Fdditimemilli(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 2147483647) class Fddiresourceid(Integer32): subtype_spec = Integer32.subtypeSpec + value_range_constraint(0, 65535) class Fddismtstationidtype(OctetString): subtype_spec = OctetString.subtypeSpec + value_size_constraint(8, 8) fixed_length = 8 class Fddimaclongaddresstype(OctetString): subtype_spec = OctetString.subtypeSpec + value_size_constraint(6, 6) fixed_length = 6 fddimib_smt = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 1)) fddimib_mac = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 2)) fddimib_mac_counters = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 3)) fddimib_path = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 4)) fddimib_port = mib_identifier((1, 3, 6, 1, 2, 1, 10, 15, 73, 5)) fddimib_smt_number = mib_scalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTNumber.setStatus('mandatory') fddimib_smt_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2)) if mibBuilder.loadTexts: fddimibSMTTable.setStatus('mandatory') fddimib_smt_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibSMTIndex')) if mibBuilder.loadTexts: fddimibSMTEntry.setStatus('mandatory') fddimib_smt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTIndex.setStatus('mandatory') fddimib_smt_station_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 2), fddi_smt_station_id_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTStationId.setStatus('mandatory') fddimib_smt_op_version_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTOpVersionId.setStatus('mandatory') fddimib_smt_hi_version_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTHiVersionId.setStatus('mandatory') fddimib_smt_lo_version_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTLoVersionId.setStatus('mandatory') fddimib_smt_user_data = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 6), octet_string().subtype(subtypeSpec=value_size_constraint(32, 32)).setFixedLength(32)).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibSMTUserData.setStatus('mandatory') fddimib_smtmib_version_id = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTMIBVersionId.setStatus('mandatory') fddimib_smtmac_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTMACCts.setStatus('mandatory') fddimib_smt_non_master_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 9), integer32().subtype(subtypeSpec=value_range_constraint(0, 2))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTNonMasterCts.setStatus('mandatory') fddimib_smt_master_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTMasterCts.setStatus('mandatory') fddimib_smt_available_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 11), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTAvailablePaths.setStatus('mandatory') fddimib_smt_config_capabilities = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTConfigCapabilities.setStatus('mandatory') fddimib_smt_config_policy = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 13), integer32().subtype(subtypeSpec=value_range_constraint(0, 1))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibSMTConfigPolicy.setStatus('mandatory') fddimib_smt_connection_policy = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(32768, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibSMTConnectionPolicy.setStatus('mandatory') fddimib_smtt_notify = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(2, 30))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibSMTTNotify.setStatus('mandatory') fddimib_smt_stat_rpt_policy = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 16), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibSMTStatRptPolicy.setStatus('mandatory') fddimib_smt_trace_max_expiration = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 17), fddi_time_milli()).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibSMTTraceMaxExpiration.setStatus('mandatory') fddimib_smt_bypass_present = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTBypassPresent.setStatus('mandatory') fddimib_smtecm_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 19), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('ec0', 1), ('ec1', 2), ('ec2', 3), ('ec3', 4), ('ec4', 5), ('ec5', 6), ('ec6', 7), ('ec7', 8)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTECMState.setStatus('mandatory') fddimib_smtcf_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))).clone(namedValues=named_values(('cf0', 1), ('cf1', 2), ('cf2', 3), ('cf3', 4), ('cf4', 5), ('cf5', 6), ('cf6', 7), ('cf7', 8), ('cf8', 9), ('cf9', 10), ('cf10', 11), ('cf11', 12), ('cf12', 13)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTCFState.setStatus('mandatory') fddimib_smt_remote_disconnect_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 21), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTRemoteDisconnectFlag.setStatus('mandatory') fddimib_smt_station_status = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 22), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('concatenated', 1), ('separated', 2), ('thru', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTStationStatus.setStatus('mandatory') fddimib_smt_peer_wrap_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 23), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTPeerWrapFlag.setStatus('mandatory') fddimib_smt_time_stamp = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 24), fddi_time_milli()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTTimeStamp.setStatus('mandatory') fddimib_smt_transition_time_stamp = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 25), fddi_time_milli()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibSMTTransitionTimeStamp.setStatus('mandatory') fddimib_smt_station_action = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 1, 2, 1, 26), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('other', 1), ('connect', 2), ('disconnect', 3), ('path-Test', 4), ('self-Test', 5), ('disable-a', 6), ('disable-b', 7), ('disable-m', 8)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibSMTStationAction.setStatus('mandatory') fddimib_mac_number = mib_scalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACNumber.setStatus('mandatory') fddimib_mac_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2)) if mibBuilder.loadTexts: fddimibMACTable.setStatus('mandatory') fddimib_mac_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibMACSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibMACIndex')) if mibBuilder.loadTexts: fddimibMACEntry.setStatus('mandatory') fddimib_macsmt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACSMTIndex.setStatus('mandatory') fddimib_mac_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACIndex.setStatus('mandatory') fddimib_mac_if_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACIfIndex.setStatus('mandatory') fddimib_mac_frame_status_functions = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACFrameStatusFunctions.setStatus('mandatory') fddimib_mact_max_capability = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 5), fddi_time_nano()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACTMaxCapability.setStatus('mandatory') fddimib_mactvx_capability = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 6), fddi_time_nano()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACTVXCapability.setStatus('mandatory') fddimib_mac_available_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACAvailablePaths.setStatus('mandatory') fddimib_mac_current_path = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 8), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('isolated', 1), ('local', 2), ('secondary', 3), ('primary', 4), ('concatenated', 5), ('thru', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACCurrentPath.setStatus('mandatory') fddimib_mac_upstream_nbr = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 9), fddi_mac_long_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACUpstreamNbr.setStatus('mandatory') fddimib_mac_downstream_nbr = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 10), fddi_mac_long_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACDownstreamNbr.setStatus('mandatory') fddimib_mac_old_upstream_nbr = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 11), fddi_mac_long_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACOldUpstreamNbr.setStatus('mandatory') fddimib_mac_old_downstream_nbr = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 12), fddi_mac_long_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACOldDownstreamNbr.setStatus('mandatory') fddimib_mac_dup_address_test = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('none', 1), ('pass', 2), ('fail', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACDupAddressTest.setStatus('mandatory') fddimib_mac_requested_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 14), integer32().subtype(subtypeSpec=value_range_constraint(0, 255))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibMACRequestedPaths.setStatus('mandatory') fddimib_mac_downstream_port_type = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 15), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('a', 1), ('b', 2), ('s', 3), ('m', 4), ('none', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACDownstreamPORTType.setStatus('mandatory') fddimib_macsmt_address = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 16), fddi_mac_long_address_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACSMTAddress.setStatus('mandatory') fddimib_mact_req = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 17), fddi_time_nano()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACTReq.setStatus('mandatory') fddimib_mact_neg = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 18), fddi_time_nano()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACTNeg.setStatus('mandatory') fddimib_mact_max = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 19), fddi_time_nano()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACTMax.setStatus('mandatory') fddimib_mac_tvx_value = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 20), fddi_time_nano()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACTvxValue.setStatus('mandatory') fddimib_mac_frame_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 21), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACFrameCts.setStatus('mandatory') fddimib_mac_copied_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 22), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACCopiedCts.setStatus('mandatory') fddimib_mac_transmit_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 23), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACTransmitCts.setStatus('mandatory') fddimib_mac_error_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 24), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACErrorCts.setStatus('mandatory') fddimib_mac_lost_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 25), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACLostCts.setStatus('mandatory') fddimib_mac_frame_error_threshold = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 26), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibMACFrameErrorThreshold.setStatus('mandatory') fddimib_mac_frame_error_ratio = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 27), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACFrameErrorRatio.setStatus('mandatory') fddimib_macrmt_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 28), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('rm0', 1), ('rm1', 2), ('rm2', 3), ('rm3', 4), ('rm4', 5), ('rm5', 6), ('rm6', 7), ('rm7', 8)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACRMTState.setStatus('mandatory') fddimib_mac_da_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 29), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACDaFlag.setStatus('mandatory') fddimib_mac_una_da_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 30), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACUnaDaFlag.setStatus('mandatory') fddimib_mac_frame_error_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 31), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACFrameErrorFlag.setStatus('mandatory') fddimib_macma_unitdata_available = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 32), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACMAUnitdataAvailable.setStatus('mandatory') fddimib_mac_hardware_present = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 33), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACHardwarePresent.setStatus('mandatory') fddimib_macma_unitdata_enable = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 2, 2, 1, 34), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibMACMAUnitdataEnable.setStatus('mandatory') fddimib_mac_counters_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1)) if mibBuilder.loadTexts: fddimibMACCountersTable.setStatus('mandatory') fddimib_mac_counters_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibMACSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibMACIndex')) if mibBuilder.loadTexts: fddimibMACCountersEntry.setStatus('mandatory') fddimib_mac_token_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 1), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACTokenCts.setStatus('mandatory') fddimib_mac_tvx_expired_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 2), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACTvxExpiredCts.setStatus('mandatory') fddimib_mac_not_copied_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 3), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACNotCopiedCts.setStatus('mandatory') fddimib_mac_late_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 4), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACLateCts.setStatus('mandatory') fddimib_mac_ring_op_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 5), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACRingOpCts.setStatus('mandatory') fddimib_mac_not_copied_ratio = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACNotCopiedRatio.setStatus('mandatory') fddimib_mac_not_copied_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibMACNotCopiedFlag.setStatus('mandatory') fddimib_mac_not_copied_threshold = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 3, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibMACNotCopiedThreshold.setStatus('mandatory') fddimib_path_number = mib_scalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPATHNumber.setStatus('mandatory') fddimib_path_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2)) if mibBuilder.loadTexts: fddimibPATHTable.setStatus('mandatory') fddimib_path_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibPATHSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibPATHIndex')) if mibBuilder.loadTexts: fddimibPATHEntry.setStatus('mandatory') fddimib_pathsmt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPATHSMTIndex.setStatus('mandatory') fddimib_path_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPATHIndex.setStatus('mandatory') fddimib_pathtvx_lower_bound = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 3), fddi_time_nano()).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibPATHTVXLowerBound.setStatus('mandatory') fddimib_patht_max_lower_bound = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 4), fddi_time_nano()).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibPATHTMaxLowerBound.setStatus('mandatory') fddimib_path_max_t_req = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 2, 1, 5), fddi_time_nano()).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibPATHMaxTReq.setStatus('mandatory') fddimib_path_config_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3)) if mibBuilder.loadTexts: fddimibPATHConfigTable.setStatus('mandatory') fddimib_path_config_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibPATHConfigSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibPATHConfigPATHIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibPATHConfigTokenOrder')) if mibBuilder.loadTexts: fddimibPATHConfigEntry.setStatus('mandatory') fddimib_path_config_smt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPATHConfigSMTIndex.setStatus('mandatory') fddimib_path_config_path_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPATHConfigPATHIndex.setStatus('mandatory') fddimib_path_config_token_order = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPATHConfigTokenOrder.setStatus('mandatory') fddimib_path_config_resource_type = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(2, 4))).clone(namedValues=named_values(('mac', 2), ('port', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPATHConfigResourceType.setStatus('mandatory') fddimib_path_config_resource_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPATHConfigResourceIndex.setStatus('mandatory') fddimib_path_config_current_path = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 4, 3, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('isolated', 1), ('local', 2), ('secondary', 3), ('primary', 4), ('concatenated', 5), ('thru', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPATHConfigCurrentPath.setStatus('mandatory') fddimib_port_number = mib_scalar((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTNumber.setStatus('mandatory') fddimib_port_table = mib_table((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2)) if mibBuilder.loadTexts: fddimibPORTTable.setStatus('mandatory') fddimib_port_entry = mib_table_row((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1)).setIndexNames((0, 'FDDI-SMT73-MIB', 'fddimibPORTSMTIndex'), (0, 'FDDI-SMT73-MIB', 'fddimibPORTIndex')) if mibBuilder.loadTexts: fddimibPORTEntry.setStatus('mandatory') fddimib_portsmt_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTSMTIndex.setStatus('mandatory') fddimib_port_index = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(1, 65535))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTIndex.setStatus('mandatory') fddimib_port_my_type = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('a', 1), ('b', 2), ('s', 3), ('m', 4), ('none', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTMyType.setStatus('mandatory') fddimib_port_neighbor_type = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('a', 1), ('b', 2), ('s', 3), ('m', 4), ('none', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTNeighborType.setStatus('mandatory') fddimib_port_connection_policies = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibPORTConnectionPolicies.setStatus('mandatory') fddimib_portmac_indicated = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('tVal9FalseRVal9False', 1), ('tVal9FalseRVal9True', 2), ('tVal9TrueRVal9False', 3), ('tVal9TrueRVal9True', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTMACIndicated.setStatus('mandatory') fddimib_port_current_path = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('ce0', 1), ('ce1', 2), ('ce2', 3), ('ce3', 4), ('ce4', 5), ('ce5', 6)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTCurrentPath.setStatus('mandatory') fddimib_port_requested_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 8), octet_string().subtype(subtypeSpec=value_size_constraint(3, 3)).setFixedLength(3)).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibPORTRequestedPaths.setStatus('mandatory') fddimib_portmac_placement = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 9), fddi_resource_id()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTMACPlacement.setStatus('mandatory') fddimib_port_available_paths = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 10), integer32().subtype(subtypeSpec=value_range_constraint(0, 7))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTAvailablePaths.setStatus('mandatory') fddimib_portpmd_class = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8))).clone(namedValues=named_values(('multimode', 1), ('single-mode1', 2), ('single-mode2', 3), ('sonet', 4), ('low-cost-fiber', 5), ('twisted-pair', 6), ('unknown', 7), ('unspecified', 8)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTPMDClass.setStatus('mandatory') fddimib_port_connection_capabilities = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 12), integer32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTConnectionCapabilities.setStatus('mandatory') fddimib_portbs_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTBSFlag.setStatus('mandatory') fddimib_portlct_fail_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 14), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTLCTFailCts.setStatus('mandatory') fddimib_port_ler_estimate = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 15), integer32().subtype(subtypeSpec=value_range_constraint(4, 15))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTLerEstimate.setStatus('mandatory') fddimib_port_lem_reject_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 16), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTLemRejectCts.setStatus('mandatory') fddimib_port_lem_cts = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 17), counter32()).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTLemCts.setStatus('mandatory') fddimib_port_ler_cutoff = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 18), integer32().subtype(subtypeSpec=value_range_constraint(4, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibPORTLerCutoff.setStatus('mandatory') fddimib_port_ler_alarm = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 19), integer32().subtype(subtypeSpec=value_range_constraint(4, 15))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibPORTLerAlarm.setStatus('mandatory') fddimib_port_connect_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 20), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('disabled', 1), ('connecting', 2), ('standby', 3), ('active', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTConnectState.setStatus('mandatory') fddimib_portpcm_state = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 21), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10))).clone(namedValues=named_values(('pc0', 1), ('pc1', 2), ('pc2', 3), ('pc3', 4), ('pc4', 5), ('pc5', 6), ('pc6', 7), ('pc7', 8), ('pc8', 9), ('pc9', 10)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTPCMState.setStatus('mandatory') fddimib_portpc_withhold = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 22), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('none', 1), ('m-m', 2), ('otherincompatible', 3), ('pathnotavailable', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTPCWithhold.setStatus('mandatory') fddimib_port_ler_flag = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 23), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTLerFlag.setStatus('mandatory') fddimib_port_hardware_present = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 24), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('true', 1), ('false', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: fddimibPORTHardwarePresent.setStatus('mandatory') fddimib_port_action = mib_table_column((1, 3, 6, 1, 2, 1, 10, 15, 73, 5, 2, 1, 25), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5, 6))).clone(namedValues=named_values(('other', 1), ('maintPORT', 2), ('enablePORT', 3), ('disablePORT', 4), ('startPORT', 5), ('stopPORT', 6)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: fddimibPORTAction.setStatus('mandatory') mibBuilder.exportSymbols('FDDI-SMT73-MIB', fddimibPATHConfigSMTIndex=fddimibPATHConfigSMTIndex, fddimibMACTable=fddimibMACTable, fddimibPORTPCMState=fddimibPORTPCMState, fddimibSMTAvailablePaths=fddimibSMTAvailablePaths, fddimibPATHConfigCurrentPath=fddimibPATHConfigCurrentPath, fddimibMACLateCts=fddimibMACLateCts, fddimibMACOldDownstreamNbr=fddimibMACOldDownstreamNbr, fddimibMACCountersEntry=fddimibMACCountersEntry, fddimibMACTransmitCts=fddimibMACTransmitCts, fddimibPORTLemRejectCts=fddimibPORTLemRejectCts, fddimibSMTRemoteDisconnectFlag=fddimibSMTRemoteDisconnectFlag, fddimibSMTEntry=fddimibSMTEntry, fddimibPATH=fddimibPATH, fddimibSMTTNotify=fddimibSMTTNotify, fddimibPATHSMTIndex=fddimibPATHSMTIndex, fddimibPATHConfigTable=fddimibPATHConfigTable, fddimibMACTMax=fddimibMACTMax, fddimibSMTTraceMaxExpiration=fddimibSMTTraceMaxExpiration, fddimibSMTOpVersionId=fddimibSMTOpVersionId, fddimibSMTPeerWrapFlag=fddimibSMTPeerWrapFlag, fddimibSMTTransitionTimeStamp=fddimibSMTTransitionTimeStamp, fddimibSMTStatRptPolicy=fddimibSMTStatRptPolicy, fddimibMACTMaxCapability=fddimibMACTMaxCapability, fddimibMACCurrentPath=fddimibMACCurrentPath, fddimibPORTRequestedPaths=fddimibPORTRequestedPaths, fddimibMACCounters=fddimibMACCounters, fddimibMACFrameErrorFlag=fddimibMACFrameErrorFlag, fddimibPORTMACPlacement=fddimibPORTMACPlacement, fddimibMACCopiedCts=fddimibMACCopiedCts, fddimibPORTConnectionCapabilities=fddimibPORTConnectionCapabilities, fddimibPORTConnectionPolicies=fddimibPORTConnectionPolicies, fddimibPATHIndex=fddimibPATHIndex, fddimibMACSMTAddress=fddimibMACSMTAddress, fddimibPORTIndex=fddimibPORTIndex, fddimibPORTPMDClass=fddimibPORTPMDClass, fddimibMACFrameCts=fddimibMACFrameCts, fddimibMACDownstreamNbr=fddimibMACDownstreamNbr, fddimibPORTMyType=fddimibPORTMyType, fddimibMACAvailablePaths=fddimibMACAvailablePaths, fddimibMACLostCts=fddimibMACLostCts, fddimibMACNotCopiedThreshold=fddimibMACNotCopiedThreshold, fddimibPORTLerFlag=fddimibPORTLerFlag, fddimibMACTvxValue=fddimibMACTvxValue, fddimibPORTLCTFailCts=fddimibPORTLCTFailCts, fddimibMACFrameErrorThreshold=fddimibMACFrameErrorThreshold, fddimibMACRingOpCts=fddimibMACRingOpCts, fddimibSMTHiVersionId=fddimibSMTHiVersionId, fddimibPORTMACIndicated=fddimibPORTMACIndicated, fddimibPORTBSFlag=fddimibPORTBSFlag, fddimibPORTConnectState=fddimibPORTConnectState, fddimibPATHConfigResourceType=fddimibPATHConfigResourceType, fddimibMACDaFlag=fddimibMACDaFlag, fddimibSMTTimeStamp=fddimibSMTTimeStamp, fddimibSMT=fddimibSMT, fddimibMACNotCopiedFlag=fddimibMACNotCopiedFlag, fddimibMACDupAddressTest=fddimibMACDupAddressTest, fddimibSMTNumber=fddimibSMTNumber, fddimibSMTMIBVersionId=fddimibSMTMIBVersionId, fddimibSMTMACCts=fddimibSMTMACCts, fddimibMACHardwarePresent=fddimibMACHardwarePresent, fddimibPORTEntry=fddimibPORTEntry, fddimibSMTLoVersionId=fddimibSMTLoVersionId, fddimibPORTLemCts=fddimibPORTLemCts, FddiSMTStationIdType=FddiSMTStationIdType, fddimibMACTVXCapability=fddimibMACTVXCapability, FddiMACLongAddressType=FddiMACLongAddressType, fddimibMACOldUpstreamNbr=fddimibMACOldUpstreamNbr, fddimibMACTNeg=fddimibMACTNeg, fddimibSMTCFState=fddimibSMTCFState, fddimibMACTvxExpiredCts=fddimibMACTvxExpiredCts, fddimibMACRequestedPaths=fddimibMACRequestedPaths, fddimibSMTMasterCts=fddimibSMTMasterCts, fddimibMACRMTState=fddimibMACRMTState, fddimibPORT=fddimibPORT, fddimibPATHNumber=fddimibPATHNumber, fddimibMACUpstreamNbr=fddimibMACUpstreamNbr, fddimibMACIfIndex=fddimibMACIfIndex, fddimibMACDownstreamPORTType=fddimibMACDownstreamPORTType, fddimibPORTNumber=fddimibPORTNumber, fddimibPORTPCWithhold=fddimibPORTPCWithhold, FddiTimeNano=FddiTimeNano, fddimibPATHTMaxLowerBound=fddimibPATHTMaxLowerBound, fddimibMACFrameErrorRatio=fddimibMACFrameErrorRatio, fddimibSMTNonMasterCts=fddimibSMTNonMasterCts, fddimibSMTStationStatus=fddimibSMTStationStatus, fddimibMACTReq=fddimibMACTReq, fddimibSMTConfigCapabilities=fddimibSMTConfigCapabilities, fddimibPORTAvailablePaths=fddimibPORTAvailablePaths, fddimibMACIndex=fddimibMACIndex, fddimibPORTLerCutoff=fddimibPORTLerCutoff, fddimibSMTConnectionPolicy=fddimibSMTConnectionPolicy, fddimibPATHConfigTokenOrder=fddimibPATHConfigTokenOrder, fddimibMACNotCopiedRatio=fddimibMACNotCopiedRatio, fddimibMAC=fddimibMAC, fddimibPORTLerAlarm=fddimibPORTLerAlarm, fddimibPATHTable=fddimibPATHTable, fddimibMACCountersTable=fddimibMACCountersTable, FddiResourceId=FddiResourceId, fddimibSMTECMState=fddimibSMTECMState, fddimibPATHMaxTReq=fddimibPATHMaxTReq, fddimibMACUnaDaFlag=fddimibMACUnaDaFlag, fddimibPORTCurrentPath=fddimibPORTCurrentPath, fddimibPORTHardwarePresent=fddimibPORTHardwarePresent, fddimibPORTSMTIndex=fddimibPORTSMTIndex, fddimibMACNotCopiedCts=fddimibMACNotCopiedCts, fddimibSMTStationId=fddimibSMTStationId, fddimibSMTStationAction=fddimibSMTStationAction, fddimibPORTLerEstimate=fddimibPORTLerEstimate, fddimibPATHConfigResourceIndex=fddimibPATHConfigResourceIndex, fddimibPORTTable=fddimibPORTTable, fddimib=fddimib, fddimibMACMAUnitdataAvailable=fddimibMACMAUnitdataAvailable, fddimibMACNumber=fddimibMACNumber, fddimibMACTokenCts=fddimibMACTokenCts, fddimibSMTBypassPresent=fddimibSMTBypassPresent, fddimibPATHConfigPATHIndex=fddimibPATHConfigPATHIndex, fddimibPORTNeighborType=fddimibPORTNeighborType, fddi=fddi, fddimibSMTConfigPolicy=fddimibSMTConfigPolicy, FddiTimeMilli=FddiTimeMilli, fddimibMACMAUnitdataEnable=fddimibMACMAUnitdataEnable, fddimibMACSMTIndex=fddimibMACSMTIndex, fddimibPATHEntry=fddimibPATHEntry, fddimibSMTIndex=fddimibSMTIndex, fddimibPORTAction=fddimibPORTAction, fddimibMACErrorCts=fddimibMACErrorCts, fddimibSMTTable=fddimibSMTTable, fddimibMACFrameStatusFunctions=fddimibMACFrameStatusFunctions, fddimibPATHTVXLowerBound=fddimibPATHTVXLowerBound, fddimibPATHConfigEntry=fddimibPATHConfigEntry, fddimibMACEntry=fddimibMACEntry, fddimibSMTUserData=fddimibSMTUserData)
class ODLIRD(): def load_odl_ird(self, odl_ird): self.content = odl_ird return self def rfc_ird(self): return { 'meta': self.to_rfc_meta(self.content['meta']), 'resources': self.to_rfc_resources(self.content['resources']) } def to_rfc_meta(self, odl_meta): return { 'cost-types': self.to_rfc_cost_type(odl_meta['cost-types']), 'default-alto-network-map': odl_meta['default-alto-network-map']['resource-id'] } def to_rfc_cost_type(self, odl_cost_types): cost_types = {} for cost_type in odl_cost_types: cost_type_name = cost_type['cost-type-name'] cost_types[cost_type_name] = { 'cost-mode': cost_type['cost-mode'], 'cost-metric': cost_type['cost-metric'], 'description': cost_type['description'] } return cost_types def to_rfc_resources(self, odl_resources): resources = {} for resource in odl_resources: resource_id = resource['resource-id'] resources[resource_id] = self.to_rfc_resource(resource) return resources def to_rfc_resource(self, odl_resource): rfc_resource = { 'uri': odl_resource['uri'], 'media-type': odl_resource['media-type'] } if 'accepts' in odl_resource: rfc_resource['accepts'] = ','.join(odl_resource['accepts']) if 'capabilities' in odl_resource: rfc_resource['capabilities'] = odl_resource['capabilities'] if 'uses' in odl_resource: rfc_resource['uses'] = odl_resource['uses'] return rfc_resource
class Odlird: def load_odl_ird(self, odl_ird): self.content = odl_ird return self def rfc_ird(self): return {'meta': self.to_rfc_meta(self.content['meta']), 'resources': self.to_rfc_resources(self.content['resources'])} def to_rfc_meta(self, odl_meta): return {'cost-types': self.to_rfc_cost_type(odl_meta['cost-types']), 'default-alto-network-map': odl_meta['default-alto-network-map']['resource-id']} def to_rfc_cost_type(self, odl_cost_types): cost_types = {} for cost_type in odl_cost_types: cost_type_name = cost_type['cost-type-name'] cost_types[cost_type_name] = {'cost-mode': cost_type['cost-mode'], 'cost-metric': cost_type['cost-metric'], 'description': cost_type['description']} return cost_types def to_rfc_resources(self, odl_resources): resources = {} for resource in odl_resources: resource_id = resource['resource-id'] resources[resource_id] = self.to_rfc_resource(resource) return resources def to_rfc_resource(self, odl_resource): rfc_resource = {'uri': odl_resource['uri'], 'media-type': odl_resource['media-type']} if 'accepts' in odl_resource: rfc_resource['accepts'] = ','.join(odl_resource['accepts']) if 'capabilities' in odl_resource: rfc_resource['capabilities'] = odl_resource['capabilities'] if 'uses' in odl_resource: rfc_resource['uses'] = odl_resource['uses'] return rfc_resource
N, A, B, C = map(int, input().split()) l_list = [int(input()) for _ in range(N)] inf = float("inf") def dfs(cur, a, b, c): if cur == N: return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else inf ans0 = dfs(cur + 1, a, b, c) ans1 = dfs(cur + 1, a + l_list[cur], b, c) + 10 ans2 = dfs(cur + 1, a, b + l_list[cur], c) + 10 ans3 = dfs(cur + 1, a, b, c + l_list[cur]) + 10 return min(ans0, ans1, ans2, ans3) print(dfs(0, 0, 0, 0))
(n, a, b, c) = map(int, input().split()) l_list = [int(input()) for _ in range(N)] inf = float('inf') def dfs(cur, a, b, c): if cur == N: return abs(a - A) + abs(b - B) + abs(c - C) - 30 if min(a, b, c) > 0 else inf ans0 = dfs(cur + 1, a, b, c) ans1 = dfs(cur + 1, a + l_list[cur], b, c) + 10 ans2 = dfs(cur + 1, a, b + l_list[cur], c) + 10 ans3 = dfs(cur + 1, a, b, c + l_list[cur]) + 10 return min(ans0, ans1, ans2, ans3) print(dfs(0, 0, 0, 0))
conditions = { 'test_project_ids': ['*'], 'test_suite_ids': ['*'], 'test_names': ['logout'], } def post_test_run(): pass
conditions = {'test_project_ids': ['*'], 'test_suite_ids': ['*'], 'test_names': ['logout']} def post_test_run(): pass
__author__ = 'tilmannbruckhaus' class Pandigital: def __init__(self, digits): self.p = digits self.N = len(self.p) def find(self, n): for i in range(n - 1): self.step() return self.get() def step(self): # The algorithm is described in E. W. Dijkstra, A Discipline of Programming, Prentice-Hall, 1997, p. 71 i = self.N - 1 while self.p[i-1] >= self.p[i]: i -= 1 j = self.N while self.p[j - 1] <= self.p[i - 1]: j -= 1 self.swap(i-1, j-1) # swap values at positions (i-1) and (j-1) i += 1 j = self.N while i < j: self.swap(i-1, j-1) i += 1 j -= 1 def swap(self, i, j): swap = self.p[j] self.p[j] = self.p[i] self.p[i] = swap def next(self): if not self.has_next(): return False self.step() return self.get() def has_next(self): for i in range(self.N - 1): if self.p[i] < self.p[i + 1]: return True return False def get(self): return ''.join([str(d) for d in self.p])
__author__ = 'tilmannbruckhaus' class Pandigital: def __init__(self, digits): self.p = digits self.N = len(self.p) def find(self, n): for i in range(n - 1): self.step() return self.get() def step(self): i = self.N - 1 while self.p[i - 1] >= self.p[i]: i -= 1 j = self.N while self.p[j - 1] <= self.p[i - 1]: j -= 1 self.swap(i - 1, j - 1) i += 1 j = self.N while i < j: self.swap(i - 1, j - 1) i += 1 j -= 1 def swap(self, i, j): swap = self.p[j] self.p[j] = self.p[i] self.p[i] = swap def next(self): if not self.has_next(): return False self.step() return self.get() def has_next(self): for i in range(self.N - 1): if self.p[i] < self.p[i + 1]: return True return False def get(self): return ''.join([str(d) for d in self.p])
class Config: def __init__(self, **kwargs): self.protocol = kwargs.get('protocol') self.ip = kwargs.get('ip') self.port = kwargs.get('port') self.heavy_traffic = kwargs.get('heavy_traffic') self.time_patterns = kwargs.get('time_patterns') self.start_time = kwargs.get('start_time') self.post_data: list = kwargs.get('post_data') self.delete_data: list = kwargs.get('delete_data') self.end_time = kwargs.get('end_time') self.max_connection_refuse_count = kwargs.get('max_connection_refuse_count') self.dataset_file = kwargs.get('dataset_file') self.initial_timestamp = kwargs.get('initial_timestamp') # passing default value since the object is used in both generating traffic and invoking traffic self.script_runtime = kwargs.get('script_runtime', 0) self.no_of_data_points = kwargs.get('no_of_data_points', 0)
class Config: def __init__(self, **kwargs): self.protocol = kwargs.get('protocol') self.ip = kwargs.get('ip') self.port = kwargs.get('port') self.heavy_traffic = kwargs.get('heavy_traffic') self.time_patterns = kwargs.get('time_patterns') self.start_time = kwargs.get('start_time') self.post_data: list = kwargs.get('post_data') self.delete_data: list = kwargs.get('delete_data') self.end_time = kwargs.get('end_time') self.max_connection_refuse_count = kwargs.get('max_connection_refuse_count') self.dataset_file = kwargs.get('dataset_file') self.initial_timestamp = kwargs.get('initial_timestamp') self.script_runtime = kwargs.get('script_runtime', 0) self.no_of_data_points = kwargs.get('no_of_data_points', 0)
x = [0] print(x) x.__setitem__(0,1) print(x) x.__setitem__(0,2) print(x) x = [4,5,6] x.__setitem__(1,7) print(x) x.__setitem__(2,8) print(x)
x = [0] print(x) x.__setitem__(0, 1) print(x) x.__setitem__(0, 2) print(x) x = [4, 5, 6] x.__setitem__(1, 7) print(x) x.__setitem__(2, 8) print(x)
for row in range(1,11): for col in range(1,21): prod = row*col if prod < 10: print('','', prod, '',end='') elif prod < 100: print('', prod, '',end='') else: print(prod, '',end='') print()
for row in range(1, 11): for col in range(1, 21): prod = row * col if prod < 10: print('', '', prod, '', end='') elif prod < 100: print('', prod, '', end='') else: print(prod, '', end='') print()
a=100 class A: b=200 def fn(self,a=1): print("fn in A") def mfn(): print("Inside mfn") print("Mod1")
a = 100 class A: b = 200 def fn(self, a=1): print('fn in A') def mfn(): print('Inside mfn') print('Mod1')
{ "targets": [ { "target_name": "node_shoom", "include_dirs": [ "vendor/shoom/include", "<!(node -e \"require('nan')\")" ], "sources": [ "addon.cc", "node_shoom.cc" ], "conditions": [ ["OS == 'win'", { "sources": [ "vendor/shoom/src/shoom_win32.cc" ] }], ["OS != 'win'", { "sources": [ "vendor/shoom/src/shoom_unix_darwin.cc" ] }], ] } ] }
{'targets': [{'target_name': 'node_shoom', 'include_dirs': ['vendor/shoom/include', '<!(node -e "require(\'nan\')")'], 'sources': ['addon.cc', 'node_shoom.cc'], 'conditions': [["OS == 'win'", {'sources': ['vendor/shoom/src/shoom_win32.cc']}], ["OS != 'win'", {'sources': ['vendor/shoom/src/shoom_unix_darwin.cc']}]]}]}
def split_annotation(annotation: dict): context = annotation['@context'] body = annotation['body'] target = annotation['target'] custom_keys = [ key for key in annotation if key not in ['body', 'target', '@context', 'id', 'type'] ] custom = {k: annotation[k] for k in custom_keys} if isinstance(context, list) and len(context) > 1: custom_contexts = [c for c in context if c != "http://www.w3.org/ns/anno.jsonld"] else: custom_contexts = None return body, target, custom, custom_contexts
def split_annotation(annotation: dict): context = annotation['@context'] body = annotation['body'] target = annotation['target'] custom_keys = [key for key in annotation if key not in ['body', 'target', '@context', 'id', 'type']] custom = {k: annotation[k] for k in custom_keys} if isinstance(context, list) and len(context) > 1: custom_contexts = [c for c in context if c != 'http://www.w3.org/ns/anno.jsonld'] else: custom_contexts = None return (body, target, custom, custom_contexts)
requirements = [ 'marshmallow==3.5.1', 'bumpversion==0.6.0' ]
requirements = ['marshmallow==3.5.1', 'bumpversion==0.6.0']
# -*- coding: utf-8 -*- DEBUG = True SQLALCHEMY_ECHO = True SQLALCHEMY_DATABASE_URI = 'mysql://root:123456@127.0.0.1/food_db?charset=utf8mb4' SQLALCHEMY_TRACK_MODIFICATIONS = False SQLALCHEMY_ENCODING = "utf8mb4"
debug = True sqlalchemy_echo = True sqlalchemy_database_uri = 'mysql://root:123456@127.0.0.1/food_db?charset=utf8mb4' sqlalchemy_track_modifications = False sqlalchemy_encoding = 'utf8mb4'
k1 = input("birinci kelime:") k2 = input("ikinci kelime:") temp1 = k1[0:2] temp2 = k2[0:2] for i in k2[2:]: temp1 += i for i in k1[2:]: temp2 += i print(temp2) print(temp1)
k1 = input('birinci kelime:') k2 = input('ikinci kelime:') temp1 = k1[0:2] temp2 = k2[0:2] for i in k2[2:]: temp1 += i for i in k1[2:]: temp2 += i print(temp2) print(temp1)
def hr(n): if n % 2 == 0: return int(n // 2) else: return 3 * n + 1 while True: n = int(input()) if n == 0: break m = n while n != 1: if m < n: m = n n = hr(n) print(m)
def hr(n): if n % 2 == 0: return int(n // 2) else: return 3 * n + 1 while True: n = int(input()) if n == 0: break m = n while n != 1: if m < n: m = n n = hr(n) print(m)
class Solution: def largestOverlap(self, A: List[List[int]], B: List[List[int]]) -> int: C = [[0 for _ in range(len(B[0]) * 3 - 2)] for _ in range(len(B) * 3 - 2)] for i in range(len(B)): for j in range(len(B[0])): C[i + len(B) - 1][j + len(B[0]) - 1] = B[i][j] total_cnt = 0 for i in range(len(C) - len(A) + 1): for j in range(len(C[0]) - len(A[0]) + 1): cnt = 0 #Traversing count for a in range(len(A)): for b in range(len(A[0])): #Traversing count ia & jb, Counting ia, jb = i + a, j + b #If A covers B, we incrementing 'cnt' value by 1 if 1 == C[ia][jb] == A[a][b]: cnt += 1 #and returning the maximum value ('total_cnt') is what we want. if cnt > total_cnt: total_cnt = cnt return total_cnt
class Solution: def largest_overlap(self, A: List[List[int]], B: List[List[int]]) -> int: c = [[0 for _ in range(len(B[0]) * 3 - 2)] for _ in range(len(B) * 3 - 2)] for i in range(len(B)): for j in range(len(B[0])): C[i + len(B) - 1][j + len(B[0]) - 1] = B[i][j] total_cnt = 0 for i in range(len(C) - len(A) + 1): for j in range(len(C[0]) - len(A[0]) + 1): cnt = 0 for a in range(len(A)): for b in range(len(A[0])): (ia, jb) = (i + a, j + b) if 1 == C[ia][jb] == A[a][b]: cnt += 1 if cnt > total_cnt: total_cnt = cnt return total_cnt
PROXMOX_CLUSTER_SCHEMA = { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'nodes': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'ip': {'type': 'string'}, 'host': {'type': 'string'}, 'user': {'type': 'string'}, 'password': {'type': 'string'}, 'key_filename': {'type': 'string'}, 'key_passphrase': {'type': 'string'}, 'port': {'type': 'integer'}, 'sudo': {'type': 'boolean'} }, 'required': ['name'] }, 'minItems': 1, 'uniqueItems': True }, 'network': { 'type': 'object', 'properties': { 'base': {'type': 'string'}, 'gateway': {'type': 'string'}, 'allocated': { 'type': 'array', 'items': { 'type': 'string', 'uniqueItems': True } }, 'allowed_range': { 'type': 'object', 'properties': { 'start': { 'type': 'integer', 'minimum': 6, 'maximum': 254 }, 'end': { 'type': 'integer', 'minimum': 6, 'maximum': 254 } }, 'required': ['start', 'end'] }, 'loadbalancer_range': { 'type': 'object', 'properties': { 'start': { 'type': 'integer', 'minimum': 6, 'maximum': 254 }, 'end': { 'type': 'integer', 'minimum': 6, 'maximum': 254 } }, 'required': ['start', 'end'] } }, 'required': ['base', 'gateway', 'allowed_range'] } }, 'required': ['name', 'nodes', 'network'] } KUBE_CLUSTER_SCHEMA = { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'user': {'type': 'string'}, 'context': {'type': 'string'}, 'pool': {'type': 'string'}, 'os_type': { 'type': 'string', 'pattern': '^(ubuntu|centos)$' }, 'ssh_key': {'type': 'string'}, 'versions': { 'type': 'object', 'properties': { 'kubernetes': { 'type': 'string', 'pattern': '^(1.15|1.15.*|1.16|1.16.*|1.17|1.17.*)$' }, # 'docker': { # 'type': 'string', # 'pattern': '^(18|18.06|18.06.*|18.09|18.09.*|19|19.03|19.03.*)$' # }, 'docker_ce': {'type': 'boolean'} }, 'required': [] }, 'template': { 'type': 'object', 'properties': { 'pve_storage': { 'type': 'object', 'properties': { 'instance': { 'type': 'object', 'properties': { 'type': { 'type': 'string', 'pattern': '^(cephfs|cifs|dir|drbd|fake|glusterfs|iscsi|iscsidirect|lvm|lvmthin|nfs|rbd|sheepdog|zfs|zfspool)$' } }, 'required': ['type'] }, 'image': { 'type': 'object', 'properties': { 'type': { 'type': 'string', 'pattern': '^(cephfs|cifs|dir|drbd|fake|glusterfs|iscsi|iscsidirect|lvm|lvmthin|nfs|rbd|sheepdog|zfs|zfspool)$' } }, 'required': ['type'] } }, 'required': ['instance', 'image'] }, 'name': {'type': 'string'}, 'node': {'type': 'string'}, 'cpus': { 'type': 'integer', 'minimum': 1 }, 'memory': { 'type': 'integer', 'minimum': 1 }, 'disk': { 'type': 'object', 'properties': { 'size': { 'type': 'integer', 'minimum': 1 }, 'hotplug': {'type': 'boolean'}, 'hotplug_size': { 'type': 'integer', 'minimum': 1 } }, 'required': ['size'] }, 'scsi': {'type': 'boolean'} }, 'required': ['pve_storage', 'node'] }, 'control_plane': { 'type': 'object', 'properties': { 'ha_masters': {'type': 'boolean'}, 'networking': { 'type': 'string', 'pattern': '^(calico|weave)$' }, 'apiserver': { 'type': 'object', 'properties': { 'ip': { 'type': ['string', 'null'], 'format': 'ipv4' }, 'port': {'type': ['integer', 'string']} }, 'required': [] } }, 'required': [] }, 'dashboard': {'type': 'boolean'}, 'storage': { 'type': ['string', 'null'], 'pattern': '^(rook|nfs|glusterfs)$' }, 'loadbalancer': {'type': 'boolean'}, 'helm': { 'type': 'object', 'properties': { 'version': { 'type': 'string', 'pattern': '^(v2|v3)$' }, 'local': {'type': 'boolean'}, 'tiller': {'type': 'boolean'} }, 'required': [] }, 'masters': { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'node': {'type': 'string'}, 'scale': { 'type': 'integer', 'minimum': 1 }, 'cpus': { 'type': 'integer', 'minimum': 1 }, 'memory': { 'type': 'integer', 'minimum': 1 }, 'pve_storage': { 'type': 'object', 'properties': { 'type': { 'type': 'string', 'pattern': '^(cephfs|cifs|dir|drbd|fake|glusterfs|iscsi|iscsidirect|lvm|lvmthin|nfs|rbd|sheepdog|zfs|zfspool)$' } }, 'required': ['type'] }, 'disk': { 'type': 'object', 'properties': { 'size': { 'type': 'integer', 'minimum': 1 }, 'hotplug': {'type': 'boolean'}, 'hotplug_size': { 'type': 'integer', 'minimum': 1 } }, 'required': ['size'] }, 'scsi': {'type': 'boolean'} }, 'required': ['name', 'node', 'scale', 'cpus', 'memory', 'disk'] }, 'workers': { 'type': 'array', 'items': { 'type': 'object', 'properties': { 'name': {'type': 'string'}, 'node': {'type': 'string'}, 'role': {'type': 'string'}, 'scale': { 'type': 'integer', 'minimum': 0 }, 'cpus': { 'type': 'integer', 'minimum': 1 }, 'memory': { 'type': 'integer', 'minimum': 1 }, 'pve_storage': { 'type': 'object', 'properties': { 'type': { 'type': 'string', 'pattern': '^(cephfs|cifs|dir|drbd|fake|glusterfs|iscsi|iscsidirect|lvm|lvmthin|nfs|rbd|sheepdog|zfs|zfspool)$' } }, 'required': ['type'] }, 'disk': { 'type': 'object', 'properties': { 'size': { 'type': 'integer', 'minimum': 1 }, 'hotplug': {'type': 'boolean'}, 'hotplug_size': { 'type': 'integer', 'minimum': 1 } }, 'required': ['size'] }, 'scsi': {'type': 'boolean'}, 'secondary_iface': {'type': 'boolean'} }, 'required': ['name', 'node', 'scale', 'cpus', 'memory', 'disk'], 'uniqueItems': True } } }, 'required': ['name', 'pool', 'os_type', 'ssh_key', 'template', 'masters', 'workers'] }
proxmox_cluster_schema = {'type': 'object', 'properties': {'name': {'type': 'string'}, 'nodes': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'ip': {'type': 'string'}, 'host': {'type': 'string'}, 'user': {'type': 'string'}, 'password': {'type': 'string'}, 'key_filename': {'type': 'string'}, 'key_passphrase': {'type': 'string'}, 'port': {'type': 'integer'}, 'sudo': {'type': 'boolean'}}, 'required': ['name']}, 'minItems': 1, 'uniqueItems': True}, 'network': {'type': 'object', 'properties': {'base': {'type': 'string'}, 'gateway': {'type': 'string'}, 'allocated': {'type': 'array', 'items': {'type': 'string', 'uniqueItems': True}}, 'allowed_range': {'type': 'object', 'properties': {'start': {'type': 'integer', 'minimum': 6, 'maximum': 254}, 'end': {'type': 'integer', 'minimum': 6, 'maximum': 254}}, 'required': ['start', 'end']}, 'loadbalancer_range': {'type': 'object', 'properties': {'start': {'type': 'integer', 'minimum': 6, 'maximum': 254}, 'end': {'type': 'integer', 'minimum': 6, 'maximum': 254}}, 'required': ['start', 'end']}}, 'required': ['base', 'gateway', 'allowed_range']}}, 'required': ['name', 'nodes', 'network']} kube_cluster_schema = {'type': 'object', 'properties': {'name': {'type': 'string'}, 'user': {'type': 'string'}, 'context': {'type': 'string'}, 'pool': {'type': 'string'}, 'os_type': {'type': 'string', 'pattern': '^(ubuntu|centos)$'}, 'ssh_key': {'type': 'string'}, 'versions': {'type': 'object', 'properties': {'kubernetes': {'type': 'string', 'pattern': '^(1.15|1.15.*|1.16|1.16.*|1.17|1.17.*)$'}, 'docker_ce': {'type': 'boolean'}}, 'required': []}, 'template': {'type': 'object', 'properties': {'pve_storage': {'type': 'object', 'properties': {'instance': {'type': 'object', 'properties': {'type': {'type': 'string', 'pattern': '^(cephfs|cifs|dir|drbd|fake|glusterfs|iscsi|iscsidirect|lvm|lvmthin|nfs|rbd|sheepdog|zfs|zfspool)$'}}, 'required': ['type']}, 'image': {'type': 'object', 'properties': {'type': {'type': 'string', 'pattern': '^(cephfs|cifs|dir|drbd|fake|glusterfs|iscsi|iscsidirect|lvm|lvmthin|nfs|rbd|sheepdog|zfs|zfspool)$'}}, 'required': ['type']}}, 'required': ['instance', 'image']}, 'name': {'type': 'string'}, 'node': {'type': 'string'}, 'cpus': {'type': 'integer', 'minimum': 1}, 'memory': {'type': 'integer', 'minimum': 1}, 'disk': {'type': 'object', 'properties': {'size': {'type': 'integer', 'minimum': 1}, 'hotplug': {'type': 'boolean'}, 'hotplug_size': {'type': 'integer', 'minimum': 1}}, 'required': ['size']}, 'scsi': {'type': 'boolean'}}, 'required': ['pve_storage', 'node']}, 'control_plane': {'type': 'object', 'properties': {'ha_masters': {'type': 'boolean'}, 'networking': {'type': 'string', 'pattern': '^(calico|weave)$'}, 'apiserver': {'type': 'object', 'properties': {'ip': {'type': ['string', 'null'], 'format': 'ipv4'}, 'port': {'type': ['integer', 'string']}}, 'required': []}}, 'required': []}, 'dashboard': {'type': 'boolean'}, 'storage': {'type': ['string', 'null'], 'pattern': '^(rook|nfs|glusterfs)$'}, 'loadbalancer': {'type': 'boolean'}, 'helm': {'type': 'object', 'properties': {'version': {'type': 'string', 'pattern': '^(v2|v3)$'}, 'local': {'type': 'boolean'}, 'tiller': {'type': 'boolean'}}, 'required': []}, 'masters': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'node': {'type': 'string'}, 'scale': {'type': 'integer', 'minimum': 1}, 'cpus': {'type': 'integer', 'minimum': 1}, 'memory': {'type': 'integer', 'minimum': 1}, 'pve_storage': {'type': 'object', 'properties': {'type': {'type': 'string', 'pattern': '^(cephfs|cifs|dir|drbd|fake|glusterfs|iscsi|iscsidirect|lvm|lvmthin|nfs|rbd|sheepdog|zfs|zfspool)$'}}, 'required': ['type']}, 'disk': {'type': 'object', 'properties': {'size': {'type': 'integer', 'minimum': 1}, 'hotplug': {'type': 'boolean'}, 'hotplug_size': {'type': 'integer', 'minimum': 1}}, 'required': ['size']}, 'scsi': {'type': 'boolean'}}, 'required': ['name', 'node', 'scale', 'cpus', 'memory', 'disk']}, 'workers': {'type': 'array', 'items': {'type': 'object', 'properties': {'name': {'type': 'string'}, 'node': {'type': 'string'}, 'role': {'type': 'string'}, 'scale': {'type': 'integer', 'minimum': 0}, 'cpus': {'type': 'integer', 'minimum': 1}, 'memory': {'type': 'integer', 'minimum': 1}, 'pve_storage': {'type': 'object', 'properties': {'type': {'type': 'string', 'pattern': '^(cephfs|cifs|dir|drbd|fake|glusterfs|iscsi|iscsidirect|lvm|lvmthin|nfs|rbd|sheepdog|zfs|zfspool)$'}}, 'required': ['type']}, 'disk': {'type': 'object', 'properties': {'size': {'type': 'integer', 'minimum': 1}, 'hotplug': {'type': 'boolean'}, 'hotplug_size': {'type': 'integer', 'minimum': 1}}, 'required': ['size']}, 'scsi': {'type': 'boolean'}, 'secondary_iface': {'type': 'boolean'}}, 'required': ['name', 'node', 'scale', 'cpus', 'memory', 'disk'], 'uniqueItems': True}}}, 'required': ['name', 'pool', 'os_type', 'ssh_key', 'template', 'masters', 'workers']}
n = int(input('Provide a number: ')) nums = [] for i in range(1, n+1): nums.append(i) print(*nums, sep=", ")
n = int(input('Provide a number: ')) nums = [] for i in range(1, n + 1): nums.append(i) print(*nums, sep=', ')
t = int(input()) while t: N, X = map(int, input().split()) S = input() arr = [] arr.append(X) for i in S: if i=='R': X += 1 arr.append(X) if i=='L': X -= 1 arr.append(X) arr = set(arr) print(len(arr)) t = t-1
t = int(input()) while t: (n, x) = map(int, input().split()) s = input() arr = [] arr.append(X) for i in S: if i == 'R': x += 1 arr.append(X) if i == 'L': x -= 1 arr.append(X) arr = set(arr) print(len(arr)) t = t - 1
netron_link = "https://lutzroeder.github.io/netron" cors_proxy = "https://cors-anywhere.herokuapp.com" release_url = "https://github.com/larq/zoo/releases/download" def html_format(source, language, css_class, options, md): return f'<a href="{netron_link}/?url={cors_proxy}/{release_url}/{source}">Interactive architecture diagram</a>'
netron_link = 'https://lutzroeder.github.io/netron' cors_proxy = 'https://cors-anywhere.herokuapp.com' release_url = 'https://github.com/larq/zoo/releases/download' def html_format(source, language, css_class, options, md): return f'<a href="{netron_link}/?url={cors_proxy}/{release_url}/{source}">Interactive architecture diagram</a>'
class Stack(list): def __getitem__(self,key): try: return super(Stack, self).__getitem__(key) except IndexError: return 0 def pop(self): try: return super(Stack, self).pop() except: return 0
class Stack(list): def __getitem__(self, key): try: return super(Stack, self).__getitem__(key) except IndexError: return 0 def pop(self): try: return super(Stack, self).pop() except: return 0
class ValidPalindrome: def isPalindrome(self, s): if len(s) == 0: return True else: s = "".join([i for i in s.lower() if i.isalnum()]) i= 0 j=len(s)-1 while j>i: if s[i] != s[j]: return False i += 1 j -= 1 return True if __name__ == "__main__": a="A man, a plan, a canal: Panama" b="race a car" print(ValidPalindrome().isPalindrome(a)) print(ValidPalindrome().isPalindrome(b))
class Validpalindrome: def is_palindrome(self, s): if len(s) == 0: return True else: s = ''.join([i for i in s.lower() if i.isalnum()]) i = 0 j = len(s) - 1 while j > i: if s[i] != s[j]: return False i += 1 j -= 1 return True if __name__ == '__main__': a = 'A man, a plan, a canal: Panama' b = 'race a car' print(valid_palindrome().isPalindrome(a)) print(valid_palindrome().isPalindrome(b))
arr = [] for arr_i in range(6): arr_t = [int(arr_temp) for arr_temp in input().split(' ')] arr.append(arr_t) #print (arr) hourglass_sums = [] for i in range(4): for j in range(4): hourglass_sums.append(sum(arr[i][j:j+3]) + arr[i+1][j+1] + sum(arr[i+2][j:j+3])) print (max(hourglass_sums))
arr = [] for arr_i in range(6): arr_t = [int(arr_temp) for arr_temp in input().split(' ')] arr.append(arr_t) hourglass_sums = [] for i in range(4): for j in range(4): hourglass_sums.append(sum(arr[i][j:j + 3]) + arr[i + 1][j + 1] + sum(arr[i + 2][j:j + 3])) print(max(hourglass_sums))
############################################################################### '''''' ############################################################################### class CoProperty(property): def __set_name__(self, owner, name): self.cooperators = tuple( # pylint: disable=W0201 acls.__dict__[name] for acls in owner.__bases__ if name in acls.__dict__ ) def allyield(self, instance, owner): for coop in self.cooperators: yield from coop.allyield(instance, owner) yield from super().__get__(instance, owner) def __get__(self, instance, owner): return tuple(self.allyield(instance, owner)) coproperty = CoProperty.__call__ ############################################################################### ###############################################################################
"""""" class Coproperty(property): def __set_name__(self, owner, name): self.cooperators = tuple((acls.__dict__[name] for acls in owner.__bases__ if name in acls.__dict__)) def allyield(self, instance, owner): for coop in self.cooperators: yield from coop.allyield(instance, owner) yield from super().__get__(instance, owner) def __get__(self, instance, owner): return tuple(self.allyield(instance, owner)) coproperty = CoProperty.__call__
class Node: def __init__(self,data): self.data = data self.left = self.right = None def sorted_array(nums): if not nums: return mid = len(nums)//2 root = Node(nums[mid]) root.left = sorted_array(nums[:mid]) root.right = sorted_array(nums[mid+1:]) return root def utility(root,res): if root is None: return res.append(root.data) utility(root.left,res) utility(root.right,res) def preorder(root): res = [] utility(root,res) return res def sortedArrayToBST(nums): root = sorted_array(nums) return preorder(root) ### Driver code..!!!! if __name__ == "__main__": nums = [-5 ,-2 ,-2 ,1 ,1 ,1 ,5 ,7] print("BST after convert",sortedArrayToBST(nums))
class Node: def __init__(self, data): self.data = data self.left = self.right = None def sorted_array(nums): if not nums: return mid = len(nums) // 2 root = node(nums[mid]) root.left = sorted_array(nums[:mid]) root.right = sorted_array(nums[mid + 1:]) return root def utility(root, res): if root is None: return res.append(root.data) utility(root.left, res) utility(root.right, res) def preorder(root): res = [] utility(root, res) return res def sorted_array_to_bst(nums): root = sorted_array(nums) return preorder(root) if __name__ == '__main__': nums = [-5, -2, -2, 1, 1, 1, 5, 7] print('BST after convert', sorted_array_to_bst(nums))
for _ in range(int(input())): n=input() if len(n)>10: print("{}{}{}".format(n[0],len(n)-2,n[-1])) else: print(n)
for _ in range(int(input())): n = input() if len(n) > 10: print('{}{}{}'.format(n[0], len(n) - 2, n[-1])) else: print(n)
ONOS_ORIGIN = "ONOS Community" ONOS_GROUP_ID = "org.onosproject" ONOS_VERSION = "1.14.0-SNAPSHOT" DEFAULT_APP_CATEGORY = "Utility" ONOS_ARTIFACT_BASE = "onos-" APP_PREFIX = ONOS_GROUP_ID + "."
onos_origin = 'ONOS Community' onos_group_id = 'org.onosproject' onos_version = '1.14.0-SNAPSHOT' default_app_category = 'Utility' onos_artifact_base = 'onos-' app_prefix = ONOS_GROUP_ID + '.'
# souce from https://stackoverflow.com/a/25471508 '''Stub for fcntl. only for Windows dev/testing.''' def fcntl(fd, op, arg=0): return 0 def ioctl(fd, op, arg=0, mutable_flag=True): if mutable_flag: return 0 else: return "" def flock(fd, op): return def lockf(fd, operation, length=0, start=0, whence=0): return
"""Stub for fcntl. only for Windows dev/testing.""" def fcntl(fd, op, arg=0): return 0 def ioctl(fd, op, arg=0, mutable_flag=True): if mutable_flag: return 0 else: return '' def flock(fd, op): return def lockf(fd, operation, length=0, start=0, whence=0): return
for i in range(0,6): if i !=3: print(i) result = 1 for i in range(1,6): result =result*i print(result) result = 0 for i in range(1,6): result = result +i print(result) result=0 for word in 'this is my 6th string'.split(): result = result+1 print(result)
for i in range(0, 6): if i != 3: print(i) result = 1 for i in range(1, 6): result = result * i print(result) result = 0 for i in range(1, 6): result = result + i print(result) result = 0 for word in 'this is my 6th string'.split(): result = result + 1 print(result)
# config.py # DEBUG = False # SQLALCHEMY_ECHO = False # instance/config.py DEBUG = True SQLALCHEMY_ECHO = True ARCFACE_PREBATCHNORM_LAYER_INDEX = -4 ARCFACE_POOLING_LAYER_INDEX = -3
debug = True sqlalchemy_echo = True arcface_prebatchnorm_layer_index = -4 arcface_pooling_layer_index = -3
total = 0 for number in range(2, 101, 2): total += number print(total)
total = 0 for number in range(2, 101, 2): total += number print(total)
# In the admin panel, when adding new fields, # sets the 'user' field to be the current logged in user # as the default class AutoUserMixin(object): def formfield_for_foreignkey(self, db_field, request, **kwargs): if db_field.name == 'user': kwargs['initial'] = request.user.id return db_field.formfield(**kwargs) return super(AutoUserMixin, self).formfield_for_foreignkey( db_field, request, **kwargs)
class Autousermixin(object): def formfield_for_foreignkey(self, db_field, request, **kwargs): if db_field.name == 'user': kwargs['initial'] = request.user.id return db_field.formfield(**kwargs) return super(AutoUserMixin, self).formfield_for_foreignkey(db_field, request, **kwargs)
BASE_PATH = 'covid19_scenarios_data' JSON_DIR = 'assets' SOURCES_FILE = 'sources.json' TMP_CASES = 'case_counts.json' TMP_POPULATION = 'population.json' TMP_SCENARIOS = "scenario_defaults.json"
base_path = 'covid19_scenarios_data' json_dir = 'assets' sources_file = 'sources.json' tmp_cases = 'case_counts.json' tmp_population = 'population.json' tmp_scenarios = 'scenario_defaults.json'
# Variant 1 - Best class Parent: _possible_drinks = ['beer', 'wine'] class Child(Parent): _possible_drinks = ['beer', 'wine', 'vodka'] # Variant 2 - Ok class Child2(Parent): def __init__(self): self._possible_drinks = super()._possible_drinks + ['vodka'] # Variant 3 - Wrong class Child3(Parent): _possible_drinks = Parent._possible_drinks + ['vodka']
class Parent: _possible_drinks = ['beer', 'wine'] class Child(Parent): _possible_drinks = ['beer', 'wine', 'vodka'] class Child2(Parent): def __init__(self): self._possible_drinks = super()._possible_drinks + ['vodka'] class Child3(Parent): _possible_drinks = Parent._possible_drinks + ['vodka']
print("Example 04: [The continue Statement] \n" " Continue to the next iteration if i is 5") i = 0 while i < 10: i += 1 if i == 5: continue print(i)
print('Example 04: [The continue Statement] \n Continue to the next iteration if i is 5') i = 0 while i < 10: i += 1 if i == 5: continue print(i)
pkgname = "python-idna" pkgver = "3.3" pkgrel = 0 build_style = "python_module" hostmakedepends = ["python-setuptools"] depends = ["python"] pkgdesc = "Internationalized Domain Names in Applications (IDNA) for Python" maintainer = "q66 <q66@chimera-linux.org>" license = "BSD-3-Clause" url = "https://github.com/kjd/idna" source = f"$(PYPI_SITE)/i/idna/idna-{pkgver}.tar.gz" sha256 = "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d" def post_install(self): self.install_license("LICENSE.md")
pkgname = 'python-idna' pkgver = '3.3' pkgrel = 0 build_style = 'python_module' hostmakedepends = ['python-setuptools'] depends = ['python'] pkgdesc = 'Internationalized Domain Names in Applications (IDNA) for Python' maintainer = 'q66 <q66@chimera-linux.org>' license = 'BSD-3-Clause' url = 'https://github.com/kjd/idna' source = f'$(PYPI_SITE)/i/idna/idna-{pkgver}.tar.gz' sha256 = '9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d' def post_install(self): self.install_license('LICENSE.md')
# https://leetcode.com/problems/word-break class Solution: def wordBreak(self, s: str, wordDict: List[str]) -> bool: s = " " + s dp = [False for _ in range(len(s))] dp[0] = True for i in range(len(s)): for j in range(i): if (dp[j] == True) and (s[j + 1 : i + 1] in wordDict): dp[i] = True break return dp[len(s) - 1]
class Solution: def word_break(self, s: str, wordDict: List[str]) -> bool: s = ' ' + s dp = [False for _ in range(len(s))] dp[0] = True for i in range(len(s)): for j in range(i): if dp[j] == True and s[j + 1:i + 1] in wordDict: dp[i] = True break return dp[len(s) - 1]
def run_simulation(): with open('./data/MorningTraffic-b.csv', 'r') as file: content = file.readlines() content = [x.strip() for x in content] timestep = 0 while True: if len(content) > 0: parts = content[0].split(';') start_time = parts[0] if int(start_time) == timestep: start_floor = parts[1] dest_floor = parts[2] print('Time:'+str(timestep)+'. Elevator ordered from: '+start_floor+', to: '+dest_floor) content.pop(0) else: print('Time:'+str(timestep)+'. Nobody wants an elevator now') timestep += 1 else: print('Simulation over') break run_simulation()
def run_simulation(): with open('./data/MorningTraffic-b.csv', 'r') as file: content = file.readlines() content = [x.strip() for x in content] timestep = 0 while True: if len(content) > 0: parts = content[0].split(';') start_time = parts[0] if int(start_time) == timestep: start_floor = parts[1] dest_floor = parts[2] print('Time:' + str(timestep) + '. Elevator ordered from: ' + start_floor + ', to: ' + dest_floor) content.pop(0) else: print('Time:' + str(timestep) + '. Nobody wants an elevator now') timestep += 1 else: print('Simulation over') break run_simulation()
_TRANSFORMATIONS = dict() def register(name): def add_to_dict(fn): global _TRANSFORMATIONS _TRANSFORMATIONS[name] = fn return fn return add_to_dict
_transformations = dict() def register(name): def add_to_dict(fn): global _TRANSFORMATIONS _TRANSFORMATIONS[name] = fn return fn return add_to_dict
# Branch code with if, elif and else structure user_input = input("Would you like to continue? ") if user_input == "no" or user_input == "n": print("Exiting") elif user_input == "yes" or user_input == "y": print("Continuing ...\nComplete!") else: print("Please try again and respond with yes or no.")
user_input = input('Would you like to continue? ') if user_input == 'no' or user_input == 'n': print('Exiting') elif user_input == 'yes' or user_input == 'y': print('Continuing ...\nComplete!') else: print('Please try again and respond with yes or no.')
class Solution: def solve(self, nums, k): i = 0 j = len(nums) - 1 while i < j: curSum = nums[i] + nums[j] if curSum == k: return True elif curSum < k: i += 1 else: j -= 1 return False
class Solution: def solve(self, nums, k): i = 0 j = len(nums) - 1 while i < j: cur_sum = nums[i] + nums[j] if curSum == k: return True elif curSum < k: i += 1 else: j -= 1 return False
class Minus: reserved = {} tokens = ('MINUS',) # Tokens t_MINUS = r'-' precedence = ( ('left', 'MINUS'), )
class Minus: reserved = {} tokens = ('MINUS',) t_minus = '-' precedence = (('left', 'MINUS'),)
# Copyright (c) 2009 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. { 'includes': [ '../../../../common_settings.gypi', # Common settings ], 'targets': [ { 'target_name': 'test_framework', 'type': '<(library)', 'dependencies': [ '../../../../system_wrappers/source/system_wrappers.gyp:system_wrappers', '../../../../common_video/vplib/main/source/vplib.gyp:webrtc_vplib', ], 'include_dirs': [ '../interface', '../../../../common_video/interface', ], 'direct_dependent_settings': { 'include_dirs': [ '../interface', ], }, 'sources': [ # header files 'benchmark.h', 'normal_async_test.h', 'normal_test.h', 'packet_loss_test.h', 'performance_test.h', 'test.h', 'unit_test.h', 'video_buffer.h', 'video_source.h', # source files 'benchmark.cc', 'normal_async_test.cc', 'normal_test.cc', 'packet_loss_test.cc', 'performance_test.cc', 'test.cc', 'unit_test.cc', 'video_buffer.cc', 'video_source.cc', ], }, ], } # Local Variables: # tab-width:2 # indent-tabs-mode:nil # End: # vim: set expandtab tabstop=2 shiftwidth=2:
{'includes': ['../../../../common_settings.gypi'], 'targets': [{'target_name': 'test_framework', 'type': '<(library)', 'dependencies': ['../../../../system_wrappers/source/system_wrappers.gyp:system_wrappers', '../../../../common_video/vplib/main/source/vplib.gyp:webrtc_vplib'], 'include_dirs': ['../interface', '../../../../common_video/interface'], 'direct_dependent_settings': {'include_dirs': ['../interface']}, 'sources': ['benchmark.h', 'normal_async_test.h', 'normal_test.h', 'packet_loss_test.h', 'performance_test.h', 'test.h', 'unit_test.h', 'video_buffer.h', 'video_source.h', 'benchmark.cc', 'normal_async_test.cc', 'normal_test.cc', 'packet_loss_test.cc', 'performance_test.cc', 'test.cc', 'unit_test.cc', 'video_buffer.cc', 'video_source.cc']}]}
map_collections = { "user": "Users", "user_relation": "UsersRelation", }
map_collections = {'user': 'Users', 'user_relation': 'UsersRelation'}
variavel_global = 'Global' def funcao(): variavel_local = 'Local' print(variavel_global) print(variavel_local) funcao()
variavel_global = 'Global' def funcao(): variavel_local = 'Local' print(variavel_global) print(variavel_local) funcao()
#!/usr/bin/env python # -*- coding: utf-8 -*- def greetings(st_1, st_2, st_3=None, st_4=None): template = "<b>Alumno</b>: {0:30} <b>rol</b>: {1:10}<br>" hi = "" hi += template.format(*st_1) hi += template.format(*st_2) if st_3: hi += template.format(*st_3) if st_4: hi += template.format(*st_4) ending = "Good luck!" return hi + ending
def greetings(st_1, st_2, st_3=None, st_4=None): template = '<b>Alumno</b>: {0:30} <b>rol</b>: {1:10}<br>' hi = '' hi += template.format(*st_1) hi += template.format(*st_2) if st_3: hi += template.format(*st_3) if st_4: hi += template.format(*st_4) ending = 'Good luck!' return hi + ending
# Definition for singly-linked list. class ListNode: def __init__(self, x): self.val = x self.next = None class Solution: def hasCycle(self, head: ListNode) -> bool: cur1 = head cur2 = head while(cur1 or cur2): cur1 = cur1 and cur1.next and cur1.next.next cur2 = cur2 and cur2.next if not (cur1 or cur2): return False if (cur1 is cur2): return True return False
class Listnode: def __init__(self, x): self.val = x self.next = None class Solution: def has_cycle(self, head: ListNode) -> bool: cur1 = head cur2 = head while cur1 or cur2: cur1 = cur1 and cur1.next and cur1.next.next cur2 = cur2 and cur2.next if not (cur1 or cur2): return False if cur1 is cur2: return True return False
def join_path(row_path, column_path): if column_path is None: raise Exception("Column path is empty!") if row_path is None: raise Exception("Row path is empty") column_path = column_path.strip() row_path = row_path.strip() if len(row_path) > 0 and row_path[-1] == ".": row_path = row_path[0:-1] if len(column_path) > 0 and column_path[-1] == ".": column_path = column_path[0:-1] if len(row_path) > 0 and row_path[0] == ".": row_path = row_path[1:] if len(column_path) and column_path[0] != ".": column_path = "." + column_path if row_path == "": return column_path[1:] if len(column_path) > 1 else "." if column_path == ".": return row_path return row_path+column_path
def join_path(row_path, column_path): if column_path is None: raise exception('Column path is empty!') if row_path is None: raise exception('Row path is empty') column_path = column_path.strip() row_path = row_path.strip() if len(row_path) > 0 and row_path[-1] == '.': row_path = row_path[0:-1] if len(column_path) > 0 and column_path[-1] == '.': column_path = column_path[0:-1] if len(row_path) > 0 and row_path[0] == '.': row_path = row_path[1:] if len(column_path) and column_path[0] != '.': column_path = '.' + column_path if row_path == '': return column_path[1:] if len(column_path) > 1 else '.' if column_path == '.': return row_path return row_path + column_path
# # LeetCode # # Problem - 35 # URL - https://leetcode.com/problems/search-insert-position/ # class Solution: def searchInsert(self, nums: List[int], target: int) -> int: return bisect.bisect_left(nums, target)
class Solution: def search_insert(self, nums: List[int], target: int) -> int: return bisect.bisect_left(nums, target)
MAX_PERCENT = 100 PERCENT_DENOMINATION = 10 class Category: width_of_ledger = 30 def __init__(self, title : str) -> None: #to define your own attributes for this category self.title = title #eg of a constructor Category("Food") self.currentAmount : float = 0 self.ledger : list = [] def deposit(self, amount: float, description = ''): # colon is a __ type, equal is a value self.ledger.append({ #key value pairs "amount" and amount "amount": amount, "description": description }) self.currentAmount += amount #same as "self.currentAmount = self.currentAmount + amount" def withdraw(self, amount: float, description = ''): if self.check_funds(amount): self.ledger.append({ "amount": -amount, "description": description }) self.currentAmount -= amount return True return False def get_balance(self): return self.currentAmount def transfer(self, amount: float, another_category): #another_category: Category if self.withdraw(amount, f'Transfer to {another_category.title}'): another_category.deposit(amount, f'Transfer from {self.title}') return True return False def check_funds (self, amount): return amount <= self.currentAmount def __str__(self) -> str: return f'{self.title_bar()}\n{self.items_in_ledger()}\n{self.total_amount()}' def title_bar(self): if len(self.title) % 2 == 0: return '*'*self.number_of_stars() + self.title + '*'*self.number_of_stars() else: return '*'*self.number_of_stars() + self.title + '*'*(self.number_of_stars() + 1) def number_of_stars(self) -> int: return (30 - len(self.title)) // 2 def items_in_ledger(self): lines_of_ledger = [] for item in self.ledger: description = item["description"][:23] #assessing the dictionary using 'dictionary', upto but not including amount = '%.2f' % item["amount"] #convert 2dp whitespaces = ' ' * (Category.width_of_ledger - len(description) - len(amount)) lines_of_ledger.append(f'{description}{whitespaces}{amount}') return '\n'.join(lines_of_ledger) def total_amount(self): formatted_amount = '%.2f' % self.currentAmount return f'Total: {formatted_amount}' #create chart def format_percent (percent: int) -> str: whitespace = ' '* (len('100')-len(str(percent))) return whitespace def calculate_total_balance(category: list[Category]) -> float: total_balance = 0 for each_category in category: withdrawal = get_total_withdrawal(each_category) total_balance += withdrawal return total_balance def get_total_withdrawal(category: Category) -> float: withdrawal_total = 0 for item in category.ledger: if item['amount'] < 0: #withdrawal withdrawal_total += -item['amount'] return withdrawal_total def create_dots(category: list[Category], total_balance: float, chart_percent: int) -> str: category_balance = get_total_withdrawal(category) if total_balance == 0: category_percent = 0 else: category_percent = (category_balance/total_balance) *100 if category_percent >= chart_percent: #torounddown to the nearest 10 return 'o ' else: return ' ' def create_spend_chart(categories: list[Category]): # calculate percentages # calculate width of the chart # calculate height of the chart HEADER = 'Percentage spent by category' END_OF_LINE = '\n' y_label_size = len('100|') chart_percent = MAX_PERCENT total_balance = calculate_total_balance(categories) size_of_categories = len(categories) all_lines = [ HEADER ] #create percent lines for number in range(11): percent_label = f'{format_percent(chart_percent)}{chart_percent}| ' all_category_dots = [] for category in categories: category_dots = create_dots(category, total_balance, chart_percent) all_category_dots.append(category_dots) percent_line = f'{percent_label}{"".join(all_category_dots)}' all_lines.append(percent_line) chart_percent -= PERCENT_DENOMINATION #create dotted lines border = ' '*4 + '-'*len(categories)*3 + '-' all_lines.append(border) # create category label lines for letter_index in range(get_max_title_length(categories)): #range sets a number limit all_categories_letter_in_this_index : list[str] = [] for category in categories: category_title_letter = category.title[letter_index] if letter_index < len(category.title) else ' ' #letter index and length of category title refers to the same category e.g. food letter_block = category_title_letter + ' '*2 all_categories_letter_in_this_index.append(letter_block) line = ' ' * (y_label_size + 1) + "".join(all_categories_letter_in_this_index) all_lines.append(line) return END_OF_LINE.join(all_lines) def get_max_title_length(categories: list[Category]) -> int: max_length = 0; for category in categories: current_length = len(category.title) if current_length > max_length: max_length = current_length return max_length #test # clothing = Category("Clothing") # clothing.deposit(232, 'Adidas Ultraboost') # clothing.deposit(30, 'Couple T-shirt') # clothing.withdraw(40, 'shopping') # clothing.withdraw(50, 'birthday present for sister') # gaming = Category('Gaming') # gaming.deposit(300, 'Maplestory Credits') # gaming.withdraw(500, 'brawlstars') # food = Category("Food") # title_bar = food.title_bar() # food.deposit(10, 'fried McNuggets') # food.deposit(62, 'Chicken beehooon') # food.withdraw(60, 'Chicken McNuggets Meal Upsize') # my_categories = [clothing, gaming, food] # print ('part a answer:' '\n') # print(food, '\n') # print(create_spend_chart([food, clothing, gaming]))
max_percent = 100 percent_denomination = 10 class Category: width_of_ledger = 30 def __init__(self, title: str) -> None: self.title = title self.currentAmount: float = 0 self.ledger: list = [] def deposit(self, amount: float, description=''): self.ledger.append({'amount': amount, 'description': description}) self.currentAmount += amount def withdraw(self, amount: float, description=''): if self.check_funds(amount): self.ledger.append({'amount': -amount, 'description': description}) self.currentAmount -= amount return True return False def get_balance(self): return self.currentAmount def transfer(self, amount: float, another_category): if self.withdraw(amount, f'Transfer to {another_category.title}'): another_category.deposit(amount, f'Transfer from {self.title}') return True return False def check_funds(self, amount): return amount <= self.currentAmount def __str__(self) -> str: return f'{self.title_bar()}\n{self.items_in_ledger()}\n{self.total_amount()}' def title_bar(self): if len(self.title) % 2 == 0: return '*' * self.number_of_stars() + self.title + '*' * self.number_of_stars() else: return '*' * self.number_of_stars() + self.title + '*' * (self.number_of_stars() + 1) def number_of_stars(self) -> int: return (30 - len(self.title)) // 2 def items_in_ledger(self): lines_of_ledger = [] for item in self.ledger: description = item['description'][:23] amount = '%.2f' % item['amount'] whitespaces = ' ' * (Category.width_of_ledger - len(description) - len(amount)) lines_of_ledger.append(f'{description}{whitespaces}{amount}') return '\n'.join(lines_of_ledger) def total_amount(self): formatted_amount = '%.2f' % self.currentAmount return f'Total: {formatted_amount}' def format_percent(percent: int) -> str: whitespace = ' ' * (len('100') - len(str(percent))) return whitespace def calculate_total_balance(category: list[Category]) -> float: total_balance = 0 for each_category in category: withdrawal = get_total_withdrawal(each_category) total_balance += withdrawal return total_balance def get_total_withdrawal(category: Category) -> float: withdrawal_total = 0 for item in category.ledger: if item['amount'] < 0: withdrawal_total += -item['amount'] return withdrawal_total def create_dots(category: list[Category], total_balance: float, chart_percent: int) -> str: category_balance = get_total_withdrawal(category) if total_balance == 0: category_percent = 0 else: category_percent = category_balance / total_balance * 100 if category_percent >= chart_percent: return 'o ' else: return ' ' def create_spend_chart(categories: list[Category]): header = 'Percentage spent by category' end_of_line = '\n' y_label_size = len('100|') chart_percent = MAX_PERCENT total_balance = calculate_total_balance(categories) size_of_categories = len(categories) all_lines = [HEADER] for number in range(11): percent_label = f'{format_percent(chart_percent)}{chart_percent}| ' all_category_dots = [] for category in categories: category_dots = create_dots(category, total_balance, chart_percent) all_category_dots.append(category_dots) percent_line = f"{percent_label}{''.join(all_category_dots)}" all_lines.append(percent_line) chart_percent -= PERCENT_DENOMINATION border = ' ' * 4 + '-' * len(categories) * 3 + '-' all_lines.append(border) for letter_index in range(get_max_title_length(categories)): all_categories_letter_in_this_index: list[str] = [] for category in categories: category_title_letter = category.title[letter_index] if letter_index < len(category.title) else ' ' letter_block = category_title_letter + ' ' * 2 all_categories_letter_in_this_index.append(letter_block) line = ' ' * (y_label_size + 1) + ''.join(all_categories_letter_in_this_index) all_lines.append(line) return END_OF_LINE.join(all_lines) def get_max_title_length(categories: list[Category]) -> int: max_length = 0 for category in categories: current_length = len(category.title) if current_length > max_length: max_length = current_length return max_length
def y_test(message_list): if message_list is None: raise StopIteration else: for message in message_list: yield message[0], message[1], message[2] message_list = [[1,2,3]] a = 1
def y_test(message_list): if message_list is None: raise StopIteration else: for message in message_list: yield (message[0], message[1], message[2]) message_list = [[1, 2, 3]] a = 1
# Test global pointers to data and code test_data = { "desc": "Global pointers to data and code", "modules": [["mod_global_ptrs1.c"]], "required": ["Running test 'mod_global_ptrs1'"] }
test_data = {'desc': 'Global pointers to data and code', 'modules': [['mod_global_ptrs1.c']], 'required': ["Running test 'mod_global_ptrs1'"]}
# Problem Statement: # Given N, find the number of ways to express N as a sum of 1,3 and 4 # # Example: # - N = 4 # - Number of ways = 4 # - Explanation: There are 4 ways we can express N, {4}, {1,3}, {3,1}, {1,1,1,1} # # Algorithm: # Divide and Conquer method comes handy for solving this problem # This can be solved by dividing into sub-problems using recursion # and finally summing the solutions for sub-problems together to get the final solution # # def numberFactor(n): if n in [0,1,2]: return 1 elif n == 3: return 2 else: sub1 = numberFactor(n-1) sub2 = numberFactor(n-3) sub3 = numberFactor(n-4) return sub1+sub2+sub3
def number_factor(n): if n in [0, 1, 2]: return 1 elif n == 3: return 2 else: sub1 = number_factor(n - 1) sub2 = number_factor(n - 3) sub3 = number_factor(n - 4) return sub1 + sub2 + sub3
class Util(): def __init__(self,item): self.item=item def getUtil(self): return self.item u=Util("Ram") print(u.getUtil())
class Util: def __init__(self, item): self.item = item def get_util(self): return self.item u = util('Ram') print(u.getUtil())
# # PySNMP MIB module ZHONE-FS-ALARM (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZHONE-FS-ALARM # Produced by pysmi-0.3.4 at Wed May 1 15:47:32 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") ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint, ValueSizeConstraint, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsUnion") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") TimeTicks, Integer32, iso, Counter32, NotificationType, MibIdentifier, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Gauge32, Unsigned32, IpAddress, ModuleIdentity, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Integer32", "iso", "Counter32", "NotificationType", "MibIdentifier", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Gauge32", "Unsigned32", "IpAddress", "ModuleIdentity", "Counter64") TextualConvention, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TruthValue", "DisplayString") zhoneTrapsSequenceNumber, zhoneTrapVersion, zhoneTrapsSeverity = mibBuilder.importSymbols("ZHONE-SYSTEM-MIB", "zhoneTrapsSequenceNumber", "zhoneTrapVersion", "zhoneTrapsSeverity") zhoneZmsProduct, = mibBuilder.importSymbols("Zhone", "zhoneZmsProduct") faultServiceAlarm = ModuleIdentity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1)) faultServiceAlarm.setRevisions(('2013-04-21 16:29', '2009-04-29 13:47', '2001-07-27 16:55',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: faultServiceAlarm.setRevisionsDescriptions(('Correct binding order in alarmReceived and alarmCleared', 'Add bindings to notifications.', '01.00.00 - Initial version',)) if mibBuilder.loadTexts: faultServiceAlarm.setLastUpdated('201304211711Z') if mibBuilder.loadTexts: faultServiceAlarm.setOrganization('Zhone Technologies, Inc.') if mibBuilder.loadTexts: faultServiceAlarm.setContactInfo(' Postal: Zhone Technologies, Inc. @ Zhone Way 7001 Oakport Street Oakland, CA 94621 USA Toll-Free: +1 877-ZHONE20 (+1 877-946-6320) Tel: +1-510-777-7000 Fax: +1-510-777-7001 E-mail: support@zhone.com') if mibBuilder.loadTexts: faultServiceAlarm.setDescription('MIB module to define a trap, that will be used to forward alarms generated Fault Service.') faultServiceDefinitions = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1)) if mibBuilder.loadTexts: faultServiceDefinitions.setStatus('current') if mibBuilder.loadTexts: faultServiceDefinitions.setDescription('Variable bindings contained in a Fault Service trap are defined here.') alarmName = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 45))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmName.setStatus('current') if mibBuilder.loadTexts: alarmName.setDescription('Alarm name.') alarmDescription = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmDescription.setStatus('current') if mibBuilder.loadTexts: alarmDescription.setDescription('Alarm description.') alarmType = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmType.setStatus('current') if mibBuilder.loadTexts: alarmType.setDescription('Entity type on which the alarm was generated.') alarmSeverity = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("critical", 1), ("major", 2), ("minor", 3), ("warning", 4), ("informational", 5)))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmSeverity.setStatus('current') if mibBuilder.loadTexts: alarmSeverity.setDescription('Severity of alarm.') alarmTimestamp = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 5), OctetString()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmTimestamp.setStatus('current') if mibBuilder.loadTexts: alarmTimestamp.setDescription('Date and Time when the alarm was received or cleared.') alarmDevice = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 6), IpAddress()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmDevice.setStatus('current') if mibBuilder.loadTexts: alarmDevice.setDescription('IP address of the device on which alarm was generated.') alarmShelf = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 32768))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmShelf.setStatus('current') if mibBuilder.loadTexts: alarmShelf.setDescription('Shelf number on which the alarm was generated.') alarmSlot = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 30))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmSlot.setStatus('current') if mibBuilder.loadTexts: alarmSlot.setDescription('Slot number on which the alarm was generated.') alarmPort = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 9), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmPort.setStatus('current') if mibBuilder.loadTexts: alarmPort.setDescription('Port number on which the alarm was generated.') alarmSubPort = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 10), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmSubPort.setStatus('current') if mibBuilder.loadTexts: alarmSubPort.setDescription('SubPort number on which the alarm was generated.') alarmDeviceName = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 255))).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmDeviceName.setStatus('current') if mibBuilder.loadTexts: alarmDeviceName.setDescription('Device name on which the alarm was generated.') alarmCpeInternal = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 12), TruthValue()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmCpeInternal.setStatus('current') if mibBuilder.loadTexts: alarmCpeInternal.setDescription('For alarms on CPEs. True if alarm was reported by the CPE itself in response to a physical condition on the CPE or on one of its ports.') alarmCpePortType = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 13), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmCpePortType.setStatus('current') if mibBuilder.loadTexts: alarmCpePortType.setDescription('For alarms on CPE ports. This is the type of port for which the alarm is being reported. For OMCI ONTs, the is the ME id.') alarmCpePortId = MibScalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 14), Integer32()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: alarmCpePortId.setStatus('current') if mibBuilder.loadTexts: alarmCpePortId.setDescription('For alarms on CPE ports. This is the identifier of the CPE port for which the alarm is being generated.') faultServiceTraps = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 2)) if mibBuilder.loadTexts: faultServiceTraps.setStatus('current') if mibBuilder.loadTexts: faultServiceTraps.setDescription('Traps that will be generated by Fault Service are defined here.') faultServiceV2Traps = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 2, 0)) if mibBuilder.loadTexts: faultServiceV2Traps.setStatus('current') if mibBuilder.loadTexts: faultServiceV2Traps.setDescription('Definition for specification of v2 traps.') alarmReceived = NotificationType((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 2, 0, 1)).setObjects(("ZHONE-SYSTEM-MIB", "zhoneTrapVersion"), ("ZHONE-SYSTEM-MIB", "zhoneTrapsSequenceNumber"), ("ZHONE-SYSTEM-MIB", "zhoneTrapsSeverity"), ("ZHONE-FS-ALARM", "alarmName"), ("ZHONE-FS-ALARM", "alarmDescription"), ("ZHONE-FS-ALARM", "alarmType"), ("ZHONE-FS-ALARM", "alarmSeverity"), ("ZHONE-FS-ALARM", "alarmTimestamp"), ("ZHONE-FS-ALARM", "alarmDevice"), ("ZHONE-FS-ALARM", "alarmShelf"), ("ZHONE-FS-ALARM", "alarmSlot"), ("ZHONE-FS-ALARM", "alarmPort"), ("ZHONE-FS-ALARM", "alarmSubPort"), ("ZHONE-FS-ALARM", "alarmDeviceName"), ("ZHONE-FS-ALARM", "alarmCpeInternal"), ("ZHONE-FS-ALARM", "alarmCpePortType"), ("ZHONE-FS-ALARM", "alarmCpePortId")) if mibBuilder.loadTexts: alarmReceived.setStatus('current') if mibBuilder.loadTexts: alarmReceived.setDescription('Alarm received definition') alarmCleared = NotificationType((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 2, 0, 2)).setObjects(("ZHONE-SYSTEM-MIB", "zhoneTrapVersion"), ("ZHONE-SYSTEM-MIB", "zhoneTrapsSequenceNumber"), ("ZHONE-SYSTEM-MIB", "zhoneTrapsSeverity"), ("ZHONE-FS-ALARM", "alarmName"), ("ZHONE-FS-ALARM", "alarmDescription"), ("ZHONE-FS-ALARM", "alarmType"), ("ZHONE-FS-ALARM", "alarmSeverity"), ("ZHONE-FS-ALARM", "alarmTimestamp"), ("ZHONE-FS-ALARM", "alarmDevice"), ("ZHONE-FS-ALARM", "alarmShelf"), ("ZHONE-FS-ALARM", "alarmSlot"), ("ZHONE-FS-ALARM", "alarmPort"), ("ZHONE-FS-ALARM", "alarmSubPort"), ("ZHONE-FS-ALARM", "alarmDeviceName"), ("ZHONE-FS-ALARM", "alarmCpeInternal"), ("ZHONE-FS-ALARM", "alarmCpePortType"), ("ZHONE-FS-ALARM", "alarmCpePortId")) if mibBuilder.loadTexts: alarmCleared.setStatus('current') if mibBuilder.loadTexts: alarmCleared.setDescription('Alarm clearing trap.') faultServiceCompliances = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 3)) if mibBuilder.loadTexts: faultServiceCompliances.setStatus('current') if mibBuilder.loadTexts: faultServiceCompliances.setDescription('Group definition for V2 compliance.') faultServiceGroups = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 3, 1)) if mibBuilder.loadTexts: faultServiceGroups.setStatus('current') if mibBuilder.loadTexts: faultServiceGroups.setDescription('Group specifications for fault service.') faultServiceAlarmGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 3, 1, 1)).setObjects(("ZHONE-FS-ALARM", "alarmName"), ("ZHONE-FS-ALARM", "alarmDescription"), ("ZHONE-FS-ALARM", "alarmType"), ("ZHONE-FS-ALARM", "alarmSeverity"), ("ZHONE-FS-ALARM", "alarmTimestamp"), ("ZHONE-FS-ALARM", "alarmDevice"), ("ZHONE-FS-ALARM", "alarmShelf"), ("ZHONE-FS-ALARM", "alarmSlot"), ("ZHONE-FS-ALARM", "alarmPort"), ("ZHONE-FS-ALARM", "alarmSubPort"), ("ZHONE-FS-ALARM", "alarmDeviceName"), ("ZHONE-FS-ALARM", "alarmCpeInternal"), ("ZHONE-FS-ALARM", "alarmCpePortType"), ("ZHONE-FS-ALARM", "alarmCpePortId")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): faultServiceAlarmGroup = faultServiceAlarmGroup.setStatus('current') if mibBuilder.loadTexts: faultServiceAlarmGroup.setDescription('Fault Service Group.') faultServiceTrapGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 3, 1, 2)).setObjects(("ZHONE-FS-ALARM", "alarmReceived"), ("ZHONE-FS-ALARM", "alarmCleared")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): faultServiceTrapGroup = faultServiceTrapGroup.setStatus('current') if mibBuilder.loadTexts: faultServiceTrapGroup.setDescription('Description.') faultServiceImports = ObjectIdentity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 4)) if mibBuilder.loadTexts: faultServiceImports.setStatus('current') if mibBuilder.loadTexts: faultServiceImports.setDescription('Objects imported from other mibs to serve as bindings in the ZMS traps') mibBuilder.exportSymbols("ZHONE-FS-ALARM", PYSNMP_MODULE_ID=faultServiceAlarm, faultServiceTrapGroup=faultServiceTrapGroup, faultServiceGroups=faultServiceGroups, alarmDeviceName=alarmDeviceName, alarmSlot=alarmSlot, faultServiceCompliances=faultServiceCompliances, faultServiceTraps=faultServiceTraps, alarmDescription=alarmDescription, alarmType=alarmType, alarmSubPort=alarmSubPort, faultServiceAlarm=faultServiceAlarm, alarmCpeInternal=alarmCpeInternal, alarmReceived=alarmReceived, alarmPort=alarmPort, alarmCpePortType=alarmCpePortType, alarmCleared=alarmCleared, faultServiceAlarmGroup=faultServiceAlarmGroup, faultServiceDefinitions=faultServiceDefinitions, alarmName=alarmName, alarmShelf=alarmShelf, alarmTimestamp=alarmTimestamp, alarmSeverity=alarmSeverity, faultServiceV2Traps=faultServiceV2Traps, faultServiceImports=faultServiceImports, alarmCpePortId=alarmCpePortId, alarmDevice=alarmDevice)
(integer, octet_string, object_identifier) = mibBuilder.importSymbols('ASN1', 'Integer', 'OctetString', 'ObjectIdentifier') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, constraints_intersection, single_value_constraint, value_size_constraint, constraints_union) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsIntersection', 'SingleValueConstraint', 'ValueSizeConstraint', 'ConstraintsUnion') (object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup') (time_ticks, integer32, iso, counter32, notification_type, mib_identifier, bits, mib_scalar, mib_table, mib_table_row, mib_table_column, object_identity, gauge32, unsigned32, ip_address, module_identity, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'Integer32', 'iso', 'Counter32', 'NotificationType', 'MibIdentifier', 'Bits', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'ObjectIdentity', 'Gauge32', 'Unsigned32', 'IpAddress', 'ModuleIdentity', 'Counter64') (textual_convention, truth_value, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'TruthValue', 'DisplayString') (zhone_traps_sequence_number, zhone_trap_version, zhone_traps_severity) = mibBuilder.importSymbols('ZHONE-SYSTEM-MIB', 'zhoneTrapsSequenceNumber', 'zhoneTrapVersion', 'zhoneTrapsSeverity') (zhone_zms_product,) = mibBuilder.importSymbols('Zhone', 'zhoneZmsProduct') fault_service_alarm = module_identity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1)) faultServiceAlarm.setRevisions(('2013-04-21 16:29', '2009-04-29 13:47', '2001-07-27 16:55')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: faultServiceAlarm.setRevisionsDescriptions(('Correct binding order in alarmReceived and alarmCleared', 'Add bindings to notifications.', '01.00.00 - Initial version')) if mibBuilder.loadTexts: faultServiceAlarm.setLastUpdated('201304211711Z') if mibBuilder.loadTexts: faultServiceAlarm.setOrganization('Zhone Technologies, Inc.') if mibBuilder.loadTexts: faultServiceAlarm.setContactInfo(' Postal: Zhone Technologies, Inc. @ Zhone Way 7001 Oakport Street Oakland, CA 94621 USA Toll-Free: +1 877-ZHONE20 (+1 877-946-6320) Tel: +1-510-777-7000 Fax: +1-510-777-7001 E-mail: support@zhone.com') if mibBuilder.loadTexts: faultServiceAlarm.setDescription('MIB module to define a trap, that will be used to forward alarms generated Fault Service.') fault_service_definitions = object_identity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1)) if mibBuilder.loadTexts: faultServiceDefinitions.setStatus('current') if mibBuilder.loadTexts: faultServiceDefinitions.setDescription('Variable bindings contained in a Fault Service trap are defined here.') alarm_name = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(1, 45))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmName.setStatus('current') if mibBuilder.loadTexts: alarmName.setDescription('Alarm name.') alarm_description = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmDescription.setStatus('current') if mibBuilder.loadTexts: alarmDescription.setDescription('Alarm description.') alarm_type = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmType.setStatus('current') if mibBuilder.loadTexts: alarmType.setDescription('Entity type on which the alarm was generated.') alarm_severity = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('critical', 1), ('major', 2), ('minor', 3), ('warning', 4), ('informational', 5)))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmSeverity.setStatus('current') if mibBuilder.loadTexts: alarmSeverity.setDescription('Severity of alarm.') alarm_timestamp = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 5), octet_string()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmTimestamp.setStatus('current') if mibBuilder.loadTexts: alarmTimestamp.setDescription('Date and Time when the alarm was received or cleared.') alarm_device = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 6), ip_address()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmDevice.setStatus('current') if mibBuilder.loadTexts: alarmDevice.setDescription('IP address of the device on which alarm was generated.') alarm_shelf = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 7), integer32().subtype(subtypeSpec=value_range_constraint(1, 32768))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmShelf.setStatus('current') if mibBuilder.loadTexts: alarmShelf.setDescription('Shelf number on which the alarm was generated.') alarm_slot = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 8), integer32().subtype(subtypeSpec=value_range_constraint(1, 30))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmSlot.setStatus('current') if mibBuilder.loadTexts: alarmSlot.setDescription('Slot number on which the alarm was generated.') alarm_port = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 9), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmPort.setStatus('current') if mibBuilder.loadTexts: alarmPort.setDescription('Port number on which the alarm was generated.') alarm_sub_port = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 10), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmSubPort.setStatus('current') if mibBuilder.loadTexts: alarmSubPort.setDescription('SubPort number on which the alarm was generated.') alarm_device_name = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 11), octet_string().subtype(subtypeSpec=value_size_constraint(0, 255))).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmDeviceName.setStatus('current') if mibBuilder.loadTexts: alarmDeviceName.setDescription('Device name on which the alarm was generated.') alarm_cpe_internal = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 12), truth_value()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmCpeInternal.setStatus('current') if mibBuilder.loadTexts: alarmCpeInternal.setDescription('For alarms on CPEs. True if alarm was reported by the CPE itself in response to a physical condition on the CPE or on one of its ports.') alarm_cpe_port_type = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 13), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmCpePortType.setStatus('current') if mibBuilder.loadTexts: alarmCpePortType.setDescription('For alarms on CPE ports. This is the type of port for which the alarm is being reported. For OMCI ONTs, the is the ME id.') alarm_cpe_port_id = mib_scalar((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 1, 14), integer32()).setMaxAccess('accessiblefornotify') if mibBuilder.loadTexts: alarmCpePortId.setStatus('current') if mibBuilder.loadTexts: alarmCpePortId.setDescription('For alarms on CPE ports. This is the identifier of the CPE port for which the alarm is being generated.') fault_service_traps = object_identity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 2)) if mibBuilder.loadTexts: faultServiceTraps.setStatus('current') if mibBuilder.loadTexts: faultServiceTraps.setDescription('Traps that will be generated by Fault Service are defined here.') fault_service_v2_traps = object_identity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 2, 0)) if mibBuilder.loadTexts: faultServiceV2Traps.setStatus('current') if mibBuilder.loadTexts: faultServiceV2Traps.setDescription('Definition for specification of v2 traps.') alarm_received = notification_type((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 2, 0, 1)).setObjects(('ZHONE-SYSTEM-MIB', 'zhoneTrapVersion'), ('ZHONE-SYSTEM-MIB', 'zhoneTrapsSequenceNumber'), ('ZHONE-SYSTEM-MIB', 'zhoneTrapsSeverity'), ('ZHONE-FS-ALARM', 'alarmName'), ('ZHONE-FS-ALARM', 'alarmDescription'), ('ZHONE-FS-ALARM', 'alarmType'), ('ZHONE-FS-ALARM', 'alarmSeverity'), ('ZHONE-FS-ALARM', 'alarmTimestamp'), ('ZHONE-FS-ALARM', 'alarmDevice'), ('ZHONE-FS-ALARM', 'alarmShelf'), ('ZHONE-FS-ALARM', 'alarmSlot'), ('ZHONE-FS-ALARM', 'alarmPort'), ('ZHONE-FS-ALARM', 'alarmSubPort'), ('ZHONE-FS-ALARM', 'alarmDeviceName'), ('ZHONE-FS-ALARM', 'alarmCpeInternal'), ('ZHONE-FS-ALARM', 'alarmCpePortType'), ('ZHONE-FS-ALARM', 'alarmCpePortId')) if mibBuilder.loadTexts: alarmReceived.setStatus('current') if mibBuilder.loadTexts: alarmReceived.setDescription('Alarm received definition') alarm_cleared = notification_type((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 2, 0, 2)).setObjects(('ZHONE-SYSTEM-MIB', 'zhoneTrapVersion'), ('ZHONE-SYSTEM-MIB', 'zhoneTrapsSequenceNumber'), ('ZHONE-SYSTEM-MIB', 'zhoneTrapsSeverity'), ('ZHONE-FS-ALARM', 'alarmName'), ('ZHONE-FS-ALARM', 'alarmDescription'), ('ZHONE-FS-ALARM', 'alarmType'), ('ZHONE-FS-ALARM', 'alarmSeverity'), ('ZHONE-FS-ALARM', 'alarmTimestamp'), ('ZHONE-FS-ALARM', 'alarmDevice'), ('ZHONE-FS-ALARM', 'alarmShelf'), ('ZHONE-FS-ALARM', 'alarmSlot'), ('ZHONE-FS-ALARM', 'alarmPort'), ('ZHONE-FS-ALARM', 'alarmSubPort'), ('ZHONE-FS-ALARM', 'alarmDeviceName'), ('ZHONE-FS-ALARM', 'alarmCpeInternal'), ('ZHONE-FS-ALARM', 'alarmCpePortType'), ('ZHONE-FS-ALARM', 'alarmCpePortId')) if mibBuilder.loadTexts: alarmCleared.setStatus('current') if mibBuilder.loadTexts: alarmCleared.setDescription('Alarm clearing trap.') fault_service_compliances = object_identity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 3)) if mibBuilder.loadTexts: faultServiceCompliances.setStatus('current') if mibBuilder.loadTexts: faultServiceCompliances.setDescription('Group definition for V2 compliance.') fault_service_groups = object_identity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 3, 1)) if mibBuilder.loadTexts: faultServiceGroups.setStatus('current') if mibBuilder.loadTexts: faultServiceGroups.setDescription('Group specifications for fault service.') fault_service_alarm_group = object_group((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 3, 1, 1)).setObjects(('ZHONE-FS-ALARM', 'alarmName'), ('ZHONE-FS-ALARM', 'alarmDescription'), ('ZHONE-FS-ALARM', 'alarmType'), ('ZHONE-FS-ALARM', 'alarmSeverity'), ('ZHONE-FS-ALARM', 'alarmTimestamp'), ('ZHONE-FS-ALARM', 'alarmDevice'), ('ZHONE-FS-ALARM', 'alarmShelf'), ('ZHONE-FS-ALARM', 'alarmSlot'), ('ZHONE-FS-ALARM', 'alarmPort'), ('ZHONE-FS-ALARM', 'alarmSubPort'), ('ZHONE-FS-ALARM', 'alarmDeviceName'), ('ZHONE-FS-ALARM', 'alarmCpeInternal'), ('ZHONE-FS-ALARM', 'alarmCpePortType'), ('ZHONE-FS-ALARM', 'alarmCpePortId')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): fault_service_alarm_group = faultServiceAlarmGroup.setStatus('current') if mibBuilder.loadTexts: faultServiceAlarmGroup.setDescription('Fault Service Group.') fault_service_trap_group = notification_group((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 3, 1, 2)).setObjects(('ZHONE-FS-ALARM', 'alarmReceived'), ('ZHONE-FS-ALARM', 'alarmCleared')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): fault_service_trap_group = faultServiceTrapGroup.setStatus('current') if mibBuilder.loadTexts: faultServiceTrapGroup.setDescription('Description.') fault_service_imports = object_identity((1, 3, 6, 1, 4, 1, 5504, 2, 7, 1, 4)) if mibBuilder.loadTexts: faultServiceImports.setStatus('current') if mibBuilder.loadTexts: faultServiceImports.setDescription('Objects imported from other mibs to serve as bindings in the ZMS traps') mibBuilder.exportSymbols('ZHONE-FS-ALARM', PYSNMP_MODULE_ID=faultServiceAlarm, faultServiceTrapGroup=faultServiceTrapGroup, faultServiceGroups=faultServiceGroups, alarmDeviceName=alarmDeviceName, alarmSlot=alarmSlot, faultServiceCompliances=faultServiceCompliances, faultServiceTraps=faultServiceTraps, alarmDescription=alarmDescription, alarmType=alarmType, alarmSubPort=alarmSubPort, faultServiceAlarm=faultServiceAlarm, alarmCpeInternal=alarmCpeInternal, alarmReceived=alarmReceived, alarmPort=alarmPort, alarmCpePortType=alarmCpePortType, alarmCleared=alarmCleared, faultServiceAlarmGroup=faultServiceAlarmGroup, faultServiceDefinitions=faultServiceDefinitions, alarmName=alarmName, alarmShelf=alarmShelf, alarmTimestamp=alarmTimestamp, alarmSeverity=alarmSeverity, faultServiceV2Traps=faultServiceV2Traps, faultServiceImports=faultServiceImports, alarmCpePortId=alarmCpePortId, alarmDevice=alarmDevice)
# -*- coding: utf-8 -*- # This file is part of the Ingram Micro Cloud Blue Connect connect-cli. # Copyright (c) 2019-2022 Ingram Micro. All Rights Reserved. PARAM_TYPES = [ 'email', 'address', 'checkbox', 'choice', 'domain', 'subdomain', 'url', 'dropdown', 'object', 'password', 'phone', 'text', ] PRECISIONS = ('integer', 'decimal(1)', 'decimal(2)', 'decimal(4)', 'decimal(8)') COMMITMENT = ('-', '1 year', '2 years', '3 years', '4 years', '5 years') BILLING_PERIOD = ( 'onetime', 'monthly', 'yearly', '2 years', '3 years', '4 years', '5 years', ) CAPABILITIES = ( 'Pay-as-you-go support and schema', 'Pay-as-you-go dynamic items support', 'Pay-as-you-go future charges support', 'Consumption reporting for Reservation Items', 'Dynamic Validation of the Draft Requests', 'Dynamic Validation of the Inquiring Form', 'Reseller Authorization Level', 'Tier Accounts Sync', 'Administrative Hold', )
param_types = ['email', 'address', 'checkbox', 'choice', 'domain', 'subdomain', 'url', 'dropdown', 'object', 'password', 'phone', 'text'] precisions = ('integer', 'decimal(1)', 'decimal(2)', 'decimal(4)', 'decimal(8)') commitment = ('-', '1 year', '2 years', '3 years', '4 years', '5 years') billing_period = ('onetime', 'monthly', 'yearly', '2 years', '3 years', '4 years', '5 years') capabilities = ('Pay-as-you-go support and schema', 'Pay-as-you-go dynamic items support', 'Pay-as-you-go future charges support', 'Consumption reporting for Reservation Items', 'Dynamic Validation of the Draft Requests', 'Dynamic Validation of the Inquiring Form', 'Reseller Authorization Level', 'Tier Accounts Sync', 'Administrative Hold')
# find the biggest gap, AB or BC pos = [int(x) for x in input().split()] AB = pos[1]-pos[0] BC = pos[2]-pos[1] if AB-BC < 0: #BC greatest print(BC-1) else: # AB or equal print(AB-1)
pos = [int(x) for x in input().split()] ab = pos[1] - pos[0] bc = pos[2] - pos[1] if AB - BC < 0: print(BC - 1) else: print(AB - 1)
if __name__ == '__main__': N =int(input()) l = [] for i in range(0,N): t = input().split() if t[0]=="insert" : l.insert(int(t[1]),int(t[2])) elif t[0]=="print": print (l) elif t[0]=="remove" : l.remove(int(t[1])) elif t[0]=="append" : l.append(int(t[1])) elif t[0]=="sort" : l.sort() elif t[0]=="pop" : l.pop() elif t[0]=="reverse" : l.reverse()
if __name__ == '__main__': n = int(input()) l = [] for i in range(0, N): t = input().split() if t[0] == 'insert': l.insert(int(t[1]), int(t[2])) elif t[0] == 'print': print(l) elif t[0] == 'remove': l.remove(int(t[1])) elif t[0] == 'append': l.append(int(t[1])) elif t[0] == 'sort': l.sort() elif t[0] == 'pop': l.pop() elif t[0] == 'reverse': l.reverse()
def r_a(a, b): return a def r_b(a, b): return b def r_str(): return '' def r_object(): return object() class A: def r_A(self): return type(self)()
def r_a(a, b): return a def r_b(a, b): return b def r_str(): return '' def r_object(): return object() class A: def r_a(self): return type(self)()
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend" EMAIL_HOST = "" EMAIL_HOST_USER = "" KEY = "" EMAIL_PORT = 587 EMAIL_USE_TLS = True DEFAULT_FROM_EMAIL = "" # This should be in the format [('A User','user@example.com'), ('B User', 'person@example.com')] REGISTRATION_ADMINS = []
email_backend = 'django.core.mail.backends.smtp.EmailBackend' email_host = '' email_host_user = '' key = '' email_port = 587 email_use_tls = True default_from_email = '' registration_admins = []
def pick_peaks(arr): prev_dex = prev_val = None result = {'pos': [], 'peaks': []} upwards = False for i, a in enumerate(arr): if prev_val == a: continue elif prev_val is None or prev_val < a: upwards = True else: if prev_dex and upwards: result['pos'].append(prev_dex) result['peaks'].append(prev_val) upwards = False prev_dex = i prev_val = a return result
def pick_peaks(arr): prev_dex = prev_val = None result = {'pos': [], 'peaks': []} upwards = False for (i, a) in enumerate(arr): if prev_val == a: continue elif prev_val is None or prev_val < a: upwards = True else: if prev_dex and upwards: result['pos'].append(prev_dex) result['peaks'].append(prev_val) upwards = False prev_dex = i prev_val = a return result
def displayBanner(): banner = open('./banner/banner.txt', 'r', encoding = 'utf8') print(banner.read()) def choice(): while True: choice = int(input(">")) if choice == 0: break elif choice == 1: exit() else: print("Retry")
def display_banner(): banner = open('./banner/banner.txt', 'r', encoding='utf8') print(banner.read()) def choice(): while True: choice = int(input('>')) if choice == 0: break elif choice == 1: exit() else: print('Retry')
print("hello") a=9 b=10 print(a+b)
print('hello') a = 9 b = 10 print(a + b)
class A(): def __init__(self): pass def f(self): return "A" class B(A): def __init__(self): pass def f(self): return "B" def g(self): return "B" class C(B): def __init__(self): pass def g(self): return "C" class D(C): def __init__(self): pass d = D() print(d.f()) print(d.g())
class A: def __init__(self): pass def f(self): return 'A' class B(A): def __init__(self): pass def f(self): return 'B' def g(self): return 'B' class C(B): def __init__(self): pass def g(self): return 'C' class D(C): def __init__(self): pass d = d() print(d.f()) print(d.g())
registry = { "twicer_service": { "grpc": 7003, }, "halfer_service": { "grpc": 7004, }, "incrementer_service": { "grpc": 7005, }, "registry_service": { "grpc": 7006, }, "compo_service": { "grpc": 7007, }, }
registry = {'twicer_service': {'grpc': 7003}, 'halfer_service': {'grpc': 7004}, 'incrementer_service': {'grpc': 7005}, 'registry_service': {'grpc': 7006}, 'compo_service': {'grpc': 7007}}
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. def CheckChangeOnUpload(input_api, output_api): return _CommonChecks(input_api, output_api) def CheckChangeOnCommit(input_api, output_api): return _CommonChecks(input_api, output_api) def _CommonChecks(input_api, output_api): results = [] results += input_api.RunTests(input_api.canned_checks.GetPylint( input_api, output_api, extra_paths_list=_GetPathsToPrepend(input_api), pylintrc='pylintrc', version='2.7')) return results def _GetPathsToPrepend(input_api): project_dir = input_api.PresubmitLocalPath() catapult_dir = input_api.os_path.join(project_dir, '..') return [ project_dir, input_api.os_path.join(catapult_dir, 'common', 'py_trace_event'), input_api.os_path.join(catapult_dir, 'common', 'py_utils'), input_api.os_path.join(catapult_dir, 'devil'), input_api.os_path.join(catapult_dir, 'telemetry'), input_api.os_path.join(catapult_dir, 'third_party', 'mock'), input_api.os_path.join(catapult_dir, 'tracing'), ]
def check_change_on_upload(input_api, output_api): return __common_checks(input_api, output_api) def check_change_on_commit(input_api, output_api): return __common_checks(input_api, output_api) def __common_checks(input_api, output_api): results = [] results += input_api.RunTests(input_api.canned_checks.GetPylint(input_api, output_api, extra_paths_list=__get_paths_to_prepend(input_api), pylintrc='pylintrc', version='2.7')) return results def __get_paths_to_prepend(input_api): project_dir = input_api.PresubmitLocalPath() catapult_dir = input_api.os_path.join(project_dir, '..') return [project_dir, input_api.os_path.join(catapult_dir, 'common', 'py_trace_event'), input_api.os_path.join(catapult_dir, 'common', 'py_utils'), input_api.os_path.join(catapult_dir, 'devil'), input_api.os_path.join(catapult_dir, 'telemetry'), input_api.os_path.join(catapult_dir, 'third_party', 'mock'), input_api.os_path.join(catapult_dir, 'tracing')]
elements = {"Ag": 106.905095, "Al": 26.981541, "Ar": 39.962383, "As": 74.921596, "Au": 196.96656, "B": 11.009305, "Ba": 137.905236, "Be": 9.012183, "Bi": 208.980388, "Br": 78.918336, "C": 12, "Ca": 39.962591, "Cd": 113.903361, "Ce": 139.905442, "Cl": 34.968853, "Co": 58.933198, "Cr": 51.94051, "Cs": 132.905433, "Cu": 62.929599, "D": 2.01355321274, "Dy": 163.929183, "e": 0.00054858, "Er": 165.930305, "Eu": 152.921243, "F": 18.998403, "Fe": 55.934939, "Ga": 68.925581, "Gd": 157.924111, "Ge": 73.921179, "H": 1.007825, "He": 4.002603, "Hf": 179.946561, "Hg": 201.970632, "Ho": 164.930332, "I": 126.904477, "In": 114.903875, "Ir": 192.962942, "K": 38.963708, "Kr": 83.911506, "La": 138.906355, "Li": 7.016005, "Lu": 174.940785, "Mg": 23.985045, "Mn": 54.938046, "Mo": 97.905405, "N": 14.003074, "Na": 22.98977, "Nb": 92.906378, "Nd": 141.907731, "Ne": 19.992439, "Ni": 57.935347, "O": 15.994915, "Os": 191.961487, "P": 30.973763, "Pb": 207.976641, "Pd": 105.903475, "Pr": 140.907657, "Pt": 194.964785, "Rb": 84.9118, "Re": 186.955765, "Rh": 102.905503, "Ru": 101.904348, "S": 31.972072, "Sb": 120.903824, "Sc": 44.955914, "Se": 79.916521, "Si": 27.976928, "Sm": 151.919741, "Sn": 119.902199, "Sr": 87.905625, "Ta": 180.948014, "Tb": 158.92535, "Te": 129.906229, "Th": 232.038054, "Ti": 47.947947, "Tl": 204.97441, "Tm": 168.934225, "U": 238.050786, "V": 50.943963, "W": 183.950953, "Xe": 131.904148, "Y": 88.905856, "Yb": 173.938873, "Zn": 63.929145, "Zr": 89.904708} class Actions(): def make_element(self, text, start, end): # print("element mass", text[start:end], elements[text[start:end]]) return elements[text[start:end]] def make_term(self, _text, _start, _end, elements): if elements[1].text == "": # print("term mass:", elements[0]) return elements[0] # print("term mass:", int(elements[1].text) * elements[0]) return int(elements[1].text) * elements[0] def make_sub_formula(self, _text, _start, _end, elements): total = 0.0 for e in elements[1]: total += e # print("sub_formula mass:", total) return total def make_ion_type(self, text, start, end, elements): total = 0.0 for component in elements[3]: plus_minus = component.elements[0].text other_part = component.elements[1] if isinstance(other_part, float): if plus_minus == "+": total += other_part else: total -= other_part else: if other_part.elements[0].text == "": multiplier = 1 else: multiplier = int(other_part.elements[0].text) if other_part.elements[1].text == "(": sub_total = other_part.elements[2] else: sub_total = 0.0 for e in other_part.elements[1]: # TODO: Deal with case of count "(" mass ")" # print("sub_total:", e) sub_total += e if plus_minus == "+": total += multiplier * sub_total else: total -= multiplier * sub_total # for e in other_part.elements: # print("subpart", e.text) mol_count = 1 if elements[1].text != "": mol_count = int(elements[1].text) return {"molecular_ion": elements[2].text, "molecular_ion_count": mol_count, "delta_formula": elements[3].text, "delta": total, "z": elements[5].text} def make_mass(self, text, start, end, elements): # print("make mass:", self, text, start, end, elements) return float(text[start:end])
elements = {'Ag': 106.905095, 'Al': 26.981541, 'Ar': 39.962383, 'As': 74.921596, 'Au': 196.96656, 'B': 11.009305, 'Ba': 137.905236, 'Be': 9.012183, 'Bi': 208.980388, 'Br': 78.918336, 'C': 12, 'Ca': 39.962591, 'Cd': 113.903361, 'Ce': 139.905442, 'Cl': 34.968853, 'Co': 58.933198, 'Cr': 51.94051, 'Cs': 132.905433, 'Cu': 62.929599, 'D': 2.01355321274, 'Dy': 163.929183, 'e': 0.00054858, 'Er': 165.930305, 'Eu': 152.921243, 'F': 18.998403, 'Fe': 55.934939, 'Ga': 68.925581, 'Gd': 157.924111, 'Ge': 73.921179, 'H': 1.007825, 'He': 4.002603, 'Hf': 179.946561, 'Hg': 201.970632, 'Ho': 164.930332, 'I': 126.904477, 'In': 114.903875, 'Ir': 192.962942, 'K': 38.963708, 'Kr': 83.911506, 'La': 138.906355, 'Li': 7.016005, 'Lu': 174.940785, 'Mg': 23.985045, 'Mn': 54.938046, 'Mo': 97.905405, 'N': 14.003074, 'Na': 22.98977, 'Nb': 92.906378, 'Nd': 141.907731, 'Ne': 19.992439, 'Ni': 57.935347, 'O': 15.994915, 'Os': 191.961487, 'P': 30.973763, 'Pb': 207.976641, 'Pd': 105.903475, 'Pr': 140.907657, 'Pt': 194.964785, 'Rb': 84.9118, 'Re': 186.955765, 'Rh': 102.905503, 'Ru': 101.904348, 'S': 31.972072, 'Sb': 120.903824, 'Sc': 44.955914, 'Se': 79.916521, 'Si': 27.976928, 'Sm': 151.919741, 'Sn': 119.902199, 'Sr': 87.905625, 'Ta': 180.948014, 'Tb': 158.92535, 'Te': 129.906229, 'Th': 232.038054, 'Ti': 47.947947, 'Tl': 204.97441, 'Tm': 168.934225, 'U': 238.050786, 'V': 50.943963, 'W': 183.950953, 'Xe': 131.904148, 'Y': 88.905856, 'Yb': 173.938873, 'Zn': 63.929145, 'Zr': 89.904708} class Actions: def make_element(self, text, start, end): return elements[text[start:end]] def make_term(self, _text, _start, _end, elements): if elements[1].text == '': return elements[0] return int(elements[1].text) * elements[0] def make_sub_formula(self, _text, _start, _end, elements): total = 0.0 for e in elements[1]: total += e return total def make_ion_type(self, text, start, end, elements): total = 0.0 for component in elements[3]: plus_minus = component.elements[0].text other_part = component.elements[1] if isinstance(other_part, float): if plus_minus == '+': total += other_part else: total -= other_part else: if other_part.elements[0].text == '': multiplier = 1 else: multiplier = int(other_part.elements[0].text) if other_part.elements[1].text == '(': sub_total = other_part.elements[2] else: sub_total = 0.0 for e in other_part.elements[1]: sub_total += e if plus_minus == '+': total += multiplier * sub_total else: total -= multiplier * sub_total mol_count = 1 if elements[1].text != '': mol_count = int(elements[1].text) return {'molecular_ion': elements[2].text, 'molecular_ion_count': mol_count, 'delta_formula': elements[3].text, 'delta': total, 'z': elements[5].text} def make_mass(self, text, start, end, elements): return float(text[start:end])