content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
# Copyright 2018, OpenCensus Authors # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class TimeSeries(object): """Time series data for a given metric and time interval. This class implements the spec for v1 TimeSeries structs as of opencensus-proto release v0.1.0. See opencensus-proto for details: https://github.com/census-instrumentation/opencensus-proto/blob/v0.1.0/src/opencensus/proto/metrics/v1/metrics.proto#L132 A TimeSeries is a collection of data points that describes the time-varying values of a metric. :type label_values: list(:class: '~opencensus.metrics.label_value.LabelValue') :param label_values: The set of label values that uniquely identify this timeseries. :type points: list(:class: '~opencensus.metrics.export.point.Point') :param points: The data points of this timeseries. :type start_timestamp: str :param start_timestamp: The time when the cumulative value was reset to zero, must be set for cumulative metrics. """ # noqa def __init__(self, label_values, points, start_timestamp): if not label_values: raise ValueError("label_values must not be null or empty") if not points: raise ValueError("points must not be null or empty") self._label_values = label_values self._points = points self._start_timestamp = start_timestamp def __repr__(self): points_repr = '[{}]'.format( ', '.join(repr(point.value) for point in self.points)) lv_repr = tuple(lv.value for lv in self.label_values) return ('{}({}, label_values={}, start_timestamp={})' .format( type(self).__name__, points_repr, lv_repr, self.start_timestamp )) @property def start_timestamp(self): return self._start_timestamp @property def label_values(self): return self._label_values @property def points(self): return self._points def check_points_type(self, type_class): """Check that each point's value is an instance of `type_class`. `type_class` should typically be a Value type, i.e. one that extends :class: `opencensus.metrics.export.value.Value`. :type type_class: type :param type_class: Type to check against. :rtype: bool :return: Whether all points are instances of `type_class`. """ for point in self.points: if (point.value is not None and not isinstance(point.value, type_class)): return False return True
class Timeseries(object): """Time series data for a given metric and time interval. This class implements the spec for v1 TimeSeries structs as of opencensus-proto release v0.1.0. See opencensus-proto for details: https://github.com/census-instrumentation/opencensus-proto/blob/v0.1.0/src/opencensus/proto/metrics/v1/metrics.proto#L132 A TimeSeries is a collection of data points that describes the time-varying values of a metric. :type label_values: list(:class: '~opencensus.metrics.label_value.LabelValue') :param label_values: The set of label values that uniquely identify this timeseries. :type points: list(:class: '~opencensus.metrics.export.point.Point') :param points: The data points of this timeseries. :type start_timestamp: str :param start_timestamp: The time when the cumulative value was reset to zero, must be set for cumulative metrics. """ def __init__(self, label_values, points, start_timestamp): if not label_values: raise value_error('label_values must not be null or empty') if not points: raise value_error('points must not be null or empty') self._label_values = label_values self._points = points self._start_timestamp = start_timestamp def __repr__(self): points_repr = '[{}]'.format(', '.join((repr(point.value) for point in self.points))) lv_repr = tuple((lv.value for lv in self.label_values)) return '{}({}, label_values={}, start_timestamp={})'.format(type(self).__name__, points_repr, lv_repr, self.start_timestamp) @property def start_timestamp(self): return self._start_timestamp @property def label_values(self): return self._label_values @property def points(self): return self._points def check_points_type(self, type_class): """Check that each point's value is an instance of `type_class`. `type_class` should typically be a Value type, i.e. one that extends :class: `opencensus.metrics.export.value.Value`. :type type_class: type :param type_class: Type to check against. :rtype: bool :return: Whether all points are instances of `type_class`. """ for point in self.points: if point.value is not None and (not isinstance(point.value, type_class)): return False return True
class Logger: PRINT_INTERVAL = 10 def __init__(self): self.buckets = [-1 for _ in range(self.PRINT_INTERVAL)] self.sets = [set() for _ in range(self.PRINT_INTERVAL)] def shouldPrintMessage(self, timestamp: int, message: str) -> bool: bucket_index = timestamp % self.PRINT_INTERVAL if self.buckets[bucket_index] != timestamp: self.sets[bucket_index].clear() self.buckets[bucket_index] = timestamp for i, bucket_timestamp in enumerate(self.buckets): if timestamp - bucket_timestamp < self.PRINT_INTERVAL: if message in self.sets[i]: return False self.sets[bucket_index].add(message) return True
class Logger: print_interval = 10 def __init__(self): self.buckets = [-1 for _ in range(self.PRINT_INTERVAL)] self.sets = [set() for _ in range(self.PRINT_INTERVAL)] def should_print_message(self, timestamp: int, message: str) -> bool: bucket_index = timestamp % self.PRINT_INTERVAL if self.buckets[bucket_index] != timestamp: self.sets[bucket_index].clear() self.buckets[bucket_index] = timestamp for (i, bucket_timestamp) in enumerate(self.buckets): if timestamp - bucket_timestamp < self.PRINT_INTERVAL: if message in self.sets[i]: return False self.sets[bucket_index].add(message) return True
#!/usr/bin/env python NAME = 'WebTotem (WebTotem)' def is_waf(self): for attack in self.attacks: r = attack(self) if r is None: return _, page = r # WebTotem returns its name in blockpage if all(i in page for i in (b'The current request was blocked', b'WebTotem')): return True return False
name = 'WebTotem (WebTotem)' def is_waf(self): for attack in self.attacks: r = attack(self) if r is None: return (_, page) = r if all((i in page for i in (b'The current request was blocked', b'WebTotem'))): return True return False
{ 'targets': [ { 'target_name': 'node_expat_object', 'sources': [ 'src/parse.cc', 'src/node-expat-object.cc' ], 'include_dirs': [ '<!(node -e "require(\'nan\')")' ], 'dependencies': [ 'deps/libexpat/libexpat.gyp:expat' ] } ] }
{'targets': [{'target_name': 'node_expat_object', 'sources': ['src/parse.cc', 'src/node-expat-object.cc'], 'include_dirs': ['<!(node -e "require(\'nan\')")'], 'dependencies': ['deps/libexpat/libexpat.gyp:expat']}]}
# Token types # # EOF (end-of-file) token is used to indicate that # there is no more input left for lexical analysis NUMBER, VARIABLE, VARIABLE_SET, PLUS, MINUS, MUL, DIV, LPAREN, RPAREN, EOF, LOG, SIN, COS, TAN, \ CTG, SQRT, POW, LOWER, HIGHER, HIGHER_EQ, LOWER_EQ, EQ, EQ_EQ, TRUE, FALSE, PLUS_EQUALS,\ MINUS_EQUALS, MUL_EQUALS, DIV_EQUALS, MOD, LEFT_SHIFT, RIGHT_SHIFT, PI, E_C, DEG, RAD = ( 'NUMBER', 'VARIABLE', 'VARIABLE_SET', 'PLUS', 'MINUS', 'MUL', 'DIV', '(', ')', 'EOF', 'LOG', \ 'SIN', 'COS', 'TG', 'CTG', 'SQRT', 'POW', '<', '>', '>=', '<=', '=', '==', 'True', 'False', '+=',\ '-=', '*=', '/=', '%', '<<', '>>', 'PI', 'E', 'DEG', 'RAD' ) class Token(object): def __init__(self, type, value): self.type = type self.value = value def __str__(self): """String representation of the class instance. Examples: Token(INTEGER, 3) Token(PLUS, '+') Token(MUL, '*') """ return 'Token({type}, {value})'.format( type=self.type, value=repr(self.value) ) def __repr__(self): return self.__str__() class Lexer(object): def __init__(self, text): # client string input, e.g. "4 + 2 * 3 - 6 / 2" self.text = text # self.pos is an index into self.text self.pos = 0 self.current_char = self.text[self.pos] def error(self): raise Exception('Invalid character') def advance(self): """Advance the `pos` pointer and set the `current_char` variable.""" self.pos += 1 if self.pos > len(self.text) - 1: self.current_char = None # Indicates end of input else: self.current_char = self.text[self.pos] def skip_whitespace(self): while self.current_char is not None and self.current_char.isspace(): self.advance() def number(self): """Return a (multidigit) integer consumed from the input.""" result = '' foundDot = False while self.current_char is not None and (self.current_char.isdigit() or self.current_char == '.'): if self.current_char == '.': foundDot = True result += self.current_char self.advance() if foundDot: return float(result) else: return int(result) def var(self): charName = '' while self.current_char is not None and self.current_char != '(' and self.current_char != '+' \ and self.current_char != '-' and self.current_char != '*' and self.current_char != '/' \ and not self.current_char.isspace() and self.current_char != '=' and self.current_char != '>' \ and self.current_char != '<': charName += self.current_char self.advance() if self.current_char is not None and self.current_char.isspace(): self.skip_whitespace() return charName def get_next_token(self): """Lexical analyzer (also known as scanner or tokenizer) This method is responsible for breaking a sentence apart into tokens. One token at a time. """ while self.current_char is not None: position = self.pos if self.current_char.isspace(): self.skip_whitespace() continue if self.current_char.isdigit(): br = self.number() return Token(NUMBER, br) if self.text[self.pos: self.pos + 2] == PLUS_EQUALS: self.advance() self.advance() return Token(PLUS_EQUALS, PLUS_EQUALS) if self.current_char == '+': self.advance() return Token(PLUS, '+') if self.text[self.pos: self.pos + 2] == MINUS_EQUALS: self.advance() self.advance() return Token(MINUS_EQUALS, MINUS_EQUALS) if self.current_char == '-': self.advance() return Token(MINUS, '-') if self.text[self.pos: self.pos + 2] == MUL_EQUALS: self.advance() self.advance() return Token(MUL_EQUALS, MUL_EQUALS) if self.current_char == '*': self.advance() return Token(MUL, '*') if self.text[self.pos: self.pos + 2] == DIV_EQUALS: self.advance() self.advance() return Token(DIV_EQUALS, DIV_EQUALS) if self.current_char == '/': self.advance() return Token(DIV, '/') if self.current_char == '(': self.advance() return Token(LPAREN, '(') if self.current_char == ')': self.advance() return Token(RPAREN, ')') if self.current_char == MOD: self.advance() return Token(MOD, MOD) if self.text[self.pos: self.pos + 2] == EQ_EQ: self.advance() self.advance() return Token(EQ_EQ, EQ_EQ) if self.current_char == EQ: self.advance() return Token(EQ, EQ) if self.text[self.pos: self.pos + 2] == LEFT_SHIFT: self.advance() self.advance() return Token(LEFT_SHIFT, LEFT_SHIFT) if self.text[self.pos: self.pos + 2] == LOWER_EQ: self.advance() self.advance() return Token(LOWER_EQ, LOWER_EQ) if self.current_char == LOWER: self.advance() return Token(LOWER, LOWER) if self.text[self.pos: self.pos + 2] == RIGHT_SHIFT: self.advance() self.advance() return Token(RIGHT_SHIFT, RIGHT_SHIFT) if self.text[self.pos: self.pos + 2] == HIGHER_EQ: self.advance() self.advance() return Token(HIGHER_EQ, HIGHER_EQ) if self.current_char == HIGHER: self.advance() return Token(HIGHER, HIGHER) if self.text[self.pos: self.pos + 5] == SQRT + LPAREN: self.advance() self.advance() self.advance() self.advance() return Token(SQRT, SQRT) if self.text[self.pos: self.pos + 4] == SIN + LPAREN: self.advance() self.advance() self.advance() return Token(SIN, SIN) if self.text[self.pos: self.pos + 3] == TAN + LPAREN: self.advance() self.advance() return Token(TAN, TAN) if self.text[self.pos: self.pos + 4] == POW + LPAREN: self.advance() self.advance() self.advance() return Token(POW, POW) if self.text[self.pos: self.pos + 4] == COS + LPAREN: self.advance() self.advance() self.advance() return Token(COS, COS) if self.text[self.pos: self.pos + 4] == CTG + LPAREN: self.advance() self.advance() self.advance() return Token(CTG, CTG) if self.text[self.pos: self.pos + 4] == LOG + LPAREN: self.advance() self.advance() self.advance() return Token(LOG, LOG) if self.text[self.pos: self.pos + 4] == DEG + LPAREN: self.advance() self.advance() self.advance() return Token(DEG, DEG) if self.text[self.pos: self.pos + 4] == RAD + LPAREN: self.advance() self.advance() self.advance() return Token(RAD, RAD) if self.text[self.pos: self.pos + 4] == TRUE: self.advance() self.advance() self.advance() self.advance() if self.current_char.isalpha: self.pos = self.pos - 4 self.current_char = self.text[self.pos] else: return Token(TRUE, TRUE) if self.text[self.pos: self.pos + 5] == FALSE: self.advance() self.advance() self.advance() self.advance() self.advance() if self.current_char.isalpha: self.pos = self.pos - 5 self.current_char = self.text[self.pos] else: return Token(FALSE, FALSE) if self.current_char.isalpha(): charName = self.var() if charName == PI: return Token(PI, PI) elif charName == E_C: return Token(E_C, E_C) if self.current_char is None: retrunToThisPos = self.pos - 1 else: retrunToThisPos = self.pos if self.current_char == '=': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE_SET, charName) elif self.current_char == '+': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE_SET, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE, charName) elif self.current_char == '*': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE_SET, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE, charName) elif self.current_char == '/': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE_SET, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE, charName) elif self.current_char == '-': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE_SET, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return Token(VARIABLE, charName) self.error() return Token(EOF, None)
(number, variable, variable_set, plus, minus, mul, div, lparen, rparen, eof, log, sin, cos, tan, ctg, sqrt, pow, lower, higher, higher_eq, lower_eq, eq, eq_eq, true, false, plus_equals, minus_equals, mul_equals, div_equals, mod, left_shift, right_shift, pi, e_c, deg, rad) = ('NUMBER', 'VARIABLE', 'VARIABLE_SET', 'PLUS', 'MINUS', 'MUL', 'DIV', '(', ')', 'EOF', 'LOG', 'SIN', 'COS', 'TG', 'CTG', 'SQRT', 'POW', '<', '>', '>=', '<=', '=', '==', 'True', 'False', '+=', '-=', '*=', '/=', '%', '<<', '>>', 'PI', 'E', 'DEG', 'RAD') class Token(object): def __init__(self, type, value): self.type = type self.value = value def __str__(self): """String representation of the class instance. Examples: Token(INTEGER, 3) Token(PLUS, '+') Token(MUL, '*') """ return 'Token({type}, {value})'.format(type=self.type, value=repr(self.value)) def __repr__(self): return self.__str__() class Lexer(object): def __init__(self, text): self.text = text self.pos = 0 self.current_char = self.text[self.pos] def error(self): raise exception('Invalid character') def advance(self): """Advance the `pos` pointer and set the `current_char` variable.""" self.pos += 1 if self.pos > len(self.text) - 1: self.current_char = None else: self.current_char = self.text[self.pos] def skip_whitespace(self): while self.current_char is not None and self.current_char.isspace(): self.advance() def number(self): """Return a (multidigit) integer consumed from the input.""" result = '' found_dot = False while self.current_char is not None and (self.current_char.isdigit() or self.current_char == '.'): if self.current_char == '.': found_dot = True result += self.current_char self.advance() if foundDot: return float(result) else: return int(result) def var(self): char_name = '' while self.current_char is not None and self.current_char != '(' and (self.current_char != '+') and (self.current_char != '-') and (self.current_char != '*') and (self.current_char != '/') and (not self.current_char.isspace()) and (self.current_char != '=') and (self.current_char != '>') and (self.current_char != '<'): char_name += self.current_char self.advance() if self.current_char is not None and self.current_char.isspace(): self.skip_whitespace() return charName def get_next_token(self): """Lexical analyzer (also known as scanner or tokenizer) This method is responsible for breaking a sentence apart into tokens. One token at a time. """ while self.current_char is not None: position = self.pos if self.current_char.isspace(): self.skip_whitespace() continue if self.current_char.isdigit(): br = self.number() return token(NUMBER, br) if self.text[self.pos:self.pos + 2] == PLUS_EQUALS: self.advance() self.advance() return token(PLUS_EQUALS, PLUS_EQUALS) if self.current_char == '+': self.advance() return token(PLUS, '+') if self.text[self.pos:self.pos + 2] == MINUS_EQUALS: self.advance() self.advance() return token(MINUS_EQUALS, MINUS_EQUALS) if self.current_char == '-': self.advance() return token(MINUS, '-') if self.text[self.pos:self.pos + 2] == MUL_EQUALS: self.advance() self.advance() return token(MUL_EQUALS, MUL_EQUALS) if self.current_char == '*': self.advance() return token(MUL, '*') if self.text[self.pos:self.pos + 2] == DIV_EQUALS: self.advance() self.advance() return token(DIV_EQUALS, DIV_EQUALS) if self.current_char == '/': self.advance() return token(DIV, '/') if self.current_char == '(': self.advance() return token(LPAREN, '(') if self.current_char == ')': self.advance() return token(RPAREN, ')') if self.current_char == MOD: self.advance() return token(MOD, MOD) if self.text[self.pos:self.pos + 2] == EQ_EQ: self.advance() self.advance() return token(EQ_EQ, EQ_EQ) if self.current_char == EQ: self.advance() return token(EQ, EQ) if self.text[self.pos:self.pos + 2] == LEFT_SHIFT: self.advance() self.advance() return token(LEFT_SHIFT, LEFT_SHIFT) if self.text[self.pos:self.pos + 2] == LOWER_EQ: self.advance() self.advance() return token(LOWER_EQ, LOWER_EQ) if self.current_char == LOWER: self.advance() return token(LOWER, LOWER) if self.text[self.pos:self.pos + 2] == RIGHT_SHIFT: self.advance() self.advance() return token(RIGHT_SHIFT, RIGHT_SHIFT) if self.text[self.pos:self.pos + 2] == HIGHER_EQ: self.advance() self.advance() return token(HIGHER_EQ, HIGHER_EQ) if self.current_char == HIGHER: self.advance() return token(HIGHER, HIGHER) if self.text[self.pos:self.pos + 5] == SQRT + LPAREN: self.advance() self.advance() self.advance() self.advance() return token(SQRT, SQRT) if self.text[self.pos:self.pos + 4] == SIN + LPAREN: self.advance() self.advance() self.advance() return token(SIN, SIN) if self.text[self.pos:self.pos + 3] == TAN + LPAREN: self.advance() self.advance() return token(TAN, TAN) if self.text[self.pos:self.pos + 4] == POW + LPAREN: self.advance() self.advance() self.advance() return token(POW, POW) if self.text[self.pos:self.pos + 4] == COS + LPAREN: self.advance() self.advance() self.advance() return token(COS, COS) if self.text[self.pos:self.pos + 4] == CTG + LPAREN: self.advance() self.advance() self.advance() return token(CTG, CTG) if self.text[self.pos:self.pos + 4] == LOG + LPAREN: self.advance() self.advance() self.advance() return token(LOG, LOG) if self.text[self.pos:self.pos + 4] == DEG + LPAREN: self.advance() self.advance() self.advance() return token(DEG, DEG) if self.text[self.pos:self.pos + 4] == RAD + LPAREN: self.advance() self.advance() self.advance() return token(RAD, RAD) if self.text[self.pos:self.pos + 4] == TRUE: self.advance() self.advance() self.advance() self.advance() if self.current_char.isalpha: self.pos = self.pos - 4 self.current_char = self.text[self.pos] else: return token(TRUE, TRUE) if self.text[self.pos:self.pos + 5] == FALSE: self.advance() self.advance() self.advance() self.advance() self.advance() if self.current_char.isalpha: self.pos = self.pos - 5 self.current_char = self.text[self.pos] else: return token(FALSE, FALSE) if self.current_char.isalpha(): char_name = self.var() if charName == PI: return token(PI, PI) elif charName == E_C: return token(E_C, E_C) if self.current_char is None: retrun_to_this_pos = self.pos - 1 else: retrun_to_this_pos = self.pos if self.current_char == '=': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE_SET, charName) elif self.current_char == '+': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE_SET, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE, charName) elif self.current_char == '*': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE_SET, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE, charName) elif self.current_char == '/': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE_SET, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE, charName) elif self.current_char == '-': self.advance() if self.current_char == '=': self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE_SET, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE, charName) else: self.pos = retrunToThisPos self.current_char = self.text[self.pos] return token(VARIABLE, charName) self.error() return token(EOF, None)
class ParamRequest(object): """ Represents a set of request parameters. """ def to_request_parameters(self): """ :return: list[:class:`ingenico.connect.sdk.RequestParam`] representing the HTTP request parameters """ raise NotImplementedError
class Paramrequest(object): """ Represents a set of request parameters. """ def to_request_parameters(self): """ :return: list[:class:`ingenico.connect.sdk.RequestParam`] representing the HTTP request parameters """ raise NotImplementedError
# Copyright 2013-2022 Lawrence Livermore National Security, LLC and other # Spack Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: (Apache-2.0 OR MIT) class PyLap(PythonPackage): """lap is a linear assignment problem solver using Jonker-Volgenant algorithm for dense (LAPJV) or sparse (LAPMOD) matrices.""" homepage = "https://github.com/gatagat/lap" pypi = "lap/lap-0.4.0.tar.gz" version('0.4.0', sha256='c4dad9976f0e9f276d8a676a6d03632c3cb7ab7c80142e3b27303d49f0ed0e3b') depends_on('py-setuptools', type='build') depends_on('py-cython@0.21:', type='build') depends_on('py-numpy@1.10.1:', type=('build', 'run'))
class Pylap(PythonPackage): """lap is a linear assignment problem solver using Jonker-Volgenant algorithm for dense (LAPJV) or sparse (LAPMOD) matrices.""" homepage = 'https://github.com/gatagat/lap' pypi = 'lap/lap-0.4.0.tar.gz' version('0.4.0', sha256='c4dad9976f0e9f276d8a676a6d03632c3cb7ab7c80142e3b27303d49f0ed0e3b') depends_on('py-setuptools', type='build') depends_on('py-cython@0.21:', type='build') depends_on('py-numpy@1.10.1:', type=('build', 'run'))
list = ['Apple','Orange','Benana','Mango']; name = "Md Tazri"; print('"Apple" in list : ',"Apple" in list); print('"Kiwi" in list : ',"Kiwi" in list); print('"Water" not in list : ',"Water" not in list); print("'Md' in name : ",'Md' in name); print("'Tazri' not in name : ",'Tazri' not in name);
list = ['Apple', 'Orange', 'Benana', 'Mango'] name = 'Md Tazri' print('"Apple" in list : ', 'Apple' in list) print('"Kiwi" in list : ', 'Kiwi' in list) print('"Water" not in list : ', 'Water' not in list) print("'Md' in name : ", 'Md' in name) print("'Tazri' not in name : ", 'Tazri' not in name)
class DiceLoss(nn.Module): def __init__(self, tolerance=1e-8): super(DiceLoss, self).__init__() self.tolerance = tolerance def forward(self, pred, label): intersection = torch.sum(pred * label) + self.tolerance union = torch.sum(pred) + torch.sum(label) + self.tolerance dice_loss = 1 - 2 * intersection / union return dice_loss class EnsembleLoss(nn.Module): def __init__(self, mask_loss, loss_func): super(EnsembleLoss, self).__init__() self.mask_loss = mask_loss self.loss_func = loss_func def forward(self, masks, ensemble_mask, mask): ensemble_loss = 0 num_backbones = len(masks) for i in range(num_backbones): ensemble_loss = ensemble_loss + self.mask_loss(masks[i], mask) / num_backbones ensemble_loss = 0.5 * ensemble_loss + 0.5 * self.loss_func(ensemble_mask, mask) return ensemble_loss
class Diceloss(nn.Module): def __init__(self, tolerance=1e-08): super(DiceLoss, self).__init__() self.tolerance = tolerance def forward(self, pred, label): intersection = torch.sum(pred * label) + self.tolerance union = torch.sum(pred) + torch.sum(label) + self.tolerance dice_loss = 1 - 2 * intersection / union return dice_loss class Ensembleloss(nn.Module): def __init__(self, mask_loss, loss_func): super(EnsembleLoss, self).__init__() self.mask_loss = mask_loss self.loss_func = loss_func def forward(self, masks, ensemble_mask, mask): ensemble_loss = 0 num_backbones = len(masks) for i in range(num_backbones): ensemble_loss = ensemble_loss + self.mask_loss(masks[i], mask) / num_backbones ensemble_loss = 0.5 * ensemble_loss + 0.5 * self.loss_func(ensemble_mask, mask) return ensemble_loss
class EventTypeFilter(TraceFilter): """ Indicates whether a listener should trace based on the event type. EventTypeFilter(level: SourceLevels) """ def ZZZ(self): """hardcoded/mock instance of the class""" return EventTypeFilter() instance=ZZZ() """hardcoded/returns an instance of the class""" def ShouldTrace(self,cache,source,eventType,id,formatOrMessage,args,data1,data): """ ShouldTrace(self: EventTypeFilter,cache: TraceEventCache,source: str,eventType: TraceEventType,id: int,formatOrMessage: str,args: Array[object],data1: object,data: Array[object]) -> bool Determines whether the trace listener should trace the event. cache: A System.Diagnostics.TraceEventCache that represents the information cache for the trace event. source: The name of the source. eventType: One of the System.Diagnostics.TraceEventType values. id: A trace identifier number. formatOrMessage: The format to use for writing an array of arguments,or a message to write. args: An array of argument objects. data1: A trace data object. data: An array of trace data objects. Returns: trueif the trace should be produced; otherwise,false. """ pass @staticmethod def __new__(self,level): """ __new__(cls: type,level: SourceLevels) """ pass EventType=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the event type of the messages to trace. Get: EventType(self: EventTypeFilter) -> SourceLevels Set: EventType(self: EventTypeFilter)=value """
class Eventtypefilter(TraceFilter): """ Indicates whether a listener should trace based on the event type. EventTypeFilter(level: SourceLevels) """ def zzz(self): """hardcoded/mock instance of the class""" return event_type_filter() instance = zzz() 'hardcoded/returns an instance of the class' def should_trace(self, cache, source, eventType, id, formatOrMessage, args, data1, data): """ ShouldTrace(self: EventTypeFilter,cache: TraceEventCache,source: str,eventType: TraceEventType,id: int,formatOrMessage: str,args: Array[object],data1: object,data: Array[object]) -> bool Determines whether the trace listener should trace the event. cache: A System.Diagnostics.TraceEventCache that represents the information cache for the trace event. source: The name of the source. eventType: One of the System.Diagnostics.TraceEventType values. id: A trace identifier number. formatOrMessage: The format to use for writing an array of arguments,or a message to write. args: An array of argument objects. data1: A trace data object. data: An array of trace data objects. Returns: trueif the trace should be produced; otherwise,false. """ pass @staticmethod def __new__(self, level): """ __new__(cls: type,level: SourceLevels) """ pass event_type = property(lambda self: object(), lambda self, v: None, lambda self: None) 'Gets or sets the event type of the messages to trace.\n\n\n\nGet: EventType(self: EventTypeFilter) -> SourceLevels\n\n\n\nSet: EventType(self: EventTypeFilter)=value\n\n'
# # This is the Robotics Language compiler # # Transformations.py: Applies tranformations to the XML structure # # Created on: June 22, 2017 # Author: Gabriel A. D. Lopes # Licence: Apache 2.0 # Copyright: 2014-2017 Robot Care Systems BV, The Hague, The Netherlands. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. atoms = { 'string':'Strings', 'boolean':'Booleans', 'real':'Reals', 'integer':'Integers' } def manySameNumbersOrStrings(x): '''number or string''' return all(map(lambda y: y in ['Reals', 'Integers'], x)) or all(map(lambda y: y == 'Strings', x)) def singleString(x): '''string''' return len(x) == 1 and x[0] == 'Strings' def singleReal(x): '''real''' return len(x) == 1 and (x[0] == 'Reals' or x[0] == 'Integers') def singleBoolean(x): '''boolean''' return len(x) == 1 and x[0] == 'Booleans' def manyStrings(x): '''string , ... , string''' return [ xi == 'Strings' for xi in x ] def manyExpressions(x): '''expression , ... , expression''' return [True] def manyCodeBlocks(x): '''code block , ... , code block''' return [ xi == 'CodeBlock' for xi in x ] def returnNothing(x): '''nothing''' return 'Nothing' def returnCodeBlock(x): '''code block''' return 'CodeBlock' def returnSameArgumentType(x): return x[0]
atoms = {'string': 'Strings', 'boolean': 'Booleans', 'real': 'Reals', 'integer': 'Integers'} def many_same_numbers_or_strings(x): """number or string""" return all(map(lambda y: y in ['Reals', 'Integers'], x)) or all(map(lambda y: y == 'Strings', x)) def single_string(x): """string""" return len(x) == 1 and x[0] == 'Strings' def single_real(x): """real""" return len(x) == 1 and (x[0] == 'Reals' or x[0] == 'Integers') def single_boolean(x): """boolean""" return len(x) == 1 and x[0] == 'Booleans' def many_strings(x): """string , ... , string""" return [xi == 'Strings' for xi in x] def many_expressions(x): """expression , ... , expression""" return [True] def many_code_blocks(x): """code block , ... , code block""" return [xi == 'CodeBlock' for xi in x] def return_nothing(x): """nothing""" return 'Nothing' def return_code_block(x): """code block""" return 'CodeBlock' def return_same_argument_type(x): return x[0]
class Contact: def __init__(self, firstname, lastname, company, address, telephone, mobile, tel_work, email, email_1, www): self.firstname = firstname self.lastname = lastname self.company = company self.address = address self.telephone = telephone self.mobile = mobile self.tel_work = tel_work self.email = email self.email_1 = email_1 self.www = www
class Contact: def __init__(self, firstname, lastname, company, address, telephone, mobile, tel_work, email, email_1, www): self.firstname = firstname self.lastname = lastname self.company = company self.address = address self.telephone = telephone self.mobile = mobile self.tel_work = tel_work self.email = email self.email_1 = email_1 self.www = www
# coding: utf-8 def array_pad(l, size, value): if size >= 0: return l + [value] * (size - len(l)) else: return [value] * (size * -1 - len(l)) + l if __name__ == '__main__': l = [12, 10, 9] print(array_pad(l, 5, 0)) print(array_pad(l, -7, -1)) print(array_pad(l, 2, 999))
def array_pad(l, size, value): if size >= 0: return l + [value] * (size - len(l)) else: return [value] * (size * -1 - len(l)) + l if __name__ == '__main__': l = [12, 10, 9] print(array_pad(l, 5, 0)) print(array_pad(l, -7, -1)) print(array_pad(l, 2, 999))
k=int (input()) l=int (input()) m=int (input()) n=int (input()) d=int (input()) damagedDragons = 0 for i in range (1, d+1): if i%k == 0 or i%l == 0 or i%m == 0 or i%n == 0: damagedDragons = damagedDragons + 1 print(damagedDragons)
k = int(input()) l = int(input()) m = int(input()) n = int(input()) d = int(input()) damaged_dragons = 0 for i in range(1, d + 1): if i % k == 0 or i % l == 0 or i % m == 0 or (i % n == 0): damaged_dragons = damagedDragons + 1 print(damagedDragons)
# Copyright 2018 Canonical Ltd. # # 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. """Module of exceptions that zaza may raise.""" class MissingOSAthenticationException(Exception): """Exception when some data needed to authenticate is missing.""" pass class CloudInitIncomplete(Exception): """Cloud init has not completed properly.""" pass class SSHFailed(Exception): """SSH failed.""" pass class NeutronAgentMissing(Exception): """Agent binary does not appear in the Neutron agent list.""" pass class NeutronBGPSpeakerMissing(Exception): """No BGP speaker appeared on agent.""" pass class ApplicationNotFound(Exception): """Application not found in machines.""" def __init__(self, application): """Create Application not found exception. :param application: Name of the application :type application: string :returns: ApplicationNotFound Exception """ msg = ("{} application was not found in machines.". format(application)) super(ApplicationNotFound, self).__init__(msg) class SeriesNotFound(Exception): """Series not found in status.""" pass class OSVersionNotFound(Exception): """OS Version not found.""" pass class ReleasePairNotFound(Exception): """Release pair was not found in OPENSTACK_RELEASES_PAIRS.""" pass class KeystoneAuthorizationStrict(Exception): """Authorization/Policy too strict.""" pass class KeystoneAuthorizationPermissive(Exception): """Authorization/Policy too permissive.""" pass class KeystoneWrongTokenProvider(Exception): """A token was issued from the wrong token provider.""" pass class KeystoneKeyRepositoryError(Exception): """Error in key repository. This may be caused by isues with one of: - incomplete or missing data in `key_repository` in leader storage - synchronization of keys to non-leader units - rotation of keys """ pass class ProcessNameCountMismatch(Exception): """Count of process names doesn't match.""" pass class ProcessNameMismatch(Exception): """Name of processes doesn't match.""" pass class PIDCountMismatch(Exception): """PID's count doesn't match.""" pass class ProcessIdsFailed(Exception): """Process ID lookup failed.""" pass class UnitNotFound(Exception): """Unit not found in actual dict.""" pass class UnitCountMismatch(Exception): """Count of unit doesn't match.""" pass class UbuntuReleaseNotFound(Exception): """Ubuntu release not found in list.""" pass class ServiceNotFound(Exception): """Service not found on unit.""" pass class CephPoolNotFound(Exception): """Ceph pool not found.""" pass class NovaGuestMigrationFailed(Exception): """Nova guest migration failed.""" pass class NovaGuestRestartFailed(Exception): """Nova guest restart failed.""" pass
"""Module of exceptions that zaza may raise.""" class Missingosathenticationexception(Exception): """Exception when some data needed to authenticate is missing.""" pass class Cloudinitincomplete(Exception): """Cloud init has not completed properly.""" pass class Sshfailed(Exception): """SSH failed.""" pass class Neutronagentmissing(Exception): """Agent binary does not appear in the Neutron agent list.""" pass class Neutronbgpspeakermissing(Exception): """No BGP speaker appeared on agent.""" pass class Applicationnotfound(Exception): """Application not found in machines.""" def __init__(self, application): """Create Application not found exception. :param application: Name of the application :type application: string :returns: ApplicationNotFound Exception """ msg = '{} application was not found in machines.'.format(application) super(ApplicationNotFound, self).__init__(msg) class Seriesnotfound(Exception): """Series not found in status.""" pass class Osversionnotfound(Exception): """OS Version not found.""" pass class Releasepairnotfound(Exception): """Release pair was not found in OPENSTACK_RELEASES_PAIRS.""" pass class Keystoneauthorizationstrict(Exception): """Authorization/Policy too strict.""" pass class Keystoneauthorizationpermissive(Exception): """Authorization/Policy too permissive.""" pass class Keystonewrongtokenprovider(Exception): """A token was issued from the wrong token provider.""" pass class Keystonekeyrepositoryerror(Exception): """Error in key repository. This may be caused by isues with one of: - incomplete or missing data in `key_repository` in leader storage - synchronization of keys to non-leader units - rotation of keys """ pass class Processnamecountmismatch(Exception): """Count of process names doesn't match.""" pass class Processnamemismatch(Exception): """Name of processes doesn't match.""" pass class Pidcountmismatch(Exception): """PID's count doesn't match.""" pass class Processidsfailed(Exception): """Process ID lookup failed.""" pass class Unitnotfound(Exception): """Unit not found in actual dict.""" pass class Unitcountmismatch(Exception): """Count of unit doesn't match.""" pass class Ubuntureleasenotfound(Exception): """Ubuntu release not found in list.""" pass class Servicenotfound(Exception): """Service not found on unit.""" pass class Cephpoolnotfound(Exception): """Ceph pool not found.""" pass class Novaguestmigrationfailed(Exception): """Nova guest migration failed.""" pass class Novaguestrestartfailed(Exception): """Nova guest restart failed.""" pass
menu = [ [ "egg", "spam", "bacon"], [ "egg", "sausage", "bacon"], [ "egg", "spam"], [ "egg", "bacon", "spam"], [ "egg", "bacon", "sausage", "spam"], [ "spam", "bacon", "sausage", "spam"], [ "spam", "egg", "spam", "spam", "bacon","spam"], [ "spam", "egg", "sausage", "spam"], [ "chicken", "chips"] ] # normal method meals = [] for meal in menu: if "spam" not in meal: meals.append(meal) else: meals.append("a meal was skipped") print(meals) print("*" * 120) # for comprehension with basic conditional comprehension meals = [meal for meal in menu if "spam" not in meal and "chicken" not in meal] print(meals) print("*" * 120) # for comprehension with two conditional comprehension fussy_meals = [meal for meal in menu if "spam" in meal or "eggs" in meal if not ("bacon" in meal and "sausage" in meal)] print(fussy_meals) print("*" * 120) fussy_meals =[meal for meal in menu if ("spam" in meal or "eggs" in meal) and not ("bacon" in meal and "sausage" in meal)] print(fussy_meals)
menu = [['egg', 'spam', 'bacon'], ['egg', 'sausage', 'bacon'], ['egg', 'spam'], ['egg', 'bacon', 'spam'], ['egg', 'bacon', 'sausage', 'spam'], ['spam', 'bacon', 'sausage', 'spam'], ['spam', 'egg', 'spam', 'spam', 'bacon', 'spam'], ['spam', 'egg', 'sausage', 'spam'], ['chicken', 'chips']] meals = [] for meal in menu: if 'spam' not in meal: meals.append(meal) else: meals.append('a meal was skipped') print(meals) print('*' * 120) meals = [meal for meal in menu if 'spam' not in meal and 'chicken' not in meal] print(meals) print('*' * 120) fussy_meals = [meal for meal in menu if 'spam' in meal or 'eggs' in meal if not ('bacon' in meal and 'sausage' in meal)] print(fussy_meals) print('*' * 120) fussy_meals = [meal for meal in menu if ('spam' in meal or 'eggs' in meal) and (not ('bacon' in meal and 'sausage' in meal))] print(fussy_meals)
def divide(x: int, y: int) -> int: result, power = 0, 32 y_power = y << power while x >= y: while y_power > x: y_power >>=1 power -=1 result += 1<<power x -= y_power return result
def divide(x: int, y: int) -> int: (result, power) = (0, 32) y_power = y << power while x >= y: while y_power > x: y_power >>= 1 power -= 1 result += 1 << power x -= y_power return result
""" TODO: Add description. Date: 2021-05-27 Author: Vitali Lupusor """
""" TODO: Add description. Date: 2021-05-27 Author: Vitali Lupusor """
sum = 0 for x in range(10): sum = sum + x print(sum)
sum = 0 for x in range(10): sum = sum + x print(sum)
""" Classes in this file are standalone because we don't want to impose a false hierarchy between two classes. That is, inheritance may imply a hierarchy that isn't real. """ class Settings(object): kExactTestBias = 1.0339757656912846e-25 kSmallEpsilon = 5.684341886080802e-14 kLargeEpsilon = 1e-07 SMALL_EPSILON = 5.684341886080802e-14 local_scratch = '/app/scratch' python = 'python' plink = "/srv/gsfs0/software/plink/1.90/plink" redis_uri = 'redis://hydra_redis:6379' class Commands(object): HELP = "HELP" INIT = "INIT" INIT_STATS = 'INIT_STATS' QC = "QC" PCA = "PCA" ECHO = "ECHO" ASSO = "ASSO" EXIT = "EXIT" all_commands = [HELP, INIT, QC, PCA, ASSO, EXIT] # used by v.1 interface commands_with_parms = [QC, PCA, ASSO] class Thresholds(object): # ECHO options ECHO_COUNTS = 20 # QC Options QC_hwe = 1e-10 QC_maf = 0.01 # PCA Options PCA_maf = 0.1 PCA_ld_window = 50 PCA_ld_threshold = 0.2 PCA_pcs = 10 # Association Options ASSO_pcs = 10 class Options(object): # HELP = Commands.HELP INIT = Commands.INIT QC = Commands.QC PCA = Commands.PCA ASSO = Commands.ASSO EXIT = Commands.EXIT HWE = "HWE" MAF = "MAF" MPS = "MPS" MPI = "MPI" SNP = "snp" LD = "LD" NONE = "NONE" class QCOptions(object): HWE = Options.HWE MAF = Options.MAF MPS = Options.MPS MPI = Options.MPI SNP = Options.SNP all_options = [HWE, MAF, MPS, MPI, SNP] class PCAOptions(object): HWE = Options.HWE MAF = Options.MAF MPS = Options.MPS MPI = Options.MPI SNP = Options.SNP LD = Options.LD NONE = Options.NONE all_options = [HWE, MAF, MPS, MPI, SNP, LD, NONE] class QCFilterNames(object): QC_HWE = Options.HWE QC_MAF = Options.MAF QC_MPS = Options.MPS QC_MPI = Options.MPI QC_snp = Options.SNP class PCAFilterNames(object): PCA_HWE = Options.HWE PCA_MAF = Options.MAF PCA_MPS = Options.MPS PCA_MPI = Options.MPI PCA_snp = Options.SNP PCA_LD = Options.LD PCA_NONE = Options.NONE external_host = "hydratest23.azurewebsites.net" class ServerHTTP(object): listen_host = '0.0.0.0' external_host = external_host#"localhost"#external_host#'hydraapp.azurewebsites.net'#"localhost"# port = '9001' max_content_length = 1024 * 1024 * 1024 # 1 GB wait_time = 0.5 # for the time.sleep() hacks class ClientHTTP(object): default_max_content_length = 1024 * 1024 * 1024 # 1 GB default_listen_host = '0.0.0.0' default_external_host = external_host#'hydraapp.azurewebsites.net' # "localhost"# clients = [{ 'name': 'Center1', 'listen_host': default_listen_host, 'external_host': default_external_host, 'port': 9002, 'max_content_length': default_max_content_length }, { 'name': 'Center2', 'listen_host': default_listen_host, 'external_host': default_external_host, 'port': 9003, 'max_content_length': default_max_content_length }, { 'name': 'Center3', 'listen_host': default_listen_host, 'external_host': default_external_host, 'port': 9004, 'max_content_length': default_max_content_length } ]
""" Classes in this file are standalone because we don't want to impose a false hierarchy between two classes. That is, inheritance may imply a hierarchy that isn't real. """ class Settings(object): k_exact_test_bias = 1.0339757656912846e-25 k_small_epsilon = 5.684341886080802e-14 k_large_epsilon = 1e-07 small_epsilon = 5.684341886080802e-14 local_scratch = '/app/scratch' python = 'python' plink = '/srv/gsfs0/software/plink/1.90/plink' redis_uri = 'redis://hydra_redis:6379' class Commands(object): help = 'HELP' init = 'INIT' init_stats = 'INIT_STATS' qc = 'QC' pca = 'PCA' echo = 'ECHO' asso = 'ASSO' exit = 'EXIT' all_commands = [HELP, INIT, QC, PCA, ASSO, EXIT] commands_with_parms = [QC, PCA, ASSO] class Thresholds(object): echo_counts = 20 qc_hwe = 1e-10 qc_maf = 0.01 pca_maf = 0.1 pca_ld_window = 50 pca_ld_threshold = 0.2 pca_pcs = 10 asso_pcs = 10 class Options(object): init = Commands.INIT qc = Commands.QC pca = Commands.PCA asso = Commands.ASSO exit = Commands.EXIT hwe = 'HWE' maf = 'MAF' mps = 'MPS' mpi = 'MPI' snp = 'snp' ld = 'LD' none = 'NONE' class Qcoptions(object): hwe = Options.HWE maf = Options.MAF mps = Options.MPS mpi = Options.MPI snp = Options.SNP all_options = [HWE, MAF, MPS, MPI, SNP] class Pcaoptions(object): hwe = Options.HWE maf = Options.MAF mps = Options.MPS mpi = Options.MPI snp = Options.SNP ld = Options.LD none = Options.NONE all_options = [HWE, MAF, MPS, MPI, SNP, LD, NONE] class Qcfilternames(object): qc_hwe = Options.HWE qc_maf = Options.MAF qc_mps = Options.MPS qc_mpi = Options.MPI qc_snp = Options.SNP class Pcafilternames(object): pca_hwe = Options.HWE pca_maf = Options.MAF pca_mps = Options.MPS pca_mpi = Options.MPI pca_snp = Options.SNP pca_ld = Options.LD pca_none = Options.NONE external_host = 'hydratest23.azurewebsites.net' class Serverhttp(object): listen_host = '0.0.0.0' external_host = external_host port = '9001' max_content_length = 1024 * 1024 * 1024 wait_time = 0.5 class Clienthttp(object): default_max_content_length = 1024 * 1024 * 1024 default_listen_host = '0.0.0.0' default_external_host = external_host clients = [{'name': 'Center1', 'listen_host': default_listen_host, 'external_host': default_external_host, 'port': 9002, 'max_content_length': default_max_content_length}, {'name': 'Center2', 'listen_host': default_listen_host, 'external_host': default_external_host, 'port': 9003, 'max_content_length': default_max_content_length}, {'name': 'Center3', 'listen_host': default_listen_host, 'external_host': default_external_host, 'port': 9004, 'max_content_length': default_max_content_length}]
f = open("io/data/file1") print(f.readline()) print(f.readline(3)) print(f.readline(4)) print(f.readline(5)) print(f.readline()) # readline() on writable file f = open("io/data/file1", "ab") try: f.readline() except OSError: print("OSError") f.close()
f = open('io/data/file1') print(f.readline()) print(f.readline(3)) print(f.readline(4)) print(f.readline(5)) print(f.readline()) f = open('io/data/file1', 'ab') try: f.readline() except OSError: print('OSError') f.close()
# return an integere cycle length K of a permutation. Applying a permutation K-times to a list will return the original list. def permutation_cycle_length(permutation): initialArray = range(len(permutation)) permutedArray = range(len(permutation)) cycles = 0 while True: permutedArray = [permutedArray[permutation[i]] for i in range(len(initialArray))] cycles += 1 if(areEqual(initialArray, permutedArray)): break return cycles def areEqual(first, second): for i in range(len(first)): if(first[i] != second[i]): return False return True print(permutation_cycle_length([4, 3, 2, 0, 1]))
def permutation_cycle_length(permutation): initial_array = range(len(permutation)) permuted_array = range(len(permutation)) cycles = 0 while True: permuted_array = [permutedArray[permutation[i]] for i in range(len(initialArray))] cycles += 1 if are_equal(initialArray, permutedArray): break return cycles def are_equal(first, second): for i in range(len(first)): if first[i] != second[i]: return False return True print(permutation_cycle_length([4, 3, 2, 0, 1]))
BLOCKCHAIN = { 'class': 'thenewboston_node.business_logic.blockchain.file_blockchain.FileBlockchain', 'kwargs': {}, } BLOCKCHAIN_URL_PATH_PREFIX = '/blockchain/'
blockchain = {'class': 'thenewboston_node.business_logic.blockchain.file_blockchain.FileBlockchain', 'kwargs': {}} blockchain_url_path_prefix = '/blockchain/'
n = int(input()) a = n // 365 n = n - a*365 m = n // 30 n = n - m*30 d = n print('{} ano(s)'.format(a)) print('{} mes(es)'.format(m)) print('{} dia(s)'.format(d))
n = int(input()) a = n // 365 n = n - a * 365 m = n // 30 n = n - m * 30 d = n print('{} ano(s)'.format(a)) print('{} mes(es)'.format(m)) print('{} dia(s)'.format(d))
num=[10,20,30,40,50,60] n=[i for i in num] print(n) n=[10,20,30,40] s=[10,20] n1=[i for i in n] print(n1) n2=[j*j for j in n] print(n2) n3=[s+s for s in n ] print(n3) for m in n: s.append(m*m) print(s) #using lambda l=[1,2,3,4] p=list(map(lambda a:a*a ,l)) print(p) l=list(filter(lambda x:x%2==0,l)) print(l) v=[i for i in l if i%2==0] print(v) my=[] for letter in 'abcd': for num in range(4): my.append((letter,num)) print(my) x=[(letter,num)for letter in 'abcd' for num in range(4)] print(x)
num = [10, 20, 30, 40, 50, 60] n = [i for i in num] print(n) n = [10, 20, 30, 40] s = [10, 20] n1 = [i for i in n] print(n1) n2 = [j * j for j in n] print(n2) n3 = [s + s for s in n] print(n3) for m in n: s.append(m * m) print(s) l = [1, 2, 3, 4] p = list(map(lambda a: a * a, l)) print(p) l = list(filter(lambda x: x % 2 == 0, l)) print(l) v = [i for i in l if i % 2 == 0] print(v) my = [] for letter in 'abcd': for num in range(4): my.append((letter, num)) print(my) x = [(letter, num) for letter in 'abcd' for num in range(4)] print(x)
""" PASSENGERS """ numPassengers = 3241 passenger_arriving = ( (2, 4, 9, 5, 2, 0, 7, 7, 4, 5, 1, 0), # 0 (1, 9, 7, 4, 1, 0, 6, 6, 9, 6, 1, 0), # 1 (5, 6, 8, 4, 3, 0, 8, 11, 5, 2, 1, 0), # 2 (4, 5, 5, 4, 2, 0, 8, 15, 0, 4, 4, 0), # 3 (5, 11, 13, 4, 3, 0, 11, 6, 3, 1, 1, 0), # 4 (9, 6, 8, 3, 0, 0, 7, 6, 9, 7, 4, 0), # 5 (8, 12, 3, 4, 1, 0, 4, 12, 5, 4, 0, 0), # 6 (4, 13, 11, 2, 3, 0, 9, 9, 6, 5, 1, 0), # 7 (3, 8, 7, 7, 3, 0, 5, 9, 7, 5, 1, 0), # 8 (2, 5, 5, 1, 3, 0, 3, 3, 5, 6, 5, 0), # 9 (5, 8, 9, 3, 1, 0, 8, 12, 4, 3, 4, 0), # 10 (3, 12, 6, 3, 2, 0, 6, 6, 8, 6, 1, 0), # 11 (1, 10, 8, 7, 1, 0, 10, 7, 6, 5, 1, 0), # 12 (4, 9, 8, 3, 1, 0, 7, 11, 12, 3, 3, 0), # 13 (2, 10, 6, 3, 2, 0, 9, 7, 4, 7, 1, 0), # 14 (2, 6, 9, 2, 4, 0, 7, 12, 7, 8, 2, 0), # 15 (3, 14, 8, 5, 5, 0, 8, 10, 5, 5, 1, 0), # 16 (2, 8, 6, 5, 2, 0, 6, 5, 3, 7, 0, 0), # 17 (3, 11, 8, 2, 0, 0, 4, 3, 4, 7, 0, 0), # 18 (2, 7, 4, 2, 4, 0, 7, 4, 3, 6, 2, 0), # 19 (7, 16, 5, 3, 3, 0, 8, 6, 6, 4, 2, 0), # 20 (1, 6, 11, 5, 0, 0, 4, 11, 6, 9, 0, 0), # 21 (5, 8, 7, 5, 2, 0, 10, 11, 4, 3, 2, 0), # 22 (2, 8, 14, 3, 3, 0, 3, 8, 4, 4, 3, 0), # 23 (3, 7, 5, 5, 5, 0, 5, 8, 4, 5, 3, 0), # 24 (7, 5, 5, 4, 3, 0, 2, 5, 6, 6, 1, 0), # 25 (7, 12, 3, 6, 3, 0, 4, 10, 9, 3, 4, 0), # 26 (1, 10, 8, 2, 1, 0, 5, 13, 5, 5, 0, 0), # 27 (6, 4, 9, 6, 3, 0, 6, 8, 7, 7, 3, 0), # 28 (6, 9, 13, 7, 1, 0, 3, 10, 7, 3, 4, 0), # 29 (4, 5, 5, 2, 2, 0, 9, 14, 6, 7, 1, 0), # 30 (2, 7, 3, 3, 1, 0, 7, 7, 4, 4, 2, 0), # 31 (4, 5, 9, 0, 2, 0, 5, 15, 3, 2, 1, 0), # 32 (4, 10, 9, 2, 3, 0, 11, 8, 4, 4, 1, 0), # 33 (6, 11, 6, 3, 1, 0, 8, 4, 10, 6, 2, 0), # 34 (6, 4, 3, 4, 3, 0, 10, 9, 6, 6, 0, 0), # 35 (4, 6, 15, 4, 2, 0, 13, 8, 3, 6, 2, 0), # 36 (6, 9, 5, 5, 6, 0, 10, 14, 2, 7, 3, 0), # 37 (2, 7, 11, 7, 1, 0, 7, 7, 5, 3, 1, 0), # 38 (4, 11, 7, 4, 2, 0, 6, 13, 3, 2, 3, 0), # 39 (10, 12, 10, 3, 3, 0, 4, 10, 6, 7, 1, 0), # 40 (6, 6, 4, 1, 2, 0, 7, 9, 5, 4, 0, 0), # 41 (6, 7, 10, 5, 3, 0, 0, 15, 9, 7, 0, 0), # 42 (8, 11, 8, 2, 3, 0, 9, 12, 7, 1, 3, 0), # 43 (5, 12, 13, 3, 2, 0, 8, 12, 3, 4, 4, 0), # 44 (5, 8, 4, 6, 0, 0, 8, 9, 5, 3, 5, 0), # 45 (11, 18, 7, 2, 0, 0, 5, 13, 6, 3, 3, 0), # 46 (5, 9, 2, 5, 0, 0, 4, 8, 5, 3, 1, 0), # 47 (5, 9, 8, 7, 1, 0, 11, 10, 4, 4, 0, 0), # 48 (0, 10, 8, 4, 1, 0, 6, 7, 7, 6, 2, 0), # 49 (8, 8, 7, 4, 3, 0, 4, 11, 4, 8, 1, 0), # 50 (9, 12, 10, 3, 2, 0, 7, 9, 6, 7, 3, 0), # 51 (3, 8, 7, 4, 3, 0, 3, 11, 5, 4, 1, 0), # 52 (6, 8, 6, 3, 4, 0, 9, 10, 6, 5, 3, 0), # 53 (2, 17, 11, 4, 2, 0, 5, 14, 6, 12, 2, 0), # 54 (3, 8, 5, 3, 2, 0, 12, 9, 5, 4, 1, 0), # 55 (1, 6, 9, 4, 6, 0, 11, 10, 6, 8, 2, 0), # 56 (5, 6, 3, 5, 1, 0, 8, 9, 3, 6, 1, 0), # 57 (0, 11, 6, 5, 0, 0, 4, 13, 5, 4, 2, 0), # 58 (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0), # 59 ) station_arriving_intensity = ( (3.7095121817383676, 9.515044981060607, 11.19193043059126, 8.87078804347826, 10.000240384615385, 6.659510869565219), # 0 (3.7443308140669203, 9.620858238197952, 11.252381752534994, 8.920190141908213, 10.075193108974359, 6.657240994867151), # 1 (3.7787518681104277, 9.725101964085297, 11.31139817195087, 8.968504830917876, 10.148564102564103, 6.654901690821256), # 2 (3.8127461259877085, 9.827663671875001, 11.368936576156813, 9.01569089673913, 10.22028605769231, 6.652493274456523), # 3 (3.8462843698175795, 9.928430874719417, 11.424953852470724, 9.061707125603865, 10.290291666666668, 6.6500160628019325), # 4 (3.879337381718857, 10.027291085770905, 11.479406888210512, 9.106512303743962, 10.358513621794872, 6.647470372886473), # 5 (3.9118759438103607, 10.12413181818182, 11.53225257069409, 9.150065217391306, 10.424884615384617, 6.644856521739131), # 6 (3.943870838210907, 10.218840585104518, 11.58344778723936, 9.19232465277778, 10.489337339743592, 6.64217482638889), # 7 (3.975292847039314, 10.311304899691358, 11.632949425164242, 9.233249396135266, 10.551804487179488, 6.639425603864735), # 8 (4.006112752414399, 10.401412275094698, 11.680714371786634, 9.272798233695653, 10.61221875, 6.636609171195653), # 9 (4.03630133645498, 10.489050224466892, 11.72669951442445, 9.310929951690824, 10.670512820512823, 6.633725845410628), # 10 (4.065829381279876, 10.5741062609603, 11.7708617403956, 9.347603336352659, 10.726619391025642, 6.630775943538648), # 11 (4.094667669007903, 10.656467897727273, 11.813157937017996, 9.382777173913043, 10.780471153846154, 6.627759782608695), # 12 (4.122786981757876, 10.736022647920176, 11.85354499160954, 9.416410250603866, 10.832000801282053, 6.624677679649759), # 13 (4.15015810164862, 10.81265802469136, 11.891979791488144, 9.448461352657004, 10.881141025641025, 6.621529951690821), # 14 (4.1767518107989465, 10.886261541193182, 11.928419223971721, 9.478889266304348, 10.92782451923077, 6.618316915760871), # 15 (4.202538891327675, 10.956720710578002, 11.96282017637818, 9.507652777777778, 10.971983974358976, 6.61503888888889), # 16 (4.227490125353625, 11.023923045998176, 11.995139536025421, 9.53471067330918, 11.013552083333336, 6.611696188103866), # 17 (4.25157629499561, 11.087756060606061, 12.025334190231364, 9.560021739130436, 11.052461538461543, 6.608289130434783), # 18 (4.274768182372451, 11.148107267554012, 12.053361026313912, 9.58354476147343, 11.088645032051284, 6.604818032910629), # 19 (4.297036569602966, 11.204864179994388, 12.079176931590974, 9.60523852657005, 11.122035256410259, 6.601283212560387), # 20 (4.318352238805971, 11.257914311079544, 12.102738793380466, 9.625061820652174, 11.152564903846153, 6.597684986413044), # 21 (4.338685972100283, 11.307145173961842, 12.124003499000287, 9.642973429951692, 11.180166666666667, 6.5940236714975855), # 22 (4.358008551604722, 11.352444281793632, 12.142927935768354, 9.658932140700484, 11.204773237179488, 6.590299584842997), # 23 (4.3762907594381035, 11.393699147727272, 12.159468991002571, 9.672896739130437, 11.226317307692307, 6.586513043478261), # 24 (4.393503377719247, 11.430797284915124, 12.173583552020853, 9.684826011473431, 11.244731570512819, 6.582664364432368), # 25 (4.409617188566969, 11.46362620650954, 12.185228506141103, 9.694678743961353, 11.259948717948719, 6.5787538647343), # 26 (4.424602974100088, 11.492073425662877, 12.194360740681233, 9.702413722826089, 11.271901442307694, 6.574781861413045), # 27 (4.438431516437421, 11.516026455527497, 12.200937142959157, 9.707989734299519, 11.280522435897437, 6.570748671497586), # 28 (4.4510735976977855, 11.535372809255753, 12.204914600292774, 9.711365564613528, 11.285744391025641, 6.566654612016909), # 29 (4.4625, 11.55, 12.20625, 9.7125, 11.287500000000001, 6.562500000000001), # 30 (4.47319183983376, 11.56215031960227, 12.205248928140096, 9.712295118464054, 11.286861125886526, 6.556726763701484), # 31 (4.4836528452685425, 11.574140056818184, 12.202274033816424, 9.711684477124184, 11.28495815602837, 6.547834661835751), # 32 (4.493887715792838, 11.585967720170455, 12.197367798913046, 9.710674080882354, 11.281811569148937, 6.535910757121439), # 33 (4.503901150895141, 11.597631818181819, 12.19057270531401, 9.709269934640524, 11.277441843971632, 6.521042112277196), # 34 (4.513697850063939, 11.609130859374998, 12.181931234903383, 9.707478043300654, 11.27186945921986, 6.503315790021656), # 35 (4.523282512787724, 11.62046335227273, 12.171485869565219, 9.705304411764708, 11.265114893617023, 6.482818853073463), # 36 (4.532659838554988, 11.631627805397729, 12.159279091183576, 9.70275504493464, 11.257198625886524, 6.4596383641512585), # 37 (4.5418345268542195, 11.642622727272729, 12.145353381642513, 9.699835947712419, 11.248141134751775, 6.433861385973679), # 38 (4.5508112771739135, 11.653446626420456, 12.129751222826087, 9.696553125000001, 11.23796289893617, 6.40557498125937), # 39 (4.559594789002558, 11.664098011363638, 12.11251509661836, 9.692912581699348, 11.22668439716312, 6.37486621272697), # 40 (4.568189761828645, 11.674575390625, 12.093687484903382, 9.68892032271242, 11.214326108156028, 6.34182214309512), # 41 (4.576600895140665, 11.684877272727276, 12.07331086956522, 9.684582352941177, 11.2009085106383, 6.3065298350824595), # 42 (4.584832888427111, 11.69500216619318, 12.051427732487923, 9.679904677287583, 11.186452083333334, 6.26907635140763), # 43 (4.592890441176471, 11.704948579545455, 12.028080555555556, 9.674893300653595, 11.17097730496454, 6.229548754789272), # 44 (4.600778252877237, 11.714715021306818, 12.003311820652177, 9.669554227941177, 11.15450465425532, 6.188034107946028), # 45 (4.6085010230179035, 11.724300000000003, 11.97716400966184, 9.663893464052288, 11.137054609929079, 6.144619473596536), # 46 (4.616063451086957, 11.733702024147728, 11.9496796044686, 9.65791701388889, 11.118647650709221, 6.099391914459438), # 47 (4.623470236572891, 11.742919602272728, 11.920901086956523, 9.651630882352942, 11.099304255319149, 6.052438493253375), # 48 (4.630726078964194, 11.751951242897727, 11.890870939009663, 9.645041074346407, 11.079044902482272, 6.003846272696985), # 49 (4.6378356777493615, 11.760795454545454, 11.85963164251208, 9.638153594771243, 11.057890070921987, 5.953702315508913), # 50 (4.6448037324168805, 11.769450745738636, 11.827225679347826, 9.630974448529413, 11.035860239361703, 5.902093684407797), # 51 (4.651634942455243, 11.777915625, 11.793695531400965, 9.623509640522876, 11.012975886524824, 5.849107442112278), # 52 (4.658334007352941, 11.786188600852274, 11.759083680555555, 9.615765175653596, 10.989257491134753, 5.794830651340996), # 53 (4.6649056265984665, 11.79426818181818, 11.723432608695653, 9.60774705882353, 10.964725531914894, 5.739350374812594), # 54 (4.671354499680307, 11.802152876420456, 11.686784797705313, 9.599461294934642, 10.939400487588653, 5.682753675245711), # 55 (4.677685326086957, 11.809841193181818, 11.649182729468599, 9.59091388888889, 10.913302836879433, 5.625127615358988), # 56 (4.683902805306906, 11.817331640625003, 11.610668885869565, 9.582110845588236, 10.886453058510638, 5.566559257871065), # 57 (4.690011636828645, 11.824622727272727, 11.57128574879227, 9.573058169934642, 10.858871631205675, 5.507135665500583), # 58 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 59 ) passenger_arriving_acc = ( (2, 4, 9, 5, 2, 0, 7, 7, 4, 5, 1, 0), # 0 (3, 13, 16, 9, 3, 0, 13, 13, 13, 11, 2, 0), # 1 (8, 19, 24, 13, 6, 0, 21, 24, 18, 13, 3, 0), # 2 (12, 24, 29, 17, 8, 0, 29, 39, 18, 17, 7, 0), # 3 (17, 35, 42, 21, 11, 0, 40, 45, 21, 18, 8, 0), # 4 (26, 41, 50, 24, 11, 0, 47, 51, 30, 25, 12, 0), # 5 (34, 53, 53, 28, 12, 0, 51, 63, 35, 29, 12, 0), # 6 (38, 66, 64, 30, 15, 0, 60, 72, 41, 34, 13, 0), # 7 (41, 74, 71, 37, 18, 0, 65, 81, 48, 39, 14, 0), # 8 (43, 79, 76, 38, 21, 0, 68, 84, 53, 45, 19, 0), # 9 (48, 87, 85, 41, 22, 0, 76, 96, 57, 48, 23, 0), # 10 (51, 99, 91, 44, 24, 0, 82, 102, 65, 54, 24, 0), # 11 (52, 109, 99, 51, 25, 0, 92, 109, 71, 59, 25, 0), # 12 (56, 118, 107, 54, 26, 0, 99, 120, 83, 62, 28, 0), # 13 (58, 128, 113, 57, 28, 0, 108, 127, 87, 69, 29, 0), # 14 (60, 134, 122, 59, 32, 0, 115, 139, 94, 77, 31, 0), # 15 (63, 148, 130, 64, 37, 0, 123, 149, 99, 82, 32, 0), # 16 (65, 156, 136, 69, 39, 0, 129, 154, 102, 89, 32, 0), # 17 (68, 167, 144, 71, 39, 0, 133, 157, 106, 96, 32, 0), # 18 (70, 174, 148, 73, 43, 0, 140, 161, 109, 102, 34, 0), # 19 (77, 190, 153, 76, 46, 0, 148, 167, 115, 106, 36, 0), # 20 (78, 196, 164, 81, 46, 0, 152, 178, 121, 115, 36, 0), # 21 (83, 204, 171, 86, 48, 0, 162, 189, 125, 118, 38, 0), # 22 (85, 212, 185, 89, 51, 0, 165, 197, 129, 122, 41, 0), # 23 (88, 219, 190, 94, 56, 0, 170, 205, 133, 127, 44, 0), # 24 (95, 224, 195, 98, 59, 0, 172, 210, 139, 133, 45, 0), # 25 (102, 236, 198, 104, 62, 0, 176, 220, 148, 136, 49, 0), # 26 (103, 246, 206, 106, 63, 0, 181, 233, 153, 141, 49, 0), # 27 (109, 250, 215, 112, 66, 0, 187, 241, 160, 148, 52, 0), # 28 (115, 259, 228, 119, 67, 0, 190, 251, 167, 151, 56, 0), # 29 (119, 264, 233, 121, 69, 0, 199, 265, 173, 158, 57, 0), # 30 (121, 271, 236, 124, 70, 0, 206, 272, 177, 162, 59, 0), # 31 (125, 276, 245, 124, 72, 0, 211, 287, 180, 164, 60, 0), # 32 (129, 286, 254, 126, 75, 0, 222, 295, 184, 168, 61, 0), # 33 (135, 297, 260, 129, 76, 0, 230, 299, 194, 174, 63, 0), # 34 (141, 301, 263, 133, 79, 0, 240, 308, 200, 180, 63, 0), # 35 (145, 307, 278, 137, 81, 0, 253, 316, 203, 186, 65, 0), # 36 (151, 316, 283, 142, 87, 0, 263, 330, 205, 193, 68, 0), # 37 (153, 323, 294, 149, 88, 0, 270, 337, 210, 196, 69, 0), # 38 (157, 334, 301, 153, 90, 0, 276, 350, 213, 198, 72, 0), # 39 (167, 346, 311, 156, 93, 0, 280, 360, 219, 205, 73, 0), # 40 (173, 352, 315, 157, 95, 0, 287, 369, 224, 209, 73, 0), # 41 (179, 359, 325, 162, 98, 0, 287, 384, 233, 216, 73, 0), # 42 (187, 370, 333, 164, 101, 0, 296, 396, 240, 217, 76, 0), # 43 (192, 382, 346, 167, 103, 0, 304, 408, 243, 221, 80, 0), # 44 (197, 390, 350, 173, 103, 0, 312, 417, 248, 224, 85, 0), # 45 (208, 408, 357, 175, 103, 0, 317, 430, 254, 227, 88, 0), # 46 (213, 417, 359, 180, 103, 0, 321, 438, 259, 230, 89, 0), # 47 (218, 426, 367, 187, 104, 0, 332, 448, 263, 234, 89, 0), # 48 (218, 436, 375, 191, 105, 0, 338, 455, 270, 240, 91, 0), # 49 (226, 444, 382, 195, 108, 0, 342, 466, 274, 248, 92, 0), # 50 (235, 456, 392, 198, 110, 0, 349, 475, 280, 255, 95, 0), # 51 (238, 464, 399, 202, 113, 0, 352, 486, 285, 259, 96, 0), # 52 (244, 472, 405, 205, 117, 0, 361, 496, 291, 264, 99, 0), # 53 (246, 489, 416, 209, 119, 0, 366, 510, 297, 276, 101, 0), # 54 (249, 497, 421, 212, 121, 0, 378, 519, 302, 280, 102, 0), # 55 (250, 503, 430, 216, 127, 0, 389, 529, 308, 288, 104, 0), # 56 (255, 509, 433, 221, 128, 0, 397, 538, 311, 294, 105, 0), # 57 (255, 520, 439, 226, 128, 0, 401, 551, 316, 298, 107, 0), # 58 (255, 520, 439, 226, 128, 0, 401, 551, 316, 298, 107, 0), # 59 ) passenger_arriving_rate = ( (3.7095121817383676, 7.612035984848484, 6.715158258354756, 3.5483152173913037, 2.000048076923077, 0.0, 6.659510869565219, 8.000192307692307, 5.322472826086956, 4.476772172236504, 1.903008996212121, 0.0), # 0 (3.7443308140669203, 7.696686590558361, 6.751429051520996, 3.5680760567632848, 2.0150386217948717, 0.0, 6.657240994867151, 8.060154487179487, 5.352114085144928, 4.500952701013997, 1.9241716476395903, 0.0), # 1 (3.7787518681104277, 7.780081571268237, 6.786838903170522, 3.58740193236715, 2.0297128205128203, 0.0, 6.654901690821256, 8.118851282051281, 5.381102898550726, 4.524559268780347, 1.9450203928170593, 0.0), # 2 (3.8127461259877085, 7.8621309375, 6.821361945694087, 3.6062763586956517, 2.044057211538462, 0.0, 6.652493274456523, 8.176228846153847, 5.409414538043478, 4.547574630462725, 1.965532734375, 0.0), # 3 (3.8462843698175795, 7.942744699775533, 6.854972311482434, 3.624682850241546, 2.0580583333333333, 0.0, 6.6500160628019325, 8.232233333333333, 5.437024275362319, 4.569981540988289, 1.9856861749438832, 0.0), # 4 (3.879337381718857, 8.021832868616723, 6.887644132926307, 3.6426049214975844, 2.0717027243589743, 0.0, 6.647470372886473, 8.286810897435897, 5.463907382246377, 4.591762755284204, 2.005458217154181, 0.0), # 5 (3.9118759438103607, 8.099305454545455, 6.919351542416455, 3.660026086956522, 2.084976923076923, 0.0, 6.644856521739131, 8.339907692307692, 5.490039130434783, 4.612901028277636, 2.0248263636363637, 0.0), # 6 (3.943870838210907, 8.175072468083613, 6.950068672343615, 3.6769298611111116, 2.0978674679487184, 0.0, 6.64217482638889, 8.391469871794873, 5.515394791666668, 4.633379114895743, 2.043768117020903, 0.0), # 7 (3.975292847039314, 8.249043919753085, 6.979769655098544, 3.693299758454106, 2.1103608974358976, 0.0, 6.639425603864735, 8.44144358974359, 5.5399496376811594, 4.653179770065696, 2.062260979938271, 0.0), # 8 (4.006112752414399, 8.321129820075758, 7.00842862307198, 3.709119293478261, 2.12244375, 0.0, 6.636609171195653, 8.489775, 5.563678940217391, 4.672285748714653, 2.0802824550189394, 0.0), # 9 (4.03630133645498, 8.391240179573513, 7.03601970865467, 3.724371980676329, 2.134102564102564, 0.0, 6.633725845410628, 8.536410256410257, 5.586557971014494, 4.690679805769779, 2.0978100448933783, 0.0), # 10 (4.065829381279876, 8.459285008768239, 7.06251704423736, 3.739041334541063, 2.145323878205128, 0.0, 6.630775943538648, 8.581295512820512, 5.608562001811595, 4.70834469615824, 2.1148212521920597, 0.0), # 11 (4.094667669007903, 8.525174318181818, 7.087894762210797, 3.7531108695652167, 2.156094230769231, 0.0, 6.627759782608695, 8.624376923076923, 5.6296663043478254, 4.725263174807198, 2.1312935795454546, 0.0), # 12 (4.122786981757876, 8.58881811833614, 7.112126994965724, 3.766564100241546, 2.1664001602564102, 0.0, 6.624677679649759, 8.665600641025641, 5.649846150362319, 4.741417996643816, 2.147204529584035, 0.0), # 13 (4.15015810164862, 8.650126419753088, 7.135187874892886, 3.779384541062801, 2.1762282051282047, 0.0, 6.621529951690821, 8.704912820512819, 5.669076811594202, 4.756791916595257, 2.162531604938272, 0.0), # 14 (4.1767518107989465, 8.709009232954545, 7.157051534383032, 3.7915557065217387, 2.1855649038461538, 0.0, 6.618316915760871, 8.742259615384615, 5.6873335597826085, 4.771367689588688, 2.177252308238636, 0.0), # 15 (4.202538891327675, 8.7653765684624, 7.177692105826908, 3.803061111111111, 2.194396794871795, 0.0, 6.61503888888889, 8.77758717948718, 5.7045916666666665, 4.785128070551272, 2.1913441421156, 0.0), # 16 (4.227490125353625, 8.81913843679854, 7.197083721615253, 3.8138842693236716, 2.202710416666667, 0.0, 6.611696188103866, 8.810841666666668, 5.720826403985508, 4.798055814410168, 2.204784609199635, 0.0), # 17 (4.25157629499561, 8.870204848484848, 7.215200514138818, 3.824008695652174, 2.2104923076923084, 0.0, 6.608289130434783, 8.841969230769234, 5.736013043478262, 4.810133676092545, 2.217551212121212, 0.0), # 18 (4.274768182372451, 8.918485814043208, 7.232016615788346, 3.8334179045893717, 2.2177290064102566, 0.0, 6.604818032910629, 8.870916025641026, 5.750126856884058, 4.8213444105255645, 2.229621453510802, 0.0), # 19 (4.297036569602966, 8.96389134399551, 7.247506158954584, 3.8420954106280196, 2.2244070512820517, 0.0, 6.601283212560387, 8.897628205128207, 5.76314311594203, 4.831670772636389, 2.2409728359988774, 0.0), # 20 (4.318352238805971, 9.006331448863634, 7.261643276028279, 3.8500247282608693, 2.2305129807692303, 0.0, 6.597684986413044, 8.922051923076921, 5.775037092391305, 4.841095517352186, 2.2515828622159084, 0.0), # 21 (4.338685972100283, 9.045716139169473, 7.274402099400172, 3.8571893719806765, 2.2360333333333333, 0.0, 6.5940236714975855, 8.944133333333333, 5.785784057971015, 4.849601399600115, 2.2614290347923682, 0.0), # 22 (4.358008551604722, 9.081955425434906, 7.285756761461012, 3.8635728562801934, 2.2409546474358972, 0.0, 6.590299584842997, 8.963818589743589, 5.79535928442029, 4.857171174307341, 2.2704888563587264, 0.0), # 23 (4.3762907594381035, 9.114959318181818, 7.295681394601543, 3.869158695652174, 2.2452634615384612, 0.0, 6.586513043478261, 8.981053846153845, 5.803738043478262, 4.863787596401028, 2.2787398295454544, 0.0), # 24 (4.393503377719247, 9.1446378279321, 7.304150131212511, 3.8739304045893723, 2.2489463141025636, 0.0, 6.582664364432368, 8.995785256410255, 5.810895606884059, 4.869433420808341, 2.286159456983025, 0.0), # 25 (4.409617188566969, 9.17090096520763, 7.311137103684661, 3.8778714975845405, 2.2519897435897436, 0.0, 6.5787538647343, 9.007958974358974, 5.816807246376811, 4.874091402456441, 2.2927252413019077, 0.0), # 26 (4.424602974100088, 9.193658740530301, 7.31661644440874, 3.880965489130435, 2.2543802884615385, 0.0, 6.574781861413045, 9.017521153846154, 5.821448233695653, 4.877744296272493, 2.2984146851325753, 0.0), # 27 (4.438431516437421, 9.212821164421996, 7.320562285775494, 3.8831958937198072, 2.256104487179487, 0.0, 6.570748671497586, 9.024417948717948, 5.824793840579711, 4.8803748571836625, 2.303205291105499, 0.0), # 28 (4.4510735976977855, 9.228298247404602, 7.322948760175664, 3.884546225845411, 2.257148878205128, 0.0, 6.566654612016909, 9.028595512820512, 5.826819338768117, 4.881965840117109, 2.3070745618511506, 0.0), # 29 (4.4625, 9.24, 7.32375, 3.885, 2.2575000000000003, 0.0, 6.562500000000001, 9.030000000000001, 5.8275, 4.8825, 2.31, 0.0), # 30 (4.47319183983376, 9.249720255681815, 7.323149356884057, 3.884918047385621, 2.257372225177305, 0.0, 6.556726763701484, 9.02948890070922, 5.827377071078432, 4.882099571256038, 2.312430063920454, 0.0), # 31 (4.4836528452685425, 9.259312045454546, 7.3213644202898545, 3.884673790849673, 2.2569916312056737, 0.0, 6.547834661835751, 9.027966524822695, 5.82701068627451, 4.880909613526569, 2.3148280113636366, 0.0), # 32 (4.493887715792838, 9.268774176136363, 7.3184206793478275, 3.8842696323529413, 2.2563623138297872, 0.0, 6.535910757121439, 9.025449255319149, 5.826404448529412, 4.878947119565218, 2.3171935440340907, 0.0), # 33 (4.503901150895141, 9.278105454545454, 7.314343623188405, 3.8837079738562093, 2.2554883687943263, 0.0, 6.521042112277196, 9.021953475177305, 5.825561960784314, 4.876229082125604, 2.3195263636363634, 0.0), # 34 (4.513697850063939, 9.287304687499997, 7.3091587409420296, 3.882991217320261, 2.2543738918439717, 0.0, 6.503315790021656, 9.017495567375887, 5.824486825980392, 4.872772493961353, 2.3218261718749993, 0.0), # 35 (4.523282512787724, 9.296370681818182, 7.302891521739131, 3.8821217647058828, 2.253022978723404, 0.0, 6.482818853073463, 9.012091914893617, 5.823182647058824, 4.868594347826087, 2.3240926704545455, 0.0), # 36 (4.532659838554988, 9.305302244318183, 7.295567454710145, 3.881102017973856, 2.2514397251773044, 0.0, 6.4596383641512585, 9.005758900709218, 5.821653026960784, 4.86371163647343, 2.3263255610795457, 0.0), # 37 (4.5418345268542195, 9.314098181818181, 7.287212028985508, 3.8799343790849674, 2.249628226950355, 0.0, 6.433861385973679, 8.99851290780142, 5.819901568627452, 4.858141352657005, 2.3285245454545453, 0.0), # 38 (4.5508112771739135, 9.322757301136363, 7.277850733695652, 3.87862125, 2.247592579787234, 0.0, 6.40557498125937, 8.990370319148935, 5.817931875, 4.8519004891304345, 2.330689325284091, 0.0), # 39 (4.559594789002558, 9.33127840909091, 7.267509057971015, 3.8771650326797387, 2.245336879432624, 0.0, 6.37486621272697, 8.981347517730496, 5.815747549019608, 4.845006038647344, 2.3328196022727274, 0.0), # 40 (4.568189761828645, 9.3396603125, 7.256212490942029, 3.8755681290849675, 2.2428652216312055, 0.0, 6.34182214309512, 8.971460886524822, 5.813352193627452, 4.837474993961353, 2.334915078125, 0.0), # 41 (4.576600895140665, 9.34790181818182, 7.2439865217391315, 3.8738329411764707, 2.2401817021276598, 0.0, 6.3065298350824595, 8.960726808510639, 5.810749411764706, 4.829324347826088, 2.336975454545455, 0.0), # 42 (4.584832888427111, 9.356001732954544, 7.230856639492753, 3.8719618709150327, 2.2372904166666667, 0.0, 6.26907635140763, 8.949161666666667, 5.80794280637255, 4.820571092995169, 2.339000433238636, 0.0), # 43 (4.592890441176471, 9.363958863636363, 7.216848333333333, 3.8699573202614377, 2.2341954609929076, 0.0, 6.229548754789272, 8.93678184397163, 5.804935980392157, 4.811232222222222, 2.3409897159090907, 0.0), # 44 (4.600778252877237, 9.371772017045453, 7.201987092391306, 3.8678216911764705, 2.230900930851064, 0.0, 6.188034107946028, 8.923603723404256, 5.801732536764706, 4.80132472826087, 2.3429430042613633, 0.0), # 45 (4.6085010230179035, 9.379440000000002, 7.186298405797103, 3.8655573856209147, 2.2274109219858156, 0.0, 6.144619473596536, 8.909643687943262, 5.798336078431372, 4.790865603864735, 2.3448600000000006, 0.0), # 46 (4.616063451086957, 9.386961619318182, 7.16980776268116, 3.8631668055555552, 2.223729530141844, 0.0, 6.099391914459438, 8.894918120567375, 5.794750208333333, 4.77987184178744, 2.3467404048295455, 0.0), # 47 (4.623470236572891, 9.394335681818182, 7.152540652173913, 3.8606523529411763, 2.21986085106383, 0.0, 6.052438493253375, 8.87944340425532, 5.790978529411765, 4.7683604347826085, 2.3485839204545456, 0.0), # 48 (4.630726078964194, 9.401560994318181, 7.134522563405797, 3.8580164297385626, 2.2158089804964543, 0.0, 6.003846272696985, 8.863235921985817, 5.787024644607844, 4.7563483756038645, 2.3503902485795454, 0.0), # 49 (4.6378356777493615, 9.408636363636361, 7.115778985507247, 3.8552614379084966, 2.211578014184397, 0.0, 5.953702315508913, 8.846312056737588, 5.782892156862745, 4.743852657004831, 2.3521590909090904, 0.0), # 50 (4.6448037324168805, 9.415560596590907, 7.096335407608696, 3.852389779411765, 2.2071720478723407, 0.0, 5.902093684407797, 8.828688191489363, 5.778584669117648, 4.73089027173913, 2.353890149147727, 0.0), # 51 (4.651634942455243, 9.4223325, 7.0762173188405795, 3.84940385620915, 2.2025951773049646, 0.0, 5.849107442112278, 8.810380709219858, 5.774105784313726, 4.717478212560386, 2.355583125, 0.0), # 52 (4.658334007352941, 9.428950880681818, 7.055450208333333, 3.8463060702614382, 2.1978514982269504, 0.0, 5.794830651340996, 8.791405992907801, 5.769459105392158, 4.703633472222222, 2.3572377201704544, 0.0), # 53 (4.6649056265984665, 9.435414545454544, 7.034059565217391, 3.843098823529412, 2.192945106382979, 0.0, 5.739350374812594, 8.771780425531915, 5.764648235294119, 4.689373043478261, 2.358853636363636, 0.0), # 54 (4.671354499680307, 9.441722301136364, 7.012070878623187, 3.8397845179738566, 2.1878800975177306, 0.0, 5.682753675245711, 8.751520390070922, 5.759676776960785, 4.674713919082125, 2.360430575284091, 0.0), # 55 (4.677685326086957, 9.447872954545453, 6.989509637681159, 3.8363655555555556, 2.1826605673758865, 0.0, 5.625127615358988, 8.730642269503546, 5.754548333333334, 4.65967309178744, 2.361968238636363, 0.0), # 56 (4.683902805306906, 9.453865312500001, 6.966401331521738, 3.832844338235294, 2.1772906117021273, 0.0, 5.566559257871065, 8.70916244680851, 5.749266507352941, 4.644267554347826, 2.3634663281250003, 0.0), # 57 (4.690011636828645, 9.459698181818181, 6.942771449275362, 3.8292232679738563, 2.1717743262411346, 0.0, 5.507135665500583, 8.687097304964539, 5.743834901960785, 4.628514299516908, 2.3649245454545453, 0.0), # 58 (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0), # 59 ) passenger_allighting_rate = ( (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 0 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 1 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 2 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 3 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 4 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 5 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 6 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 7 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 8 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 9 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 10 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 11 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 12 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 13 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 14 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 15 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 16 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 17 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 18 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 19 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 20 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 21 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 22 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 23 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 24 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 25 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 26 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 27 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 28 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 29 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 30 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 31 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 32 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 33 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 34 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 35 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 36 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 37 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 38 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 39 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 40 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 41 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 42 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 43 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 44 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 45 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 46 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 47 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 48 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 49 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 50 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 51 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 52 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 53 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 54 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 55 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 56 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 57 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 58 (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), # 59 ) """ parameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html """ #initial entropy entropy = 258194110137029475889902652135037600173 #index for seed sequence child child_seed_index = ( 1, # 0 59, # 1 )
""" PASSENGERS """ num_passengers = 3241 passenger_arriving = ((2, 4, 9, 5, 2, 0, 7, 7, 4, 5, 1, 0), (1, 9, 7, 4, 1, 0, 6, 6, 9, 6, 1, 0), (5, 6, 8, 4, 3, 0, 8, 11, 5, 2, 1, 0), (4, 5, 5, 4, 2, 0, 8, 15, 0, 4, 4, 0), (5, 11, 13, 4, 3, 0, 11, 6, 3, 1, 1, 0), (9, 6, 8, 3, 0, 0, 7, 6, 9, 7, 4, 0), (8, 12, 3, 4, 1, 0, 4, 12, 5, 4, 0, 0), (4, 13, 11, 2, 3, 0, 9, 9, 6, 5, 1, 0), (3, 8, 7, 7, 3, 0, 5, 9, 7, 5, 1, 0), (2, 5, 5, 1, 3, 0, 3, 3, 5, 6, 5, 0), (5, 8, 9, 3, 1, 0, 8, 12, 4, 3, 4, 0), (3, 12, 6, 3, 2, 0, 6, 6, 8, 6, 1, 0), (1, 10, 8, 7, 1, 0, 10, 7, 6, 5, 1, 0), (4, 9, 8, 3, 1, 0, 7, 11, 12, 3, 3, 0), (2, 10, 6, 3, 2, 0, 9, 7, 4, 7, 1, 0), (2, 6, 9, 2, 4, 0, 7, 12, 7, 8, 2, 0), (3, 14, 8, 5, 5, 0, 8, 10, 5, 5, 1, 0), (2, 8, 6, 5, 2, 0, 6, 5, 3, 7, 0, 0), (3, 11, 8, 2, 0, 0, 4, 3, 4, 7, 0, 0), (2, 7, 4, 2, 4, 0, 7, 4, 3, 6, 2, 0), (7, 16, 5, 3, 3, 0, 8, 6, 6, 4, 2, 0), (1, 6, 11, 5, 0, 0, 4, 11, 6, 9, 0, 0), (5, 8, 7, 5, 2, 0, 10, 11, 4, 3, 2, 0), (2, 8, 14, 3, 3, 0, 3, 8, 4, 4, 3, 0), (3, 7, 5, 5, 5, 0, 5, 8, 4, 5, 3, 0), (7, 5, 5, 4, 3, 0, 2, 5, 6, 6, 1, 0), (7, 12, 3, 6, 3, 0, 4, 10, 9, 3, 4, 0), (1, 10, 8, 2, 1, 0, 5, 13, 5, 5, 0, 0), (6, 4, 9, 6, 3, 0, 6, 8, 7, 7, 3, 0), (6, 9, 13, 7, 1, 0, 3, 10, 7, 3, 4, 0), (4, 5, 5, 2, 2, 0, 9, 14, 6, 7, 1, 0), (2, 7, 3, 3, 1, 0, 7, 7, 4, 4, 2, 0), (4, 5, 9, 0, 2, 0, 5, 15, 3, 2, 1, 0), (4, 10, 9, 2, 3, 0, 11, 8, 4, 4, 1, 0), (6, 11, 6, 3, 1, 0, 8, 4, 10, 6, 2, 0), (6, 4, 3, 4, 3, 0, 10, 9, 6, 6, 0, 0), (4, 6, 15, 4, 2, 0, 13, 8, 3, 6, 2, 0), (6, 9, 5, 5, 6, 0, 10, 14, 2, 7, 3, 0), (2, 7, 11, 7, 1, 0, 7, 7, 5, 3, 1, 0), (4, 11, 7, 4, 2, 0, 6, 13, 3, 2, 3, 0), (10, 12, 10, 3, 3, 0, 4, 10, 6, 7, 1, 0), (6, 6, 4, 1, 2, 0, 7, 9, 5, 4, 0, 0), (6, 7, 10, 5, 3, 0, 0, 15, 9, 7, 0, 0), (8, 11, 8, 2, 3, 0, 9, 12, 7, 1, 3, 0), (5, 12, 13, 3, 2, 0, 8, 12, 3, 4, 4, 0), (5, 8, 4, 6, 0, 0, 8, 9, 5, 3, 5, 0), (11, 18, 7, 2, 0, 0, 5, 13, 6, 3, 3, 0), (5, 9, 2, 5, 0, 0, 4, 8, 5, 3, 1, 0), (5, 9, 8, 7, 1, 0, 11, 10, 4, 4, 0, 0), (0, 10, 8, 4, 1, 0, 6, 7, 7, 6, 2, 0), (8, 8, 7, 4, 3, 0, 4, 11, 4, 8, 1, 0), (9, 12, 10, 3, 2, 0, 7, 9, 6, 7, 3, 0), (3, 8, 7, 4, 3, 0, 3, 11, 5, 4, 1, 0), (6, 8, 6, 3, 4, 0, 9, 10, 6, 5, 3, 0), (2, 17, 11, 4, 2, 0, 5, 14, 6, 12, 2, 0), (3, 8, 5, 3, 2, 0, 12, 9, 5, 4, 1, 0), (1, 6, 9, 4, 6, 0, 11, 10, 6, 8, 2, 0), (5, 6, 3, 5, 1, 0, 8, 9, 3, 6, 1, 0), (0, 11, 6, 5, 0, 0, 4, 13, 5, 4, 2, 0), (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)) station_arriving_intensity = ((3.7095121817383676, 9.515044981060607, 11.19193043059126, 8.87078804347826, 10.000240384615385, 6.659510869565219), (3.7443308140669203, 9.620858238197952, 11.252381752534994, 8.920190141908213, 10.075193108974359, 6.657240994867151), (3.7787518681104277, 9.725101964085297, 11.31139817195087, 8.968504830917876, 10.148564102564103, 6.654901690821256), (3.8127461259877085, 9.827663671875001, 11.368936576156813, 9.01569089673913, 10.22028605769231, 6.652493274456523), (3.8462843698175795, 9.928430874719417, 11.424953852470724, 9.061707125603865, 10.290291666666668, 6.6500160628019325), (3.879337381718857, 10.027291085770905, 11.479406888210512, 9.106512303743962, 10.358513621794872, 6.647470372886473), (3.9118759438103607, 10.12413181818182, 11.53225257069409, 9.150065217391306, 10.424884615384617, 6.644856521739131), (3.943870838210907, 10.218840585104518, 11.58344778723936, 9.19232465277778, 10.489337339743592, 6.64217482638889), (3.975292847039314, 10.311304899691358, 11.632949425164242, 9.233249396135266, 10.551804487179488, 6.639425603864735), (4.006112752414399, 10.401412275094698, 11.680714371786634, 9.272798233695653, 10.61221875, 6.636609171195653), (4.03630133645498, 10.489050224466892, 11.72669951442445, 9.310929951690824, 10.670512820512823, 6.633725845410628), (4.065829381279876, 10.5741062609603, 11.7708617403956, 9.347603336352659, 10.726619391025642, 6.630775943538648), (4.094667669007903, 10.656467897727273, 11.813157937017996, 9.382777173913043, 10.780471153846154, 6.627759782608695), (4.122786981757876, 10.736022647920176, 11.85354499160954, 9.416410250603866, 10.832000801282053, 6.624677679649759), (4.15015810164862, 10.81265802469136, 11.891979791488144, 9.448461352657004, 10.881141025641025, 6.621529951690821), (4.1767518107989465, 10.886261541193182, 11.928419223971721, 9.478889266304348, 10.92782451923077, 6.618316915760871), (4.202538891327675, 10.956720710578002, 11.96282017637818, 9.507652777777778, 10.971983974358976, 6.61503888888889), (4.227490125353625, 11.023923045998176, 11.995139536025421, 9.53471067330918, 11.013552083333336, 6.611696188103866), (4.25157629499561, 11.087756060606061, 12.025334190231364, 9.560021739130436, 11.052461538461543, 6.608289130434783), (4.274768182372451, 11.148107267554012, 12.053361026313912, 9.58354476147343, 11.088645032051284, 6.604818032910629), (4.297036569602966, 11.204864179994388, 12.079176931590974, 9.60523852657005, 11.122035256410259, 6.601283212560387), (4.318352238805971, 11.257914311079544, 12.102738793380466, 9.625061820652174, 11.152564903846153, 6.597684986413044), (4.338685972100283, 11.307145173961842, 12.124003499000287, 9.642973429951692, 11.180166666666667, 6.5940236714975855), (4.358008551604722, 11.352444281793632, 12.142927935768354, 9.658932140700484, 11.204773237179488, 6.590299584842997), (4.3762907594381035, 11.393699147727272, 12.159468991002571, 9.672896739130437, 11.226317307692307, 6.586513043478261), (4.393503377719247, 11.430797284915124, 12.173583552020853, 9.684826011473431, 11.244731570512819, 6.582664364432368), (4.409617188566969, 11.46362620650954, 12.185228506141103, 9.694678743961353, 11.259948717948719, 6.5787538647343), (4.424602974100088, 11.492073425662877, 12.194360740681233, 9.702413722826089, 11.271901442307694, 6.574781861413045), (4.438431516437421, 11.516026455527497, 12.200937142959157, 9.707989734299519, 11.280522435897437, 6.570748671497586), (4.4510735976977855, 11.535372809255753, 12.204914600292774, 9.711365564613528, 11.285744391025641, 6.566654612016909), (4.4625, 11.55, 12.20625, 9.7125, 11.287500000000001, 6.562500000000001), (4.47319183983376, 11.56215031960227, 12.205248928140096, 9.712295118464054, 11.286861125886526, 6.556726763701484), (4.4836528452685425, 11.574140056818184, 12.202274033816424, 9.711684477124184, 11.28495815602837, 6.547834661835751), (4.493887715792838, 11.585967720170455, 12.197367798913046, 9.710674080882354, 11.281811569148937, 6.535910757121439), (4.503901150895141, 11.597631818181819, 12.19057270531401, 9.709269934640524, 11.277441843971632, 6.521042112277196), (4.513697850063939, 11.609130859374998, 12.181931234903383, 9.707478043300654, 11.27186945921986, 6.503315790021656), (4.523282512787724, 11.62046335227273, 12.171485869565219, 9.705304411764708, 11.265114893617023, 6.482818853073463), (4.532659838554988, 11.631627805397729, 12.159279091183576, 9.70275504493464, 11.257198625886524, 6.4596383641512585), (4.5418345268542195, 11.642622727272729, 12.145353381642513, 9.699835947712419, 11.248141134751775, 6.433861385973679), (4.5508112771739135, 11.653446626420456, 12.129751222826087, 9.696553125000001, 11.23796289893617, 6.40557498125937), (4.559594789002558, 11.664098011363638, 12.11251509661836, 9.692912581699348, 11.22668439716312, 6.37486621272697), (4.568189761828645, 11.674575390625, 12.093687484903382, 9.68892032271242, 11.214326108156028, 6.34182214309512), (4.576600895140665, 11.684877272727276, 12.07331086956522, 9.684582352941177, 11.2009085106383, 6.3065298350824595), (4.584832888427111, 11.69500216619318, 12.051427732487923, 9.679904677287583, 11.186452083333334, 6.26907635140763), (4.592890441176471, 11.704948579545455, 12.028080555555556, 9.674893300653595, 11.17097730496454, 6.229548754789272), (4.600778252877237, 11.714715021306818, 12.003311820652177, 9.669554227941177, 11.15450465425532, 6.188034107946028), (4.6085010230179035, 11.724300000000003, 11.97716400966184, 9.663893464052288, 11.137054609929079, 6.144619473596536), (4.616063451086957, 11.733702024147728, 11.9496796044686, 9.65791701388889, 11.118647650709221, 6.099391914459438), (4.623470236572891, 11.742919602272728, 11.920901086956523, 9.651630882352942, 11.099304255319149, 6.052438493253375), (4.630726078964194, 11.751951242897727, 11.890870939009663, 9.645041074346407, 11.079044902482272, 6.003846272696985), (4.6378356777493615, 11.760795454545454, 11.85963164251208, 9.638153594771243, 11.057890070921987, 5.953702315508913), (4.6448037324168805, 11.769450745738636, 11.827225679347826, 9.630974448529413, 11.035860239361703, 5.902093684407797), (4.651634942455243, 11.777915625, 11.793695531400965, 9.623509640522876, 11.012975886524824, 5.849107442112278), (4.658334007352941, 11.786188600852274, 11.759083680555555, 9.615765175653596, 10.989257491134753, 5.794830651340996), (4.6649056265984665, 11.79426818181818, 11.723432608695653, 9.60774705882353, 10.964725531914894, 5.739350374812594), (4.671354499680307, 11.802152876420456, 11.686784797705313, 9.599461294934642, 10.939400487588653, 5.682753675245711), (4.677685326086957, 11.809841193181818, 11.649182729468599, 9.59091388888889, 10.913302836879433, 5.625127615358988), (4.683902805306906, 11.817331640625003, 11.610668885869565, 9.582110845588236, 10.886453058510638, 5.566559257871065), (4.690011636828645, 11.824622727272727, 11.57128574879227, 9.573058169934642, 10.858871631205675, 5.507135665500583), (0.0, 0.0, 0.0, 0.0, 0.0, 0.0)) passenger_arriving_acc = ((2, 4, 9, 5, 2, 0, 7, 7, 4, 5, 1, 0), (3, 13, 16, 9, 3, 0, 13, 13, 13, 11, 2, 0), (8, 19, 24, 13, 6, 0, 21, 24, 18, 13, 3, 0), (12, 24, 29, 17, 8, 0, 29, 39, 18, 17, 7, 0), (17, 35, 42, 21, 11, 0, 40, 45, 21, 18, 8, 0), (26, 41, 50, 24, 11, 0, 47, 51, 30, 25, 12, 0), (34, 53, 53, 28, 12, 0, 51, 63, 35, 29, 12, 0), (38, 66, 64, 30, 15, 0, 60, 72, 41, 34, 13, 0), (41, 74, 71, 37, 18, 0, 65, 81, 48, 39, 14, 0), (43, 79, 76, 38, 21, 0, 68, 84, 53, 45, 19, 0), (48, 87, 85, 41, 22, 0, 76, 96, 57, 48, 23, 0), (51, 99, 91, 44, 24, 0, 82, 102, 65, 54, 24, 0), (52, 109, 99, 51, 25, 0, 92, 109, 71, 59, 25, 0), (56, 118, 107, 54, 26, 0, 99, 120, 83, 62, 28, 0), (58, 128, 113, 57, 28, 0, 108, 127, 87, 69, 29, 0), (60, 134, 122, 59, 32, 0, 115, 139, 94, 77, 31, 0), (63, 148, 130, 64, 37, 0, 123, 149, 99, 82, 32, 0), (65, 156, 136, 69, 39, 0, 129, 154, 102, 89, 32, 0), (68, 167, 144, 71, 39, 0, 133, 157, 106, 96, 32, 0), (70, 174, 148, 73, 43, 0, 140, 161, 109, 102, 34, 0), (77, 190, 153, 76, 46, 0, 148, 167, 115, 106, 36, 0), (78, 196, 164, 81, 46, 0, 152, 178, 121, 115, 36, 0), (83, 204, 171, 86, 48, 0, 162, 189, 125, 118, 38, 0), (85, 212, 185, 89, 51, 0, 165, 197, 129, 122, 41, 0), (88, 219, 190, 94, 56, 0, 170, 205, 133, 127, 44, 0), (95, 224, 195, 98, 59, 0, 172, 210, 139, 133, 45, 0), (102, 236, 198, 104, 62, 0, 176, 220, 148, 136, 49, 0), (103, 246, 206, 106, 63, 0, 181, 233, 153, 141, 49, 0), (109, 250, 215, 112, 66, 0, 187, 241, 160, 148, 52, 0), (115, 259, 228, 119, 67, 0, 190, 251, 167, 151, 56, 0), (119, 264, 233, 121, 69, 0, 199, 265, 173, 158, 57, 0), (121, 271, 236, 124, 70, 0, 206, 272, 177, 162, 59, 0), (125, 276, 245, 124, 72, 0, 211, 287, 180, 164, 60, 0), (129, 286, 254, 126, 75, 0, 222, 295, 184, 168, 61, 0), (135, 297, 260, 129, 76, 0, 230, 299, 194, 174, 63, 0), (141, 301, 263, 133, 79, 0, 240, 308, 200, 180, 63, 0), (145, 307, 278, 137, 81, 0, 253, 316, 203, 186, 65, 0), (151, 316, 283, 142, 87, 0, 263, 330, 205, 193, 68, 0), (153, 323, 294, 149, 88, 0, 270, 337, 210, 196, 69, 0), (157, 334, 301, 153, 90, 0, 276, 350, 213, 198, 72, 0), (167, 346, 311, 156, 93, 0, 280, 360, 219, 205, 73, 0), (173, 352, 315, 157, 95, 0, 287, 369, 224, 209, 73, 0), (179, 359, 325, 162, 98, 0, 287, 384, 233, 216, 73, 0), (187, 370, 333, 164, 101, 0, 296, 396, 240, 217, 76, 0), (192, 382, 346, 167, 103, 0, 304, 408, 243, 221, 80, 0), (197, 390, 350, 173, 103, 0, 312, 417, 248, 224, 85, 0), (208, 408, 357, 175, 103, 0, 317, 430, 254, 227, 88, 0), (213, 417, 359, 180, 103, 0, 321, 438, 259, 230, 89, 0), (218, 426, 367, 187, 104, 0, 332, 448, 263, 234, 89, 0), (218, 436, 375, 191, 105, 0, 338, 455, 270, 240, 91, 0), (226, 444, 382, 195, 108, 0, 342, 466, 274, 248, 92, 0), (235, 456, 392, 198, 110, 0, 349, 475, 280, 255, 95, 0), (238, 464, 399, 202, 113, 0, 352, 486, 285, 259, 96, 0), (244, 472, 405, 205, 117, 0, 361, 496, 291, 264, 99, 0), (246, 489, 416, 209, 119, 0, 366, 510, 297, 276, 101, 0), (249, 497, 421, 212, 121, 0, 378, 519, 302, 280, 102, 0), (250, 503, 430, 216, 127, 0, 389, 529, 308, 288, 104, 0), (255, 509, 433, 221, 128, 0, 397, 538, 311, 294, 105, 0), (255, 520, 439, 226, 128, 0, 401, 551, 316, 298, 107, 0), (255, 520, 439, 226, 128, 0, 401, 551, 316, 298, 107, 0)) passenger_arriving_rate = ((3.7095121817383676, 7.612035984848484, 6.715158258354756, 3.5483152173913037, 2.000048076923077, 0.0, 6.659510869565219, 8.000192307692307, 5.322472826086956, 4.476772172236504, 1.903008996212121, 0.0), (3.7443308140669203, 7.696686590558361, 6.751429051520996, 3.5680760567632848, 2.0150386217948717, 0.0, 6.657240994867151, 8.060154487179487, 5.352114085144928, 4.500952701013997, 1.9241716476395903, 0.0), (3.7787518681104277, 7.780081571268237, 6.786838903170522, 3.58740193236715, 2.0297128205128203, 0.0, 6.654901690821256, 8.118851282051281, 5.381102898550726, 4.524559268780347, 1.9450203928170593, 0.0), (3.8127461259877085, 7.8621309375, 6.821361945694087, 3.6062763586956517, 2.044057211538462, 0.0, 6.652493274456523, 8.176228846153847, 5.409414538043478, 4.547574630462725, 1.965532734375, 0.0), (3.8462843698175795, 7.942744699775533, 6.854972311482434, 3.624682850241546, 2.0580583333333333, 0.0, 6.6500160628019325, 8.232233333333333, 5.437024275362319, 4.569981540988289, 1.9856861749438832, 0.0), (3.879337381718857, 8.021832868616723, 6.887644132926307, 3.6426049214975844, 2.0717027243589743, 0.0, 6.647470372886473, 8.286810897435897, 5.463907382246377, 4.591762755284204, 2.005458217154181, 0.0), (3.9118759438103607, 8.099305454545455, 6.919351542416455, 3.660026086956522, 2.084976923076923, 0.0, 6.644856521739131, 8.339907692307692, 5.490039130434783, 4.612901028277636, 2.0248263636363637, 0.0), (3.943870838210907, 8.175072468083613, 6.950068672343615, 3.6769298611111116, 2.0978674679487184, 0.0, 6.64217482638889, 8.391469871794873, 5.515394791666668, 4.633379114895743, 2.043768117020903, 0.0), (3.975292847039314, 8.249043919753085, 6.979769655098544, 3.693299758454106, 2.1103608974358976, 0.0, 6.639425603864735, 8.44144358974359, 5.5399496376811594, 4.653179770065696, 2.062260979938271, 0.0), (4.006112752414399, 8.321129820075758, 7.00842862307198, 3.709119293478261, 2.12244375, 0.0, 6.636609171195653, 8.489775, 5.563678940217391, 4.672285748714653, 2.0802824550189394, 0.0), (4.03630133645498, 8.391240179573513, 7.03601970865467, 3.724371980676329, 2.134102564102564, 0.0, 6.633725845410628, 8.536410256410257, 5.586557971014494, 4.690679805769779, 2.0978100448933783, 0.0), (4.065829381279876, 8.459285008768239, 7.06251704423736, 3.739041334541063, 2.145323878205128, 0.0, 6.630775943538648, 8.581295512820512, 5.608562001811595, 4.70834469615824, 2.1148212521920597, 0.0), (4.094667669007903, 8.525174318181818, 7.087894762210797, 3.7531108695652167, 2.156094230769231, 0.0, 6.627759782608695, 8.624376923076923, 5.6296663043478254, 4.725263174807198, 2.1312935795454546, 0.0), (4.122786981757876, 8.58881811833614, 7.112126994965724, 3.766564100241546, 2.1664001602564102, 0.0, 6.624677679649759, 8.665600641025641, 5.649846150362319, 4.741417996643816, 2.147204529584035, 0.0), (4.15015810164862, 8.650126419753088, 7.135187874892886, 3.779384541062801, 2.1762282051282047, 0.0, 6.621529951690821, 8.704912820512819, 5.669076811594202, 4.756791916595257, 2.162531604938272, 0.0), (4.1767518107989465, 8.709009232954545, 7.157051534383032, 3.7915557065217387, 2.1855649038461538, 0.0, 6.618316915760871, 8.742259615384615, 5.6873335597826085, 4.771367689588688, 2.177252308238636, 0.0), (4.202538891327675, 8.7653765684624, 7.177692105826908, 3.803061111111111, 2.194396794871795, 0.0, 6.61503888888889, 8.77758717948718, 5.7045916666666665, 4.785128070551272, 2.1913441421156, 0.0), (4.227490125353625, 8.81913843679854, 7.197083721615253, 3.8138842693236716, 2.202710416666667, 0.0, 6.611696188103866, 8.810841666666668, 5.720826403985508, 4.798055814410168, 2.204784609199635, 0.0), (4.25157629499561, 8.870204848484848, 7.215200514138818, 3.824008695652174, 2.2104923076923084, 0.0, 6.608289130434783, 8.841969230769234, 5.736013043478262, 4.810133676092545, 2.217551212121212, 0.0), (4.274768182372451, 8.918485814043208, 7.232016615788346, 3.8334179045893717, 2.2177290064102566, 0.0, 6.604818032910629, 8.870916025641026, 5.750126856884058, 4.8213444105255645, 2.229621453510802, 0.0), (4.297036569602966, 8.96389134399551, 7.247506158954584, 3.8420954106280196, 2.2244070512820517, 0.0, 6.601283212560387, 8.897628205128207, 5.76314311594203, 4.831670772636389, 2.2409728359988774, 0.0), (4.318352238805971, 9.006331448863634, 7.261643276028279, 3.8500247282608693, 2.2305129807692303, 0.0, 6.597684986413044, 8.922051923076921, 5.775037092391305, 4.841095517352186, 2.2515828622159084, 0.0), (4.338685972100283, 9.045716139169473, 7.274402099400172, 3.8571893719806765, 2.2360333333333333, 0.0, 6.5940236714975855, 8.944133333333333, 5.785784057971015, 4.849601399600115, 2.2614290347923682, 0.0), (4.358008551604722, 9.081955425434906, 7.285756761461012, 3.8635728562801934, 2.2409546474358972, 0.0, 6.590299584842997, 8.963818589743589, 5.79535928442029, 4.857171174307341, 2.2704888563587264, 0.0), (4.3762907594381035, 9.114959318181818, 7.295681394601543, 3.869158695652174, 2.2452634615384612, 0.0, 6.586513043478261, 8.981053846153845, 5.803738043478262, 4.863787596401028, 2.2787398295454544, 0.0), (4.393503377719247, 9.1446378279321, 7.304150131212511, 3.8739304045893723, 2.2489463141025636, 0.0, 6.582664364432368, 8.995785256410255, 5.810895606884059, 4.869433420808341, 2.286159456983025, 0.0), (4.409617188566969, 9.17090096520763, 7.311137103684661, 3.8778714975845405, 2.2519897435897436, 0.0, 6.5787538647343, 9.007958974358974, 5.816807246376811, 4.874091402456441, 2.2927252413019077, 0.0), (4.424602974100088, 9.193658740530301, 7.31661644440874, 3.880965489130435, 2.2543802884615385, 0.0, 6.574781861413045, 9.017521153846154, 5.821448233695653, 4.877744296272493, 2.2984146851325753, 0.0), (4.438431516437421, 9.212821164421996, 7.320562285775494, 3.8831958937198072, 2.256104487179487, 0.0, 6.570748671497586, 9.024417948717948, 5.824793840579711, 4.8803748571836625, 2.303205291105499, 0.0), (4.4510735976977855, 9.228298247404602, 7.322948760175664, 3.884546225845411, 2.257148878205128, 0.0, 6.566654612016909, 9.028595512820512, 5.826819338768117, 4.881965840117109, 2.3070745618511506, 0.0), (4.4625, 9.24, 7.32375, 3.885, 2.2575000000000003, 0.0, 6.562500000000001, 9.030000000000001, 5.8275, 4.8825, 2.31, 0.0), (4.47319183983376, 9.249720255681815, 7.323149356884057, 3.884918047385621, 2.257372225177305, 0.0, 6.556726763701484, 9.02948890070922, 5.827377071078432, 4.882099571256038, 2.312430063920454, 0.0), (4.4836528452685425, 9.259312045454546, 7.3213644202898545, 3.884673790849673, 2.2569916312056737, 0.0, 6.547834661835751, 9.027966524822695, 5.82701068627451, 4.880909613526569, 2.3148280113636366, 0.0), (4.493887715792838, 9.268774176136363, 7.3184206793478275, 3.8842696323529413, 2.2563623138297872, 0.0, 6.535910757121439, 9.025449255319149, 5.826404448529412, 4.878947119565218, 2.3171935440340907, 0.0), (4.503901150895141, 9.278105454545454, 7.314343623188405, 3.8837079738562093, 2.2554883687943263, 0.0, 6.521042112277196, 9.021953475177305, 5.825561960784314, 4.876229082125604, 2.3195263636363634, 0.0), (4.513697850063939, 9.287304687499997, 7.3091587409420296, 3.882991217320261, 2.2543738918439717, 0.0, 6.503315790021656, 9.017495567375887, 5.824486825980392, 4.872772493961353, 2.3218261718749993, 0.0), (4.523282512787724, 9.296370681818182, 7.302891521739131, 3.8821217647058828, 2.253022978723404, 0.0, 6.482818853073463, 9.012091914893617, 5.823182647058824, 4.868594347826087, 2.3240926704545455, 0.0), (4.532659838554988, 9.305302244318183, 7.295567454710145, 3.881102017973856, 2.2514397251773044, 0.0, 6.4596383641512585, 9.005758900709218, 5.821653026960784, 4.86371163647343, 2.3263255610795457, 0.0), (4.5418345268542195, 9.314098181818181, 7.287212028985508, 3.8799343790849674, 2.249628226950355, 0.0, 6.433861385973679, 8.99851290780142, 5.819901568627452, 4.858141352657005, 2.3285245454545453, 0.0), (4.5508112771739135, 9.322757301136363, 7.277850733695652, 3.87862125, 2.247592579787234, 0.0, 6.40557498125937, 8.990370319148935, 5.817931875, 4.8519004891304345, 2.330689325284091, 0.0), (4.559594789002558, 9.33127840909091, 7.267509057971015, 3.8771650326797387, 2.245336879432624, 0.0, 6.37486621272697, 8.981347517730496, 5.815747549019608, 4.845006038647344, 2.3328196022727274, 0.0), (4.568189761828645, 9.3396603125, 7.256212490942029, 3.8755681290849675, 2.2428652216312055, 0.0, 6.34182214309512, 8.971460886524822, 5.813352193627452, 4.837474993961353, 2.334915078125, 0.0), (4.576600895140665, 9.34790181818182, 7.2439865217391315, 3.8738329411764707, 2.2401817021276598, 0.0, 6.3065298350824595, 8.960726808510639, 5.810749411764706, 4.829324347826088, 2.336975454545455, 0.0), (4.584832888427111, 9.356001732954544, 7.230856639492753, 3.8719618709150327, 2.2372904166666667, 0.0, 6.26907635140763, 8.949161666666667, 5.80794280637255, 4.820571092995169, 2.339000433238636, 0.0), (4.592890441176471, 9.363958863636363, 7.216848333333333, 3.8699573202614377, 2.2341954609929076, 0.0, 6.229548754789272, 8.93678184397163, 5.804935980392157, 4.811232222222222, 2.3409897159090907, 0.0), (4.600778252877237, 9.371772017045453, 7.201987092391306, 3.8678216911764705, 2.230900930851064, 0.0, 6.188034107946028, 8.923603723404256, 5.801732536764706, 4.80132472826087, 2.3429430042613633, 0.0), (4.6085010230179035, 9.379440000000002, 7.186298405797103, 3.8655573856209147, 2.2274109219858156, 0.0, 6.144619473596536, 8.909643687943262, 5.798336078431372, 4.790865603864735, 2.3448600000000006, 0.0), (4.616063451086957, 9.386961619318182, 7.16980776268116, 3.8631668055555552, 2.223729530141844, 0.0, 6.099391914459438, 8.894918120567375, 5.794750208333333, 4.77987184178744, 2.3467404048295455, 0.0), (4.623470236572891, 9.394335681818182, 7.152540652173913, 3.8606523529411763, 2.21986085106383, 0.0, 6.052438493253375, 8.87944340425532, 5.790978529411765, 4.7683604347826085, 2.3485839204545456, 0.0), (4.630726078964194, 9.401560994318181, 7.134522563405797, 3.8580164297385626, 2.2158089804964543, 0.0, 6.003846272696985, 8.863235921985817, 5.787024644607844, 4.7563483756038645, 2.3503902485795454, 0.0), (4.6378356777493615, 9.408636363636361, 7.115778985507247, 3.8552614379084966, 2.211578014184397, 0.0, 5.953702315508913, 8.846312056737588, 5.782892156862745, 4.743852657004831, 2.3521590909090904, 0.0), (4.6448037324168805, 9.415560596590907, 7.096335407608696, 3.852389779411765, 2.2071720478723407, 0.0, 5.902093684407797, 8.828688191489363, 5.778584669117648, 4.73089027173913, 2.353890149147727, 0.0), (4.651634942455243, 9.4223325, 7.0762173188405795, 3.84940385620915, 2.2025951773049646, 0.0, 5.849107442112278, 8.810380709219858, 5.774105784313726, 4.717478212560386, 2.355583125, 0.0), (4.658334007352941, 9.428950880681818, 7.055450208333333, 3.8463060702614382, 2.1978514982269504, 0.0, 5.794830651340996, 8.791405992907801, 5.769459105392158, 4.703633472222222, 2.3572377201704544, 0.0), (4.6649056265984665, 9.435414545454544, 7.034059565217391, 3.843098823529412, 2.192945106382979, 0.0, 5.739350374812594, 8.771780425531915, 5.764648235294119, 4.689373043478261, 2.358853636363636, 0.0), (4.671354499680307, 9.441722301136364, 7.012070878623187, 3.8397845179738566, 2.1878800975177306, 0.0, 5.682753675245711, 8.751520390070922, 5.759676776960785, 4.674713919082125, 2.360430575284091, 0.0), (4.677685326086957, 9.447872954545453, 6.989509637681159, 3.8363655555555556, 2.1826605673758865, 0.0, 5.625127615358988, 8.730642269503546, 5.754548333333334, 4.65967309178744, 2.361968238636363, 0.0), (4.683902805306906, 9.453865312500001, 6.966401331521738, 3.832844338235294, 2.1772906117021273, 0.0, 5.566559257871065, 8.70916244680851, 5.749266507352941, 4.644267554347826, 2.3634663281250003, 0.0), (4.690011636828645, 9.459698181818181, 6.942771449275362, 3.8292232679738563, 2.1717743262411346, 0.0, 5.507135665500583, 8.687097304964539, 5.743834901960785, 4.628514299516908, 2.3649245454545453, 0.0), (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)) passenger_allighting_rate = ((0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1), (0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1, 0, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 0.16666666666666666, 1)) '\nparameters for reproducibiliy. More information: https://numpy.org/doc/stable/reference/random/parallel.html\n' entropy = 258194110137029475889902652135037600173 child_seed_index = (1, 59)
"""A basic example of using the SQLAlchemy Sharding API. Sharding refers to horizontally scaling data across multiple databases. The basic components of a "sharded" mapping are: * multiple databases, each assigned a 'shard id' * a function which can return a single shard id, given an instance to be saved; this is called "shard_chooser" * a function which can return a list of shard ids which apply to a particular instance identifier; this is called "id_chooser". If it returns all shard ids, all shards will be searched. * a function which can return a list of shard ids to try, given a particular Query ("query_chooser"). If it returns all shard ids, all shards will be queried and the results joined together. In this example, four sqlite databases will store information about weather data on a database-per-continent basis. We provide example shard_chooser, id_chooser and query_chooser functions. The query_chooser illustrates inspection of the SQL expression element in order to attempt to determine a single shard being requested. The construction of generic sharding routines is an ambitious approach to the issue of organizing instances among multiple databases. For a more plain-spoken alternative, the "distinct entity" approach is a simple method of assigning objects to different tables (and potentially database nodes) in an explicit way - described on the wiki at `EntityName <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/EntityName>`_. """
"""A basic example of using the SQLAlchemy Sharding API. Sharding refers to horizontally scaling data across multiple databases. The basic components of a "sharded" mapping are: * multiple databases, each assigned a 'shard id' * a function which can return a single shard id, given an instance to be saved; this is called "shard_chooser" * a function which can return a list of shard ids which apply to a particular instance identifier; this is called "id_chooser". If it returns all shard ids, all shards will be searched. * a function which can return a list of shard ids to try, given a particular Query ("query_chooser"). If it returns all shard ids, all shards will be queried and the results joined together. In this example, four sqlite databases will store information about weather data on a database-per-continent basis. We provide example shard_chooser, id_chooser and query_chooser functions. The query_chooser illustrates inspection of the SQL expression element in order to attempt to determine a single shard being requested. The construction of generic sharding routines is an ambitious approach to the issue of organizing instances among multiple databases. For a more plain-spoken alternative, the "distinct entity" approach is a simple method of assigning objects to different tables (and potentially database nodes) in an explicit way - described on the wiki at `EntityName <http://www.sqlalchemy.org/trac/wiki/UsageRecipes/EntityName>`_. """
# # PySNMP MIB module CISCO-IPSEC-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-IPSEC-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:02:28 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint") ciscoExperiment, = mibBuilder.importSymbols("CISCO-SMI", "ciscoExperiment") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") ModuleCompliance, NotificationGroup, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup", "ObjectGroup") iso, Gauge32, NotificationType, Integer32, ModuleIdentity, ObjectIdentity, Bits, TimeTicks, Counter32, MibIdentifier, Counter64, IpAddress, Unsigned32, MibScalar, MibTable, MibTableRow, MibTableColumn = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "Gauge32", "NotificationType", "Integer32", "ModuleIdentity", "ObjectIdentity", "Bits", "TimeTicks", "Counter32", "MibIdentifier", "Counter64", "IpAddress", "Unsigned32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn") TextualConvention, DisplayString, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "TruthValue") ciscoIPsecMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 10, 62)) if mibBuilder.loadTexts: ciscoIPsecMIB.setLastUpdated('200008071139Z') if mibBuilder.loadTexts: ciscoIPsecMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoIPsecMIB.setContactInfo(' Cisco Systems Enterprise Business Management Unit Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-ipsecurity@cisco.com') if mibBuilder.loadTexts: ciscoIPsecMIB.setDescription("The MIB module for modeling Cisco-specific IPsec attributes Overview of Cisco IPsec MIB MIB description This MIB models the Cisco implementation-specific attributes of a Cisco entity that implements IPsec. This MIB is complementary to the standard IPsec MIB proposed jointly by Tivoli and Cisco. The ciscoIPsec MIB provides the operational information on Cisco's IPsec tunnelling implementation. The following entities are managed: 1) ISAKMP Group: a) ISAKMP global parameters b) ISAKMP Policy Table 2) IPSec Group: a) IPSec Global Parameters b) IPSec Global Traffic Parameters c) Cryptomap Group - Cryptomap Set Table - Cryptomap Table - CryptomapSet Binding Table 3) System Capacity & Capability Group: a) Capacity Parameters b) Capability Parameters 4) Trap Control Group 5) Notifications Group") class CIPsecLifetime(TextualConvention, Gauge32): description = 'Value in units of seconds' status = 'current' subtypeSpec = Gauge32.subtypeSpec + ValueRangeConstraint(120, 86400) class CIPsecLifesize(TextualConvention, Gauge32): description = 'Value in units of kilobytes' status = 'current' subtypeSpec = Gauge32.subtypeSpec + ValueRangeConstraint(2560, 536870912) class CIPsecNumCryptoMaps(TextualConvention, Gauge32): description = 'Integral units representing count of cryptomaps' status = 'current' subtypeSpec = Gauge32.subtypeSpec + ValueRangeConstraint(0, 2147483647) class CryptomapType(TextualConvention, Integer32): description = 'The type of a cryptomap entry. Cryptomap is a unit of IOS IPSec policy specification.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5)) namedValues = NamedValues(("cryptomapTypeNONE", 0), ("cryptomapTypeMANUAL", 1), ("cryptomapTypeISAKMP", 2), ("cryptomapTypeCET", 3), ("cryptomapTypeDYNAMIC", 4), ("cryptomapTypeDYNAMICDISCOVERY", 5)) class CryptomapSetBindStatus(TextualConvention, Integer32): description = "The status of the binding of a cryptomap set to the specified interface. The value qhen queried is always 'attached'. When set to 'detached', the cryptomap set if detached from the specified interface. Setting the value to 'attached' will result in SNMP General Error." status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2)) namedValues = NamedValues(("unknown", 0), ("attached", 1), ("detached", 2)) class IPSIpAddress(TextualConvention, OctetString): description = 'An IP V4 or V6 Address.' status = 'current' subtypeSpec = OctetString.subtypeSpec + ConstraintsUnion(ValueSizeConstraint(4, 4), ValueSizeConstraint(16, 16), ) class IkeHashAlgo(TextualConvention, Integer32): description = 'The hash algorithm used in IPsec Phase-1 IKE negotiations.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("none", 1), ("md5", 2), ("sha", 3)) class IkeAuthMethod(TextualConvention, Integer32): description = 'The authentication method used in IPsec Phase-1 IKE negotiations.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5)) namedValues = NamedValues(("none", 1), ("preSharedKey", 2), ("rsaSig", 3), ("rsaEncrypt", 4), ("revPublicKey", 5)) class IkeIdentityType(TextualConvention, Integer32): description = 'The type of identity used by the local entity to identity itself to the peer with which it performs IPSec Main Mode negotiations. This type decides the content of the Identification payload in the Main Mode of IPSec tunnel setup.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2)) namedValues = NamedValues(("isakmpIdTypeUNKNOWN", 0), ("isakmpIdTypeADDRESS", 1), ("isakmpIdTypeHOSTNAME", 2)) class DiffHellmanGrp(TextualConvention, Integer32): description = 'The Diffie Hellman Group used in negotiations.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("none", 1), ("dhGroup1", 2), ("dhGroup2", 3)) class EncryptAlgo(TextualConvention, Integer32): description = 'The encryption algorithm used in negotiations.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3)) namedValues = NamedValues(("none", 1), ("des", 2), ("des3", 3)) class TrapStatus(TextualConvention, Integer32): description = 'The administrative status for sending a TRAP.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2)) namedValues = NamedValues(("enabled", 1), ("disabled", 2)) ciscoIPsecMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1)) ciscoIPsecMIBNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 2)) ciscoIPsecMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 3)) cipsIsakmpGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1)) cipsIPsecGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2)) cipsIPsecGlobals = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1)) cipsIPsecStatistics = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 2)) cipsCryptomapGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3)) cipsSysCapacityGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 3)) cipsTrapCntlGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4)) cipsIsakmpEnabled = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 1), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsIsakmpEnabled.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpEnabled.setDescription('The value of this object is TRUE if ISAKMP has been enabled on the managed entity. Otherise the value of this object is FALSE.') cipsIsakmpIdentity = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 2), IkeIdentityType()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsIsakmpIdentity.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpIdentity.setDescription('The value of this object is shows the type of identity used by the managed entity in ISAKMP negotiations with another peer.') cipsIsakmpKeepaliveInterval = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(10, 3600))).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsIsakmpKeepaliveInterval.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpKeepaliveInterval.setDescription('The value of this object is time interval in seconds between successive ISAKMP keepalive heartbeats issued to the peers to which IKE tunnels have been setup.') cipsNumIsakmpPolicies = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsNumIsakmpPolicies.setStatus('current') if mibBuilder.loadTexts: cipsNumIsakmpPolicies.setDescription('The value of this object is the number of ISAKMP policies that have been configured on the managed entity.') cipsIsakmpPolicyTable = MibTable((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5), ) if mibBuilder.loadTexts: cipsIsakmpPolicyTable.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolicyTable.setDescription('The table containing the list of all ISAKMP policy entries configured by the operator.') cipsIsakmpPolicyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1), ).setIndexNames((0, "CISCO-IPSEC-MIB", "cipsIsakmpPolPriority")) if mibBuilder.loadTexts: cipsIsakmpPolicyEntry.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolicyEntry.setDescription('Each entry contains the attributes associated with a single ISAKMP Policy entry.') cipsIsakmpPolPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: cipsIsakmpPolPriority.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolPriority.setDescription('The priotity of this ISAKMP Policy entry. This is also the index of this table.') cipsIsakmpPolEncr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 2), EncryptAlgo()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsIsakmpPolEncr.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolEncr.setDescription('The encryption transform specified by this ISAKMP policy specification. The Internet Key Exchange (IKE) tunnels setup using this policy item would use the specified encryption transform to protect the ISAKMP PDUs.') cipsIsakmpPolHash = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 3), IkeHashAlgo()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsIsakmpPolHash.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolHash.setDescription('The hash transform specified by this ISAKMP policy specification. The IKE tunnels setup using this policy item would use the specified hash transform to protect the ISAKMP PDUs.') cipsIsakmpPolAuth = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 4), IkeAuthMethod()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsIsakmpPolAuth.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolAuth.setDescription('The peer authentication mthod specified by this ISAKMP policy specification. If this policy entity is selected for negotiation with a peer, the local entity would authenticate the peer using the method specified by this object.') cipsIsakmpPolGroup = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 5), DiffHellmanGrp()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsIsakmpPolGroup.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolGroup.setDescription('This object specifies the Oakley group used for Diffie Hellman exchange in the Main Mode. If this policy item is selected to negotiate Main Mode with an IKE peer, the local entity chooses the group specified by this object to perform Diffie Hellman exchange with the peer.') cipsIsakmpPolLifetime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(60, 86400))).setUnits('seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsIsakmpPolLifetime.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolLifetime.setDescription('This object specifies the lifetime in seconds of the IKE tunnels generated using this policy specification.') cipsSALifetime = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 1), CIPsecLifetime()).setUnits('Seconds').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsSALifetime.setStatus('current') if mibBuilder.loadTexts: cipsSALifetime.setDescription('The default lifetime (in seconds) assigned to an SA as a global policy (maybe overridden in specific cryptomap definitions).') cipsSALifesize = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 2), CIPsecLifesize()).setUnits('KBytes').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsSALifesize.setStatus('current') if mibBuilder.loadTexts: cipsSALifesize.setDescription('The default lifesize in KBytes assigned to an SA as a global policy (unless overridden in cryptomap definition)') cipsNumStaticCryptomapSets = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 3), CIPsecNumCryptoMaps()).setUnits('Integral Units').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsNumStaticCryptomapSets.setStatus('current') if mibBuilder.loadTexts: cipsNumStaticCryptomapSets.setDescription('The number of Cryptomap Sets that are are fully configured. Statically defined cryptomap sets are ones where the operator has fully specified all the parameters required set up IPSec Virtual Private Networks (VPNs).') cipsNumCETCryptomapSets = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 4), CIPsecNumCryptoMaps()).setUnits('Integral Units').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsNumCETCryptomapSets.setStatus('current') if mibBuilder.loadTexts: cipsNumCETCryptomapSets.setDescription('The number of static Cryptomap Sets that have at least one CET cryptomap element as a member of the set.') cipsNumDynamicCryptomapSets = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 5), CIPsecNumCryptoMaps()).setUnits('Integral Units').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsNumDynamicCryptomapSets.setStatus('current') if mibBuilder.loadTexts: cipsNumDynamicCryptomapSets.setDescription("The number of dynamic IPSec Policy templates (called 'dynamic cryptomap templates') configured on the managed entity.") cipsNumTEDCryptomapSets = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 6), CIPsecNumCryptoMaps()).setUnits('Integral Units').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsNumTEDCryptomapSets.setStatus('current') if mibBuilder.loadTexts: cipsNumTEDCryptomapSets.setDescription('The number of static Cryptomap Sets that have at least one dynamic cryptomap template bound to them which has the Tunnel Endpoint Discovery (TED) enabled.') cipsNumTEDProbesReceived = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 2, 1), Counter32()).setUnits('Integral Units').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsNumTEDProbesReceived.setStatus('current') if mibBuilder.loadTexts: cipsNumTEDProbesReceived.setDescription('The number of TED probes that were received by this managed entity since bootup. Not affected by any CLI operation.') cipsNumTEDProbesSent = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 2, 2), Counter32()).setUnits('Integral Units').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsNumTEDProbesSent.setStatus('current') if mibBuilder.loadTexts: cipsNumTEDProbesSent.setDescription('The number of TED probes that were dispatched by all the dynamic cryptomaps in this managed entity since bootup. Not affected by any CLI operation.') cipsNumTEDFailures = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 2, 3), Counter32()).setUnits('Integral Units').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsNumTEDFailures.setStatus('current') if mibBuilder.loadTexts: cipsNumTEDFailures.setDescription('The number of TED probes that were dispatched by the local entity and that failed to locate crypto endpoint. Not affected by any CLI operation.') cipsMaxSAs = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 3, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setUnits('Integral Units').setMaxAccess("readonly") if mibBuilder.loadTexts: cipsMaxSAs.setStatus('current') if mibBuilder.loadTexts: cipsMaxSAs.setDescription('The maximum number of IPsec Security Associations that can be established on this managed entity. If no theoretical limit exists, this returns value 0. Not affected by any CLI operation.') cips3DesCapable = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 3, 2), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cips3DesCapable.setStatus('current') if mibBuilder.loadTexts: cips3DesCapable.setDescription('The value of this object is TRUE if the managed entity has the hardware nad software features to support 3DES encryption algorithm. Not affected by any CLI operation.') cipsStaticCryptomapSetTable = MibTable((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1), ) if mibBuilder.loadTexts: cipsStaticCryptomapSetTable.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetTable.setDescription('The table containing the list of all cryptomap sets that are fully specified and are not wild-carded. The operator may include different types of cryptomaps in such a set - manual, CET, ISAKMP or dynamic.') cipsStaticCryptomapSetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1), ).setIndexNames((0, "CISCO-IPSEC-MIB", "cipsStaticCryptomapSetName")) if mibBuilder.loadTexts: cipsStaticCryptomapSetEntry.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetEntry.setDescription('Each entry contains the attributes associated with a single static cryptomap set.') cipsStaticCryptomapSetName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 1), DisplayString()) if mibBuilder.loadTexts: cipsStaticCryptomapSetName.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetName.setDescription('The index of the static cryptomap table. The value of the string is the name string assigned by the operator in defining the cryptomap set.') cipsStaticCryptomapSetSize = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapSetSize.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetSize.setDescription('The total number of cryptomap entries contained in this cryptomap set. ') cipsStaticCryptomapSetNumIsakmp = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapSetNumIsakmp.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumIsakmp.setDescription('The number of cryptomaps associated with this cryptomap set that use ISAKMP protocol to do key exchange.') cipsStaticCryptomapSetNumManual = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapSetNumManual.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumManual.setDescription('The number of cryptomaps associated with this cryptomap set that require the operator to manually setup the keys and SPIs.') cipsStaticCryptomapSetNumCET = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 5), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapSetNumCET.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumCET.setDescription("The number of cryptomaps of type 'ipsec-cisco' associated with this cryptomap set. Such cryptomap elements implement Cisco Encryption Technology based Virtual Private Networks.") cipsStaticCryptomapSetNumDynamic = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 6), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapSetNumDynamic.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumDynamic.setDescription('The number of dynamic cryptomap templates linked to this cryptomap set.') cipsStaticCryptomapSetNumDisc = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 7), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapSetNumDisc.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumDisc.setDescription('The number of dynamic cryptomap templates linked to this cryptomap set that have Tunnel Endpoint Discovery (TED) enabled.') cipsStaticCryptomapSetNumSAs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 8), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapSetNumSAs.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumSAs.setDescription('The number of and IPsec Security Associations that are active and were setup using this cryptomap. ') cipsDynamicCryptomapSetTable = MibTable((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2), ) if mibBuilder.loadTexts: cipsDynamicCryptomapSetTable.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetTable.setDescription('The table containing the list of all dynamic cryptomaps that use IKE, defined on the managed entity.') cipsDynamicCryptomapSetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2, 1), ).setIndexNames((0, "CISCO-IPSEC-MIB", "cipsDynamicCryptomapSetName")) if mibBuilder.loadTexts: cipsDynamicCryptomapSetEntry.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetEntry.setDescription('Each entry contains the attributes associated with a single dynamic cryptomap template.') cipsDynamicCryptomapSetName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2, 1, 1), DisplayString()) if mibBuilder.loadTexts: cipsDynamicCryptomapSetName.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetName.setDescription('The index of the dynamic cryptomap table. The value of the string is the one assigned by the operator in defining the cryptomap set.') cipsDynamicCryptomapSetSize = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsDynamicCryptomapSetSize.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetSize.setDescription('The number of cryptomap entries in this cryptomap.') cipsDynamicCryptomapSetNumAssoc = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2, 1, 3), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsDynamicCryptomapSetNumAssoc.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetNumAssoc.setDescription('The number of static cryptomap sets with which this dynamic cryptomap is associated. ') cipsStaticCryptomapTable = MibTable((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3), ) if mibBuilder.loadTexts: cipsStaticCryptomapTable.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapTable.setDescription('The table ilisting the member cryptomaps of the cryptomap sets that are configured on the managed entity.') cipsStaticCryptomapEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1), ).setIndexNames((0, "CISCO-IPSEC-MIB", "cipsStaticCryptomapSetName"), (0, "CISCO-IPSEC-MIB", "cipsStaticCryptomapPriority")) if mibBuilder.loadTexts: cipsStaticCryptomapEntry.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapEntry.setDescription('Each entry contains the attributes associated with a single static (fully specified) cryptomap entry. This table does not include the members of dynamic cryptomap sets that may be linked with the parent static cryptomap set.') cipsStaticCryptomapPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))) if mibBuilder.loadTexts: cipsStaticCryptomapPriority.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapPriority.setDescription('The priority of the cryptomap entry in the cryptomap set. This is the second index component of this table.') cipsStaticCryptomapType = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 2), CryptomapType()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapType.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapType.setDescription('The type of the cryptomap entry. This can be an ISAKMP cryptomap, CET or manual. Dynamic cryptomaps are not counted in this table.') cipsStaticCryptomapDescr = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapDescr.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapDescr.setDescription('The description string entered by the operatoir while creating this cryptomap. The string generally identifies a description and the purpose of this policy.') cipsStaticCryptomapPeer = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 4), IPSIpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapPeer.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapPeer.setDescription('The IP address of the current peer associated with this IPSec policy item. Traffic that is protected by this cryptomap is protected by a tunnel that terminates at the device whose IP address is specified by this object.') cipsStaticCryptomapNumPeers = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 5), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 40))).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapNumPeers.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapNumPeers.setDescription("The number of peers associated with this cryptomap entry. The peers other than the one identified by 'cipsStaticCryptomapPeer' are backup peers. Manual cryptomaps may have only one peer.") cipsStaticCryptomapPfs = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 6), DiffHellmanGrp()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapPfs.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapPfs.setDescription('This object identifies if the tunnels instantiated due to this policy item should use Perfect Forward Secrecy (PFS) and if so, what group of Oakley they should use.') cipsStaticCryptomapLifetime = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(120, 86400), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapLifetime.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapLifetime.setDescription('This object identifies the lifetime of the IPSec Security Associations (SA) created using this IPSec policy entry. If this value is zero, the lifetime assumes the value specified by the global lifetime parameter.') cipsStaticCryptomapLifesize = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(ValueRangeConstraint(0, 0), ValueRangeConstraint(2560, 536870912), ))).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapLifesize.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapLifesize.setDescription('This object identifies the lifesize (maximum traffic in bytes that may be carried) of the IPSec SAs created using this IPSec policy entry. If this value is zero, the lifetime assumes the value specified by the global lifesize parameter.') cipsStaticCryptomapLevelHost = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 9), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsStaticCryptomapLevelHost.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapLevelHost.setDescription('This object identifies the granularity of the IPSec SAs created using this IPSec policy entry. If this value is TRUE, distinct SA bundles are created for distinct hosts at the end of the application traffic.') cipsCryptomapSetIfTable = MibTable((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 4), ) if mibBuilder.loadTexts: cipsCryptomapSetIfTable.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetIfTable.setDescription('The table lists the binding of cryptomap sets to the interfaces of the managed entity.') cipsCryptomapSetIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 4, 1), ).setIndexNames((0, "IF-MIB", "ifIndex"), (0, "CISCO-IPSEC-MIB", "cipsStaticCryptomapSetName")) if mibBuilder.loadTexts: cipsCryptomapSetIfEntry.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetIfEntry.setDescription('Each entry contains the record of the association between an interface and a cryptomap set (static) that is defined on the managed entity. Note that the cryptomap set identified in this binding must static. Dynamic cryptomaps cannot be bound to interfaces.') cipsCryptomapSetIfVirtual = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 4, 1, 1), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: cipsCryptomapSetIfVirtual.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetIfVirtual.setDescription('The value of this object identifies if the interface to which the cryptomap set is attached is a tunnel (such as a GRE or PPTP tunnel).') cipsCryptomapSetIfStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 4, 1, 2), CryptomapSetBindStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cipsCryptomapSetIfStatus.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetIfStatus.setDescription("This object identifies the status of the binding of the specified cryptomap set with the specified interface. The value when queried is always 'attached'. When set to 'detached', the cryptomap set if detached from the specified interface. The effect of this is same as the CLI command config-if# no crypto map cryptomapSetName Setting the value to 'attached' will result in SNMP General Error.") cipsCntlIsakmpPolicyAdded = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 1), TrapStatus().clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cipsCntlIsakmpPolicyAdded.setStatus('current') if mibBuilder.loadTexts: cipsCntlIsakmpPolicyAdded.setDescription('This object defines the administrative state of sending the IOS IPsec ISAKMP Policy Add trap.') cipsCntlIsakmpPolicyDeleted = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 2), TrapStatus().clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cipsCntlIsakmpPolicyDeleted.setStatus('current') if mibBuilder.loadTexts: cipsCntlIsakmpPolicyDeleted.setDescription('This object defines the administrative state of sending the IOS IPsec ISAKMP Policy Delete trap.') cipsCntlCryptomapAdded = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 3), TrapStatus().clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cipsCntlCryptomapAdded.setStatus('current') if mibBuilder.loadTexts: cipsCntlCryptomapAdded.setDescription('This object defines the administrative state of sending the IOS IPsec Cryptomap Add trap.') cipsCntlCryptomapDeleted = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 4), TrapStatus().clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cipsCntlCryptomapDeleted.setStatus('current') if mibBuilder.loadTexts: cipsCntlCryptomapDeleted.setDescription('This object defines the administrative state of sending the IOS IPsec Cryptomap Delete trap.') cipsCntlCryptomapSetAttached = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 5), TrapStatus().clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cipsCntlCryptomapSetAttached.setStatus('current') if mibBuilder.loadTexts: cipsCntlCryptomapSetAttached.setDescription('This object defines the administrative state of sending the IOS IPsec trap that is issued when a cryptomap set is attached to an interface.') cipsCntlCryptomapSetDetached = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 6), TrapStatus().clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cipsCntlCryptomapSetDetached.setStatus('current') if mibBuilder.loadTexts: cipsCntlCryptomapSetDetached.setDescription('This object defines the administrative state of sending the IOS IPsec trap that is issued when a cryptomap set is detached from an interface. to which it was earlier bound.') cipsCntlTooManySAs = MibScalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 7), TrapStatus().clone('disabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cipsCntlTooManySAs.setStatus('current') if mibBuilder.loadTexts: cipsCntlTooManySAs.setDescription('This object defines the administrative state of sending the IOS IPsec trap that is issued when the number of SAs crosses the maximum number of SAs that may be supported on the managed entity.') cipsMIBNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0)) cipsIsakmpPolicyAdded = NotificationType((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 1)).setObjects(("CISCO-IPSEC-MIB", "cipsNumIsakmpPolicies")) if mibBuilder.loadTexts: cipsIsakmpPolicyAdded.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolicyAdded.setDescription('This trap is generated when a new ISAKMP policy element is defined on the managed entity. The context of the event includes the updated number of ISAKMP policy elements currently available.') cipsIsakmpPolicyDeleted = NotificationType((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 2)).setObjects(("CISCO-IPSEC-MIB", "cipsNumIsakmpPolicies")) if mibBuilder.loadTexts: cipsIsakmpPolicyDeleted.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolicyDeleted.setDescription('This trap is generated when an existing ISAKMP policy element is deleted on the managed entity. The context of the event includes the updated number of ISAKMP policy elements currently available.') cipsCryptomapAdded = NotificationType((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 3)).setObjects(("CISCO-IPSEC-MIB", "cipsStaticCryptomapType"), ("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetSize")) if mibBuilder.loadTexts: cipsCryptomapAdded.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapAdded.setDescription('This trap is generated when a new cryptomap is added to the specified cryptomap set.') cipsCryptomapDeleted = NotificationType((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 4)).setObjects(("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetSize")) if mibBuilder.loadTexts: cipsCryptomapDeleted.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapDeleted.setDescription('This trap is generated when a cryptomap is removed from the specified cryptomap set.') cipsCryptomapSetAttached = NotificationType((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 5)).setObjects(("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetSize"), ("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetNumIsakmp"), ("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetNumDynamic")) if mibBuilder.loadTexts: cipsCryptomapSetAttached.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetAttached.setDescription('A cryptomap set must be attached to an interface of the device in order for it to be operational. This trap is generated when the cryptomap set attached to an active interface of the managed entity. The context of the notification includes: Size of the attached cryptomap set, Number of ISAKMP cryptomaps in the set and Number of Dynamic cryptomaps in the set.') cipsCryptomapSetDetached = NotificationType((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 6)).setObjects(("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetSize")) if mibBuilder.loadTexts: cipsCryptomapSetDetached.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetDetached.setDescription('This trap is generated when a cryptomap set is detached from an interafce to which it was bound earlier. The context of the event identifies the size of the cryptomap set.') cipsTooManySAs = NotificationType((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 7)).setObjects(("CISCO-IPSEC-MIB", "cipsMaxSAs")) if mibBuilder.loadTexts: cipsTooManySAs.setStatus('current') if mibBuilder.loadTexts: cipsTooManySAs.setDescription('This trap is generated when a new SA is attempted to be setup while the number of currently active SAs equals the maximum configurable. The variables are: cipsMaxSAs') cipsMIBConformances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 1)) cipsMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2)) cipsMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 1, 1)).setObjects(("CISCO-IPSEC-MIB", "cipsMIBConfIsakmpGroup"), ("CISCO-IPSEC-MIB", "cipsMIBConfIPSecGlobalsGroup"), ("CISCO-IPSEC-MIB", "cipsMIBConfCapacityGroup"), ("CISCO-IPSEC-MIB", "cipsMIBStaticCryptomapGroup"), ("CISCO-IPSEC-MIB", "cipsMIBMandatoryNotifCntlGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cipsMIBCompliance = cipsMIBCompliance.setStatus('current') if mibBuilder.loadTexts: cipsMIBCompliance.setDescription('The compliance statement for entities which implement the Cisco IPsec MIB') cipsMIBConfIsakmpGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 1)).setObjects(("CISCO-IPSEC-MIB", "cipsIsakmpEnabled"), ("CISCO-IPSEC-MIB", "cipsIsakmpIdentity"), ("CISCO-IPSEC-MIB", "cipsIsakmpKeepaliveInterval"), ("CISCO-IPSEC-MIB", "cipsNumIsakmpPolicies")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cipsMIBConfIsakmpGroup = cipsMIBConfIsakmpGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBConfIsakmpGroup.setDescription('A collection of objects providing Global ISAKMP policy monitoring capability to a Cisco IPsec capable VPN router.') cipsMIBConfIPSecGlobalsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 2)).setObjects(("CISCO-IPSEC-MIB", "cipsSALifetime"), ("CISCO-IPSEC-MIB", "cipsSALifesize")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cipsMIBConfIPSecGlobalsGroup = cipsMIBConfIPSecGlobalsGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBConfIPSecGlobalsGroup.setDescription('A collection of objects providing Global IPSec policy monitoring capability to a Cisco IPsec capable VPN router.') cipsMIBConfCapacityGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 3)).setObjects(("CISCO-IPSEC-MIB", "cipsMaxSAs"), ("CISCO-IPSEC-MIB", "cips3DesCapable")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cipsMIBConfCapacityGroup = cipsMIBConfCapacityGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBConfCapacityGroup.setDescription('A collection of objects providing IPsec System Capacity monitoring capability to a Cisco IPsec capable VPN router.') cipsMIBStaticCryptomapGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 4)).setObjects(("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetSize"), ("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetNumIsakmp"), ("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetNumCET"), ("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetNumSAs")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cipsMIBStaticCryptomapGroup = cipsMIBStaticCryptomapGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBStaticCryptomapGroup.setDescription('A collection of objects instrumenting the properties of the Static (fully specified) Cryptomap Sets on an IPsec-capable IOS router.') cipsMIBManualCryptomapGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 5)).setObjects(("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetNumManual")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cipsMIBManualCryptomapGroup = cipsMIBManualCryptomapGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBManualCryptomapGroup.setDescription('A collection of objects instrumenting the properties of the Manual Cryptomap entries on a Cisco IPsec capable IOS router.') cipsMIBDynamicCryptomapGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 6)).setObjects(("CISCO-IPSEC-MIB", "cipsNumTEDProbesReceived"), ("CISCO-IPSEC-MIB", "cipsNumTEDProbesSent"), ("CISCO-IPSEC-MIB", "cipsNumTEDFailures"), ("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetNumDynamic"), ("CISCO-IPSEC-MIB", "cipsStaticCryptomapSetNumDisc"), ("CISCO-IPSEC-MIB", "cipsNumTEDCryptomapSets"), ("CISCO-IPSEC-MIB", "cipsDynamicCryptomapSetSize"), ("CISCO-IPSEC-MIB", "cipsDynamicCryptomapSetNumAssoc")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cipsMIBDynamicCryptomapGroup = cipsMIBDynamicCryptomapGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBDynamicCryptomapGroup.setDescription('A collection of objects instrumenting the properties of the Dynamic Cryptomap group on a Cisco IPsec capable IOS router.') cipsMIBMandatoryNotifCntlGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 7)).setObjects(("CISCO-IPSEC-MIB", "cipsCntlIsakmpPolicyAdded"), ("CISCO-IPSEC-MIB", "cipsCntlIsakmpPolicyDeleted"), ("CISCO-IPSEC-MIB", "cipsCntlCryptomapAdded"), ("CISCO-IPSEC-MIB", "cipsCntlCryptomapDeleted"), ("CISCO-IPSEC-MIB", "cipsCntlCryptomapSetAttached"), ("CISCO-IPSEC-MIB", "cipsCntlCryptomapSetDetached"), ("CISCO-IPSEC-MIB", "cipsCntlTooManySAs")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cipsMIBMandatoryNotifCntlGroup = cipsMIBMandatoryNotifCntlGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBMandatoryNotifCntlGroup.setDescription('A collection of objects providing IPsec Notification capability to a IPsec-capable IOS router. It is mandatory to implement this set of objects pertaining to IOS notifications about IPSec activity.') mibBuilder.exportSymbols("CISCO-IPSEC-MIB", cipsIPsecGlobals=cipsIPsecGlobals, cipsCryptomapSetIfVirtual=cipsCryptomapSetIfVirtual, cipsStaticCryptomapSetNumManual=cipsStaticCryptomapSetNumManual, cipsStaticCryptomapDescr=cipsStaticCryptomapDescr, cipsIsakmpGroup=cipsIsakmpGroup, cipsDynamicCryptomapSetSize=cipsDynamicCryptomapSetSize, cipsCryptomapAdded=cipsCryptomapAdded, cipsTrapCntlGroup=cipsTrapCntlGroup, cipsCryptomapSetIfEntry=cipsCryptomapSetIfEntry, cipsMIBConfIPSecGlobalsGroup=cipsMIBConfIPSecGlobalsGroup, cipsStaticCryptomapSetNumIsakmp=cipsStaticCryptomapSetNumIsakmp, cipsMIBMandatoryNotifCntlGroup=cipsMIBMandatoryNotifCntlGroup, cipsNumTEDFailures=cipsNumTEDFailures, ciscoIPsecMIB=ciscoIPsecMIB, cipsStaticCryptomapPfs=cipsStaticCryptomapPfs, cipsStaticCryptomapSetSize=cipsStaticCryptomapSetSize, CryptomapSetBindStatus=CryptomapSetBindStatus, ciscoIPsecMIBNotificationPrefix=ciscoIPsecMIBNotificationPrefix, cipsNumCETCryptomapSets=cipsNumCETCryptomapSets, cipsNumStaticCryptomapSets=cipsNumStaticCryptomapSets, cipsIsakmpPolPriority=cipsIsakmpPolPriority, IkeHashAlgo=IkeHashAlgo, cipsCryptomapSetAttached=cipsCryptomapSetAttached, cipsMIBDynamicCryptomapGroup=cipsMIBDynamicCryptomapGroup, cips3DesCapable=cips3DesCapable, cipsIsakmpPolicyTable=cipsIsakmpPolicyTable, cipsStaticCryptomapPeer=cipsStaticCryptomapPeer, cipsSysCapacityGroup=cipsSysCapacityGroup, cipsStaticCryptomapLevelHost=cipsStaticCryptomapLevelHost, cipsIsakmpKeepaliveInterval=cipsIsakmpKeepaliveInterval, cipsMIBCompliance=cipsMIBCompliance, cipsNumDynamicCryptomapSets=cipsNumDynamicCryptomapSets, cipsIsakmpPolicyEntry=cipsIsakmpPolicyEntry, cipsStaticCryptomapType=cipsStaticCryptomapType, cipsDynamicCryptomapSetEntry=cipsDynamicCryptomapSetEntry, cipsIsakmpPolEncr=cipsIsakmpPolEncr, ciscoIPsecMIBObjects=ciscoIPsecMIBObjects, cipsMIBStaticCryptomapGroup=cipsMIBStaticCryptomapGroup, cipsStaticCryptomapSetName=cipsStaticCryptomapSetName, cipsNumTEDProbesSent=cipsNumTEDProbesSent, cipsMIBConfCapacityGroup=cipsMIBConfCapacityGroup, cipsCntlTooManySAs=cipsCntlTooManySAs, cipsIsakmpPolAuth=cipsIsakmpPolAuth, IPSIpAddress=IPSIpAddress, ciscoIPsecMIBConformance=ciscoIPsecMIBConformance, cipsMaxSAs=cipsMaxSAs, cipsDynamicCryptomapSetNumAssoc=cipsDynamicCryptomapSetNumAssoc, cipsIsakmpPolHash=cipsIsakmpPolHash, cipsStaticCryptomapTable=cipsStaticCryptomapTable, CryptomapType=CryptomapType, cipsMIBConformances=cipsMIBConformances, cipsStaticCryptomapNumPeers=cipsStaticCryptomapNumPeers, cipsNumTEDProbesReceived=cipsNumTEDProbesReceived, cipsCryptomapDeleted=cipsCryptomapDeleted, cipsStaticCryptomapSetNumSAs=cipsStaticCryptomapSetNumSAs, cipsStaticCryptomapSetNumDynamic=cipsStaticCryptomapSetNumDynamic, cipsStaticCryptomapLifesize=cipsStaticCryptomapLifesize, cipsCntlCryptomapAdded=cipsCntlCryptomapAdded, cipsIsakmpPolicyAdded=cipsIsakmpPolicyAdded, IkeIdentityType=IkeIdentityType, cipsIsakmpIdentity=cipsIsakmpIdentity, cipsCryptomapSetIfTable=cipsCryptomapSetIfTable, cipsDynamicCryptomapSetTable=cipsDynamicCryptomapSetTable, PYSNMP_MODULE_ID=ciscoIPsecMIB, cipsMIBManualCryptomapGroup=cipsMIBManualCryptomapGroup, cipsMIBNotifications=cipsMIBNotifications, cipsIsakmpEnabled=cipsIsakmpEnabled, cipsTooManySAs=cipsTooManySAs, cipsStaticCryptomapSetEntry=cipsStaticCryptomapSetEntry, cipsCntlCryptomapSetAttached=cipsCntlCryptomapSetAttached, cipsMIBConfIsakmpGroup=cipsMIBConfIsakmpGroup, CIPsecLifesize=CIPsecLifesize, cipsDynamicCryptomapSetName=cipsDynamicCryptomapSetName, cipsCryptomapGroup=cipsCryptomapGroup, cipsCntlCryptomapDeleted=cipsCntlCryptomapDeleted, TrapStatus=TrapStatus, cipsNumIsakmpPolicies=cipsNumIsakmpPolicies, cipsIsakmpPolicyDeleted=cipsIsakmpPolicyDeleted, cipsStaticCryptomapLifetime=cipsStaticCryptomapLifetime, cipsCntlCryptomapSetDetached=cipsCntlCryptomapSetDetached, EncryptAlgo=EncryptAlgo, cipsIPsecStatistics=cipsIPsecStatistics, cipsCntlIsakmpPolicyAdded=cipsCntlIsakmpPolicyAdded, IkeAuthMethod=IkeAuthMethod, cipsSALifetime=cipsSALifetime, cipsStaticCryptomapSetNumCET=cipsStaticCryptomapSetNumCET, cipsStaticCryptomapSetTable=cipsStaticCryptomapSetTable, cipsCntlIsakmpPolicyDeleted=cipsCntlIsakmpPolicyDeleted, cipsIsakmpPolLifetime=cipsIsakmpPolLifetime, cipsStaticCryptomapEntry=cipsStaticCryptomapEntry, DiffHellmanGrp=DiffHellmanGrp, cipsCryptomapSetDetached=cipsCryptomapSetDetached, cipsStaticCryptomapSetNumDisc=cipsStaticCryptomapSetNumDisc, CIPsecNumCryptoMaps=CIPsecNumCryptoMaps, cipsNumTEDCryptomapSets=cipsNumTEDCryptomapSets, cipsSALifesize=cipsSALifesize, cipsCryptomapSetIfStatus=cipsCryptomapSetIfStatus, CIPsecLifetime=CIPsecLifetime, cipsStaticCryptomapPriority=cipsStaticCryptomapPriority, cipsIsakmpPolGroup=cipsIsakmpPolGroup, cipsIPsecGroup=cipsIPsecGroup, cipsMIBGroups=cipsMIBGroups)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_range_constraint, value_size_constraint, constraints_union, constraints_intersection, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'SingleValueConstraint') (cisco_experiment,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoExperiment') (if_index,) = mibBuilder.importSymbols('IF-MIB', 'ifIndex') (module_compliance, notification_group, object_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup', 'ObjectGroup') (iso, gauge32, notification_type, integer32, module_identity, object_identity, bits, time_ticks, counter32, mib_identifier, counter64, ip_address, unsigned32, mib_scalar, mib_table, mib_table_row, mib_table_column) = mibBuilder.importSymbols('SNMPv2-SMI', 'iso', 'Gauge32', 'NotificationType', 'Integer32', 'ModuleIdentity', 'ObjectIdentity', 'Bits', 'TimeTicks', 'Counter32', 'MibIdentifier', 'Counter64', 'IpAddress', 'Unsigned32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn') (textual_convention, display_string, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'TruthValue') cisco_i_psec_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 10, 62)) if mibBuilder.loadTexts: ciscoIPsecMIB.setLastUpdated('200008071139Z') if mibBuilder.loadTexts: ciscoIPsecMIB.setOrganization('Cisco Systems, Inc.') if mibBuilder.loadTexts: ciscoIPsecMIB.setContactInfo(' Cisco Systems Enterprise Business Management Unit Postal: 170 W Tasman Drive San Jose, CA 95134 USA Tel: +1 800 553-NETS E-mail: cs-ipsecurity@cisco.com') if mibBuilder.loadTexts: ciscoIPsecMIB.setDescription("The MIB module for modeling Cisco-specific IPsec attributes Overview of Cisco IPsec MIB MIB description This MIB models the Cisco implementation-specific attributes of a Cisco entity that implements IPsec. This MIB is complementary to the standard IPsec MIB proposed jointly by Tivoli and Cisco. The ciscoIPsec MIB provides the operational information on Cisco's IPsec tunnelling implementation. The following entities are managed: 1) ISAKMP Group: a) ISAKMP global parameters b) ISAKMP Policy Table 2) IPSec Group: a) IPSec Global Parameters b) IPSec Global Traffic Parameters c) Cryptomap Group - Cryptomap Set Table - Cryptomap Table - CryptomapSet Binding Table 3) System Capacity & Capability Group: a) Capacity Parameters b) Capability Parameters 4) Trap Control Group 5) Notifications Group") class Cipseclifetime(TextualConvention, Gauge32): description = 'Value in units of seconds' status = 'current' subtype_spec = Gauge32.subtypeSpec + value_range_constraint(120, 86400) class Cipseclifesize(TextualConvention, Gauge32): description = 'Value in units of kilobytes' status = 'current' subtype_spec = Gauge32.subtypeSpec + value_range_constraint(2560, 536870912) class Cipsecnumcryptomaps(TextualConvention, Gauge32): description = 'Integral units representing count of cryptomaps' status = 'current' subtype_spec = Gauge32.subtypeSpec + value_range_constraint(0, 2147483647) class Cryptomaptype(TextualConvention, Integer32): description = 'The type of a cryptomap entry. Cryptomap is a unit of IOS IPSec policy specification.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2, 3, 4, 5)) named_values = named_values(('cryptomapTypeNONE', 0), ('cryptomapTypeMANUAL', 1), ('cryptomapTypeISAKMP', 2), ('cryptomapTypeCET', 3), ('cryptomapTypeDYNAMIC', 4), ('cryptomapTypeDYNAMICDISCOVERY', 5)) class Cryptomapsetbindstatus(TextualConvention, Integer32): description = "The status of the binding of a cryptomap set to the specified interface. The value qhen queried is always 'attached'. When set to 'detached', the cryptomap set if detached from the specified interface. Setting the value to 'attached' will result in SNMP General Error." status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2)) named_values = named_values(('unknown', 0), ('attached', 1), ('detached', 2)) class Ipsipaddress(TextualConvention, OctetString): description = 'An IP V4 or V6 Address.' status = 'current' subtype_spec = OctetString.subtypeSpec + constraints_union(value_size_constraint(4, 4), value_size_constraint(16, 16)) class Ikehashalgo(TextualConvention, Integer32): description = 'The hash algorithm used in IPsec Phase-1 IKE negotiations.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('none', 1), ('md5', 2), ('sha', 3)) class Ikeauthmethod(TextualConvention, Integer32): description = 'The authentication method used in IPsec Phase-1 IKE negotiations.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3, 4, 5)) named_values = named_values(('none', 1), ('preSharedKey', 2), ('rsaSig', 3), ('rsaEncrypt', 4), ('revPublicKey', 5)) class Ikeidentitytype(TextualConvention, Integer32): description = 'The type of identity used by the local entity to identity itself to the peer with which it performs IPSec Main Mode negotiations. This type decides the content of the Identification payload in the Main Mode of IPSec tunnel setup.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(0, 1, 2)) named_values = named_values(('isakmpIdTypeUNKNOWN', 0), ('isakmpIdTypeADDRESS', 1), ('isakmpIdTypeHOSTNAME', 2)) class Diffhellmangrp(TextualConvention, Integer32): description = 'The Diffie Hellman Group used in negotiations.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('none', 1), ('dhGroup1', 2), ('dhGroup2', 3)) class Encryptalgo(TextualConvention, Integer32): description = 'The encryption algorithm used in negotiations.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2, 3)) named_values = named_values(('none', 1), ('des', 2), ('des3', 3)) class Trapstatus(TextualConvention, Integer32): description = 'The administrative status for sending a TRAP.' status = 'current' subtype_spec = Integer32.subtypeSpec + constraints_union(single_value_constraint(1, 2)) named_values = named_values(('enabled', 1), ('disabled', 2)) cisco_i_psec_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1)) cisco_i_psec_mib_notification_prefix = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 2)) cisco_i_psec_mib_conformance = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 3)) cips_isakmp_group = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1)) cips_i_psec_group = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2)) cips_i_psec_globals = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1)) cips_i_psec_statistics = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 2)) cips_cryptomap_group = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3)) cips_sys_capacity_group = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 3)) cips_trap_cntl_group = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4)) cips_isakmp_enabled = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 1), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsIsakmpEnabled.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpEnabled.setDescription('The value of this object is TRUE if ISAKMP has been enabled on the managed entity. Otherise the value of this object is FALSE.') cips_isakmp_identity = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 2), ike_identity_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsIsakmpIdentity.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpIdentity.setDescription('The value of this object is shows the type of identity used by the managed entity in ISAKMP negotiations with another peer.') cips_isakmp_keepalive_interval = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 3), integer32().subtype(subtypeSpec=value_range_constraint(10, 3600))).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsIsakmpKeepaliveInterval.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpKeepaliveInterval.setDescription('The value of this object is time interval in seconds between successive ISAKMP keepalive heartbeats issued to the peers to which IKE tunnels have been setup.') cips_num_isakmp_policies = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 4), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsNumIsakmpPolicies.setStatus('current') if mibBuilder.loadTexts: cipsNumIsakmpPolicies.setDescription('The value of this object is the number of ISAKMP policies that have been configured on the managed entity.') cips_isakmp_policy_table = mib_table((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5)) if mibBuilder.loadTexts: cipsIsakmpPolicyTable.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolicyTable.setDescription('The table containing the list of all ISAKMP policy entries configured by the operator.') cips_isakmp_policy_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1)).setIndexNames((0, 'CISCO-IPSEC-MIB', 'cipsIsakmpPolPriority')) if mibBuilder.loadTexts: cipsIsakmpPolicyEntry.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolicyEntry.setDescription('Each entry contains the attributes associated with a single ISAKMP Policy entry.') cips_isakmp_pol_priority = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: cipsIsakmpPolPriority.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolPriority.setDescription('The priotity of this ISAKMP Policy entry. This is also the index of this table.') cips_isakmp_pol_encr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 2), encrypt_algo()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsIsakmpPolEncr.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolEncr.setDescription('The encryption transform specified by this ISAKMP policy specification. The Internet Key Exchange (IKE) tunnels setup using this policy item would use the specified encryption transform to protect the ISAKMP PDUs.') cips_isakmp_pol_hash = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 3), ike_hash_algo()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsIsakmpPolHash.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolHash.setDescription('The hash transform specified by this ISAKMP policy specification. The IKE tunnels setup using this policy item would use the specified hash transform to protect the ISAKMP PDUs.') cips_isakmp_pol_auth = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 4), ike_auth_method()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsIsakmpPolAuth.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolAuth.setDescription('The peer authentication mthod specified by this ISAKMP policy specification. If this policy entity is selected for negotiation with a peer, the local entity would authenticate the peer using the method specified by this object.') cips_isakmp_pol_group = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 5), diff_hellman_grp()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsIsakmpPolGroup.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolGroup.setDescription('This object specifies the Oakley group used for Diffie Hellman exchange in the Main Mode. If this policy item is selected to negotiate Main Mode with an IKE peer, the local entity chooses the group specified by this object to perform Diffie Hellman exchange with the peer.') cips_isakmp_pol_lifetime = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 1, 5, 1, 6), integer32().subtype(subtypeSpec=value_range_constraint(60, 86400))).setUnits('seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsIsakmpPolLifetime.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolLifetime.setDescription('This object specifies the lifetime in seconds of the IKE tunnels generated using this policy specification.') cips_sa_lifetime = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 1), ci_psec_lifetime()).setUnits('Seconds').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsSALifetime.setStatus('current') if mibBuilder.loadTexts: cipsSALifetime.setDescription('The default lifetime (in seconds) assigned to an SA as a global policy (maybe overridden in specific cryptomap definitions).') cips_sa_lifesize = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 2), ci_psec_lifesize()).setUnits('KBytes').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsSALifesize.setStatus('current') if mibBuilder.loadTexts: cipsSALifesize.setDescription('The default lifesize in KBytes assigned to an SA as a global policy (unless overridden in cryptomap definition)') cips_num_static_cryptomap_sets = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 3), ci_psec_num_crypto_maps()).setUnits('Integral Units').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsNumStaticCryptomapSets.setStatus('current') if mibBuilder.loadTexts: cipsNumStaticCryptomapSets.setDescription('The number of Cryptomap Sets that are are fully configured. Statically defined cryptomap sets are ones where the operator has fully specified all the parameters required set up IPSec Virtual Private Networks (VPNs).') cips_num_cet_cryptomap_sets = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 4), ci_psec_num_crypto_maps()).setUnits('Integral Units').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsNumCETCryptomapSets.setStatus('current') if mibBuilder.loadTexts: cipsNumCETCryptomapSets.setDescription('The number of static Cryptomap Sets that have at least one CET cryptomap element as a member of the set.') cips_num_dynamic_cryptomap_sets = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 5), ci_psec_num_crypto_maps()).setUnits('Integral Units').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsNumDynamicCryptomapSets.setStatus('current') if mibBuilder.loadTexts: cipsNumDynamicCryptomapSets.setDescription("The number of dynamic IPSec Policy templates (called 'dynamic cryptomap templates') configured on the managed entity.") cips_num_ted_cryptomap_sets = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 1, 6), ci_psec_num_crypto_maps()).setUnits('Integral Units').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsNumTEDCryptomapSets.setStatus('current') if mibBuilder.loadTexts: cipsNumTEDCryptomapSets.setDescription('The number of static Cryptomap Sets that have at least one dynamic cryptomap template bound to them which has the Tunnel Endpoint Discovery (TED) enabled.') cips_num_ted_probes_received = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 2, 1), counter32()).setUnits('Integral Units').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsNumTEDProbesReceived.setStatus('current') if mibBuilder.loadTexts: cipsNumTEDProbesReceived.setDescription('The number of TED probes that were received by this managed entity since bootup. Not affected by any CLI operation.') cips_num_ted_probes_sent = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 2, 2), counter32()).setUnits('Integral Units').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsNumTEDProbesSent.setStatus('current') if mibBuilder.loadTexts: cipsNumTEDProbesSent.setDescription('The number of TED probes that were dispatched by all the dynamic cryptomaps in this managed entity since bootup. Not affected by any CLI operation.') cips_num_ted_failures = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 2, 3), counter32()).setUnits('Integral Units').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsNumTEDFailures.setStatus('current') if mibBuilder.loadTexts: cipsNumTEDFailures.setDescription('The number of TED probes that were dispatched by the local entity and that failed to locate crypto endpoint. Not affected by any CLI operation.') cips_max_s_as = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 3, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))).setUnits('Integral Units').setMaxAccess('readonly') if mibBuilder.loadTexts: cipsMaxSAs.setStatus('current') if mibBuilder.loadTexts: cipsMaxSAs.setDescription('The maximum number of IPsec Security Associations that can be established on this managed entity. If no theoretical limit exists, this returns value 0. Not affected by any CLI operation.') cips3_des_capable = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 3, 2), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cips3DesCapable.setStatus('current') if mibBuilder.loadTexts: cips3DesCapable.setDescription('The value of this object is TRUE if the managed entity has the hardware nad software features to support 3DES encryption algorithm. Not affected by any CLI operation.') cips_static_cryptomap_set_table = mib_table((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1)) if mibBuilder.loadTexts: cipsStaticCryptomapSetTable.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetTable.setDescription('The table containing the list of all cryptomap sets that are fully specified and are not wild-carded. The operator may include different types of cryptomaps in such a set - manual, CET, ISAKMP or dynamic.') cips_static_cryptomap_set_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1)).setIndexNames((0, 'CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetName')) if mibBuilder.loadTexts: cipsStaticCryptomapSetEntry.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetEntry.setDescription('Each entry contains the attributes associated with a single static cryptomap set.') cips_static_cryptomap_set_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 1), display_string()) if mibBuilder.loadTexts: cipsStaticCryptomapSetName.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetName.setDescription('The index of the static cryptomap table. The value of the string is the name string assigned by the operator in defining the cryptomap set.') cips_static_cryptomap_set_size = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapSetSize.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetSize.setDescription('The total number of cryptomap entries contained in this cryptomap set. ') cips_static_cryptomap_set_num_isakmp = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumIsakmp.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumIsakmp.setDescription('The number of cryptomaps associated with this cryptomap set that use ISAKMP protocol to do key exchange.') cips_static_cryptomap_set_num_manual = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 4), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumManual.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumManual.setDescription('The number of cryptomaps associated with this cryptomap set that require the operator to manually setup the keys and SPIs.') cips_static_cryptomap_set_num_cet = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 5), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumCET.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumCET.setDescription("The number of cryptomaps of type 'ipsec-cisco' associated with this cryptomap set. Such cryptomap elements implement Cisco Encryption Technology based Virtual Private Networks.") cips_static_cryptomap_set_num_dynamic = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 6), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumDynamic.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumDynamic.setDescription('The number of dynamic cryptomap templates linked to this cryptomap set.') cips_static_cryptomap_set_num_disc = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 7), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumDisc.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumDisc.setDescription('The number of dynamic cryptomap templates linked to this cryptomap set that have Tunnel Endpoint Discovery (TED) enabled.') cips_static_cryptomap_set_num_s_as = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 1, 1, 8), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumSAs.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapSetNumSAs.setDescription('The number of and IPsec Security Associations that are active and were setup using this cryptomap. ') cips_dynamic_cryptomap_set_table = mib_table((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2)) if mibBuilder.loadTexts: cipsDynamicCryptomapSetTable.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetTable.setDescription('The table containing the list of all dynamic cryptomaps that use IKE, defined on the managed entity.') cips_dynamic_cryptomap_set_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2, 1)).setIndexNames((0, 'CISCO-IPSEC-MIB', 'cipsDynamicCryptomapSetName')) if mibBuilder.loadTexts: cipsDynamicCryptomapSetEntry.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetEntry.setDescription('Each entry contains the attributes associated with a single dynamic cryptomap template.') cips_dynamic_cryptomap_set_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2, 1, 1), display_string()) if mibBuilder.loadTexts: cipsDynamicCryptomapSetName.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetName.setDescription('The index of the dynamic cryptomap table. The value of the string is the one assigned by the operator in defining the cryptomap set.') cips_dynamic_cryptomap_set_size = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2, 1, 2), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsDynamicCryptomapSetSize.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetSize.setDescription('The number of cryptomap entries in this cryptomap.') cips_dynamic_cryptomap_set_num_assoc = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 2, 1, 3), gauge32()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsDynamicCryptomapSetNumAssoc.setStatus('current') if mibBuilder.loadTexts: cipsDynamicCryptomapSetNumAssoc.setDescription('The number of static cryptomap sets with which this dynamic cryptomap is associated. ') cips_static_cryptomap_table = mib_table((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3)) if mibBuilder.loadTexts: cipsStaticCryptomapTable.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapTable.setDescription('The table ilisting the member cryptomaps of the cryptomap sets that are configured on the managed entity.') cips_static_cryptomap_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1)).setIndexNames((0, 'CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetName'), (0, 'CISCO-IPSEC-MIB', 'cipsStaticCryptomapPriority')) if mibBuilder.loadTexts: cipsStaticCryptomapEntry.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapEntry.setDescription('Each entry contains the attributes associated with a single static (fully specified) cryptomap entry. This table does not include the members of dynamic cryptomap sets that may be linked with the parent static cryptomap set.') cips_static_cryptomap_priority = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(0, 65535))) if mibBuilder.loadTexts: cipsStaticCryptomapPriority.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapPriority.setDescription('The priority of the cryptomap entry in the cryptomap set. This is the second index component of this table.') cips_static_cryptomap_type = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 2), cryptomap_type()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapType.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapType.setDescription('The type of the cryptomap entry. This can be an ISAKMP cryptomap, CET or manual. Dynamic cryptomaps are not counted in this table.') cips_static_cryptomap_descr = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapDescr.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapDescr.setDescription('The description string entered by the operatoir while creating this cryptomap. The string generally identifies a description and the purpose of this policy.') cips_static_cryptomap_peer = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 4), ips_ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapPeer.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapPeer.setDescription('The IP address of the current peer associated with this IPSec policy item. Traffic that is protected by this cryptomap is protected by a tunnel that terminates at the device whose IP address is specified by this object.') cips_static_cryptomap_num_peers = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 5), integer32().subtype(subtypeSpec=value_range_constraint(0, 40))).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapNumPeers.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapNumPeers.setDescription("The number of peers associated with this cryptomap entry. The peers other than the one identified by 'cipsStaticCryptomapPeer' are backup peers. Manual cryptomaps may have only one peer.") cips_static_cryptomap_pfs = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 6), diff_hellman_grp()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapPfs.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapPfs.setDescription('This object identifies if the tunnels instantiated due to this policy item should use Perfect Forward Secrecy (PFS) and if so, what group of Oakley they should use.') cips_static_cryptomap_lifetime = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 7), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(120, 86400)))).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapLifetime.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapLifetime.setDescription('This object identifies the lifetime of the IPSec Security Associations (SA) created using this IPSec policy entry. If this value is zero, the lifetime assumes the value specified by the global lifetime parameter.') cips_static_cryptomap_lifesize = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 8), integer32().subtype(subtypeSpec=constraints_union(value_range_constraint(0, 0), value_range_constraint(2560, 536870912)))).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapLifesize.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapLifesize.setDescription('This object identifies the lifesize (maximum traffic in bytes that may be carried) of the IPSec SAs created using this IPSec policy entry. If this value is zero, the lifetime assumes the value specified by the global lifesize parameter.') cips_static_cryptomap_level_host = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 3, 1, 9), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsStaticCryptomapLevelHost.setStatus('current') if mibBuilder.loadTexts: cipsStaticCryptomapLevelHost.setDescription('This object identifies the granularity of the IPSec SAs created using this IPSec policy entry. If this value is TRUE, distinct SA bundles are created for distinct hosts at the end of the application traffic.') cips_cryptomap_set_if_table = mib_table((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 4)) if mibBuilder.loadTexts: cipsCryptomapSetIfTable.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetIfTable.setDescription('The table lists the binding of cryptomap sets to the interfaces of the managed entity.') cips_cryptomap_set_if_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 4, 1)).setIndexNames((0, 'IF-MIB', 'ifIndex'), (0, 'CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetName')) if mibBuilder.loadTexts: cipsCryptomapSetIfEntry.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetIfEntry.setDescription('Each entry contains the record of the association between an interface and a cryptomap set (static) that is defined on the managed entity. Note that the cryptomap set identified in this binding must static. Dynamic cryptomaps cannot be bound to interfaces.') cips_cryptomap_set_if_virtual = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 4, 1, 1), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: cipsCryptomapSetIfVirtual.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetIfVirtual.setDescription('The value of this object identifies if the interface to which the cryptomap set is attached is a tunnel (such as a GRE or PPTP tunnel).') cips_cryptomap_set_if_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 2, 3, 4, 1, 2), cryptomap_set_bind_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: cipsCryptomapSetIfStatus.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetIfStatus.setDescription("This object identifies the status of the binding of the specified cryptomap set with the specified interface. The value when queried is always 'attached'. When set to 'detached', the cryptomap set if detached from the specified interface. The effect of this is same as the CLI command config-if# no crypto map cryptomapSetName Setting the value to 'attached' will result in SNMP General Error.") cips_cntl_isakmp_policy_added = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 1), trap_status().clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cipsCntlIsakmpPolicyAdded.setStatus('current') if mibBuilder.loadTexts: cipsCntlIsakmpPolicyAdded.setDescription('This object defines the administrative state of sending the IOS IPsec ISAKMP Policy Add trap.') cips_cntl_isakmp_policy_deleted = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 2), trap_status().clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cipsCntlIsakmpPolicyDeleted.setStatus('current') if mibBuilder.loadTexts: cipsCntlIsakmpPolicyDeleted.setDescription('This object defines the administrative state of sending the IOS IPsec ISAKMP Policy Delete trap.') cips_cntl_cryptomap_added = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 3), trap_status().clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cipsCntlCryptomapAdded.setStatus('current') if mibBuilder.loadTexts: cipsCntlCryptomapAdded.setDescription('This object defines the administrative state of sending the IOS IPsec Cryptomap Add trap.') cips_cntl_cryptomap_deleted = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 4), trap_status().clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cipsCntlCryptomapDeleted.setStatus('current') if mibBuilder.loadTexts: cipsCntlCryptomapDeleted.setDescription('This object defines the administrative state of sending the IOS IPsec Cryptomap Delete trap.') cips_cntl_cryptomap_set_attached = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 5), trap_status().clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cipsCntlCryptomapSetAttached.setStatus('current') if mibBuilder.loadTexts: cipsCntlCryptomapSetAttached.setDescription('This object defines the administrative state of sending the IOS IPsec trap that is issued when a cryptomap set is attached to an interface.') cips_cntl_cryptomap_set_detached = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 6), trap_status().clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cipsCntlCryptomapSetDetached.setStatus('current') if mibBuilder.loadTexts: cipsCntlCryptomapSetDetached.setDescription('This object defines the administrative state of sending the IOS IPsec trap that is issued when a cryptomap set is detached from an interface. to which it was earlier bound.') cips_cntl_too_many_s_as = mib_scalar((1, 3, 6, 1, 4, 1, 9, 10, 62, 1, 4, 7), trap_status().clone('disabled')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cipsCntlTooManySAs.setStatus('current') if mibBuilder.loadTexts: cipsCntlTooManySAs.setDescription('This object defines the administrative state of sending the IOS IPsec trap that is issued when the number of SAs crosses the maximum number of SAs that may be supported on the managed entity.') cips_mib_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0)) cips_isakmp_policy_added = notification_type((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 1)).setObjects(('CISCO-IPSEC-MIB', 'cipsNumIsakmpPolicies')) if mibBuilder.loadTexts: cipsIsakmpPolicyAdded.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolicyAdded.setDescription('This trap is generated when a new ISAKMP policy element is defined on the managed entity. The context of the event includes the updated number of ISAKMP policy elements currently available.') cips_isakmp_policy_deleted = notification_type((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 2)).setObjects(('CISCO-IPSEC-MIB', 'cipsNumIsakmpPolicies')) if mibBuilder.loadTexts: cipsIsakmpPolicyDeleted.setStatus('current') if mibBuilder.loadTexts: cipsIsakmpPolicyDeleted.setDescription('This trap is generated when an existing ISAKMP policy element is deleted on the managed entity. The context of the event includes the updated number of ISAKMP policy elements currently available.') cips_cryptomap_added = notification_type((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 3)).setObjects(('CISCO-IPSEC-MIB', 'cipsStaticCryptomapType'), ('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetSize')) if mibBuilder.loadTexts: cipsCryptomapAdded.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapAdded.setDescription('This trap is generated when a new cryptomap is added to the specified cryptomap set.') cips_cryptomap_deleted = notification_type((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 4)).setObjects(('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetSize')) if mibBuilder.loadTexts: cipsCryptomapDeleted.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapDeleted.setDescription('This trap is generated when a cryptomap is removed from the specified cryptomap set.') cips_cryptomap_set_attached = notification_type((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 5)).setObjects(('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetSize'), ('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetNumIsakmp'), ('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetNumDynamic')) if mibBuilder.loadTexts: cipsCryptomapSetAttached.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetAttached.setDescription('A cryptomap set must be attached to an interface of the device in order for it to be operational. This trap is generated when the cryptomap set attached to an active interface of the managed entity. The context of the notification includes: Size of the attached cryptomap set, Number of ISAKMP cryptomaps in the set and Number of Dynamic cryptomaps in the set.') cips_cryptomap_set_detached = notification_type((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 6)).setObjects(('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetSize')) if mibBuilder.loadTexts: cipsCryptomapSetDetached.setStatus('current') if mibBuilder.loadTexts: cipsCryptomapSetDetached.setDescription('This trap is generated when a cryptomap set is detached from an interafce to which it was bound earlier. The context of the event identifies the size of the cryptomap set.') cips_too_many_s_as = notification_type((1, 3, 6, 1, 4, 1, 9, 10, 62, 2, 0, 7)).setObjects(('CISCO-IPSEC-MIB', 'cipsMaxSAs')) if mibBuilder.loadTexts: cipsTooManySAs.setStatus('current') if mibBuilder.loadTexts: cipsTooManySAs.setDescription('This trap is generated when a new SA is attempted to be setup while the number of currently active SAs equals the maximum configurable. The variables are: cipsMaxSAs') cips_mib_conformances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 1)) cips_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2)) cips_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 1, 1)).setObjects(('CISCO-IPSEC-MIB', 'cipsMIBConfIsakmpGroup'), ('CISCO-IPSEC-MIB', 'cipsMIBConfIPSecGlobalsGroup'), ('CISCO-IPSEC-MIB', 'cipsMIBConfCapacityGroup'), ('CISCO-IPSEC-MIB', 'cipsMIBStaticCryptomapGroup'), ('CISCO-IPSEC-MIB', 'cipsMIBMandatoryNotifCntlGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cips_mib_compliance = cipsMIBCompliance.setStatus('current') if mibBuilder.loadTexts: cipsMIBCompliance.setDescription('The compliance statement for entities which implement the Cisco IPsec MIB') cips_mib_conf_isakmp_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 1)).setObjects(('CISCO-IPSEC-MIB', 'cipsIsakmpEnabled'), ('CISCO-IPSEC-MIB', 'cipsIsakmpIdentity'), ('CISCO-IPSEC-MIB', 'cipsIsakmpKeepaliveInterval'), ('CISCO-IPSEC-MIB', 'cipsNumIsakmpPolicies')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cips_mib_conf_isakmp_group = cipsMIBConfIsakmpGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBConfIsakmpGroup.setDescription('A collection of objects providing Global ISAKMP policy monitoring capability to a Cisco IPsec capable VPN router.') cips_mib_conf_ip_sec_globals_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 2)).setObjects(('CISCO-IPSEC-MIB', 'cipsSALifetime'), ('CISCO-IPSEC-MIB', 'cipsSALifesize')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cips_mib_conf_ip_sec_globals_group = cipsMIBConfIPSecGlobalsGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBConfIPSecGlobalsGroup.setDescription('A collection of objects providing Global IPSec policy monitoring capability to a Cisco IPsec capable VPN router.') cips_mib_conf_capacity_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 3)).setObjects(('CISCO-IPSEC-MIB', 'cipsMaxSAs'), ('CISCO-IPSEC-MIB', 'cips3DesCapable')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cips_mib_conf_capacity_group = cipsMIBConfCapacityGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBConfCapacityGroup.setDescription('A collection of objects providing IPsec System Capacity monitoring capability to a Cisco IPsec capable VPN router.') cips_mib_static_cryptomap_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 4)).setObjects(('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetSize'), ('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetNumIsakmp'), ('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetNumCET'), ('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetNumSAs')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cips_mib_static_cryptomap_group = cipsMIBStaticCryptomapGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBStaticCryptomapGroup.setDescription('A collection of objects instrumenting the properties of the Static (fully specified) Cryptomap Sets on an IPsec-capable IOS router.') cips_mib_manual_cryptomap_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 5)).setObjects(('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetNumManual')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cips_mib_manual_cryptomap_group = cipsMIBManualCryptomapGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBManualCryptomapGroup.setDescription('A collection of objects instrumenting the properties of the Manual Cryptomap entries on a Cisco IPsec capable IOS router.') cips_mib_dynamic_cryptomap_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 6)).setObjects(('CISCO-IPSEC-MIB', 'cipsNumTEDProbesReceived'), ('CISCO-IPSEC-MIB', 'cipsNumTEDProbesSent'), ('CISCO-IPSEC-MIB', 'cipsNumTEDFailures'), ('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetNumDynamic'), ('CISCO-IPSEC-MIB', 'cipsStaticCryptomapSetNumDisc'), ('CISCO-IPSEC-MIB', 'cipsNumTEDCryptomapSets'), ('CISCO-IPSEC-MIB', 'cipsDynamicCryptomapSetSize'), ('CISCO-IPSEC-MIB', 'cipsDynamicCryptomapSetNumAssoc')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cips_mib_dynamic_cryptomap_group = cipsMIBDynamicCryptomapGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBDynamicCryptomapGroup.setDescription('A collection of objects instrumenting the properties of the Dynamic Cryptomap group on a Cisco IPsec capable IOS router.') cips_mib_mandatory_notif_cntl_group = object_group((1, 3, 6, 1, 4, 1, 9, 10, 62, 3, 2, 7)).setObjects(('CISCO-IPSEC-MIB', 'cipsCntlIsakmpPolicyAdded'), ('CISCO-IPSEC-MIB', 'cipsCntlIsakmpPolicyDeleted'), ('CISCO-IPSEC-MIB', 'cipsCntlCryptomapAdded'), ('CISCO-IPSEC-MIB', 'cipsCntlCryptomapDeleted'), ('CISCO-IPSEC-MIB', 'cipsCntlCryptomapSetAttached'), ('CISCO-IPSEC-MIB', 'cipsCntlCryptomapSetDetached'), ('CISCO-IPSEC-MIB', 'cipsCntlTooManySAs')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cips_mib_mandatory_notif_cntl_group = cipsMIBMandatoryNotifCntlGroup.setStatus('current') if mibBuilder.loadTexts: cipsMIBMandatoryNotifCntlGroup.setDescription('A collection of objects providing IPsec Notification capability to a IPsec-capable IOS router. It is mandatory to implement this set of objects pertaining to IOS notifications about IPSec activity.') mibBuilder.exportSymbols('CISCO-IPSEC-MIB', cipsIPsecGlobals=cipsIPsecGlobals, cipsCryptomapSetIfVirtual=cipsCryptomapSetIfVirtual, cipsStaticCryptomapSetNumManual=cipsStaticCryptomapSetNumManual, cipsStaticCryptomapDescr=cipsStaticCryptomapDescr, cipsIsakmpGroup=cipsIsakmpGroup, cipsDynamicCryptomapSetSize=cipsDynamicCryptomapSetSize, cipsCryptomapAdded=cipsCryptomapAdded, cipsTrapCntlGroup=cipsTrapCntlGroup, cipsCryptomapSetIfEntry=cipsCryptomapSetIfEntry, cipsMIBConfIPSecGlobalsGroup=cipsMIBConfIPSecGlobalsGroup, cipsStaticCryptomapSetNumIsakmp=cipsStaticCryptomapSetNumIsakmp, cipsMIBMandatoryNotifCntlGroup=cipsMIBMandatoryNotifCntlGroup, cipsNumTEDFailures=cipsNumTEDFailures, ciscoIPsecMIB=ciscoIPsecMIB, cipsStaticCryptomapPfs=cipsStaticCryptomapPfs, cipsStaticCryptomapSetSize=cipsStaticCryptomapSetSize, CryptomapSetBindStatus=CryptomapSetBindStatus, ciscoIPsecMIBNotificationPrefix=ciscoIPsecMIBNotificationPrefix, cipsNumCETCryptomapSets=cipsNumCETCryptomapSets, cipsNumStaticCryptomapSets=cipsNumStaticCryptomapSets, cipsIsakmpPolPriority=cipsIsakmpPolPriority, IkeHashAlgo=IkeHashAlgo, cipsCryptomapSetAttached=cipsCryptomapSetAttached, cipsMIBDynamicCryptomapGroup=cipsMIBDynamicCryptomapGroup, cips3DesCapable=cips3DesCapable, cipsIsakmpPolicyTable=cipsIsakmpPolicyTable, cipsStaticCryptomapPeer=cipsStaticCryptomapPeer, cipsSysCapacityGroup=cipsSysCapacityGroup, cipsStaticCryptomapLevelHost=cipsStaticCryptomapLevelHost, cipsIsakmpKeepaliveInterval=cipsIsakmpKeepaliveInterval, cipsMIBCompliance=cipsMIBCompliance, cipsNumDynamicCryptomapSets=cipsNumDynamicCryptomapSets, cipsIsakmpPolicyEntry=cipsIsakmpPolicyEntry, cipsStaticCryptomapType=cipsStaticCryptomapType, cipsDynamicCryptomapSetEntry=cipsDynamicCryptomapSetEntry, cipsIsakmpPolEncr=cipsIsakmpPolEncr, ciscoIPsecMIBObjects=ciscoIPsecMIBObjects, cipsMIBStaticCryptomapGroup=cipsMIBStaticCryptomapGroup, cipsStaticCryptomapSetName=cipsStaticCryptomapSetName, cipsNumTEDProbesSent=cipsNumTEDProbesSent, cipsMIBConfCapacityGroup=cipsMIBConfCapacityGroup, cipsCntlTooManySAs=cipsCntlTooManySAs, cipsIsakmpPolAuth=cipsIsakmpPolAuth, IPSIpAddress=IPSIpAddress, ciscoIPsecMIBConformance=ciscoIPsecMIBConformance, cipsMaxSAs=cipsMaxSAs, cipsDynamicCryptomapSetNumAssoc=cipsDynamicCryptomapSetNumAssoc, cipsIsakmpPolHash=cipsIsakmpPolHash, cipsStaticCryptomapTable=cipsStaticCryptomapTable, CryptomapType=CryptomapType, cipsMIBConformances=cipsMIBConformances, cipsStaticCryptomapNumPeers=cipsStaticCryptomapNumPeers, cipsNumTEDProbesReceived=cipsNumTEDProbesReceived, cipsCryptomapDeleted=cipsCryptomapDeleted, cipsStaticCryptomapSetNumSAs=cipsStaticCryptomapSetNumSAs, cipsStaticCryptomapSetNumDynamic=cipsStaticCryptomapSetNumDynamic, cipsStaticCryptomapLifesize=cipsStaticCryptomapLifesize, cipsCntlCryptomapAdded=cipsCntlCryptomapAdded, cipsIsakmpPolicyAdded=cipsIsakmpPolicyAdded, IkeIdentityType=IkeIdentityType, cipsIsakmpIdentity=cipsIsakmpIdentity, cipsCryptomapSetIfTable=cipsCryptomapSetIfTable, cipsDynamicCryptomapSetTable=cipsDynamicCryptomapSetTable, PYSNMP_MODULE_ID=ciscoIPsecMIB, cipsMIBManualCryptomapGroup=cipsMIBManualCryptomapGroup, cipsMIBNotifications=cipsMIBNotifications, cipsIsakmpEnabled=cipsIsakmpEnabled, cipsTooManySAs=cipsTooManySAs, cipsStaticCryptomapSetEntry=cipsStaticCryptomapSetEntry, cipsCntlCryptomapSetAttached=cipsCntlCryptomapSetAttached, cipsMIBConfIsakmpGroup=cipsMIBConfIsakmpGroup, CIPsecLifesize=CIPsecLifesize, cipsDynamicCryptomapSetName=cipsDynamicCryptomapSetName, cipsCryptomapGroup=cipsCryptomapGroup, cipsCntlCryptomapDeleted=cipsCntlCryptomapDeleted, TrapStatus=TrapStatus, cipsNumIsakmpPolicies=cipsNumIsakmpPolicies, cipsIsakmpPolicyDeleted=cipsIsakmpPolicyDeleted, cipsStaticCryptomapLifetime=cipsStaticCryptomapLifetime, cipsCntlCryptomapSetDetached=cipsCntlCryptomapSetDetached, EncryptAlgo=EncryptAlgo, cipsIPsecStatistics=cipsIPsecStatistics, cipsCntlIsakmpPolicyAdded=cipsCntlIsakmpPolicyAdded, IkeAuthMethod=IkeAuthMethod, cipsSALifetime=cipsSALifetime, cipsStaticCryptomapSetNumCET=cipsStaticCryptomapSetNumCET, cipsStaticCryptomapSetTable=cipsStaticCryptomapSetTable, cipsCntlIsakmpPolicyDeleted=cipsCntlIsakmpPolicyDeleted, cipsIsakmpPolLifetime=cipsIsakmpPolLifetime, cipsStaticCryptomapEntry=cipsStaticCryptomapEntry, DiffHellmanGrp=DiffHellmanGrp, cipsCryptomapSetDetached=cipsCryptomapSetDetached, cipsStaticCryptomapSetNumDisc=cipsStaticCryptomapSetNumDisc, CIPsecNumCryptoMaps=CIPsecNumCryptoMaps, cipsNumTEDCryptomapSets=cipsNumTEDCryptomapSets, cipsSALifesize=cipsSALifesize, cipsCryptomapSetIfStatus=cipsCryptomapSetIfStatus, CIPsecLifetime=CIPsecLifetime, cipsStaticCryptomapPriority=cipsStaticCryptomapPriority, cipsIsakmpPolGroup=cipsIsakmpPolGroup, cipsIPsecGroup=cipsIPsecGroup, cipsMIBGroups=cipsMIBGroups)
sensorData = open('input.txt').read().splitlines() diff = [-1, 0, 1] key = None trenchMap = set() y = 0 for line in sensorData: if not key: key = line elif len(line) > 0: for x in range(len(line)): if line[x] == '#': trenchMap.add((x, y)) y += 1 neighboorhood = set() for point in trenchMap: x, y = point for dx in diff: for dy in diff: neighboorhood.add((x + dx, y + dy)) print(len(key)) def oneStep(trenchMap, neighboorhood, itr=0): itrKey = {'#': '1', '.': '0'} pointToSave = '#' if key[0] == '#' and key[-1] == '.': if itr > 0 and (itr % 2) == 0: itrKey = {'#': '0', '.': '1'} else: pointToSave = '.' newTrenchMap = set() newNeighboorhood = set() for point in neighboorhood: number = '' x, y = point for dy in diff: for dx in diff: if (x + dx, y + dy) in trenchMap: number += itrKey['#'] else: number += itrKey['.'] if key[int(number, 2)] == pointToSave: newTrenchMap.add(point) for dy in diff: for dx in diff: newNeighboorhood.add((x + dx, y + dy)) return newTrenchMap, newNeighboorhood def printMap(trenchMap): minY = len(trenchMap) minX = len(trenchMap) maxY = 0 maxX = 0 for point in trenchMap: x, y = point if y < minY: minY = y if y > maxY: maxY = y if x < minX: minX = x if x > maxX: maxX = x for y in range(minY, maxY + 1): for x in range(minX, maxX + 1): if (x, y) in trenchMap: print('#', end='') else: print('.', end='') print('') print('') for i in range(50): trenchMap, neighboorhood = oneStep(trenchMap, neighboorhood, itr=i + 1) if (i + 1) == 2: print("Answer part A: the number of lit points is {}".format(len(trenchMap))) print("Answer part B: the number of lit points is {}".format(len(trenchMap)))
sensor_data = open('input.txt').read().splitlines() diff = [-1, 0, 1] key = None trench_map = set() y = 0 for line in sensorData: if not key: key = line elif len(line) > 0: for x in range(len(line)): if line[x] == '#': trenchMap.add((x, y)) y += 1 neighboorhood = set() for point in trenchMap: (x, y) = point for dx in diff: for dy in diff: neighboorhood.add((x + dx, y + dy)) print(len(key)) def one_step(trenchMap, neighboorhood, itr=0): itr_key = {'#': '1', '.': '0'} point_to_save = '#' if key[0] == '#' and key[-1] == '.': if itr > 0 and itr % 2 == 0: itr_key = {'#': '0', '.': '1'} else: point_to_save = '.' new_trench_map = set() new_neighboorhood = set() for point in neighboorhood: number = '' (x, y) = point for dy in diff: for dx in diff: if (x + dx, y + dy) in trenchMap: number += itrKey['#'] else: number += itrKey['.'] if key[int(number, 2)] == pointToSave: newTrenchMap.add(point) for dy in diff: for dx in diff: newNeighboorhood.add((x + dx, y + dy)) return (newTrenchMap, newNeighboorhood) def print_map(trenchMap): min_y = len(trenchMap) min_x = len(trenchMap) max_y = 0 max_x = 0 for point in trenchMap: (x, y) = point if y < minY: min_y = y if y > maxY: max_y = y if x < minX: min_x = x if x > maxX: max_x = x for y in range(minY, maxY + 1): for x in range(minX, maxX + 1): if (x, y) in trenchMap: print('#', end='') else: print('.', end='') print('') print('') for i in range(50): (trench_map, neighboorhood) = one_step(trenchMap, neighboorhood, itr=i + 1) if i + 1 == 2: print('Answer part A: the number of lit points is {}'.format(len(trenchMap))) print('Answer part B: the number of lit points is {}'.format(len(trenchMap)))
class Config(object): CHROME_PATH = '/Library/Application Support/Google/chromedriver76.0.3809.68' BROWSERMOB_PATH = '/usr/local/bin/browsermob-proxy-2.1.4/bin/browsermob-proxy' class Docker(Config): CHROME_PATH = '/usr/local/bin/chromedriver'
class Config(object): chrome_path = '/Library/Application Support/Google/chromedriver76.0.3809.68' browsermob_path = '/usr/local/bin/browsermob-proxy-2.1.4/bin/browsermob-proxy' class Docker(Config): chrome_path = '/usr/local/bin/chromedriver'
numbers = [1, 2, 3, 4, 5] for x in numbers: print(x) print("--------") for x in reversed(numbers): print(x) print(numbers)
numbers = [1, 2, 3, 4, 5] for x in numbers: print(x) print('--------') for x in reversed(numbers): print(x) print(numbers)
a=int(input()) def s(n): if n==3:return['***','* *','***'] x=s(n//3) y=list(zip(x,x,x)) for i in range(len(y)): y[i]=''.join(y[i]) z=list(zip(x,[' '*(n//3)]*(n//3),x)) for i in range(len(z)): z[i]=''.join(z[i]) return y+z+y print('\n'.join(s(a)))
a = int(input()) def s(n): if n == 3: return ['***', '* *', '***'] x = s(n // 3) y = list(zip(x, x, x)) for i in range(len(y)): y[i] = ''.join(y[i]) z = list(zip(x, [' ' * (n // 3)] * (n // 3), x)) for i in range(len(z)): z[i] = ''.join(z[i]) return y + z + y print('\n'.join(s(a)))
def dictTolist(data): result = [] if isinstance(data, dict) and data.__len__() > 0: result.append(data) elif isinstance(data, list) and data.__len__() > 0: result = data else: result = None return result
def dict_tolist(data): result = [] if isinstance(data, dict) and data.__len__() > 0: result.append(data) elif isinstance(data, list) and data.__len__() > 0: result = data else: result = None return result
######################## # * First Solution ######################## class Solution: def searchInsert(self, nums: List[int], target: int) -> int: low = 0 high = len(nums)-1 while low < high: mid = (low+high) // 2 if nums[mid] == target: return mid elif nums[mid] > target: high = mid-1 elif nums[mid] < target: low = mid+1 for i in range(len(nums)): if nums[i] >= target: return i return len(nums) ######################## # * Second Solution ######################## class Solution: def searchInsert(self, nums: List[int], target: int) -> int: # ? Border Cases if target > nums[-1]: return len(nums) if target <= nums[0]: return 0 ############ # * Binary Search here low = 0 high = len(nums)-1 while low < high: mid = (low+high) // 2 if nums[mid] == target: return mid elif nums[mid] > target: high = mid-1 elif nums[mid] < target: low = mid+1 # * Simple Traversal here for i in range(len(nums)): if nums[i] >= target: return i
class Solution: def search_insert(self, nums: List[int], target: int) -> int: low = 0 high = len(nums) - 1 while low < high: mid = (low + high) // 2 if nums[mid] == target: return mid elif nums[mid] > target: high = mid - 1 elif nums[mid] < target: low = mid + 1 for i in range(len(nums)): if nums[i] >= target: return i return len(nums) class Solution: def search_insert(self, nums: List[int], target: int) -> int: if target > nums[-1]: return len(nums) if target <= nums[0]: return 0 low = 0 high = len(nums) - 1 while low < high: mid = (low + high) // 2 if nums[mid] == target: return mid elif nums[mid] > target: high = mid - 1 elif nums[mid] < target: low = mid + 1 for i in range(len(nums)): if nums[i] >= target: return i
# Dictionary # length (len), check a key, get, set, add # Dictionary 1 ------------------------------------------- print(" Dictionary with string keys ".center(44, "-")) dict_employee_IDs = {"ID01": 'John Papa', "ID02": 'David Thompson', "ID03": 'Terry Gao', "ID04": 'Barry Tex'} print(dict_employee_IDs) # len ------------------------------------------- print(" dictionary length ".center(44, "-")) dict_employee_IDs_length = len(dict_employee_IDs) print(str(dict_employee_IDs_length)) # Check if a key is in dictionary ------------------------------------------- print(" Check if a key is in dictionary ".center(44, "-")) emp_id = "ID02" # emp_id = "ID05" # Invalid Key if emp_id in dict_employee_IDs: name = dict_employee_IDs[emp_id] print('Employee ID {} is {}.'.format(emp_id, name)) else: print('Employee ID {} not found!'.format(emp_id)) # Dictionary 2 ------------------------------------------- print(" Dictionary with string keys ".center(44, "-")) dict_employee1_Info = {"Name": 'John Papa', "Department": 'Network', "DataOfBirth": '02/24/1975', "Salary": '$60K US'} print(dict_employee1_Info) # get ------------------------------------------- print(" Getting data from dictionary ".center(44, "-")) name = dict_employee1_Info.get("Name") department = dict_employee1_Info.get("Department") dob = dict_employee1_Info.get("DataOfBirth") salary = dict_employee1_Info.get("Salary") print('{} works in {} department with a salary of {}. His data of birth is {}'.format(name, department, salary, dob)) print(dict_employee1_Info.get("City")) print(dict_employee1_Info.get("Branch", "Unknown")) # set ------------------------------------------- print(" Setting value for an item in dictionary ".center(60, "-")) dict_employee1_Info["Department"] = 'Development' dict_employee1_Info["Salary"] = '$70K US' print('{} works in {} department with a salary of {}. His data of birth is {}'.format(name, department, salary, dob)) department = dict_employee1_Info.get("Department") salary = dict_employee1_Info.get("Salary") print('{} works in {} department with a salary of {}. His data of birth is {}'.format(name, department, salary, dob)) print(dict_employee1_Info) # add ------------------------------------------- print(" Add to dictionary ".center(60, "-")) dict_employee1_Info["Branch"] = "Airport Branch" dict_employee1_Info["City"] = "Boston" print(dict_employee1_Info) print(dict_employee1_Info.get("City")) print(dict_employee1_Info.get("Branch", "Unknown"))
print(' Dictionary with string keys '.center(44, '-')) dict_employee_i_ds = {'ID01': 'John Papa', 'ID02': 'David Thompson', 'ID03': 'Terry Gao', 'ID04': 'Barry Tex'} print(dict_employee_IDs) print(' dictionary length '.center(44, '-')) dict_employee_i_ds_length = len(dict_employee_IDs) print(str(dict_employee_IDs_length)) print(' Check if a key is in dictionary '.center(44, '-')) emp_id = 'ID02' if emp_id in dict_employee_IDs: name = dict_employee_IDs[emp_id] print('Employee ID {} is {}.'.format(emp_id, name)) else: print('Employee ID {} not found!'.format(emp_id)) print(' Dictionary with string keys '.center(44, '-')) dict_employee1__info = {'Name': 'John Papa', 'Department': 'Network', 'DataOfBirth': '02/24/1975', 'Salary': '$60K US'} print(dict_employee1_Info) print(' Getting data from dictionary '.center(44, '-')) name = dict_employee1_Info.get('Name') department = dict_employee1_Info.get('Department') dob = dict_employee1_Info.get('DataOfBirth') salary = dict_employee1_Info.get('Salary') print('{} works in {} department with a salary of {}. His data of birth is {}'.format(name, department, salary, dob)) print(dict_employee1_Info.get('City')) print(dict_employee1_Info.get('Branch', 'Unknown')) print(' Setting value for an item in dictionary '.center(60, '-')) dict_employee1_Info['Department'] = 'Development' dict_employee1_Info['Salary'] = '$70K US' print('{} works in {} department with a salary of {}. His data of birth is {}'.format(name, department, salary, dob)) department = dict_employee1_Info.get('Department') salary = dict_employee1_Info.get('Salary') print('{} works in {} department with a salary of {}. His data of birth is {}'.format(name, department, salary, dob)) print(dict_employee1_Info) print(' Add to dictionary '.center(60, '-')) dict_employee1_Info['Branch'] = 'Airport Branch' dict_employee1_Info['City'] = 'Boston' print(dict_employee1_Info) print(dict_employee1_Info.get('City')) print(dict_employee1_Info.get('Branch', 'Unknown'))
class Solution: def isUgly(self, num): """ :type num: int :rtype: bool """ while not num: return False while not (num % 2): num //= 2 while not (num % 3): num //= 3 while not (num % 5): num //= 5 return num == 1
class Solution: def is_ugly(self, num): """ :type num: int :rtype: bool """ while not num: return False while not num % 2: num //= 2 while not num % 3: num //= 3 while not num % 5: num //= 5 return num == 1
# Processing functions for various USMTF message formats def tacelint(logger_item, message_dict, lines_list, processed_message_list): prev_soi = [] prev_line = [] for line in lines_list: if len(prev_line) == 0: prev_line.append(line) else: del prev_line[0] prev_line.append(line) line_split = line.split("/") if line_split[0] == 'SOI': if len(prev_soi) == 0: prev_soi.append(line) else: del prev_soi[0] prev_soi.append(line) message_dict['tar-sig-id'] = line_split[1] message_dict['time-up'] = line_split[2] message_dict['time-down'] = line_split[3] message_dict['sort-code'] = line_split[4] message_dict['emitter-desig'] = line_split[5] try: message_dict['event-loc'] = line_split[6] except: pass try: message_dict['tgt-id'] = line_split[7] except: pass try: message_dict['enemy-uid'] = line_split[8] except: pass try: message_dict['wpn-type'] = line_split[9] except: pass try: message_dict['emitter-func-code'] = line_split[10] except: pass continue if line_split[0] == 'EMLOC': message_dict['data-entry'] = line_split[1] message_dict['emitter-loc-cat'] = line_split[2] message_dict['loc'] = line_split[3].split(":")[1] message_dict['orientation'] = line_split[5][:-1] message_dict['semi-major'] = line_split[6][:-2] message_dict['semi-minor'] = line_split[7][:-2] message_dict['units'] = line_split[6][-2:] continue if line_split[0] == 'PRM': message_dict['data-entry'] = line_split[1] message_dict['freq'] = line_split[2][:-3] message_dict['freq-units'] = line_split[2][-3:] message_dict['rf-op-mode'] = line_split[3] message_dict['pri'] = line_split[4].split(":")[1] try: message_dict['pri-ac'] = line_split[5] except: pass try: message_dict['pd'] = line_split[6].split(":")[1] except: pass try: message_dict['scan-type'] = line_split[7] except: pass try: message_dict['scan-rate'] = line_split[8] except: pass try: message_dict['ant-pol'] = line_split[9] except: pass processed_message_list.append(message_dict) continue if line_split[0] == 'REF': message_dict['serial-letter'] = line_split[1] message_dict['ref-type'] = line_split[2] message_dict['originiator'] = line_split[3] message_dict['dt-ref'] = line_split[4] continue if line_split[0] == 'AMPN': message_dict['ampn'] = line_split[1] processed_message_list.append(message_dict) continue if line_split[0] == 'NARR': message_dict['narr'] = line_split[1] processed_message_list.append(message_dict) continue if line_split[0] == 'COLLINFO': try: message_dict['collector-di'] = line_split[1] except: pass try: message_dict['collector-tri'] = line_split[2] except: pass try: message_dict['coll-msn-num'] = line_split[3] except: pass try: message_dict['coll-proj-name'] = line_split[4] except: pass continue if line_split[0] == 'FORCODE': message_dict['forcode'] = line_split[1] processed_message_list.append(message_dict) continue if line_split[0] == 'PLATID': message_dict['scn'] = line_split[1] message_dict['pt-d'] = line_split[2] message_dict['pt'] = line_split[3] message_dict['plat-name'] = line_split[4] message_dict['ship-name'] = line_split[5] try: message_dict['pen-num'] = line_split[6] except: pass try: message_dict['nationality'] = line_split[7] except: pass try: message_dict['track-num'] = line_split[8] except: pass processed_message_list.append(message_dict) continue if line_split[0] == 'DECL': message_dict['source-class'] = line_split[1] message_dict['class-reason'] = line_split[2] message_dict['dg-inst'] = line_split[3] try: message_dict['dg-exempt-code'] = line_split[4] except: pass processed_message_list.append(message_dict) continue
def tacelint(logger_item, message_dict, lines_list, processed_message_list): prev_soi = [] prev_line = [] for line in lines_list: if len(prev_line) == 0: prev_line.append(line) else: del prev_line[0] prev_line.append(line) line_split = line.split('/') if line_split[0] == 'SOI': if len(prev_soi) == 0: prev_soi.append(line) else: del prev_soi[0] prev_soi.append(line) message_dict['tar-sig-id'] = line_split[1] message_dict['time-up'] = line_split[2] message_dict['time-down'] = line_split[3] message_dict['sort-code'] = line_split[4] message_dict['emitter-desig'] = line_split[5] try: message_dict['event-loc'] = line_split[6] except: pass try: message_dict['tgt-id'] = line_split[7] except: pass try: message_dict['enemy-uid'] = line_split[8] except: pass try: message_dict['wpn-type'] = line_split[9] except: pass try: message_dict['emitter-func-code'] = line_split[10] except: pass continue if line_split[0] == 'EMLOC': message_dict['data-entry'] = line_split[1] message_dict['emitter-loc-cat'] = line_split[2] message_dict['loc'] = line_split[3].split(':')[1] message_dict['orientation'] = line_split[5][:-1] message_dict['semi-major'] = line_split[6][:-2] message_dict['semi-minor'] = line_split[7][:-2] message_dict['units'] = line_split[6][-2:] continue if line_split[0] == 'PRM': message_dict['data-entry'] = line_split[1] message_dict['freq'] = line_split[2][:-3] message_dict['freq-units'] = line_split[2][-3:] message_dict['rf-op-mode'] = line_split[3] message_dict['pri'] = line_split[4].split(':')[1] try: message_dict['pri-ac'] = line_split[5] except: pass try: message_dict['pd'] = line_split[6].split(':')[1] except: pass try: message_dict['scan-type'] = line_split[7] except: pass try: message_dict['scan-rate'] = line_split[8] except: pass try: message_dict['ant-pol'] = line_split[9] except: pass processed_message_list.append(message_dict) continue if line_split[0] == 'REF': message_dict['serial-letter'] = line_split[1] message_dict['ref-type'] = line_split[2] message_dict['originiator'] = line_split[3] message_dict['dt-ref'] = line_split[4] continue if line_split[0] == 'AMPN': message_dict['ampn'] = line_split[1] processed_message_list.append(message_dict) continue if line_split[0] == 'NARR': message_dict['narr'] = line_split[1] processed_message_list.append(message_dict) continue if line_split[0] == 'COLLINFO': try: message_dict['collector-di'] = line_split[1] except: pass try: message_dict['collector-tri'] = line_split[2] except: pass try: message_dict['coll-msn-num'] = line_split[3] except: pass try: message_dict['coll-proj-name'] = line_split[4] except: pass continue if line_split[0] == 'FORCODE': message_dict['forcode'] = line_split[1] processed_message_list.append(message_dict) continue if line_split[0] == 'PLATID': message_dict['scn'] = line_split[1] message_dict['pt-d'] = line_split[2] message_dict['pt'] = line_split[3] message_dict['plat-name'] = line_split[4] message_dict['ship-name'] = line_split[5] try: message_dict['pen-num'] = line_split[6] except: pass try: message_dict['nationality'] = line_split[7] except: pass try: message_dict['track-num'] = line_split[8] except: pass processed_message_list.append(message_dict) continue if line_split[0] == 'DECL': message_dict['source-class'] = line_split[1] message_dict['class-reason'] = line_split[2] message_dict['dg-inst'] = line_split[3] try: message_dict['dg-exempt-code'] = line_split[4] except: pass processed_message_list.append(message_dict) continue
class AnyOrderList: """Sequence that compares to a list, but allows any order. This is only intended for comparison purposes, not as an actual list replacement. """ def __init__(self, list_): self._list = list_ self._list.sort() def __eq__(self, other): assert isinstance(other, list) return self._list == sorted(other) def __str__(self): return str(self._list) def __repr__(self): return "AnyOrderList({})".format(repr(self._list))
class Anyorderlist: """Sequence that compares to a list, but allows any order. This is only intended for comparison purposes, not as an actual list replacement. """ def __init__(self, list_): self._list = list_ self._list.sort() def __eq__(self, other): assert isinstance(other, list) return self._list == sorted(other) def __str__(self): return str(self._list) def __repr__(self): return 'AnyOrderList({})'.format(repr(self._list))
def first(n_1): line_1 = set() for i in range(n_1): number = int(input()) line_1.add(number) return line_1 def second(n_2): line_2 = set() for i in range(n_2): number = int(input()) line_2.add(number) return line_2 data = input().split() n_1 = int(data[0]) n_2 =int(data[1]) first_line = first(n_1) second_line = second(n_2) common = first_line.intersection(second_line) for i in common: print(i)
def first(n_1): line_1 = set() for i in range(n_1): number = int(input()) line_1.add(number) return line_1 def second(n_2): line_2 = set() for i in range(n_2): number = int(input()) line_2.add(number) return line_2 data = input().split() n_1 = int(data[0]) n_2 = int(data[1]) first_line = first(n_1) second_line = second(n_2) common = first_line.intersection(second_line) for i in common: print(i)
""" List Data Type(list): - Just Like Array following indexing - **Unlike Arrays, list can hold HETEROGENEOUS DATA TYPE - Repetition allowed - Multi Dimensional """ # Creating a Multi-Dimensional List print(" \n-------CREATE---------- ") List = [['Hitesh', 'kumar', 'Sahu'], [29]] thislist = ["0", "1", "2", "3", "4", "5", "6", "7"] fruitList = list(("apple", "banana", "cherry")) print(List) print(" \n-------READ---------- ") print("List[1]: ", List[1]) print("List[0][0]: ", List[0][0]) print("List[0][-2]: ", List[0][-2]) # negative index start from -1 for x in thislist: print("Element", x) print(thislist) print("LENGTH", len(thislist)) print("MAX", max(thislist)) print("MIN", min(thislist)) print("thislist[:4]: ", thislist[:4]) print("thislist[2:]: ", thislist[2:]) print(" \n-------UPDATE---------- ") thislist[1] = "9" print(thislist) print("\nTraversing Elements") if "9" in thislist: print("Yes, '9' is in the list") thislist.reverse() print("Reverse", thislist) thislist.sort() print("Sorted", thislist) thislist.append("10") print("Append 10:", thislist) thislist.insert(7, "8") print("Insert 8:", thislist) thislist.insert(1, "1") print("Insert 1:", thislist) print(" \n-------DELETE---------- ") thislist.remove("10") print("remove 10:", thislist) thislist.pop(9) print("pop 9:", thislist) del thislist[8] print("del 8:", thislist) thislist.clear() print("clear:", thislist)
""" List Data Type(list): - Just Like Array following indexing - **Unlike Arrays, list can hold HETEROGENEOUS DATA TYPE - Repetition allowed - Multi Dimensional """ print(' \n-------CREATE---------- ') list = [['Hitesh', 'kumar', 'Sahu'], [29]] thislist = ['0', '1', '2', '3', '4', '5', '6', '7'] fruit_list = list(('apple', 'banana', 'cherry')) print(List) print(' \n-------READ---------- ') print('List[1]: ', List[1]) print('List[0][0]: ', List[0][0]) print('List[0][-2]: ', List[0][-2]) for x in thislist: print('Element', x) print(thislist) print('LENGTH', len(thislist)) print('MAX', max(thislist)) print('MIN', min(thislist)) print('thislist[:4]: ', thislist[:4]) print('thislist[2:]: ', thislist[2:]) print(' \n-------UPDATE---------- ') thislist[1] = '9' print(thislist) print('\nTraversing Elements') if '9' in thislist: print("Yes, '9' is in the list") thislist.reverse() print('Reverse', thislist) thislist.sort() print('Sorted', thislist) thislist.append('10') print('Append 10:', thislist) thislist.insert(7, '8') print('Insert 8:', thislist) thislist.insert(1, '1') print('Insert 1:', thislist) print(' \n-------DELETE---------- ') thislist.remove('10') print('remove 10:', thislist) thislist.pop(9) print('pop 9:', thislist) del thislist[8] print('del 8:', thislist) thislist.clear() print('clear:', thislist)
class UnityPackException(Exception): pass class ArchiveNotFound(UnityPackException): pass
class Unitypackexception(Exception): pass class Archivenotfound(UnityPackException): pass
""" [9/08/2014] Challenge #179 [Easy] You make me happy when clouds are gray...scale https://www.reddit.com/r/dailyprogrammer/comments/2ftcb8/9082014_challenge_179_easy_you_make_me_happy_when/ #Description The 'Daily Business' newspaper are a distributor of the most recent news concerning business. They have a problem though, there is a new newspaper brought out every single day and up to this point, all of the images and advertisements featured have been in full colour and this is costing the company. If you can convert these images before they reach the publisher, then you will surely get a promotion, or at least a raise! #Formal Inputs & Outputs ##Input description On console input you should enter a filepath to the image you wish to convert to grayscale. ##Output description The program should save an image in the current directory of the image passed as input, the only difference being that it is now in black and white. #Notes/Hints There are several methods to convert an image to grayscale, the easiest is to sum up all of the RGB values and divide it by 3 (The length of the array) and fill each R,G and B value with that number. For example RED = (255,0,0) Would turn to (85,85,85) //Because 255/3 == 85. There is a problem with this method though, GREEN = (0,255,0) brings back the exact same value! There is a formula to solve this, see if you can find it. Share any interesting methods for grayscale conversion that you come across. #Finally We have an IRC channel over at irc.freenode.net in #reddit-dailyprogrammer Stop on by :D Have a good challenge idea? Consider submitting it to /r/dailyprogrammer_ideas """ def main(): pass if __name__ == "__main__": main()
""" [9/08/2014] Challenge #179 [Easy] You make me happy when clouds are gray...scale https://www.reddit.com/r/dailyprogrammer/comments/2ftcb8/9082014_challenge_179_easy_you_make_me_happy_when/ #Description The 'Daily Business' newspaper are a distributor of the most recent news concerning business. They have a problem though, there is a new newspaper brought out every single day and up to this point, all of the images and advertisements featured have been in full colour and this is costing the company. If you can convert these images before they reach the publisher, then you will surely get a promotion, or at least a raise! #Formal Inputs & Outputs ##Input description On console input you should enter a filepath to the image you wish to convert to grayscale. ##Output description The program should save an image in the current directory of the image passed as input, the only difference being that it is now in black and white. #Notes/Hints There are several methods to convert an image to grayscale, the easiest is to sum up all of the RGB values and divide it by 3 (The length of the array) and fill each R,G and B value with that number. For example RED = (255,0,0) Would turn to (85,85,85) //Because 255/3 == 85. There is a problem with this method though, GREEN = (0,255,0) brings back the exact same value! There is a formula to solve this, see if you can find it. Share any interesting methods for grayscale conversion that you come across. #Finally We have an IRC channel over at irc.freenode.net in #reddit-dailyprogrammer Stop on by :D Have a good challenge idea? Consider submitting it to /r/dailyprogrammer_ideas """ def main(): pass if __name__ == '__main__': main()
# Interview Question #5 # The problem is that we want to find duplicates in a one-dimensional array of integers in O(N) running time # where the integer values are smaller than the length of the array! # For example: if we have a list [1, 2, 3, 1, 5] then the algorithm can detect that there are a duplicate with value 1. # Note: the array can not contain items smaller than 0 and items with values greater than the size of the list. # This is how we can achieve O(N) linear running time complexity! def duplicate_finder_1(nums): duplicates = [] for n in set(nums): if nums.count(n) > 1: duplicates.append(n) return duplicates if duplicates else 'The array does not contain any duplicates!' def duplicate_finder_2(nums): duplicates = set() for i, n in enumerate(sorted(nums)): if i + 1 < len(nums) and n == nums[i + 1]: duplicates.add(n) return list(duplicates) if duplicates else 'The array does not contain any duplicates!' # Course implementation def duplicate_finder_3(nums): duplicates = set() for n in nums: if nums[abs(n)] >= 0: nums[abs(n)] *= -1 else: duplicates.add(n) return list({-n if n < 0 else n for n in duplicates}) if duplicates \ else 'The array does not contain any duplicates!' # return list(map(lambda n: n * -1 if n < 0 else n, # duplicates)) if duplicates else 'The array does not contain any duplicates!' # My solutions allow the use of numbers greater than the length of the array print(duplicate_finder_1([1, 2, 3, 4])) print(duplicate_finder_1([1, 1, 2, 3, 3, 4])) print(duplicate_finder_2([5, 6, 7, 8])) print(duplicate_finder_2([5, 6, 6, 6, 7, 7, 9])) print(duplicate_finder_3([2, 3, 1, 2, 4, 3, 3])) print(duplicate_finder_3([0, 1, 2]))
def duplicate_finder_1(nums): duplicates = [] for n in set(nums): if nums.count(n) > 1: duplicates.append(n) return duplicates if duplicates else 'The array does not contain any duplicates!' def duplicate_finder_2(nums): duplicates = set() for (i, n) in enumerate(sorted(nums)): if i + 1 < len(nums) and n == nums[i + 1]: duplicates.add(n) return list(duplicates) if duplicates else 'The array does not contain any duplicates!' def duplicate_finder_3(nums): duplicates = set() for n in nums: if nums[abs(n)] >= 0: nums[abs(n)] *= -1 else: duplicates.add(n) return list({-n if n < 0 else n for n in duplicates}) if duplicates else 'The array does not contain any duplicates!' print(duplicate_finder_1([1, 2, 3, 4])) print(duplicate_finder_1([1, 1, 2, 3, 3, 4])) print(duplicate_finder_2([5, 6, 7, 8])) print(duplicate_finder_2([5, 6, 6, 6, 7, 7, 9])) print(duplicate_finder_3([2, 3, 1, 2, 4, 3, 3])) print(duplicate_finder_3([0, 1, 2]))
''' sgqlc - Simple GraphQL Client ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Access GraphQL endpoints using Python ===================================== This package provide the following modules: - :mod:`sgqlc.endpoint.base`: with abstract class :class:`sgqlc.endpoint.base.BaseEndpoint` and helpful logging utilities to transform errors into JSON objects. - :mod:`sgqlc.endpoint.http`: concrete :class:`sgqlc.endpoint.http.HTTPEndpoint` using :func:`urllib.request.urlopen()`. :license: ISC ''' __docformat__ = 'reStructuredText en'
""" sgqlc - Simple GraphQL Client ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Access GraphQL endpoints using Python ===================================== This package provide the following modules: - :mod:`sgqlc.endpoint.base`: with abstract class :class:`sgqlc.endpoint.base.BaseEndpoint` and helpful logging utilities to transform errors into JSON objects. - :mod:`sgqlc.endpoint.http`: concrete :class:`sgqlc.endpoint.http.HTTPEndpoint` using :func:`urllib.request.urlopen()`. :license: ISC """ __docformat__ = 'reStructuredText en'
START = { "type": "http.response.start", "status": 200, "headers": [ (b"content-length", b"13"), (b"content-type", b"text/html; charset=utf-8"), ], } BODY1 = {"type": "http.response.body", "body": b"Hello"} BODY2 = {"type": "http.response.body", "body": b", world!"} async def helloworld(scope, receive, send) -> None: await send(START) await send(BODY1) await send(BODY2) async def receiver(scope, receive, send) -> None: while True: try: await receive() except StopAsyncIteration: break await send(START) await send(BODY1) await send(BODY2) async def handle_404(scope, receive, send): await send( { "type": "http.response.start", "status": 404, "headers": [], } ) await send({"type": "http.response.body"}) routes = { "/": helloworld, "/receiver": receiver, } async def app(scope, receive, send): path = scope["path"] handler = routes.get(path, handle_404) await handler(scope, receive, send)
start = {'type': 'http.response.start', 'status': 200, 'headers': [(b'content-length', b'13'), (b'content-type', b'text/html; charset=utf-8')]} body1 = {'type': 'http.response.body', 'body': b'Hello'} body2 = {'type': 'http.response.body', 'body': b', world!'} async def helloworld(scope, receive, send) -> None: await send(START) await send(BODY1) await send(BODY2) async def receiver(scope, receive, send) -> None: while True: try: await receive() except StopAsyncIteration: break await send(START) await send(BODY1) await send(BODY2) async def handle_404(scope, receive, send): await send({'type': 'http.response.start', 'status': 404, 'headers': []}) await send({'type': 'http.response.body'}) routes = {'/': helloworld, '/receiver': receiver} async def app(scope, receive, send): path = scope['path'] handler = routes.get(path, handle_404) await handler(scope, receive, send)
load("@fbcode_macros//build_defs:platform_utils.bzl", "platform_utils") def get_ppx_bin(): return "third-party-buck/{}/build/ocaml-lwt_ppx/lib/lwt_ppx/ppx.exe".format(platform_utils.get_platform_for_base_path(get_base_path()))
load('@fbcode_macros//build_defs:platform_utils.bzl', 'platform_utils') def get_ppx_bin(): return 'third-party-buck/{}/build/ocaml-lwt_ppx/lib/lwt_ppx/ppx.exe'.format(platform_utils.get_platform_for_base_path(get_base_path()))
def append_attr(obj, attr, value): """ Appends value to object attribute Attribute may be undefined For example: append_attr(obj, 'test', 1) append_attr(obj, 'test', 2) assert obj.test == [1, 2] """ try: getattr(obj, attr).append(value) except AttributeError: setattr(obj, attr, [value])
def append_attr(obj, attr, value): """ Appends value to object attribute Attribute may be undefined For example: append_attr(obj, 'test', 1) append_attr(obj, 'test', 2) assert obj.test == [1, 2] """ try: getattr(obj, attr).append(value) except AttributeError: setattr(obj, attr, [value])
"""DataSet base class """ class DataSet(object): """Base DataSet """ def __init__(self, common_params, dataset_params): """ common_params: A params dict dataset_params: A params dict """ raise NotImplementedError def batch(self): """Get batch """ raise NotImplementedError
"""DataSet base class """ class Dataset(object): """Base DataSet """ def __init__(self, common_params, dataset_params): """ common_params: A params dict dataset_params: A params dict """ raise NotImplementedError def batch(self): """Get batch """ raise NotImplementedError
# -*- coding: utf-8 -*- class Solution: def maxProduct(self, nums): best_max, current_max, current_min = float('-inf'), 1, 1 for num in nums: current_max, current_min = max(current_min * num, num, current_max * num),\ min(current_min * num, num, current_max * num) best_max = max(best_max, current_max) return best_max if __name__ == '__main__': solution = Solution() assert 6 == solution.maxProduct([2, 3, -2, 4]) assert 0 == solution.maxProduct([-2, 0, -1])
class Solution: def max_product(self, nums): (best_max, current_max, current_min) = (float('-inf'), 1, 1) for num in nums: (current_max, current_min) = (max(current_min * num, num, current_max * num), min(current_min * num, num, current_max * num)) best_max = max(best_max, current_max) return best_max if __name__ == '__main__': solution = solution() assert 6 == solution.maxProduct([2, 3, -2, 4]) assert 0 == solution.maxProduct([-2, 0, -1])
#!/usr/bin/env python3 """ .. automodule:: test_phile.test_PySide2 .. automodule:: test_phile.test_asyncio .. automodule:: test_phile.test_builtins .. automodule:: test_phile.test_cmd .. automodule:: test_phile.test_configuration .. automodule:: test_phile.test_data .. automodule:: test_phile.test_datetime .. automodule:: test_phile.test_imapclient .. automodule:: test_phile.test_keyring .. automodule:: test_phile.test_launcher .. automodule:: test_phile.test_main .. automodule:: test_phile.test_notify .. automodule:: test_phile.test_os .. automodule:: test_phile.test_tmux .. automodule:: test_phile.test_tray .. automodule:: test_phile.test_trigger .. automodule:: test_phile.test_unittest .. automodule:: test_phile.test_watchdog .. automodule:: test_phile.threaded_mock """
""" .. automodule:: test_phile.test_PySide2 .. automodule:: test_phile.test_asyncio .. automodule:: test_phile.test_builtins .. automodule:: test_phile.test_cmd .. automodule:: test_phile.test_configuration .. automodule:: test_phile.test_data .. automodule:: test_phile.test_datetime .. automodule:: test_phile.test_imapclient .. automodule:: test_phile.test_keyring .. automodule:: test_phile.test_launcher .. automodule:: test_phile.test_main .. automodule:: test_phile.test_notify .. automodule:: test_phile.test_os .. automodule:: test_phile.test_tmux .. automodule:: test_phile.test_tray .. automodule:: test_phile.test_trigger .. automodule:: test_phile.test_unittest .. automodule:: test_phile.test_watchdog .. automodule:: test_phile.threaded_mock """
def limpar(tela): telaPrincipal = tela lista = [telaPrincipal.telefone, telaPrincipal.nome, telaPrincipal.cep, telaPrincipal.end, telaPrincipal.numero, telaPrincipal.bairro, telaPrincipal.ref, telaPrincipal.complemento, telaPrincipal.devendo, telaPrincipal.taxa_2] for i in lista: i.clear() telaPrincipal.label_cadastrado.hide() telaPrincipal.label_atualizado.hide()
def limpar(tela): tela_principal = tela lista = [telaPrincipal.telefone, telaPrincipal.nome, telaPrincipal.cep, telaPrincipal.end, telaPrincipal.numero, telaPrincipal.bairro, telaPrincipal.ref, telaPrincipal.complemento, telaPrincipal.devendo, telaPrincipal.taxa_2] for i in lista: i.clear() telaPrincipal.label_cadastrado.hide() telaPrincipal.label_atualizado.hide()
#Embedded file name: ACEStream\version.pyo VERSION = '2.0.8.7' VERSION_REV = '2191' VERSION_DATE = '2013/03/28 18:36:41'
version = '2.0.8.7' version_rev = '2191' version_date = '2013/03/28 18:36:41'
credentials = { 'ldap': { 'user': '', 'pass': '' }, 'rocket': { 'user': '', 'pass': '' } }
credentials = {'ldap': {'user': '', 'pass': ''}, 'rocket': {'user': '', 'pass': ''}}
# https://edabit.com/challenge/KWoj7kWiHRqJtG6S2 # There is a single operator in Python # capable of providing the remainder of a division operation. # Two numbers are passed as parameters. # The first parameter divided by the second parameter will have a remainder, possibly zero. # Return that value. def remainder(int1: int, int2: int) -> int: leftovers = int1 % int2 return leftovers print(remainder(5, 5))
def remainder(int1: int, int2: int) -> int: leftovers = int1 % int2 return leftovers print(remainder(5, 5))
#! /usr/bin/python ## # @file # This file is part of SeisSol. # # @author Sebastian Rettenberger (sebastian.rettenberger AT tum.de, http://www5.in.tum.de/wiki/index.php/Sebastian_Rettenberger) # # @section LICENSE # Copyright (c) 2016, SeisSol Group # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # 3. Neither the name of the copyright holder nor the names of its # contributors may be used to endorse or promote products derived from this # software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. # # @section DESCRIPTION # Finds ASAGI and add inlcude pathes, libs and library pathes # asagi_prog_src = """ #include <asagi.h> int main() { asagi::Grid* grid = asagi::Grid::create(); return 0; } """ def CheckPKG(context, lib): context.Message('Checking for ASAGI... ') ret = context.TryAction('pkg-config --exists \'%s\'' % lib)[0] context.Result(ret) return ret def CheckASAGILinking(context, message): context.Message(message+'... ') ret = context.TryLink(asagi_prog_src, '.cpp') context.Result(ret) return ret def generate(env, **kw): conf = env.Configure(custom_tests = {'CheckPKG': CheckPKG, 'CheckASAGILinking': CheckASAGILinking}) if 'required' in kw: required = kw['required'] else: required = False if 'parallel' in kw: parallel = kw['parallel'] else: # Use parallel as default, since ASAGI makes not too much # sense in serial code parallel = True if not parallel: env.Append(CPPDEFINES=['ASAGI_NOMPI']) lib = 'asagi' if parallel else 'asagi_nompi' ret = conf.CheckPKG(lib) if not ret: if required: print('Could not find ASAGI!') env.Exit(1) else: conf.Finish() return # Try shared first conf.env.ParseConfig('pkg-config --cflags --libs '+lib) ret = conf.CheckASAGILinking('Checking for shared ASAGI library') if not ret: conf.env.ParseConfig('pkg-config --cflags --libs --static '+lib) ret = conf.CheckASAGILinking('Checking for static ASAGI library') if not ret: if required: print('Could not find ASAGI!') env.Exit(1) else: conf.Finish() return conf.Finish() def exists(env): return True
asagi_prog_src = '\n#include <asagi.h>\n\nint main() {\n asagi::Grid* grid = asagi::Grid::create();\n \n return 0;\n}\n' def check_pkg(context, lib): context.Message('Checking for ASAGI... ') ret = context.TryAction("pkg-config --exists '%s'" % lib)[0] context.Result(ret) return ret def check_asagi_linking(context, message): context.Message(message + '... ') ret = context.TryLink(asagi_prog_src, '.cpp') context.Result(ret) return ret def generate(env, **kw): conf = env.Configure(custom_tests={'CheckPKG': CheckPKG, 'CheckASAGILinking': CheckASAGILinking}) if 'required' in kw: required = kw['required'] else: required = False if 'parallel' in kw: parallel = kw['parallel'] else: parallel = True if not parallel: env.Append(CPPDEFINES=['ASAGI_NOMPI']) lib = 'asagi' if parallel else 'asagi_nompi' ret = conf.CheckPKG(lib) if not ret: if required: print('Could not find ASAGI!') env.Exit(1) else: conf.Finish() return conf.env.ParseConfig('pkg-config --cflags --libs ' + lib) ret = conf.CheckASAGILinking('Checking for shared ASAGI library') if not ret: conf.env.ParseConfig('pkg-config --cflags --libs --static ' + lib) ret = conf.CheckASAGILinking('Checking for static ASAGI library') if not ret: if required: print('Could not find ASAGI!') env.Exit(1) else: conf.Finish() return conf.Finish() def exists(env): return True
# Script Name : data.py # Author : Howard Zhang # Created : 14th June 2018 # Last Modified : 14th June 2018 # Version : 1.0 # Modifications : # Description : The struct of data to sort and display. class Data: # Total of data to sort data_count = 32 def __init__(self, value): self.value = value self.set_color() def set_color(self, rgba = None): if not rgba: rgba = (0, 1 - self.value / (self.data_count * 2), self.value / (self.data_count * 2) + 0.5, 1) self.color = rgba
class Data: data_count = 32 def __init__(self, value): self.value = value self.set_color() def set_color(self, rgba=None): if not rgba: rgba = (0, 1 - self.value / (self.data_count * 2), self.value / (self.data_count * 2) + 0.5, 1) self.color = rgba
class Plugin: def __init__(self): pass def execute(self): print("HELLO WORLD 2. :D")
class Plugin: def __init__(self): pass def execute(self): print('HELLO WORLD 2. :D')
class NotAuthenticatedError(Exception): pass class AuthenticationFailedError(Exception): pass
class Notauthenticatederror(Exception): pass class Authenticationfailederror(Exception): pass
OPERATION_TYPES = [ 'ADD', 'REMOVE', 'CHANGE_DATA', 'PATCH_METADATA' ] USER_CHANGEABLE_RELEASE_STATUSES = { 'MUTABLE': [ 'DRAFT', 'PENDING_RELEASE', 'PENDING_DELETE' ], 'IMMUTABLE': [ 'RELEASED', 'DELETED' ] } RELEASE_STATUS_ALLOWED_TRANSITIONS = { 'DRAFT': ['PENDING_RELEASE'], 'PENDING_RELEASE': ['DRAFT'], 'PENDING_DELETE': [], 'RELEASED': ['DRAFT', 'PENDING_DELETE'], 'DELETED': [] }
operation_types = ['ADD', 'REMOVE', 'CHANGE_DATA', 'PATCH_METADATA'] user_changeable_release_statuses = {'MUTABLE': ['DRAFT', 'PENDING_RELEASE', 'PENDING_DELETE'], 'IMMUTABLE': ['RELEASED', 'DELETED']} release_status_allowed_transitions = {'DRAFT': ['PENDING_RELEASE'], 'PENDING_RELEASE': ['DRAFT'], 'PENDING_DELETE': [], 'RELEASED': ['DRAFT', 'PENDING_DELETE'], 'DELETED': []}
total_taxis = 100 size = 4 expected_customers = 120 size_without_driver = size - 1 number_of_cars_required = expected_customers/size_without_driver print(f"number of cars required {number_of_cars_required}")
total_taxis = 100 size = 4 expected_customers = 120 size_without_driver = size - 1 number_of_cars_required = expected_customers / size_without_driver print(f'number of cars required {number_of_cars_required}')
lst = ["Peace", "of", "the", "mind", 2, 4, 7] for i in lst: place = "".join(map(str, lst)) print(place)
lst = ['Peace', 'of', 'the', 'mind', 2, 4, 7] for i in lst: place = ''.join(map(str, lst)) print(place)
class DebuggerStepperBoundaryAttribute(Attribute,_Attribute): """ Indicates the code following the attribute is to be executed in run,not step,mode. DebuggerStepperBoundaryAttribute() """ def __init__(self,*args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass def __reduce_ex__(self,*args): pass
class Debuggerstepperboundaryattribute(Attribute, _Attribute): """ Indicates the code following the attribute is to be executed in run,not step,mode. DebuggerStepperBoundaryAttribute() """ def __init__(self, *args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass def __reduce_ex__(self, *args): pass
choice = '' def add(num1, num2): return num1 + num2 def subs(num1, num2): return num1 - num2 def mult(num1, num2): return num1 * num2 def div(num1, num2): return num1 / num2 def mod(num1, num2): return num1 % num2 def power(num1, num2): result = 1 for i in range(num2): result *= num1 return result def input_checker(item): try: checked = int(item) return True except: print("\nSorry your input is invalid") return False def get_user_inputs(): while True: num1 = input("Input first number: ") num2 = input("Input second number: ") if input_checker(num1) & input_checker(num2): num1 = int(num1) num2 = int(num2) break return num1, num2 def main(): while True: print("Please select operations you want: \n 1. Adding\n 2. Substracting\n 3. Multiplying\n 4. Dividing\n 5. Modulo\n 6. Powering") choice = input("\nYour choice (1,2,3,4,5,6): ") if input_checker(choice): choice = int(choice) num1, num2 = get_user_inputs() if choice==1: print(num1, "+", num2, " = ", add(num1,num2)) elif choice==2: print(num1, "-", num2, " = ", subs(num1,num2)) elif choice==3: print(num1, "*", num2, " = ", mult(num1,num2)) elif choice==4: print(num1, "/", num2, " = ", div(num1,num2)) elif choice==5: print(num1, "%", num2, " = ", mod(num1,num2)) elif choice==6: print(num1, "^", num2, " = ", power(num1,num2)) else: print("Choose between 1 - 6!") print('\n') if __name__ == "__main__": main()
choice = '' def add(num1, num2): return num1 + num2 def subs(num1, num2): return num1 - num2 def mult(num1, num2): return num1 * num2 def div(num1, num2): return num1 / num2 def mod(num1, num2): return num1 % num2 def power(num1, num2): result = 1 for i in range(num2): result *= num1 return result def input_checker(item): try: checked = int(item) return True except: print('\nSorry your input is invalid') return False def get_user_inputs(): while True: num1 = input('Input first number: ') num2 = input('Input second number: ') if input_checker(num1) & input_checker(num2): num1 = int(num1) num2 = int(num2) break return (num1, num2) def main(): while True: print('Please select operations you want: \n 1. Adding\n 2. Substracting\n 3. Multiplying\n 4. Dividing\n 5. Modulo\n 6. Powering') choice = input('\nYour choice (1,2,3,4,5,6): ') if input_checker(choice): choice = int(choice) (num1, num2) = get_user_inputs() if choice == 1: print(num1, '+', num2, ' = ', add(num1, num2)) elif choice == 2: print(num1, '-', num2, ' = ', subs(num1, num2)) elif choice == 3: print(num1, '*', num2, ' = ', mult(num1, num2)) elif choice == 4: print(num1, '/', num2, ' = ', div(num1, num2)) elif choice == 5: print(num1, '%', num2, ' = ', mod(num1, num2)) elif choice == 6: print(num1, '^', num2, ' = ', power(num1, num2)) else: print('Choose between 1 - 6!') print('\n') if __name__ == '__main__': main()
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # */AIPND/intropylab-classifying-images/print_functions_for_lab_checks.py # # PROGRAMMER: Jennifer S. # DATE CREATED: 05/14/2018 # REVISED DATE: <=(Date Revised - if any) # PURPOSE: This set of functions can be used to check your code after programming # each function. The top section of each part of the lab contains # the section labeled 'Checking your code'. When directed within this # section of the lab one can use these functions to more easily check # your code. See the docstrings below each function for details on how # to use the function within your code. # ## # Functions below defined to help with "Checking your code", specifically # running these functions with the appropriate input arguments within the # main() funtion will print out what's needed for "Checking your code" # def check_command_line_arguments(in_arg): """ For Lab: Classifying Images - 7. Command Line Arguments Prints each of the command line arguments passed in as parameter in_arg, assumes you defined all three command line arguments as outlined in '7. Command Line Arguments' Parameters: in_arg -data structure that stores the command line arguments object Returns: Nothing - just prints to console """ if in_arg is None: print("* Doesn't Check the Command Line Arguments because 'get_input_args' hasn't been defined.") else: # prints command line agrs print("Command Line Arguments:\n dir =", in_arg.dir, "\n arch =", in_arg.arch, "\n dogfile =", in_arg.dogfile) def check_creating_pet_image_labels(results_dic): """ For Lab: Classifying Images - 9/10. Creating Pet Image Labels Prints first 10 key-value pairs and makes sure there are 40 key-value pairs in your results_dic dictionary. Assumes you defined the results_dic dictionary as was outlined in '9/10. Creating Pet Image Labels' Parameters: results_dic - Dictionary with key as image filename and value as a List (index)idx 0 = pet image label (string) Returns: Nothing - just prints to console """ if results_dic is None: print("* Doesn't Check the Results Dictionary because 'get_pet_labels' hasn't been defined.") else: # Code to print 10 key-value pairs (or fewer if less than 10 images) # & makes sure there are 40 pairs, one for each file in pet_images/ stop_point = len(results_dic) if stop_point > 10: stop_point = 10 print("\nPet Image Label Dictionary has", len(results_dic), "key-value pairs.\nBelow are", stop_point, "of them:") # counter - to count how many labels have been printed n = 0 # for loop to iterate through the dictionary for key in results_dic: # prints only first 10 labels if n < stop_point: print("{:2d} key: {:>30} label: {:>26}".format(n+1, key, results_dic[key][0]) ) # Increments counter n += 1 # If past first 10 (or fewer) labels the breaks out of loop else: break def check_classifying_images(results_dic): """ For Lab: Classifying Images - 11/12. Classifying Images Prints Pet Image Label and Classifier Label for ALL Matches followed by ALL NOT matches. Next prints out the total number of images followed by how many were matches and how many were not-matches to check all 40 images are processed. Assumes you defined the results_dic dictionary as was outlined in '11/12. Classifying Images' Parameters: results_dic - Dictionary with key as image filename and value as a List (index)idx 0 = pet image label (string) idx 1 = classifier label (string) idx 2 = 1/0 (int) where 1 = match between pet image and classifer labels and 0 = no match between labels Returns: Nothing - just prints to console """ if results_dic is None: print("* Doesn't Check the Results Dictionary because 'classify_images' hasn't been defined.") elif len(results_dic[next(iter(results_dic))]) < 2: print("* Doesn't Check the Results Dictionary because 'classify_images' hasn't been defined.") else: # Code for checking classify_images - # Checks matches and not matches are classified correctly # Checks that all 40 images are classified as a Match or Not-a Match # Sets counters for matches & NOT-matches n_match = 0 n_notmatch = 0 # Prints all Matches first print("\n MATCH:") for key in results_dic: # Prints only if a Match Index 2 == 1 if results_dic[key][2] == 1: # Increments Match counter n_match += 1 print("\n{:>30}: \nReal: {:>26} Classifier: {:>30}".format(key, results_dic[key][0], results_dic[key][1])) # Prints all NOT-Matches next print("\n NOT A MATCH:") for key in results_dic: # Prints only if NOT-a-Match Index 2 == 0 if results_dic[key][2] == 0: # Increments Not-a-Match counter n_notmatch += 1 print("\n{:>30}: \nReal: {:>26} Classifier: {:>30}".format(key, results_dic[key][0], results_dic[key][1])) # Prints Total Number of Images - expects 40 from pet_images folder print("\n# Total Images",n_match + n_notmatch, "# Matches:",n_match , "# NOT Matches:",n_notmatch) def check_classifying_labels_as_dogs(results_dic): """ For Lab: Classifying Images - 13. Classifying Labels as Dogs Prints Pet Image Label, Classifier Label, whether Pet Label is-a-dog(1=Yes, 0=No), and whether Classifier Label is-a-dog(1=Yes, 0=No) for ALL Matches followed by ALL NOT matches. Next prints out the total number of images followed by how many were matches and how many were not-matches to check all 40 images are processed. Assumes you defined the results_dic dictionary as was outlined in '13. Classifying Labels as Dogs' Parameters: results_dic - Dictionary with key as image filename and value as a List (index)idx 0 = pet image label (string) idx 1 = classifier label (string) idx 2 = 1/0 (int) where 1 = match between pet image and classifer labels and 0 = no match between labels idx 3 = 1/0 (int) where 1 = pet image 'is-a' dog and 0 = pet Image 'is-NOT-a' dog. idx 4 = 1/0 (int) where 1 = Classifier classifies image 'as-a' dog and 0 = Classifier classifies image 'as-NOT-a' dog. Returns: Nothing - just prints to console """ if results_dic is None: print("* Doesn't Check the Results Dictionary because 'adjust_results4_isadog' hasn't been defined.") elif len(results_dic[next(iter(results_dic))]) < 4 : print("* Doesn't Check the Results Dictionary because 'adjust_results4_isadog' hasn't been defined.") else: # Code for checking adjust_results4_isadog - # Checks matches and not matches are classified correctly as "dogs" and # "not-dogs" Checks that all 40 images are classified as a Match or Not-a # Match # Sets counters for matches & NOT-matches n_match = 0 n_notmatch = 0 # Prints all Matches first print("\n MATCH:") for key in results_dic: # Prints only if a Match Index 2 == 1 if results_dic[key][2] == 1: # Increments Match counter n_match += 1 print("\n{:>30}: \nReal: {:>26} Classifier: {:>30} \nPetLabelDog: {:1d} ClassLabelDog: {:1d}".format(key, results_dic[key][0], results_dic[key][1], results_dic[key][3], results_dic[key][4])) # Prints all NOT-Matches next print("\n NOT A MATCH:") for key in results_dic: # Prints only if NOT-a-Match Index 2 == 0 if results_dic[key][2] == 0: # Increments Not-a-Match counter n_notmatch += 1 print("\n{:>30}: \nReal: {:>26} Classifier: {:>30} \nPetLabelDog: {:1d} ClassLabelDog: {:1d}".format(key, results_dic[key][0], results_dic[key][1], results_dic[key][3], results_dic[key][4])) # Prints Total Number of Images - expects 40 from pet_images folder print("\n# Total Images",n_match + n_notmatch, "# Matches:",n_match , "# NOT Matches:",n_notmatch) def check_calculating_results(results_dic, results_stats_dic): """ For Lab: Classifying Images - 14. Calculating Results Prints First statistics from the results stats dictionary (that was created by the calculates_results_stats() function), then prints the same statistics that were calculated in this function using the results dictionary. Assumes you defined the results_stats dictionary and the statistics as was outlined in '14. Calculating Results ' Parameters: results_dic - Dictionary with key as image filename and value as a List (index)idx 0 = pet image label (string) idx 1 = classifier label (string) idx 2 = 1/0 (int) where 1 = match between pet image and classifer labels and 0 = no match between labels idx 3 = 1/0 (int) where 1 = pet image 'is-a' dog and 0 = pet Image 'is-NOT-a' dog. idx 4 = 1/0 (int) where 1 = Classifier classifies image 'as-a' dog and 0 = Classifier classifies image 'as-NOT-a' dog. results_stats_dic - Dictionary that contains the results statistics (either a percentage or a count) where the key is the statistic's name (starting with 'pct' for percentage or 'n' for count) and the value is the statistic's value Returns: Nothing - just prints to console """ if results_stats_dic is None: print("* Doesn't Check the Results Dictionary because 'calculates_results_stats' hasn't been defined.") else: # Code for checking results_stats_dic - # Checks calculations of counts & percentages BY using results_dic # to re-calculate the values and then compare to the values # in results_stats_dic # Initialize counters to zero and number of images total n_images = len(results_dic) n_pet_dog = 0 n_class_cdog = 0 n_class_cnotd = 0 n_match_breed = 0 # Interates through results_dic dictionary to recompute the statistics # outside of the calculates_results_stats() function for key in results_dic: # match (if dog then breed match) if results_dic[key][2] == 1: # isa dog (pet label) & breed match if results_dic[key][3] == 1: n_pet_dog += 1 # isa dog (classifier label) & breed match if results_dic[key][4] == 1: n_class_cdog += 1 n_match_breed += 1 # NOT dog (pet_label) else: # NOT dog (classifier label) if results_dic[key][4] == 0: n_class_cnotd += 1 # NOT - match (not a breed match if a dog) else: # NOT - match # isa dog (pet label) if results_dic[key][3] == 1: n_pet_dog += 1 # isa dog (classifier label) if results_dic[key][4] == 1: n_class_cdog += 1 # NOT dog (pet_label) else: # NOT dog (classifier label) if results_dic[key][4] == 0: n_class_cnotd += 1 # calculates statistics based upon counters from above n_pet_notd = n_images - n_pet_dog if n_pet_dog != 0: pct_corr_dog = ( n_class_cdog / n_pet_dog )*100 else: pct_corr_dog = 0 if n_pet_notd != 0: pct_corr_notdog = ( n_class_cnotd / n_pet_notd )*100 else: pct_corr_notdog = 0 if n_pet_dog != 0: pct_corr_breed = ( n_match_breed / n_pet_dog )*100 else: pct_corr_breed = 0 # prints calculated statistics print("\n ** Statistics from calculates_results_stats() function:") print("N Images: {:2d} N Dog Images: {:2d} N NotDog Images: {:2d} \nPct Corr dog: {:5.1f} Pct Corr NOTdog: {:5.1f} Pct Corr Breed: {:5.1f}".format( results_stats_dic['n_images'], results_stats_dic['n_dogs_img'], results_stats_dic['n_notdogs_img'], results_stats_dic['pct_correct_dogs'], results_stats_dic['pct_correct_notdogs'], results_stats_dic['pct_correct_breed'])) print("\n ** Check Statistics - calculated from this function as a check:") print("N Images: {:2d} N Dog Images: {:2d} N NotDog Images: {:2d} \nPct Corr dog: {:5.1f} Pct Corr NOTdog: {:5.1f} Pct Corr Breed: {:5.1f}".format( n_images, n_pet_dog, n_pet_notd, pct_corr_dog, pct_corr_notdog, pct_corr_breed))
def check_command_line_arguments(in_arg): """ For Lab: Classifying Images - 7. Command Line Arguments Prints each of the command line arguments passed in as parameter in_arg, assumes you defined all three command line arguments as outlined in '7. Command Line Arguments' Parameters: in_arg -data structure that stores the command line arguments object Returns: Nothing - just prints to console """ if in_arg is None: print("* Doesn't Check the Command Line Arguments because 'get_input_args' hasn't been defined.") else: print('Command Line Arguments:\n dir =', in_arg.dir, '\n arch =', in_arg.arch, '\n dogfile =', in_arg.dogfile) def check_creating_pet_image_labels(results_dic): """ For Lab: Classifying Images - 9/10. Creating Pet Image Labels Prints first 10 key-value pairs and makes sure there are 40 key-value pairs in your results_dic dictionary. Assumes you defined the results_dic dictionary as was outlined in '9/10. Creating Pet Image Labels' Parameters: results_dic - Dictionary with key as image filename and value as a List (index)idx 0 = pet image label (string) Returns: Nothing - just prints to console """ if results_dic is None: print("* Doesn't Check the Results Dictionary because 'get_pet_labels' hasn't been defined.") else: stop_point = len(results_dic) if stop_point > 10: stop_point = 10 print('\nPet Image Label Dictionary has', len(results_dic), 'key-value pairs.\nBelow are', stop_point, 'of them:') n = 0 for key in results_dic: if n < stop_point: print('{:2d} key: {:>30} label: {:>26}'.format(n + 1, key, results_dic[key][0])) n += 1 else: break def check_classifying_images(results_dic): """ For Lab: Classifying Images - 11/12. Classifying Images Prints Pet Image Label and Classifier Label for ALL Matches followed by ALL NOT matches. Next prints out the total number of images followed by how many were matches and how many were not-matches to check all 40 images are processed. Assumes you defined the results_dic dictionary as was outlined in '11/12. Classifying Images' Parameters: results_dic - Dictionary with key as image filename and value as a List (index)idx 0 = pet image label (string) idx 1 = classifier label (string) idx 2 = 1/0 (int) where 1 = match between pet image and classifer labels and 0 = no match between labels Returns: Nothing - just prints to console """ if results_dic is None: print("* Doesn't Check the Results Dictionary because 'classify_images' hasn't been defined.") elif len(results_dic[next(iter(results_dic))]) < 2: print("* Doesn't Check the Results Dictionary because 'classify_images' hasn't been defined.") else: n_match = 0 n_notmatch = 0 print('\n MATCH:') for key in results_dic: if results_dic[key][2] == 1: n_match += 1 print('\n{:>30}: \nReal: {:>26} Classifier: {:>30}'.format(key, results_dic[key][0], results_dic[key][1])) print('\n NOT A MATCH:') for key in results_dic: if results_dic[key][2] == 0: n_notmatch += 1 print('\n{:>30}: \nReal: {:>26} Classifier: {:>30}'.format(key, results_dic[key][0], results_dic[key][1])) print('\n# Total Images', n_match + n_notmatch, '# Matches:', n_match, '# NOT Matches:', n_notmatch) def check_classifying_labels_as_dogs(results_dic): """ For Lab: Classifying Images - 13. Classifying Labels as Dogs Prints Pet Image Label, Classifier Label, whether Pet Label is-a-dog(1=Yes, 0=No), and whether Classifier Label is-a-dog(1=Yes, 0=No) for ALL Matches followed by ALL NOT matches. Next prints out the total number of images followed by how many were matches and how many were not-matches to check all 40 images are processed. Assumes you defined the results_dic dictionary as was outlined in '13. Classifying Labels as Dogs' Parameters: results_dic - Dictionary with key as image filename and value as a List (index)idx 0 = pet image label (string) idx 1 = classifier label (string) idx 2 = 1/0 (int) where 1 = match between pet image and classifer labels and 0 = no match between labels idx 3 = 1/0 (int) where 1 = pet image 'is-a' dog and 0 = pet Image 'is-NOT-a' dog. idx 4 = 1/0 (int) where 1 = Classifier classifies image 'as-a' dog and 0 = Classifier classifies image 'as-NOT-a' dog. Returns: Nothing - just prints to console """ if results_dic is None: print("* Doesn't Check the Results Dictionary because 'adjust_results4_isadog' hasn't been defined.") elif len(results_dic[next(iter(results_dic))]) < 4: print("* Doesn't Check the Results Dictionary because 'adjust_results4_isadog' hasn't been defined.") else: n_match = 0 n_notmatch = 0 print('\n MATCH:') for key in results_dic: if results_dic[key][2] == 1: n_match += 1 print('\n{:>30}: \nReal: {:>26} Classifier: {:>30} \nPetLabelDog: {:1d} ClassLabelDog: {:1d}'.format(key, results_dic[key][0], results_dic[key][1], results_dic[key][3], results_dic[key][4])) print('\n NOT A MATCH:') for key in results_dic: if results_dic[key][2] == 0: n_notmatch += 1 print('\n{:>30}: \nReal: {:>26} Classifier: {:>30} \nPetLabelDog: {:1d} ClassLabelDog: {:1d}'.format(key, results_dic[key][0], results_dic[key][1], results_dic[key][3], results_dic[key][4])) print('\n# Total Images', n_match + n_notmatch, '# Matches:', n_match, '# NOT Matches:', n_notmatch) def check_calculating_results(results_dic, results_stats_dic): """ For Lab: Classifying Images - 14. Calculating Results Prints First statistics from the results stats dictionary (that was created by the calculates_results_stats() function), then prints the same statistics that were calculated in this function using the results dictionary. Assumes you defined the results_stats dictionary and the statistics as was outlined in '14. Calculating Results ' Parameters: results_dic - Dictionary with key as image filename and value as a List (index)idx 0 = pet image label (string) idx 1 = classifier label (string) idx 2 = 1/0 (int) where 1 = match between pet image and classifer labels and 0 = no match between labels idx 3 = 1/0 (int) where 1 = pet image 'is-a' dog and 0 = pet Image 'is-NOT-a' dog. idx 4 = 1/0 (int) where 1 = Classifier classifies image 'as-a' dog and 0 = Classifier classifies image 'as-NOT-a' dog. results_stats_dic - Dictionary that contains the results statistics (either a percentage or a count) where the key is the statistic's name (starting with 'pct' for percentage or 'n' for count) and the value is the statistic's value Returns: Nothing - just prints to console """ if results_stats_dic is None: print("* Doesn't Check the Results Dictionary because 'calculates_results_stats' hasn't been defined.") else: n_images = len(results_dic) n_pet_dog = 0 n_class_cdog = 0 n_class_cnotd = 0 n_match_breed = 0 for key in results_dic: if results_dic[key][2] == 1: if results_dic[key][3] == 1: n_pet_dog += 1 if results_dic[key][4] == 1: n_class_cdog += 1 n_match_breed += 1 elif results_dic[key][4] == 0: n_class_cnotd += 1 elif results_dic[key][3] == 1: n_pet_dog += 1 if results_dic[key][4] == 1: n_class_cdog += 1 elif results_dic[key][4] == 0: n_class_cnotd += 1 n_pet_notd = n_images - n_pet_dog if n_pet_dog != 0: pct_corr_dog = n_class_cdog / n_pet_dog * 100 else: pct_corr_dog = 0 if n_pet_notd != 0: pct_corr_notdog = n_class_cnotd / n_pet_notd * 100 else: pct_corr_notdog = 0 if n_pet_dog != 0: pct_corr_breed = n_match_breed / n_pet_dog * 100 else: pct_corr_breed = 0 print('\n ** Statistics from calculates_results_stats() function:') print('N Images: {:2d} N Dog Images: {:2d} N NotDog Images: {:2d} \nPct Corr dog: {:5.1f} Pct Corr NOTdog: {:5.1f} Pct Corr Breed: {:5.1f}'.format(results_stats_dic['n_images'], results_stats_dic['n_dogs_img'], results_stats_dic['n_notdogs_img'], results_stats_dic['pct_correct_dogs'], results_stats_dic['pct_correct_notdogs'], results_stats_dic['pct_correct_breed'])) print('\n ** Check Statistics - calculated from this function as a check:') print('N Images: {:2d} N Dog Images: {:2d} N NotDog Images: {:2d} \nPct Corr dog: {:5.1f} Pct Corr NOTdog: {:5.1f} Pct Corr Breed: {:5.1f}'.format(n_images, n_pet_dog, n_pet_notd, pct_corr_dog, pct_corr_notdog, pct_corr_breed))
#!/usr/bin/env python '''\ Given two strings, remove all characters contained in the latter from the former. Note that order is preserved. For example: "ab", "b" -> "a" "abcdabcd", "acec" -> "bdbd" What is the run-time of your algorithm? How much memory does it use? Is it optimal? linear search with memcpy: O(nh**2) linear search without memcpy: O(nh) sort then binary search: O(n log n + h log n) table lookup: O(n + h) ''' def remove_needles(haystack, needles): needles_set = frozenset(needles) return ''.join(c for c in haystack if c not in needles_set) def remove_needles_test(haystack, needles, expected): actual = remove_needles(haystack, needles) assert actual == expected def main(): remove_needles_test('', '', ''); remove_needles_test('a', '', 'a'); remove_needles_test('', 'a', ''); remove_needles_test('ab', 'b', 'a'); remove_needles_test('bab', 'b', 'a'); remove_needles_test('bab', 'a', 'bb'); remove_needles_test('abcdabcd', 'acec', 'bdbd'); if __name__ == '__main__': main()
"""Given two strings, remove all characters contained in the latter from the former. Note that order is preserved. For example: "ab", "b" -> "a" "abcdabcd", "acec" -> "bdbd" What is the run-time of your algorithm? How much memory does it use? Is it optimal? linear search with memcpy: O(nh**2) linear search without memcpy: O(nh) sort then binary search: O(n log n + h log n) table lookup: O(n + h) """ def remove_needles(haystack, needles): needles_set = frozenset(needles) return ''.join((c for c in haystack if c not in needles_set)) def remove_needles_test(haystack, needles, expected): actual = remove_needles(haystack, needles) assert actual == expected def main(): remove_needles_test('', '', '') remove_needles_test('a', '', 'a') remove_needles_test('', 'a', '') remove_needles_test('ab', 'b', 'a') remove_needles_test('bab', 'b', 'a') remove_needles_test('bab', 'a', 'bb') remove_needles_test('abcdabcd', 'acec', 'bdbd') if __name__ == '__main__': main()
ACACA_AcCoA = 34 ACACA_HCO3 = 2100 ACAT2_AcCoA = 29 ACLY_Citrate = 78 ACLY_CoA = 14 ACO2_Citrate = 480 ACO2_Isocitrate = 120 ACOT12_AcCoA = 47 ACOT13_AcCoA = 47 ACSS1_Acetate = 73 ACSS1_CoA = 11 ACSS2_Acetate = 73 ACSS2_CoA = 11 CS_AcCoA = 5 CS_OXa = 5.9 EP300_AcCoA = 0.28 FASN_AcCoA = 7 FASN_HCO3 = 2100 FASN_NADPH = 5 FH_Fumarate = 13 HMGCS1_AcCoA = 14 IDH2_Isocitrate = 2400 IDH2_NAD = 80 KAT2A_AcCoA = 6.7 KAT2B_AcCoA = 1.1 MDH2_Malate = 560 MDH2_NAD = 140 OGDH_AlphaKG = 4000 OGDH_NAD = 80 PC_Pyruvate = 220 PC_HCO3 = 3200 PDHA1_Pyruvate = 64.8 PDHA1_NAD = 33 PDHA1_CoA = 4 SDHA_Succinate = 20 SDHA_Fumarate = 25 SLC13A5_Citrate = 600 # https://www.ncbi.nlm.nih.gov/pmc/articles/PMC2913483/ SUCLG2_SucCoA = 86 """Not used Km values HDAC1_Ac-protein = 25, HDAC2_Ac-rotein = 32, HDAC3_Ac-protein = 35, """
acaca__ac_co_a = 34 acaca_hco3 = 2100 acat2__ac_co_a = 29 acly__citrate = 78 acly__co_a = 14 aco2__citrate = 480 aco2__isocitrate = 120 acot12__ac_co_a = 47 acot13__ac_co_a = 47 acss1__acetate = 73 acss1__co_a = 11 acss2__acetate = 73 acss2__co_a = 11 cs__ac_co_a = 5 cs_o_xa = 5.9 ep300__ac_co_a = 0.28 fasn__ac_co_a = 7 fasn_hco3 = 2100 fasn_nadph = 5 fh__fumarate = 13 hmgcs1__ac_co_a = 14 idh2__isocitrate = 2400 idh2_nad = 80 kat2_a__ac_co_a = 6.7 kat2_b__ac_co_a = 1.1 mdh2__malate = 560 mdh2_nad = 140 ogdh__alpha_kg = 4000 ogdh_nad = 80 pc__pyruvate = 220 pc_hco3 = 3200 pdha1__pyruvate = 64.8 pdha1_nad = 33 pdha1__co_a = 4 sdha__succinate = 20 sdha__fumarate = 25 slc13_a5__citrate = 600 suclg2__suc_co_a = 86 'Not used Km values\nHDAC1_Ac-protein = 25,\nHDAC2_Ac-rotein = 32,\nHDAC3_Ac-protein = 35,\n'
# Set the following variables and rename to credentials.py USER = RPC_USERNAME PASSWORD = RPC_PASSWORD SITE_SECRET_KEY = BYTE_STRING
user = RPC_USERNAME password = RPC_PASSWORD site_secret_key = BYTE_STRING
def GetXSection(fileName): #[pb] #Cross Section derived from sample name using https://cms-gen-dev.cern.ch/xsdb/ #TODO UL QCD files have PSWeights in their name, but xsdb does not include it in its name fileName = fileName.replace("PSWeights_", "") #TODO: UL Single Top xSection only defined for filename without inclusive decays specified fileName = fileName.replace("5f_InclusiveDecays_", "5f_") #TODO: UL tZq_ll_4f_ckm_NLO_TuneCP5_13TeV-amcatnlo-pythia8 only defined with PSWeights... fileName = fileName.replace("tZq_ll_4f_ckm_NLO_TuneCP5_13TeV-amcatnlo-pythia8", "tZq_ll_4f_ckm_NLO_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") if fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 70.89 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_mtop1735_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 68.45 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 69.66 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 116.1 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_mtop1755_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 112.5 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 118.0 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5_PSweights_13TeV-amcatnlo-pythia8_correctnPartonsInBorn") !=-1 : return 3.74 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_mtop1735_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8") !=-1 : return 114.4 elif fileName.find("ST_t-channel_antitop_4f_hdampdown_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 67.91 elif fileName.find("ST_tW_antitop_5f_hdampdown_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.99 elif fileName.find("ST_t-channel_antitop_4f_hdampdown_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8") !=-1 : return 69.09 elif fileName.find("ST_t-channel_antitop_4f_hdampup_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 67.91 elif fileName.find("ST_tW_antitop_5f_hdampup_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.96 elif fileName.find("DYJetsToLL_BGenFilter_Zpt-100to200_M-50_TuneCP5_13TeV-madgraphMLM-pythia8_newgridpack") !=-1 : return 2.678 elif fileName.find("DYJetsToLL_BGenFilter_Zpt-200toInf_M-50_TuneCP5_13TeV-madgraphMLM-pythia8_newgridpack") !=-1 : return 0.3909 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5_erdON_PSweights_13TeV-powheg-pythia8") !=-1 : return 67.91 elif fileName.find("ST_t-channel_antitop_5f_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8_vtd_vts_decay") !=-1 : return 82.52 elif fileName.find("ST_t-channel_antitop_4f_hdampup_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8") !=-1 : return 69.09 elif fileName.find("ST_t-channel_top_4f_hdampdown_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 113.3 elif fileName.find("ST_tW_top_5f_hdampdown_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.92 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5_erdON_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_t-channel_antitop_5f_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8_vtd_vts_prod") !=-1 : return 225.5 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 67.91 elif fileName.find("ST_t-channel_top_4f_hdampup_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 113.3 elif fileName.find("ST_t-channel_top_4f_hdampdown_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8") !=-1 : return 115.3 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5_erdON_13TeV-powheg-madspin-pythia8") !=-1 : return 69.09 elif fileName.find("ST_tW_top_5f_hdampup_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.9 elif fileName.find("DYJetsToTauTau_ForcedMuEleDecay_M-50_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8") !=-1 : return 6505.0 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5CR1_PSweights_13TeV-powheg-pythia8") !=-1 : return 67.91 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("DYJetsToTauTau_ForcedMuEleDecay_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_ext1") !=-1 : return 1991.0 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5CR2_PSweights_13TeV-powheg-pythia8") !=-1 : return 67.91 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 36.65 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_mtop1735_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.44 elif fileName.find("ST_t-channel_top_4f_hdampup_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8") !=-1 : return 115.3 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5CR1_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 67.91 elif fileName.find("ST_t-channel_top_5f_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8_vtd_vts_decay") !=-1 : return 138.1 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_mtop1755_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 33.4 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5_erdON_PSweights_13TeV-powheg-pythia8") !=-1 : return 113.3 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 35.52 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5down_13TeV-powheg-madspin-pythia8") !=-1 : return 69.09 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5CR2_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_tW_antitop_5f_DS_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 35.25 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5CR2_13TeV-powheg-madspin-pythia8") !=-1 : return 69.09 elif fileName.find("ST_t-channel_top_5f_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8_vtd_vts_prod") !=-1 : return 547.2 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5_PSweights_correctnPartonsInBorn_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5_erdON_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5CR1_13TeV-powheg-madspin-pythia8") !=-1 : return 69.09 elif fileName.find("DYJetsToLL_BGenFilter_Zpt-200toInf_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 0.5082 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5_erdON_13TeV-powheg-madspin-pythia8") !=-1 : return 115.3 elif fileName.find("TTWJetsToLNu_TuneCP5CR2_GluonMove_PSweights_13TeV-amcatnloFXFX-madspin-pythia8") !=-1 : return 0.2183 elif fileName.find("ST_s-channel_4f_leptonDecays_mtop1715_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 3.824 elif fileName.find("ST_s-channel_4f_leptonDecays_mtop1755_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 3.506 elif fileName.find("ST_s-channel_4f_leptonDecays_mtop1695_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 3.991 elif fileName.find("DYJetsToLL_BGenFilter_Zpt-100to200_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 3.41 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 67.91 elif fileName.find("ST_t-channel_antitop_4f_inclusiveDecays_TuneCP5_13TeV-powhegV2-madspin-pythia8") !=-1 : return 67.91 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5up_13TeV-powheg-madspin-pythia8") !=-1 : return 69.09 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 113.3 elif fileName.find("ST_s-channel_4f_leptonDecays_mtop1735_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 3.653 elif fileName.find("TTWJetsToLNu_TuneCP5CR1_QCDbased_PSweights_13TeV-amcatnloFXFX-madspin-pythia8") !=-1 : return 0.2169 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5CR1_PSweights_13TeV-powheg-pythia8") !=-1 : return 113.3 elif fileName.find("ST_tW_antitop_5f_hdampdown_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 34.98 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5CR2_PSweights_13TeV-powheg-pythia8") !=-1 : return 113.3 elif fileName.find("ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8") !=-1 : return 69.09 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_mtop1715_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 36.65 elif fileName.find("ST_tW_top_5f_inclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 36.58 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5CR2_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5CR1_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_mtop1735_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 36.65 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 113.3 elif fileName.find("DYJetsToLL_Zpt-200toInf_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_TuneDown") !=-1 : return 6.714 elif fileName.find("DYJetsToTauTau_ForcedMuEleDecay_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 1981.0 elif fileName.find("ST_tW_top_5f_inclusiveDecays_mtop1735_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.38 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_mtop1695_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 36.65 elif fileName.find("ST_tW_top_5f_DS_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 33.75 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_mtop1755_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 36.65 elif fileName.find("ST_tW_top_5f_inclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 35.46 elif fileName.find("DYJetsToLL_M-105To160_VBFFilter_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8") !=-1 : return 2.01 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5down_13TeV-powheg-madspin-pythia8") !=-1 : return 115.3 elif fileName.find("ST_tW_top_5f_inclusiveDecays_mtop1755_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 33.34 elif fileName.find("DYJetsToLL_M-105To160_VBFFilter_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 1.526 elif fileName.find("DYBJetsToLL_M-50_Zpt-200toInf_TuneCP5_13TeV-madgraphMLM-pythia8_newgridpack") !=-1 : return 0.3282 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5CR2_13TeV-powheg-madspin-pythia8") !=-1 : return 115.3 elif fileName.find("ST_t-channel_eleDecays_anomwtbLVRV_LVRVunphys_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 47.81 elif fileName.find("ST_tW_antitop_5f_hdampup_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_t-channel_tauDecays_anomwtbLVRV_LVRVunphys_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 47.69 elif fileName.find("DYBJetsToLL_M-50_Zpt-100to200_TuneCP5_13TeV-madgraphMLM-pythia8_newgridpack") !=-1 : return 3.21 elif fileName.find("ST_t-channel_tauDecays_anomwtbLVLT_LVLTunphys_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 84.72 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5CR1_13TeV-powheg-madspin-pythia8") !=-1 : return 115.3 elif fileName.find("DYJetsToLL_M-4to50_HT-100to200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 203.3 elif fileName.find("DYJetsToLL_Zpt-200toInf_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_TuneUp") !=-1 : return 6.716 elif fileName.find("TTToSemiLepton_HT500Njet9_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 3.884 elif fileName.find("ST_tW_antitop_5f_DS_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 35.25 elif fileName.find("DYJetsToLL_M-4to50_HT-600toInf_TuneCP5_PSWeights_13TeV-madgraphMLM-pythia8") !=-1 : return 1.837 elif fileName.find("ST_t-channel_muDecays_anomwtbLVLT_LVLTunphys_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 84.86 elif fileName.find("DYJetsToLL_M-4to50_HT-200to400_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 54.31 elif fileName.find("ST_t-channel_top_4f_inclusiveDecays_TuneCP5_13TeV-powhegV2-madspin-pythia8") !=-1 : return 113.3 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5up_13TeV-powheg-madspin-pythia8") !=-1 : return 115.3 elif fileName.find("ST_t-channel_antitop_5f_TuneCP5_13TeV-powheg-madspin-pythia8_vtd_vts_decay") !=-1 : return 82.52 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 113.3 elif fileName.find("ST_t-channel_muDecays_anomwtbLVRV_LVRVunphys_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 47.63 elif fileName.find("DYJetsToLL_CGenFilter_Zpt-200toInf_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 3.184 elif fileName.find("DYJetsToLL_M-4to50_HT-70to100_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 146.6 elif fileName.find("DYJetsToLL_M-50_HT-1200to2500_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 0.1937 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5down_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("ST_t-channel_eDecays_anomwtbLVLT_LVLTunphys_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 84.84 elif fileName.find("DYJetsToLL_BGenFilter_Zpt-200toInf_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 0.5327 elif fileName.find("DYJetsToLL_BGenFilter_Zpt-100to200_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 3.384 elif fileName.find("ST_tW_top_5f_hdampdown_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("DYJetsToLL_CGenFilter_Zpt-100to200_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 25.86 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5_erdON_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_t-channel_antitop_5f_TuneCP5_13TeV-powheg-madspin-pythia8_vtd_vts_prod") !=-1 : return 225.5 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("DYJetsToTauTau_ForcedMuDecay_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 1990.0 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_mtop1695_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 36.65 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_mtop1715_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 36.65 elif fileName.find("TTToSemiLepton_HT500Njet9_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 4.613 elif fileName.find("DYJetsToLL_M-50_HT-800to1200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 0.8021 elif fileName.find("DYJetsToLL_M-50_HT-2500toInf_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 0.003514 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5CR2_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_mtop1735_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 36.65 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5CR1_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("ST_t-channel_top_4f_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8") !=-1 : return 115.3 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_mtop1755_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 36.65 elif fileName.find("TTToSemilepton_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8") !=-1 : return 31.06 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5up_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("ST_t-channel_tauDecays_anomwtbLVRT_LV2RT2_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 102.2 elif fileName.find("DYJetsToEE_M-50_LTbinned_800To2000_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.01009 elif fileName.find("DYJetsToLL_M-50_HT-100to200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 160.7 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5down_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_tW_top_5f_inclusiveDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_t-channel_tauDecays_anomwtbLVRT_LV1RT4_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 108.3 elif fileName.find("ST_t-channel_tauDecays_anomwtbLVRT_LV3RT1_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 54.52 elif fileName.find("DYJetsToLL_M-50_HT-200to400_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 48.63 elif fileName.find("DYJetsToLL_M-50_HT-600to800_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 1.761 elif fileName.find("DYJetsToTauTau_ForcedMuEleDecay_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 6458.0 elif fileName.find("ST_tW_top_5f_hdampup_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 34.9 elif fileName.find("DYJetsToLL_M-50_HT-400to600_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 6.993 elif fileName.find("DYJetsToEE_M-50_LTbinned_100To200_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 93.51 elif fileName.find("ST_t-channel_muDecays_anomwtbLVRT_LV1RT4_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 108.6 elif fileName.find("tZq_ll_4f_ckm_NLO_TuneCP5CR1_QCDbased_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 0.07358 elif fileName.find("DYJetsToLL_M-50_VBFFilter_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8") !=-1 : return 266.1 elif fileName.find("DYJetsToEE_M-50_LTbinned_200To400_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 4.121 elif fileName.find("ST_t-channel_muDecays_anomwtbLVRT_LV2RT2_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 102.7 elif fileName.find("DYJetsToLL_M-50_HT-70to100_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 146.5 elif fileName.find("ST_tW_top_5f_DS_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 33.75 elif fileName.find("ST_tW_antitop_5f_DS_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 35.13 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5CR2_GluonMove_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("DYJetsToEE_M-50_LTbinned_400To800_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.2445 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5CR1_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5CR2_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("TTJets_SingleLeptFromTbar_genMET-150_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 6.167 elif fileName.find("ST_t-channel_muDecays_anomwtbLVRT_LV3RT1_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 54.72 elif fileName.find("DYJetsToLL_M-5to50_HT-600toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 1.107 elif fileName.find("ST_t-channel_eDecays_anomwtbLVRT_LV2RT2_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 102.9 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("TTTo2L2Nu_HT500Njet7_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 10.56 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5_erdON_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("DYJetsToEE_M-50_LTbinned_95To100_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 47.14 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5up_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("TTJets_SingleLeptFromTbar_genMET-80_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 31.68 elif fileName.find("ST_tW_top_5f_inclusiveDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_t-channel_4f_leptonDecays_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 70.9 elif fileName.find("DYJetsToLL_M-5to50_HT-400to600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 3.628 elif fileName.find("ST_t-channel_eDecays_anomwtbLVRT_LV1RT4_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 108.9 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5CR1_QCDbased_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("DYJetsToLL_M-50_VBFFilter_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 202.3 elif fileName.find("DYJetsToLL_M-5to50_HT-100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 224.4 elif fileName.find("ST_t-channel_top_5f_TuneCP5_13TeV-powheg-madspin-pythia8_vtd_vts_prod") !=-1 : return 547.2 elif fileName.find("DYJetsToLL_M-5to50_HT-200to400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 37.87 elif fileName.find("TTWJetsToLNu_TuneCP5CR2_GluonMove_13TeV-amcatnloFXFX-madspin-pythia8") !=-1 : return 0.2188 elif fileName.find("DYBJetsToLL_M-50_Zpt-100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 3.088 elif fileName.find("ST_t-channel_tauDecays_anomwtbLVRT_RT4_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 53.84 elif fileName.find("DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_CUETP8M1Down") !=-1 : return 5940.0 elif fileName.find("DYJetsToLL_M-1To5_HT-400to600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 65.9 elif fileName.find("TTToSemiLepton_HT500Njet9_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 4.179 elif fileName.find("DYJetsToLL_M-1To5_HT-200to400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 789.8 elif fileName.find("DYJetsToEE_M-50_LTbinned_80To85_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 174.1 elif fileName.find("DYBJetsToLL_M-50_Zpt-200toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 0.3159 elif fileName.find("DYJetsToEE_M-50_LTbinned_90To95_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 179.6 elif fileName.find("DYJetsToTauTau_ForcedMuDecay_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 6503.0 elif fileName.find("DYJetsToLL_M-1To5_HT-600toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 16.72 elif fileName.find("DYJetsToLL_M-5to50_HT-70to100_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 301.0 elif fileName.find("DYJetsToLL_M-1To5_HT-150to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 1124.0 elif fileName.find("DYJetsToEE_M-50_LTbinned_85To90_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 250.6 elif fileName.find("DYJetsToLL_M-50_HT-1200to2500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 0.1512 elif fileName.find("TTToSemiLeptonic_TuneCP5CR2_GluonMove_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-160_MZp-2_13TeV-madgraph") !=-1 : return 0.0001077 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-100_MZp-8_13TeV-madgraph") !=-1 : return 1.563e-05 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-160_MZp-5_13TeV-madgraph") !=-1 : return 4.298e-05 elif fileName.find("TTToSemiLeptonic_TuneCP5CR1_QCDbased_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-150_MZp-8_13TeV-madgraph") !=-1 : return 5.117e-05 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-150_MZp-5_13TeV-madgraph") !=-1 : return 8.237e-05 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-120_MZp-2_13TeV-madgraph") !=-1 : return 0.0002052 elif fileName.find("TTJets_SingleLeptFromT_genMET-150_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 6.212 elif fileName.find("TTTo2L2Nu_HT500Njet7_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 12.41 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-140_MZp-8_13TeV-madgraph") !=-1 : return 6.504e-05 elif fileName.find("DYJetsToLL_M-50_HT-2500toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 0.003659 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-130_MZp-2_13TeV-madgraph") !=-1 : return 0.0002577 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-150_MZp-2_13TeV-madgraph") !=-1 : return 0.0002047 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-140_MZp-2_13TeV-madgraph") !=-1 : return 0.0002613 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-130_MZp-5_13TeV-madgraph") !=-1 : return 0.0001031 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-100_MZp-2_13TeV-madgraph") !=-1 : return 5.684e-05 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-110_MZp-8_13TeV-madgraph") !=-1 : return 3.331e-05 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-130_MZp-8_13TeV-madgraph") !=-1 : return 6.456e-05 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-100_MZp-5_13TeV-madgraph") !=-1 : return 2.343e-05 elif fileName.find("ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-120_13TeV_amcatnlo_pythia8") !=-1 : return 7.402 elif fileName.find("ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-150_13TeV_amcatnlo_pythia8") !=-1 : return 1.686 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-110_MZp-5_13TeV-madgraph") !=-1 : return 5.221e-05 elif fileName.find("ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-140_13TeV_amcatnlo_pythia8") !=-1 : return 3.367 elif fileName.find("ST_tW_top_5f_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_t-channel_tauDecays_anomwtbLVRV_RV_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 24.06 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-110_MZp-2_13TeV-madgraph") !=-1 : return 0.0001291 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-120_MZp-8_13TeV-madgraph") !=-1 : return 5.201e-05 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-140_MZp-5_13TeV-madgraph") !=-1 : return 0.0001043 elif fileName.find("ST_t-channel_tauDecays_anomwtbLVLT_LT_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 71.8 elif fileName.find("ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-160_13TeV_amcatnlo_pythia8") !=-1 : return 0.4841 elif fileName.find("TTWJetsToLNu_TuneCP5CR1_QCDbased_13TeV-amcatnloFXFX-madspin-pythia8") !=-1 : return 0.2183 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5down_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-100_13TeV_amcatnlo_pythia8") !=-1 : return 11.62 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-160_MZp-8_13TeV-madgraph") !=-1 : return 2.687e-05 elif fileName.find("DYJetsToLL_Zpt-200toInf_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 6.733 elif fileName.find("DYJetsToLL_M-50_HT-800to1200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 0.6229 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-120_MZp-5_13TeV-madgraph") !=-1 : return 8.243e-05 elif fileName.find("DYJetsToLL_Zpt-100to200_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 57.3 elif fileName.find("ST_t-channel_muDecays_anomwtbLVRT_RT4_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 53.81 elif fileName.find("DYJetsToLL_M-50_Zpt-150toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 18.36 elif fileName.find("ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-155_13TeV_amcatnlo_pythia8") !=-1 : return 1.008 elif fileName.find("DYJetsToLL_M-50_HT-200to400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 41.04 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-90_MZp-8_13TeV-madgraph") !=-1 : return 3.684e-06 elif fileName.find("DYJetsToLL_M-105To160_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8") !=-1 : return 47.05 elif fileName.find("tZq_Zhad_Wlept_4f_ckm_NLO_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 0.1518 elif fileName.find("TTJets_SingleLeptFromT_genMET-80_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 32.27 elif fileName.find("DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_CUETP8M1Up") !=-1 : return 5872.0 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5CR2_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-90_MZp-5_13TeV-madgraph") !=-1 : return 5.859e-06 elif fileName.find("TTToSemiLepton_HT500Njet9_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 4.295 elif fileName.find("DYJetsToLL_M-50_HT-100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 147.4 elif fileName.find("DYJetsToLL_M-105To160_VBFFilter_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 2.026 elif fileName.find("DYJetsToLL_M-50_HT-600to800_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 1.358 elif fileName.find("ST_t-channel_muDecays_anomwtbLVRV_RV_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 24.21 elif fileName.find("ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-90_13TeV_amcatnlo_pythia8") !=-1 : return 13.46 elif fileName.find("ST_t-channel_muDecays_anomwtbLVLT_LT_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 71.67 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5CR1_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-80_13TeV_amcatnlo_pythia8") !=-1 : return 15.03 elif fileName.find("DYJetsToLL_M-50_HT-400to600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 5.674 elif fileName.find("ST_t-channel_eDecays_anomwtbLVRT_RT4_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 53.7 elif fileName.find("ST_tW_top_5f_DS_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 33.67 elif fileName.find("TTTo2L2Nu_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8") !=-1 : return 7.269 elif fileName.find("TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-90_MZp-2_13TeV-madgraph") !=-1 : return 1.318e-05 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-140_MZp-2_13TeV-madgraph") !=-1 : return 0.0001947 elif fileName.find("DYJetsToNuNu_PtZ-400To650_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.2783 elif fileName.find("DYJetsToLL_BGenFilter_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 255.2 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-130_MZp-8_13TeV-madgraph") !=-1 : return 4.803e-05 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-110_MZp-5_13TeV-madgraph") !=-1 : return 3.898e-05 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-110_MZp-8_13TeV-madgraph") !=-1 : return 2.495e-05 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-100_MZp-5_13TeV-madgraph") !=-1 : return 1.776e-05 elif fileName.find("DYJetsToNuNu_PtZ-100To250_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 54.86 elif fileName.find("TTToSemiLeptonic_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_TuneCP5down_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-120_MZp-8_13TeV-madgraph") !=-1 : return 3.87e-05 elif fileName.find("TTToSemiLeptonic_mtop178p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 584.6 elif fileName.find("DYJetsToNuNu_PtZ-250To400_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 2.073 elif fileName.find("TTToSemiLeptonic_mtop175p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 633.4 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-130_MZp-5_13TeV-madgraph") !=-1 : return 7.685e-05 elif fileName.find("TTToSemiLeptonic_mtop169p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 746.2 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-160_MZp-5_13TeV-madgraph") !=-1 : return 3.199e-05 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-160_MZp-8_13TeV-madgraph") !=-1 : return 1.993e-05 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-120_MZp-2_13TeV-madgraph") !=-1 : return 0.0001529 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-160_MZp-2_13TeV-madgraph") !=-1 : return 7.999e-05 elif fileName.find("DYJetsToLL_M-105To160_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8") !=-1 : return 38.81 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-100_MZp-2_13TeV-madgraph") !=-1 : return 4.276e-05 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-150_MZp-5_13TeV-madgraph") !=-1 : return 6.133e-05 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5up_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("TTToSemiLeptonic_mtop173p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 668.6 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-140_MZp-8_13TeV-madgraph") !=-1 : return 4.869e-05 elif fileName.find("TTToSemiLeptonic_mtop166p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 811.4 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-150_MZp-8_13TeV-madgraph") !=-1 : return 3.827e-05 elif fileName.find("ST_t-channel_eDecays_anomwtbLVRV_RV_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 24.12 elif fileName.find("DYJetsToNuNu_PtZ-650ToInf_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.02603 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-140_MZp-5_13TeV-madgraph") !=-1 : return 7.75e-05 elif fileName.find("ST_t-channel_eDecays_anomwtbLVLT_LT_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 71.81 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-110_MZp-2_13TeV-madgraph") !=-1 : return 9.633e-05 elif fileName.find("TTWJetsToLNu_TuneCP5_PSweights_13TeV-amcatnloFXFX-madspin-pythia8") !=-1 : return 0.2198 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-130_MZp-2_13TeV-madgraph") !=-1 : return 0.0001914 elif fileName.find("TTToSemiLeptonic_mtop171p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 706.1 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-120_MZp-5_13TeV-madgraph") !=-1 : return 6.122e-05 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-150_MZp-2_13TeV-madgraph") !=-1 : return 0.000153 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-100_MZp-8_13TeV-madgraph") !=-1 : return 1.168e-05 elif fileName.find("DYJetsToLL_M-105To160_VBFFilter_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 1.518 elif fileName.find("DYJetsToLL_M-4to50_HT-600toInf_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 1.85 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-25_13TeV-madgraph") !=-1 : return 0.01724 elif fileName.find("DY2JetsToLL_M-50_LHEZpT_400-inf_TuneCP5_13TeV-amcnloFXFX-pythia8") !=-1 : return 0.4477 elif fileName.find("DY1JetsToLL_M-50_LHEZpT_400-inf_TuneCP5_13TeV-amcnloFXFX-pythia8") !=-1 : return 0.1193 elif fileName.find("DY2JetsToLL_M-50_LHEZpT_250-400_TuneCP5_13TeV-amcnloFXFX-pythia8") !=-1 : return 2.737 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-30_13TeV-madgraph") !=-1 : return 0.01416 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-35_13TeV-madgraph") !=-1 : return 0.02032 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-25_13TeV-madgraph") !=-1 : return 0.03673 elif fileName.find("DYJetsToNuNu_PtZ-50To100_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 237.2 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-90_MZp-8_13TeV-madgraph") !=-1 : return 2.736e-06 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-100_MA-20_13TeV-madgraph") !=-1 : return 0.0008489 elif fileName.find("DY1JetsToLL_M-50_LHEZpT_250-400_TuneCP5_13TeV-amcnloFXFX-pythia8") !=-1 : return 1.098 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-90_MZp-5_13TeV-madgraph") !=-1 : return 4.393e-06 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-20_13TeV-madgraph") !=-1 : return 0.03297 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-25_13TeV-madgraph") !=-1 : return 0.03162 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-10_13TeV-madgraph") !=-1 : return 0.01898 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-25_13TeV-madgraph") !=-1 : return 0.005135 elif fileName.find("DYJetsToLL_M-4to50_HT-200to400_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 54.39 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-20_13TeV-madgraph") !=-1 : return 0.008633 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-100_MA-10_13TeV-madgraph") !=-1 : return 0.002968 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-35_13TeV-madgraph") !=-1 : return 0.03638 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-15_13TeV-madgraph") !=-1 : return 0.01158 elif fileName.find("DYJetsToLL_M-4to50_HT-400to600_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 5.697 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-100_MA-15_13TeV-madgraph") !=-1 : return 0.002361 elif fileName.find("TTToSemiLepton_HT500Njet9_hdampDOWN_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 3.899 elif fileName.find("ST_tW_DS_antitop_5f_inclusiveDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 35.13 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-20_13TeV-madgraph") !=-1 : return 0.02027 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-10_13TeV-madgraph") !=-1 : return 0.01418 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-25_13TeV-madgraph") !=-1 : return 0.03152 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-35_13TeV-madgraph") !=-1 : return 0.0346 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-30_13TeV-madgraph") !=-1 : return 0.03397 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-25_13TeV-madgraph") !=-1 : return 0.0188 elif fileName.find("DY1JetsToLL_M-50_LHEZpT_150-250_TuneCP5_13TeV-amcnloFXFX-pythia8") !=-1 : return 9.543 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-30_13TeV-madgraph") !=-1 : return 0.001474 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-10_13TeV-madgraph") !=-1 : return 0.01521 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-30_13TeV-madgraph") !=-1 : return 0.01928 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-15_13TeV-madgraph") !=-1 : return 0.02175 elif fileName.find("DYJetsToLL_M-4to50_HT-100to200_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 204.0 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-15_13TeV-madgraph") !=-1 : return 0.0269 elif fileName.find("TTToSemiLepton_HT500Njet9_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 4.253 elif fileName.find("DYBJetsToNuNu_Zpt-40toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 48.71 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-30_13TeV-madgraph") !=-1 : return 0.02977 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-20_13TeV-madgraph") !=-1 : return 0.01481 elif fileName.find("TTToHadronic_TuneCP5CR2_GluonMove_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-20_13TeV-madgraph") !=-1 : return 0.03 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-15_13TeV-madgraph") !=-1 : return 0.01866 elif fileName.find("TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-90_MZp-2_13TeV-madgraph") !=-1 : return 9.812e-06 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-10_13TeV-madgraph") !=-1 : return 0.01839 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-15_13TeV-madgraph") !=-1 : return 0.02536 elif fileName.find("DY2JetsToLL_M-50_LHEZpT_150-250_TuneCP5_13TeV-amcnloFXFX-pythia8") !=-1 : return 15.65 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-10_13TeV-madgraph") !=-1 : return 0.008011 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-15_13TeV-madgraph") !=-1 : return 0.009756 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-35_13TeV-madgraph") !=-1 : return 0.007598 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-10_13TeV-madgraph") !=-1 : return 0.008264 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-35_13TeV-madgraph") !=-1 : return 0.02491 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-30_13TeV-madgraph") !=-1 : return 0.03793 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-20_13TeV-madgraph") !=-1 : return 0.02735 elif fileName.find("DYJetsToLL_M-50_HT-1200to2500_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 0.1933 elif fileName.find("DYJetsToLL_M-1500to2000_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.00218 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5down_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-35_13TeV-madgraph") !=-1 : return 0.02608 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-20_13TeV-madgraph") !=-1 : return 0.02245 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-20_13TeV-madgraph") !=-1 : return 0.02486 elif fileName.find("TTToHadronic_TuneCP5CR1_QCDbased_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-25_13TeV-madgraph") !=-1 : return 0.01403 elif fileName.find("DYBJetsToLL_M-50_Zpt-100to200_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 4.042 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_TuneCP5up_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("DYJetsToLL_M-1to4_HT-600toInf_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 2.453 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-30_13TeV-madgraph") !=-1 : return 0.0011 elif fileName.find("DYJetsToLL_M-1to4_HT-100to200_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 479.6 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-25_13TeV-madgraph") !=-1 : return 0.003863 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-25_13TeV-madgraph") !=-1 : return 0.01305 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-35_13TeV-madgraph") !=-1 : return 0.01856 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-30_13TeV-madgraph") !=-1 : return 0.02827 elif fileName.find("DY1JetsToLL_M-50_LHEZpT_50-150_TuneCP5_13TeV-amcnloFXFX-pythia8") !=-1 : return 316.6 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-20_13TeV-madgraph") !=-1 : return 0.01516 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-35_13TeV-madgraph") !=-1 : return 0.02718 elif fileName.find("DYJetsToLL_M-50_HT-1200to2500_TuneCP5_14TeV-madgraphMLM-pythia8") !=-1 : return 0.2466 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-10_13TeV-madgraph") !=-1 : return 0.006028 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-35_13TeV-madgraph") !=-1 : return 0.005625 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-35_13TeV-madgraph") !=-1 : return 0.01527 elif fileName.find("DYJetsToLL_M-1to4_HT-400to600_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 8.207 elif fileName.find("TTToSemiLeptonic_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.0 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-10_13TeV-madgraph") !=-1 : return 0.01143 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-20_13TeV-madgraph") !=-1 : return 0.006446 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-30_13TeV-madgraph") !=-1 : return 0.01449 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-15_13TeV-madgraph") !=-1 : return 0.007288 elif fileName.find("DY2JetsToLL_M-50_LHEZpT_50-150_TuneCP5_13TeV-amcnloFXFX-pythia8") !=-1 : return 169.6 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-20_13TeV-madgraph") !=-1 : return 0.02056 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-30_13TeV-madgraph") !=-1 : return 0.02555 elif fileName.find("DYJetsToLL_M-2000to3000_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.0005156 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-25_13TeV-madgraph") !=-1 : return 0.02348 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-25_13TeV-madgraph") !=-1 : return 0.02368 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-20_13TeV-madgraph") !=-1 : return 0.01108 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-10_13TeV-madgraph") !=-1 : return 0.01375 elif fileName.find("ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("TTTo2L2Nu_HT500Njet7_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 11.34 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-25_13TeV-madgraph") !=-1 : return 0.02774 elif fileName.find("DYJetsToLL_M-4to50_HT-70to100_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 145.5 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-100_MA-20_13TeV-madgraph") !=-1 : return 0.0006391 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-10_13TeV-madgraph") !=-1 : return 0.01428 elif fileName.find("DYJetsToLL_M-1000to1500_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.01636 elif fileName.find("DYJetsToEE_M-50_LTbinned_800To2000_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 0.008352 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-100_MA-15_13TeV-madgraph") !=-1 : return 0.001767 elif fileName.find("DYBJetsToLL_M-50_Zpt-200toInf_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 0.4286 elif fileName.find("TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-90_MA-10_13TeV-madgraph") !=-1 : return 0.0002799 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-30_13TeV-madgraph") !=-1 : return 0.02227 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-15_13TeV-madgraph") !=-1 : return 0.01906 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-15_13TeV-madgraph") !=-1 : return 0.008748 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-15_13TeV-madgraph") !=-1 : return 0.01638 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-15_13TeV-madgraph") !=-1 : return 0.02024 elif fileName.find("DYJetsToLL_M-1to4_HT-200to400_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 85.85 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-100_MA-10_13TeV-madgraph") !=-1 : return 0.002219 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-30_13TeV-madgraph") !=-1 : return 0.01063 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-10_13TeV-madgraph") !=-1 : return 0.006195 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-10_13TeV-madgraph") !=-1 : return 0.01064 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-15_13TeV-madgraph") !=-1 : return 0.014 elif fileName.find("TTToSemiLepton_HT500Njet9_hdampUP_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 4.571 elif fileName.find("DYJetsToLL_M-50_HT-2500toInf_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 0.003468 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5CR2_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("DYJetsToEE_M-50_LTbinned_200To400_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 3.574 elif fileName.find("ST_t-channel_antitop_5f_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 71.74 elif fileName.find("TTZPrimeToMuMu_M-1700_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 9.353e-05 elif fileName.find("TTZPrimeToMuMu_M-2000_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 3.577e-05 elif fileName.find("TTZPrimeToMuMu_M-1600_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.0001325 elif fileName.find("DYJetsToLL_M-50_Zpt-150toInf_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 22.93 elif fileName.find("TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-90_MA-10_13TeV-madgraph") !=-1 : return 0.0002095 elif fileName.find("DYJetsToLL_M-1to4_HT-70to100_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 626.8 elif fileName.find("TTZPrimeToMuMu_M-1300_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.0004131 elif fileName.find("DYJetsToEE_M-50_LTbinned_100To200_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 94.34 elif fileName.find("DYJetsToEE_M-50_LTbinned_400To800_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 0.2005 elif fileName.find("DYJetsToLL_Pt-100To250_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 81.22 elif fileName.find("DYJetsToLL_M-50_HT-800to1200_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 0.8052 elif fileName.find("TTZPrimeToMuMu_M-1500_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.0001903 elif fileName.find("TTZPrimeToMuMu_M-1900_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 4.862e-05 elif fileName.find("TTZPrimeToMuMu_M-1000_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.00154 elif fileName.find("DYJetsToLL_Pt-400To650_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.3882 elif fileName.find("TTZPrimeToMuMu_M-1800_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 6.693e-05 elif fileName.find("TTZPrimeToMuMu_M-1400_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.0002778 elif fileName.find("TTZPrimeToMuMu_M-1200_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.0006259 elif fileName.find("DYJetsToLL_Pt-250To400_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 2.991 elif fileName.find("DYJetsToLL_M-800to1000_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.03047 elif fileName.find("TTToSemiLeptonic_WspTgt150_TuneCUETP8M2T4_13TeV-powheg-pythia8") !=-1 : return 34.49 elif fileName.find("DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_DownPS") !=-1 : return 5735.0 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5CR1_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("DYJetsToLL_Pt-650ToInf_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.03737 elif fileName.find("TTZPrimeToMuMu_M-900_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.002515 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-160_MZ-2_13TeV-madgraph") !=-1 : return 5.559e-05 elif fileName.find("DYJetsToLL_M-700to800_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.03614 elif fileName.find("DYJetsToLL_M-200to400_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 7.77 elif fileName.find("DYJetsToLL_M-400to500_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.4065 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-140_MZ-8_13TeV-madgraph") !=-1 : return 4.225e-05 elif fileName.find("ST_tW_antitop_5f_inclusiveDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 34.97 elif fileName.find("DYJetsToEE_M-50_LTbinned_95To100_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 48.2 elif fileName.find("TTZPrimeToMuMu_M-800_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.004257 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-130_MZ-2_13TeV-madgraph") !=-1 : return 0.000168 elif fileName.find("Test_ZprimeToTT_M-4500_W-45_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 0.000701 elif fileName.find("TTTo2L2Nu_HT500Njet7_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 11.59 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-160_MZ-8_13TeV-madgraph") !=-1 : return 1.365e-05 elif fileName.find("TTTo2L2Nu_TuneCP5CR2_GluonMove_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTZPrimeToMuMu_M-400_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.06842 elif fileName.find("TTToHadronic_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5up_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("TTToHadronic_mtop175p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 633.4 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-110_MZ-5_13TeV-madgraph") !=-1 : return 2.886e-05 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-120_MZ-5_13TeV-madgraph") !=-1 : return 5.067e-05 elif fileName.find("DYJetsToLL_M-500to700_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.2334 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-140_MZ-2_13TeV-madgraph") !=-1 : return 0.0001727 elif fileName.find("TTZPrimeToMuMu_M-300_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.2194 elif fileName.find("DYJetsToLL_Pt-50To100_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 354.8 elif fileName.find("TTToHadronic_mtop171p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 706.1 elif fileName.find("TTZPrimeToMuMu_M-600_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.01409 elif fileName.find("TTZPrimeToMuMu_M-500_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.0287 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-110_MZ-8_13TeV-madgraph") !=-1 : return 1.808e-05 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-100_MZ-2_13TeV-madgraph") !=-1 : return 2.652e-05 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5down_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("TTToHadronic_mtop169p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 746.2 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-130_MZ-5_13TeV-madgraph") !=-1 : return 6.649e-05 elif fileName.find("TTZPrimeToMuMu_M-700_TuneCP5_PSWeights_13TeV-madgraph-pythia8") !=-1 : return 0.007522 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-100_MZ-8_13TeV-madgraph") !=-1 : return 6.686e-06 elif fileName.find("DYJetsToLL_M-50_HT-100to200_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 161.1 elif fileName.find("TTToHadronic_mtop166p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 811.4 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-130_MZ-8_13TeV-madgraph") !=-1 : return 4.106e-05 elif fileName.find("TTToHadronic_mtop173p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 668.6 elif fileName.find("ST_s-channel_4f_hadronicDecays_TuneCP5_13TeV-amcatnlo-pythia8") !=-1 : return 11.24 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-150_MZ-5_13TeV-madgraph") !=-1 : return 5.214e-05 elif fileName.find("DYJetsToLL_M-50_HT-600to800_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 1.743 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-120_MZ-8_13TeV-madgraph") !=-1 : return 3.151e-05 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-150_MZ-2_13TeV-madgraph") !=-1 : return 0.0001319 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-100_MZ-5_13TeV-madgraph") !=-1 : return 1.058e-05 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-140_MZ-5_13TeV-madgraph") !=-1 : return 6.855e-05 elif fileName.find("DYJetsToLL_M-50_HT-200to400_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 48.66 elif fileName.find("BdToPsi2sKst_MuTrkFilter_DGamma0_TuneCP5_13TeV-pythia8-evtgen") !=-1 : return 5942000.0 elif fileName.find("DYJetsToLL_M-100to200_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 226.6 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-120_MZ-2_13TeV-madgraph") !=-1 : return 0.0001282 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-110_MZ-2_13TeV-madgraph") !=-1 : return 7.276e-05 elif fileName.find("TTToHadronic_mtop178p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 584.6 elif fileName.find("DYJetsToLL_M-50_HT-400to600_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 6.968 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-150_MZ-8_13TeV-madgraph") !=-1 : return 3.237e-05 elif fileName.find("ST_s-channel_4f_hadronicDecays_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 11.24 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-160_MZ-5_13TeV-madgraph") !=-1 : return 2.198e-05 elif fileName.find("DYJetsToLL_Zpt-0To50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 5375.0 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-150_MZ-2_13TeV-madgraph") !=-1 : return 0.0001309 elif fileName.find("DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_UpPS") !=-1 : return 6005.0 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-110_MZ-8_13TeV-madgraph") !=-1 : return 1.802e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-140_MZ-2_13TeV-madgraph") !=-1 : return 0.0001729 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-120_MZ-8_13TeV-madgraph") !=-1 : return 3.146e-05 elif fileName.find("tZq_nunu_4f_ckm_NLO_TuneCP5_PSweights_13TeV-madgraph-pythia8") !=-1 : return 0.1337 elif fileName.find("DYJetsToEE_M-50_LTbinned_90To95_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 167.3 elif fileName.find("DYJetsToEE_M-50_LTbinned_80To85_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 159.9 elif fileName.find("DYJetsToEE_M-50_LTbinned_75To80_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 134.6 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5CR2_GluonMove_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-160_MZ-2_13TeV-madgraph") !=-1 : return 5.542e-05 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-90_MZ-8_13TeV-madgraph") !=-1 : return 9.926e-07 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-90_MZ-5_13TeV-madgraph") !=-1 : return 1.652e-06 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-140_MZ-5_13TeV-madgraph") !=-1 : return 6.851e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-110_MZ-2_13TeV-madgraph") !=-1 : return 7.265e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-140_MZ-8_13TeV-madgraph") !=-1 : return 4.231e-05 elif fileName.find("DYJetsToEE_M-50_LTbinned_85To90_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 229.4 elif fileName.find("TTToSemilepton_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8") !=-1 : return 320.1 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-150_MZ-8_13TeV-madgraph") !=-1 : return 3.234e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-160_MZ-5_13TeV-madgraph") !=-1 : return 2.212e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-160_MZ-8_13TeV-madgraph") !=-1 : return 1.364e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-130_MZ-8_13TeV-madgraph") !=-1 : return 4.116e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-100_MZ-5_13TeV-madgraph") !=-1 : return 1.06e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-100_MZ-2_13TeV-madgraph") !=-1 : return 2.654e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-150_MZ-5_13TeV-madgraph") !=-1 : return 5.234e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-110_MZ-5_13TeV-madgraph") !=-1 : return 2.894e-05 elif fileName.find("TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-90_MZ-2_13TeV-madgraph") !=-1 : return 4.124e-06 elif fileName.find("ST_tW_DS_top_5f_inclusiveDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 33.67 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-120_MZ-5_13TeV-madgraph") !=-1 : return 5.064e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-120_MZ-2_13TeV-madgraph") !=-1 : return 0.0001276 elif fileName.find("TTTo2L2Nu_TuneCP5CR1_QCDbased_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-130_MZ-2_13TeV-madgraph") !=-1 : return 0.0001671 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-100_MZ-8_13TeV-madgraph") !=-1 : return 6.706e-06 elif fileName.find("DYJetsToLL_M-50_HT-70to100_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 146.7 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-130_MZ-5_13TeV-madgraph") !=-1 : return 6.66e-05 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-90_MZ-2_13TeV-madgraph") !=-1 : return 4.126e-06 elif fileName.find("TTToSemiLeptonic_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYToMuMu_M-4500To6000_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 3.566e-07 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5_13TeV-amcatnlo-pythia8") !=-1 : return 3.74 elif fileName.find("DYJetsToLL_M-50_HT-40to70_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 311.4 elif fileName.find("DYToMuMu_M-3500To4500_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 3.317e-06 elif fileName.find("DYToMuMu_M-2300To3500_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 7.34e-05 elif fileName.find("ST_s-channel_4f_leptonDecays_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 3.74 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-90_MZ-8_13TeV-madgraph") !=-1 : return 9.872e-07 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5up_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("DY1JetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 730.3 elif fileName.find("DY2JetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 387.4 elif fileName.find("DYJetsToEE_M-50_LTbinned_5To75_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 866.2 elif fileName.find("TTToHplusToWZprime_WToENu_ZToMuMu_MH-90_MZ-5_13TeV-madgraph") !=-1 : return 1.655e-06 elif fileName.find("DYJetsToLL_M-10to50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 18810.0 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5CR1_QCDbased_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("DYJetsToEE_M-50_LTbinned_0To75_5f_LO_13TeV-madgraph_pythia8") !=-1 : return 948.2 elif fileName.find("TTToHadronic_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.0 elif fileName.find("TTJets_SingleLeptFromTbar_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 108.7 elif fileName.find("TTTo2L2Nu_HT500Njet7_hdampDOWN_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 10.58 elif fileName.find("DY3JetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 95.02 elif fileName.find("TTTo2L2Nu_HT500Njet7_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 11.37 elif fileName.find("DY4JetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 36.71 elif fileName.find("TTZJetsToQQ_Dilept_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 0.0568 elif fileName.find("DYJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-herwigpp_30M") !=-1 : return 14240.0 elif fileName.find("DYToMuMu_M-1400To2300_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 0.001178 elif fileName.find("DYJetsToLL_M-1500to2000_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.002367 elif fileName.find("TTJets_DiLept_genMET-150_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 3.655 elif fileName.find("TTTo2L2Nu_mtop166p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 811.4 elif fileName.find("TTToSemiLepton_HT500Njet9_TuneCP5down_13TeV-powheg-pythia8") !=-1 : return 4.216 elif fileName.find("tZq_ll_4f_ckm_NLO_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 0.07358 elif fileName.find("DYToMuMu_M-800To1400_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 0.01437 elif fileName.find("DYJetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 16270.0 elif fileName.find("TTTo2L2Nu_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("QCD_HT1500to2000_BGenFilter_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 13.61 elif fileName.find("DYToMuMu_M-6000ToInf_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 1.576e-08 elif fileName.find("TTToSemiLeptonic_TuneCP5CR2_GluonMove_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("QCD_HT1000to1500_BGenFilter_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 138.2 elif fileName.find("DYJetsToLL_M-2000to3000_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.0005409 elif fileName.find("TTTo2L2Nu_mtop173p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 668.6 elif fileName.find("DYJetsToLL_M-10to50_TuneCUETP8M1_14TeV-madgraphMLM-pythia8") !=-1 : return 17230.0 elif fileName.find("TTTo2L2Nu_mtop169p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 746.2 elif fileName.find("TTTo2L2Nu_mtop175p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 633.4 elif fileName.find("DYJetsToLL_M-1000to1500_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.01828 elif fileName.find("TTTo2L2Nu_mtop178p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 584.6 elif fileName.find("TTTo2L2Nu_mtop171p5_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 706.1 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-15_13TeV-madgraph") !=-1 : return 0.01533 elif fileName.find("QCD_HT2000toInf_BGenFilter_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 2.92 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-20_13TeV-madgraph") !=-1 : return 0.004946 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-10_13TeV-madgraph") !=-1 : return 0.003822 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-25_13TeV-madgraph") !=-1 : return 0.00815 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-30_13TeV-madgraph") !=-1 : return 0.01965 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-25_13TeV-madgraph") !=-1 : return 0.0186 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-10_13TeV-madgraph") !=-1 : return 0.01061 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-20_13TeV-madgraph") !=-1 : return 0.01191 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-30_13TeV-madgraph") !=-1 : return 0.0009769 elif fileName.find("DYJetsToLL_Pt-650ToInf_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.04796 elif fileName.find("DYToEE_M-3500To4500_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 3.327e-06 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-100_MA-15_13TeV-madgraph") !=-1 : return 0.001117 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-15_13TeV-madgraph") !=-1 : return 0.004958 elif fileName.find("TTToSemiLeptonic_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-25_13TeV-madgraph") !=-1 : return 0.02274 elif fileName.find("DYJetsToLL_Pt-250To400_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 3.774 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-20_13TeV-madgraph") !=-1 : return 0.01947 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-35_13TeV-madgraph") !=-1 : return 0.005199 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-10_13TeV-madgraph") !=-1 : return 0.003564 elif fileName.find("TTTo2L2Nu_HT500Njet7_hdampUP_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 12.39 elif fileName.find("DYJetsToLL_M-800to1000_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.03406 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-30_13TeV-madgraph") !=-1 : return 0.009303 elif fileName.find("DYJetsToLL_M-3000toInf_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 3.048e-05 elif fileName.find("ST_tW_top_5f_inclusiveDecays_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 34.91 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-30_13TeV-madgraph") !=-1 : return 0.009536 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-35_13TeV-madgraph") !=-1 : return 0.01695 elif fileName.find("DYToMuMu_M-200To400_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 2.342 elif fileName.find("DYJetsToLL_Pt-400To650_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.5164 elif fileName.find("BdToXKst_MuTrkFilter_DGamma0_TuneCP5_13TeV-pythia8-evtgen") !=-1 : return 7990000.0 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-35_13TeV-madgraph") !=-1 : return 0.02178 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-10_13TeV-madgraph") !=-1 : return 0.008312 elif fileName.find("DYToEE_M-4500To6000_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 3.551e-07 elif fileName.find("DYToEE_M-2300To3500_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 7.405e-05 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-30_13TeV-madgraph") !=-1 : return 0.02451 elif fileName.find("TTToSemiLeptonic_TuneCP5CR1_QCDbased_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-30_13TeV-madgraph") !=-1 : return 0.02076 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-15_13TeV-madgraph") !=-1 : return 0.01426 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-25_13TeV-madgraph") !=-1 : return 0.003278 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-15_13TeV-madgraph") !=-1 : return 0.01005 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-35_13TeV-madgraph") !=-1 : return 0.01012 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-10_13TeV-madgraph") !=-1 : return 0.007271 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-35_13TeV-madgraph") !=-1 : return 0.02426 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-25_13TeV-madgraph") !=-1 : return 0.01975 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-10_13TeV-madgraph") !=-1 : return 0.01005 elif fileName.find("QCD_HT700to1000_BGenFilter_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 721.8 elif fileName.find("DYToEE_M-1400To2300_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 0.001177 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-100_MA-20_13TeV-madgraph") !=-1 : return 0.0004878 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-20_13TeV-madgraph") !=-1 : return 0.01767 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-20_13TeV-madgraph") !=-1 : return 0.01555 elif fileName.find("DYJetsToLL_Pt-100To250_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 96.8 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-15_13TeV-madgraph") !=-1 : return 0.005209 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-20_13TeV-madgraph") !=-1 : return 0.006725 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-100_MA-10_13TeV-madgraph") !=-1 : return 0.001144 elif fileName.find("TTJets_DiLept_genMET-80_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 22.45 elif fileName.find("DYJetsToLL_M-1to10_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 173100.0 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5_PSweights_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-15_13TeV-madgraph") !=-1 : return 0.01206 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-25_13TeV-madgraph") !=-1 : return 0.01188 elif fileName.find("DYToMuMu_M-400To800_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 0.2084 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-100_MA-15_13TeV-madgraph") !=-1 : return 0.001121 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-15_13TeV-madgraph") !=-1 : return 0.005207 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-35_13TeV-madgraph") !=-1 : return 0.02177 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-10_13TeV-madgraph") !=-1 : return 0.003565 elif fileName.find("QCD_HT500to700_BGenFilter_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 3078.0 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-100_MA-10_13TeV-madgraph") !=-1 : return 0.001146 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-25_13TeV-madgraph") !=-1 : return 0.003271 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-20_13TeV-madgraph") !=-1 : return 0.01949 elif fileName.find("DYJetsToLL_M-500to700_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.2558 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-30_13TeV-madgraph") !=-1 : return 0.0009777 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-30_13TeV-madgraph") !=-1 : return 0.0196 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-25_13TeV-madgraph") !=-1 : return 0.01853 elif fileName.find("TTToSemiLepton_HT500Njet9_TuneCP5up_13TeV-powheg-pythia8") !=-1 : return 4.281 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-10_13TeV-madgraph") !=-1 : return 0.01066 elif fileName.find("TTToHplusToWA_WToMuNu_AToMuMu_MH-90_MA-10_13TeV-madgraph") !=-1 : return 0.000107 elif fileName.find("TTTo2L2Nu_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.0 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-25_13TeV-madgraph") !=-1 : return 0.01975 elif fileName.find("TTToSemiLeptonic_widthx1p15_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-30_13TeV-madgraph") !=-1 : return 0.009525 elif fileName.find("ST_tWnunu_5f_LO_TuneCP5_PSweights_13TeV-madgraph-pythia8") !=-1 : return 0.02099 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-10_13TeV-madgraph") !=-1 : return 0.008305 elif fileName.find("QCD_HT200to300_BGenFilter_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 111700.0 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-15_13TeV-madgraph") !=-1 : return 0.01205 elif fileName.find("QCD_HT100to200_BGenFilter_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 1275000.0 elif fileName.find("DYJetsToLL_Pt-50To100_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 407.9 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-35_13TeV-madgraph") !=-1 : return 0.01689 elif fileName.find("DYJetsToLL_M-200to400_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 8.502 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-20_13TeV-madgraph") !=-1 : return 0.006756 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-30_13TeV-madgraph") !=-1 : return 0.00934 elif fileName.find("DYJetsToLL_M-700to800_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.04023 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-35_13TeV-madgraph") !=-1 : return 0.01011 elif fileName.find("DY4JetsToTauTau_M-50_TuneCUETP8M1_13TeV-madgraph-pythia8") !=-1 : return 18.17 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-15_13TeV-madgraph") !=-1 : return 0.01429 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-15_13TeV-madgraph") !=-1 : return 0.01007 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-20_13TeV-madgraph") !=-1 : return 0.004962 elif fileName.find("DY2JetsToTauTau_M-50_TuneCUETP8M1_13TeV-madgraph-pythia8") !=-1 : return 111.1 elif fileName.find("DYToEE_M-800To1400_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 0.01445 elif fileName.find("DY3JetsToTauTau_M-50_TuneCUETP8M1_13TeV-madgraph-pythia8") !=-1 : return 34.04 elif fileName.find("DYJetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8_Fall17") !=-1 : return 5350.0 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-10_13TeV-madgraph") !=-1 : return 0.007278 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-30_13TeV-madgraph") !=-1 : return 0.02073 elif fileName.find("DYJetsToLL_M-400to500_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 0.4514 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-20_13TeV-madgraph") !=-1 : return 0.01554 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-15_13TeV-madgraph") !=-1 : return 0.01535 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-25_13TeV-madgraph") !=-1 : return 0.008158 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-10_13TeV-madgraph") !=-1 : return 0.003828 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-20_13TeV-madgraph") !=-1 : return 0.0177 elif fileName.find("DYToEE_M-6000ToInf_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 1.585e-08 elif fileName.find("TTToSemiLeptonic_widthx0p85_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-25_13TeV-madgraph") !=-1 : return 0.0119 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-20_13TeV-madgraph") !=-1 : return 0.0119 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-15_13TeV-madgraph") !=-1 : return 0.004967 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-25_13TeV-madgraph") !=-1 : return 0.02275 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-10_13TeV-madgraph") !=-1 : return 0.009985 elif fileName.find("TTJets_SingleLeptFromT_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 109.6 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-100_MA-20_13TeV-madgraph") !=-1 : return 0.0004875 elif fileName.find("QCD_HT300to500_BGenFilter_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 27960.0 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-35_13TeV-madgraph") !=-1 : return 0.02431 elif fileName.find("DYJetsToLL_M-100to200_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 247.8 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-35_13TeV-madgraph") !=-1 : return 0.00514 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-30_13TeV-madgraph") !=-1 : return 0.02449 elif fileName.find("DY2JetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 334.7 elif fileName.find("TTToSemiLeptonic_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DY3JetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 102.3 elif fileName.find("DY1JetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 1012.0 elif fileName.find("DY4JetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 54.52 elif fileName.find("TTToLL_MLL_1200To1800_TuneCUETP8M1_13TeV-powheg-pythia8") !=-1 : return 76.63 elif fileName.find("TTToSemiLeptonic_TuneCP2_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8") !=-1 : return 5941.0 elif fileName.find("TTToHplusToWA_WToENu_AToMuMu_MH-90_MA-10_13TeV-madgraph") !=-1 : return 0.000107 elif fileName.find("TTToSemiLeptonic_mtop166p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 811.4 elif fileName.find("TTToSemiLeptonic_widthx1p3_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToSemiLeptonic_mtop173p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 668.6 elif fileName.find("TTToSemiLeptonic_mtop178p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 584.6 elif fileName.find("DYBJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 70.08 elif fileName.find("TTTo2L2Nu_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8") !=-1 : return 76.7 elif fileName.find("DYToEE_M-200To400_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 2.341 elif fileName.find("TTToSemiLeptonic_hdampDOWN_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToSemiLeptonic_mtop169p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 746.2 elif fileName.find("TTToSemiLeptonic_mtop171p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 706.1 elif fileName.find("TTToSemiLeptonic_widthx0p7_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYToEE_M-400To800_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8") !=-1 : return 0.208 elif fileName.find("TTToHadronic_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTWJetsToLNu_TuneCP5_13TeV-amcatnloFXFX-madspin-pythia8") !=-1 : return 0.2149 elif fileName.find("TTToSemiLeptonic_mtop175p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 633.4 elif fileName.find("DYJetsToLL_M-50_TuneCUETHS1_13TeV-madgraphMLM-herwigpp") !=-1 : return 358.6 elif fileName.find("TTToLL_MLL_1800ToInf_TuneCUETP8M1_13TeV-powheg-pythia8") !=-1 : return 76.63 elif fileName.find("TTToHadronic_TuneCP5CR2_GluonMove_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYJetsToLL_Pt-0To50_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 106300.0 elif fileName.find("DYJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8") !=-1 : return 4963.0 elif fileName.find("TTWJetsToQQ_TuneCP5_13TeV-amcatnloFXFX-madspin-pythia8") !=-1 : return 0.4316 elif fileName.find("TTToSemiLepton_HT500Njet9_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 4.239 elif fileName.find("ST_tWll_5f_LO_TuneCP5_PSweights_13TeV-madgraph-pythia8") !=-1 : return 0.01103 elif fileName.find("TTToLL_MLL_800To1200_TuneCUETP8M1_13TeV-powheg-pythia8") !=-1 : return 76.63 elif fileName.find("Test_BulkGravToWW_narrow_M-4000_13TeV_TuneCP5-madgraph") !=-1 : return 4.543e-05 elif fileName.find("TTJets_HT-1200to2500_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 0.1316 elif fileName.find("tZq_W_lept_Z_hadron_4f_ckm_NLO_13TeV_amcatnlo_pythia8") !=-1 : return 0.1573 elif fileName.find("DYJetsToLL_M-10to50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 15810 elif fileName.find("ttHTobb_ttToSemiLep_M125_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 0.5418 elif fileName.find("TTJets_HT-2500toInf_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 0.001407 elif fileName.find("TTTo2L2Nu_HT500Njet7_TuneCP5down_13TeV-powheg-pythia8") !=-1 : return 11.38 elif fileName.find("TTToHadronic_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTJets_HT-800to1200_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 0.7532 elif fileName.find("TTToSemiLeptonic_hdampUP_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.0 elif fileName.find("TTToLL_MLL_500To800_TuneCUETP8M1_13TeV-powheg-pythia8") !=-1 : return 76.63 elif fileName.find("TTToHadronic_TuneCP5CR1_QCDbased_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTTo2L2Nu_TuneCP5down_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTZPrimeToMuMu_M-1800_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 6.694e-05 elif fileName.find("TTZPrimeToMuMu_M-1600_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.0001324 elif fileName.find("TTZPrimeToMuMu_M-1200_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.0006278 elif fileName.find("ST_t-channel_antitop_5f_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 82.52 elif fileName.find("TTZPrimeToMuMu_M-1500_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.0001899 elif fileName.find("TTZPrimeToMuMu_M-1700_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 9.354e-05 elif fileName.find("TTJets_HT-600to800_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 1.821 elif fileName.find("TTZPrimeToMuMu_M-1000_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.001539 elif fileName.find("ST_t-channel_eleDecays_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 24.85 elif fileName.find("ST_t-channel_tauDecays_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 24.7 elif fileName.find("DYJetsToLL_M-5to50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 81880.0 elif fileName.find("TTZPrimeToMuMu_M-2000_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.001539 elif fileName.find("TTZPrimeToMuMu_M-1400_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.0002776 elif fileName.find("TTZPrimeToMuMu_M-1300_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.0004127 elif fileName.find("TTZPrimeToMuMu_M-1900_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 4.857e-05 elif fileName.find("TTToHadronic_hdampDOWN_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHadronic_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTZPrimeToMuMu_M-600_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.01408 elif fileName.find("TTToHadronic_mtop169p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 746.2 elif fileName.find("TTZPrimeToMuMu_M-300_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.22 elif fileName.find("TTToSemiLeptonic_TuneCP5_erdON_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5down_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("ST_t-channel_muDecays_13TeV-comphep-pythia8_TuneCP5") !=-1 : return 24.72 elif fileName.find("TTToHadronic_mtop171p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 706.1 elif fileName.find("TTZPrimeToMuMu_M-400_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.0684 elif fileName.find("DYBBJetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 14.49 elif fileName.find("TTToHadronic_mtop166p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 811.4 elif fileName.find("ttHTobb_ttTo2L2Nu_M125_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 0.5418 elif fileName.find("TTTo2L2Nu_HT500Njet7_TuneCP5up_13TeV-powheg-pythia8") !=-1 : return 11.43 elif fileName.find("TTZPrimeToMuMu_M-900_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.002517 elif fileName.find("TTToHadronic_mtop178p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 584.6 elif fileName.find("TTToHadronic_mtop173p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 668.6 elif fileName.find("TTZPrimeToMuMu_M-700_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.007514 elif fileName.find("TTZPrimeToMuMu_M-500_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.02871 elif fileName.find("TTZPrimeToMuMu_M-800_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.004255 elif fileName.find("TTTo2L2Nu_TuneCP5CR2_GluonMove_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHadronic_mtop175p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 633.4 elif fileName.find("TTTo2L2Nu_noSC_TuneCUETP8M2T4_13TeV-powheg-pythia8") !=-1 : return 76.7 elif fileName.find("DY1JetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 877.8 elif fileName.find("DYJetsToLL_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 6529.0 elif fileName.find("QCD_HT1000to1500_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 1092.0 elif fileName.find("DY4JetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 44.03 elif fileName.find("TTTo2L2Nu_TuneCP5up_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("QCD_HT1500to2000_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 99.76 elif fileName.find("TTTo2L2Nu_TuneCP5CR1_QCDbased_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DY3JetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 111.5 elif fileName.find("DY2JetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 304.4 elif fileName.find("TTToHadrons_mtop178p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 584.6 elif fileName.find("DYJetsToQQ_HT180_13TeV_TuneCP5-madgraphMLM-pythia8") !=-1 : return 1728.0 elif fileName.find("DYJetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 5343.0 elif fileName.find("QCD_HT2000toInf_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 20.35 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5up_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("TTTo2L2Nu_widthx1p15_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYTo2Mu_M1300_CUETP8M1_13TeV_Pythia8_Corrected-v3") !=-1 : return 0.001656 elif fileName.find("DYJetsToLL_M-50_TuneCH3_13TeV-madgraphMLM-herwig7") !=-1 : return 9.402 elif fileName.find("TTTo2L2Nu_HT500Njet7_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 11.28 elif fileName.find("DYJetsToEE_M-50_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 1795.0 elif fileName.find("QCD_HT700to1000_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 6344.0 elif fileName.find("TTToSemiLeptonic_TuneCP5down_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYJetsToLL_M-50_TuneCP2_13TeV-madgraphMLM-pythia8") !=-1 : return 4878.0 elif fileName.find("DYJetsToLL_M-50_TuneCP1_13TeV-madgraphMLM-pythia8") !=-1 : return 4661.0 elif fileName.find("TTToHadronic_hdampUP_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.0 elif fileName.find("TTTo2L2Nu_widthx0p85_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYTo2E_M1300_CUETP8M1_13TeV_Pythia8_Corrected-v3") !=-1 : return 0.001661 elif fileName.find("DYTo2Mu_M800_CUETP8M1_13TeV_Pythia8_Corrected-v3") !=-1 : return 0.01419 elif fileName.find("TTTo2L2Nu_TuneCP5_PSweights_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYTo2Mu_M300_CUETP8M1_13TeV_Pythia8_Corrected-v3") !=-1 : return 0.5658 elif fileName.find("TTTo2L2Nu_mtop175p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 633.4 elif fileName.find("TTTo2L2Nu_mtop169p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 746.2 elif fileName.find("DYJetsToLL_1J_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 955.8 elif fileName.find("QCD_HT300to500_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 323400.0 elif fileName.find("DYToEE_M-50_NNPDF31_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 2137.0 elif fileName.find("TTTo2L2Nu_mtop173p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 668.6 elif fileName.find("TTTo2L2Nu_hdampDOWN_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYJetsToLL_0J_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 5313.0 elif fileName.find("DYJetsToLL_2J_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 360.4 elif fileName.find("TTTo2L2Nu_mtop178p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 584.6 elif fileName.find("TTTo2L2Nu_mtop171p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 706.1 elif fileName.find("QCD_HT200to300_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 1551000.0 elif fileName.find("TTTo2L2Nu_widthx0p7_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("QCD_HT500to700_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 30140.0 elif fileName.find("TTTo2L2Nu_mtop166p5_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 811.4 elif fileName.find("ST_t-channel_top_5f_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 119.7 elif fileName.find("TTTo2L2Nu_widthx1p3_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("QCD_HT100to200_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 23590000.0 elif fileName.find("QCD_HT50to100_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 185300000.0 elif fileName.find("TTZToLLNuNu_M-10_TuneCP5_13TeV-amcatnlo-pythia8") !=-1 : return 0.2432 elif fileName.find("TTToSemiLeptonic_TuneCP5up_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTJets_DiLept_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 54.23 elif fileName.find("QCD_HT1000to1500_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 1088.0 elif fileName.find("TTToHadronic_TuneCP5_erdON_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToLL_MLL_500To800_41to65_NNPDF31_13TeV-powheg") !=-1 : return 687.1 elif fileName.find("QCD_HT1500to2000_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 99.11 elif fileName.find("TTZToLL_M-1to10_TuneCP5_13TeV-amcatnlo-pythia8") !=-1 : return 0.05324 elif fileName.find("TTTo2L2Nu_hdampUP_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.0 elif fileName.find("QCD_HT700to1000_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 6334.0 elif fileName.find("QCD_HT2000toInf_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 20.23 elif fileName.find("ST_tWlnuZ_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.001267 elif fileName.find("TTToLL_MLL_500To800_0to20_NNPDF31_13TeV-powheg") !=-1 : return 687.1 elif fileName.find("W4JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 544.3 elif fileName.find("QCD_HT300to500_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 322600.0 elif fileName.find("W2JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 2793.0 elif fileName.find("TTZZTo4b_5f_LO_TuneCP5_13TeV_madgraph_pythia8") !=-1 : return 0.001385 elif fileName.find("TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("W3JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 992.5 elif fileName.find("QCD_HT500to700_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 29980.0 elif fileName.find("QCD_HT200to300_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 1547000.0 elif fileName.find("W1JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 8873.0 elif fileName.find("TTToHadronic_TuneCP5down_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("QCD_HT100to200_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 23700000.0 elif fileName.find("ST_tWqqZ_5f_LO_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.001122 elif fileName.find("DYToMuMu_pomflux_Pt-30_TuneCP5_13TeV-pythia8") !=-1 : return 4.219 elif fileName.find("WJetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 52940.0 elif fileName.find("TTTo2L2Nu_TuneCP5_erdON_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTToHadronic_TuneCP5up_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTTo2L2Nu_TuneCUETP8M1_14TeV-powheg-pythia8") !=-1 : return 90.75 elif fileName.find("TTToLL_MLL_1200To1800_NNPDF31_13TeV-powheg") !=-1 : return 687.1 elif fileName.find("TTTo2L2Nu_TuneCP5down_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYJetsToQQ_HT180_13TeV-madgraphMLM-pythia8") !=-1 : return 1208.0 elif fileName.find("tZq_ll_4f_scaledown_13TeV-amcatnlo-pythia8") !=-1 : return 0.0758 elif fileName.find("TTToLL_MLL_1800ToInf_NNPDF31_13TeV-powheg") !=-1 : return 687.1 elif fileName.find("TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8") !=-1 : return 722.8 elif fileName.find("ttZJets_TuneCP5_13TeV_madgraphMLM_pythia8") !=-1 : return 0.5407 elif fileName.find("TTToHadronic_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("tZq_ll_4f_ckm_NLO_13TeV-amcatnlo-herwigpp") !=-1 : return 0.07579 elif fileName.find("ttWJets_TuneCP5_13TeV_madgraphMLM_pythia8") !=-1 : return 0.4611 elif fileName.find("TTToLL_MLL_800To1200_NNPDF31_13TeV-powheg") !=-1 : return 687.1 elif fileName.find("tZq_ll_4f_scaleup_13TeV-amcatnlo-pythia8") !=-1 : return 0.0758 elif fileName.find("DYToEE_M-50_NNPDF31_13TeV-powheg-pythia8") !=-1 : return 2137.0 elif fileName.find("TTJets_TuneCP5_13TeV-madgraphMLM-pythia8") !=-1 : return 496.1 elif fileName.find("DYToLL-M-50_3J_14TeV-madgraphMLM-pythia8") !=-1 : return 191.7 elif fileName.find("DYToLL-M-50_0J_14TeV-madgraphMLM-pythia8") !=-1 : return 3676.0 elif fileName.find("TTTo2L2Nu_TuneCP5up_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("DYToLL-M-50_1J_14TeV-madgraphMLM-pythia8") !=-1 : return 1090.0 elif fileName.find("DYToLL-M-50_2J_14TeV-madgraphMLM-pythia8") !=-1 : return 358.7 elif fileName.find("TTZToQQ_TuneCP5_13TeV-amcatnlo-pythia8") !=-1 : return 0.5104 elif fileName.find("TTTo2L2Nu_TuneCP5_13TeV-powheg-pythia8") !=-1 : return 687.1 elif fileName.find("TTZToBB_TuneCP5_13TeV-amcatnlo-pythia8") !=-1 : return 0.1118 elif fileName.find("DYToLL_M_1_TuneCUETP8M1_13TeV_pythia8") !=-1 : return 19670.0 elif fileName.find("DYToLL_2J_13TeV-amcatnloFXFX-pythia8") !=-1 : return 340.5 elif fileName.find("DYToLL_0J_13TeV-amcatnloFXFX-pythia8") !=-1 : return 4757.0 elif fileName.find("DYTo2Mu_M1300_CUETP8M1_13TeV-pythia8") !=-1 : return 78420000000.0 elif fileName.find("TTWZ_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.002441 elif fileName.find("TTWW_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.006979 elif fileName.find("TTZZ_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.001386 elif fileName.find("DYTo2Mu_M300_CUETP8M1_13TeV-pythia8") !=-1 : return 78390000000.0 elif fileName.find("TTZH_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.00113 elif fileName.find("TTTW_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.0007314 elif fileName.find("DYTo2E_M1300_CUETP8M1_13TeV-pythia8") !=-1 : return 78390000000.0 elif fileName.find("DYTo2Mu_M800_CUETP8M1_13TeV-pythia8") !=-1 : return 78420000000.0 elif fileName.find("TTWH_TuneCP5_13TeV-madgraph-pythia8") !=-1 : return 0.001141 elif fileName.find("WZ_TuneCP5_PSweights_13TeV-pythia8") !=-1 : return 27.52 elif fileName.find("WWZ_TuneCP5_13TeV-amcatnlo-pythia8") !=-1 : return 0.1676 elif fileName.find("DYTo2E_M800_CUETP8M1_13TeV-pythia8") !=-1 : return 78420000000.0 elif fileName.find("WW_TuneCP5_PSweights_13TeV-pythia8") !=-1 : return 76.15 elif fileName.find("ZZZ_TuneCP5_13TeV-amcatnlo-pythia8") !=-1 : return 0.01398 elif fileName.find("DYTo2E_M300_CUETP8M1_13TeV-pythia8") !=-1 : return 78420000000.0 elif fileName.find("WZZ_TuneCP5_13TeV-amcatnlo-pythia8") !=-1 : return 0.05565 elif fileName.find("tZq_ll_4f_13TeV-amcatnlo-herwigpp") !=-1 : return 0.0758 elif fileName.find("tZq_ll_4f_13TeV-amcatnlo-pythia8") !=-1 : return 0.0758 elif fileName.find("DYToLL_M-50_14TeV_pythia8_pilot1") !=-1 : return 4927.0 elif fileName.find("DYToLL_M-50_14TeV_pythia8") !=-1 : return 4963.0 elif fileName.find("WZ_TuneCP5_13TeV-pythia8") !=-1 : return 27.6 elif fileName.find("ZZ_TuneCP5_13TeV-pythia8") !=-1 : return 12.14 elif fileName.find("WW_TuneCP5_13TeV-pythia8") !=-1 : return 75.8 elif fileName.find("DYJetsToLL_Pt-100To250") !=-1 : return 84.014804 elif fileName.find("DYJetsToLL_Pt-400To650") !=-1 : return 0.436041144 elif fileName.find("DYJetsToLL_Pt-650ToInf") !=-1 : return 0.040981055 elif fileName.find("DYJetsToLL_Pt-250To400") !=-1 : return 3.228256512 elif fileName.find("DYJetsToLL_Pt-50To100") !=-1 : return 363.81428 elif fileName.find("DYJetsToLL_Zpt-0To50") !=-1 : return 5352.57924 elif fileName.find("TTToSemiLeptonic") !=-1 : return 365.34 elif fileName.find("TTToHadronic") !=-1 : return 377.96 elif fileName.find("TTJetsFXFX") !=-1 : return 831.76 elif fileName.find("TTTo2L2Nu") !=-1 : return 88.29 elif fileName.find("DYToLL_0J") !=-1 : return 4620.519036 elif fileName.find("DYToLL_2J") !=-1 : return 338.258531 elif fileName.find("DYToLL_1J") !=-1 : return 859.589402 elif fileName.find("SingleMuon")!=-1 or fileName.find("SingleElectron") !=-1 or fileName.find("JetHT") !=-1 or fileName.find("MET") !=-1 or fileName.find("MTHT") !=-1: return 1. else: print("Cross section not defined! Returning 0 and skipping sample:\n{}\n".format(fileName)) return 0
def get_x_section(fileName): file_name = fileName.replace('PSWeights_', '') file_name = fileName.replace('5f_InclusiveDecays_', '5f_') file_name = fileName.replace('tZq_ll_4f_ckm_NLO_TuneCP5_13TeV-amcatnlo-pythia8', 'tZq_ll_4f_ckm_NLO_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') if fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8') != -1: return 70.89 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_mtop1735_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8') != -1: return 68.45 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8') != -1: return 69.66 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8') != -1: return 116.1 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_mtop1755_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8') != -1: return 112.5 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8') != -1: return 118.0 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5_PSweights_13TeV-amcatnlo-pythia8_correctnPartonsInBorn') != -1: return 3.74 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_mtop1735_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8') != -1: return 114.4 elif fileName.find('ST_t-channel_antitop_4f_hdampdown_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 67.91 elif fileName.find('ST_tW_antitop_5f_hdampdown_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.99 elif fileName.find('ST_t-channel_antitop_4f_hdampdown_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8') != -1: return 69.09 elif fileName.find('ST_t-channel_antitop_4f_hdampup_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 67.91 elif fileName.find('ST_tW_antitop_5f_hdampup_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.96 elif fileName.find('DYJetsToLL_BGenFilter_Zpt-100to200_M-50_TuneCP5_13TeV-madgraphMLM-pythia8_newgridpack') != -1: return 2.678 elif fileName.find('DYJetsToLL_BGenFilter_Zpt-200toInf_M-50_TuneCP5_13TeV-madgraphMLM-pythia8_newgridpack') != -1: return 0.3909 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5_erdON_PSweights_13TeV-powheg-pythia8') != -1: return 67.91 elif fileName.find('ST_t-channel_antitop_5f_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8_vtd_vts_decay') != -1: return 82.52 elif fileName.find('ST_t-channel_antitop_4f_hdampup_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8') != -1: return 69.09 elif fileName.find('ST_t-channel_top_4f_hdampdown_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 113.3 elif fileName.find('ST_tW_top_5f_hdampdown_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.92 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5_erdON_PSweights_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_t-channel_antitop_5f_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8_vtd_vts_prod') != -1: return 225.5 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 67.91 elif fileName.find('ST_t-channel_top_4f_hdampup_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 113.3 elif fileName.find('ST_t-channel_top_4f_hdampdown_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8') != -1: return 115.3 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5_erdON_13TeV-powheg-madspin-pythia8') != -1: return 69.09 elif fileName.find('ST_tW_top_5f_hdampup_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.9 elif fileName.find('DYJetsToTauTau_ForcedMuEleDecay_M-50_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8') != -1: return 6505.0 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5CR1_PSweights_13TeV-powheg-pythia8') != -1: return 67.91 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('DYJetsToTauTau_ForcedMuEleDecay_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_ext1') != -1: return 1991.0 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5CR2_PSweights_13TeV-powheg-pythia8') != -1: return 67.91 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 36.65 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_mtop1735_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.44 elif fileName.find('ST_t-channel_top_4f_hdampup_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8') != -1: return 115.3 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5CR1_PSweights_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 67.91 elif fileName.find('ST_t-channel_top_5f_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8_vtd_vts_decay') != -1: return 138.1 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_mtop1755_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 33.4 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5_erdON_PSweights_13TeV-powheg-pythia8') != -1: return 113.3 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 35.52 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5down_13TeV-powheg-madspin-pythia8') != -1: return 69.09 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5CR2_PSweights_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_tW_antitop_5f_DS_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 35.25 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5CR2_13TeV-powheg-madspin-pythia8') != -1: return 69.09 elif fileName.find('ST_t-channel_top_5f_TuneCP5_PSweights_13TeV-powheg-madspin-pythia8_vtd_vts_prod') != -1: return 547.2 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5_PSweights_correctnPartonsInBorn_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5_erdON_PSweights_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5CR1_13TeV-powheg-madspin-pythia8') != -1: return 69.09 elif fileName.find('DYJetsToLL_BGenFilter_Zpt-200toInf_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 0.5082 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5_erdON_13TeV-powheg-madspin-pythia8') != -1: return 115.3 elif fileName.find('TTWJetsToLNu_TuneCP5CR2_GluonMove_PSweights_13TeV-amcatnloFXFX-madspin-pythia8') != -1: return 0.2183 elif fileName.find('ST_s-channel_4f_leptonDecays_mtop1715_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 3.824 elif fileName.find('ST_s-channel_4f_leptonDecays_mtop1755_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 3.506 elif fileName.find('ST_s-channel_4f_leptonDecays_mtop1695_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 3.991 elif fileName.find('DYJetsToLL_BGenFilter_Zpt-100to200_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 3.41 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 67.91 elif fileName.find('ST_t-channel_antitop_4f_inclusiveDecays_TuneCP5_13TeV-powhegV2-madspin-pythia8') != -1: return 67.91 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5up_13TeV-powheg-madspin-pythia8') != -1: return 69.09 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 113.3 elif fileName.find('ST_s-channel_4f_leptonDecays_mtop1735_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 3.653 elif fileName.find('TTWJetsToLNu_TuneCP5CR1_QCDbased_PSweights_13TeV-amcatnloFXFX-madspin-pythia8') != -1: return 0.2169 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5CR1_PSweights_13TeV-powheg-pythia8') != -1: return 113.3 elif fileName.find('ST_tW_antitop_5f_hdampdown_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 34.98 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5CR2_PSweights_13TeV-powheg-pythia8') != -1: return 113.3 elif fileName.find('ST_t-channel_antitop_4f_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8') != -1: return 69.09 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_mtop1715_TuneCP5_13TeV-powheg-pythia8') != -1: return 36.65 elif fileName.find('ST_tW_top_5f_inclusiveDecays_mtop1695_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 36.58 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5CR2_PSweights_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5CR1_PSweights_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_mtop1735_TuneCP5_13TeV-powheg-pythia8') != -1: return 36.65 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 113.3 elif fileName.find('DYJetsToLL_Zpt-200toInf_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_TuneDown') != -1: return 6.714 elif fileName.find('DYJetsToTauTau_ForcedMuEleDecay_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 1981.0 elif fileName.find('ST_tW_top_5f_inclusiveDecays_mtop1735_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.38 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_mtop1695_TuneCP5_13TeV-powheg-pythia8') != -1: return 36.65 elif fileName.find('ST_tW_top_5f_DS_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 33.75 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_mtop1755_TuneCP5_13TeV-powheg-pythia8') != -1: return 36.65 elif fileName.find('ST_tW_top_5f_inclusiveDecays_mtop1715_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 35.46 elif fileName.find('DYJetsToLL_M-105To160_VBFFilter_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8') != -1: return 2.01 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5down_13TeV-powheg-madspin-pythia8') != -1: return 115.3 elif fileName.find('ST_tW_top_5f_inclusiveDecays_mtop1755_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 33.34 elif fileName.find('DYJetsToLL_M-105To160_VBFFilter_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 1.526 elif fileName.find('DYBJetsToLL_M-50_Zpt-200toInf_TuneCP5_13TeV-madgraphMLM-pythia8_newgridpack') != -1: return 0.3282 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5CR2_13TeV-powheg-madspin-pythia8') != -1: return 115.3 elif fileName.find('ST_t-channel_eleDecays_anomwtbLVRV_LVRVunphys_13TeV-comphep-pythia8_TuneCP5') != -1: return 47.81 elif fileName.find('ST_tW_antitop_5f_hdampup_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_t-channel_tauDecays_anomwtbLVRV_LVRVunphys_13TeV-comphep-pythia8_TuneCP5') != -1: return 47.69 elif fileName.find('DYBJetsToLL_M-50_Zpt-100to200_TuneCP5_13TeV-madgraphMLM-pythia8_newgridpack') != -1: return 3.21 elif fileName.find('ST_t-channel_tauDecays_anomwtbLVLT_LVLTunphys_13TeV-comphep-pythia8_TuneCP5') != -1: return 84.72 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5CR1_13TeV-powheg-madspin-pythia8') != -1: return 115.3 elif fileName.find('DYJetsToLL_M-4to50_HT-100to200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 203.3 elif fileName.find('DYJetsToLL_Zpt-200toInf_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8_TuneUp') != -1: return 6.716 elif fileName.find('TTToSemiLepton_HT500Njet9_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 3.884 elif fileName.find('ST_tW_antitop_5f_DS_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 35.25 elif fileName.find('DYJetsToLL_M-4to50_HT-600toInf_TuneCP5_PSWeights_13TeV-madgraphMLM-pythia8') != -1: return 1.837 elif fileName.find('ST_t-channel_muDecays_anomwtbLVLT_LVLTunphys_13TeV-comphep-pythia8_TuneCP5') != -1: return 84.86 elif fileName.find('DYJetsToLL_M-4to50_HT-200to400_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 54.31 elif fileName.find('ST_t-channel_top_4f_inclusiveDecays_TuneCP5_13TeV-powhegV2-madspin-pythia8') != -1: return 113.3 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5up_13TeV-powheg-madspin-pythia8') != -1: return 115.3 elif fileName.find('ST_t-channel_antitop_5f_TuneCP5_13TeV-powheg-madspin-pythia8_vtd_vts_decay') != -1: return 82.52 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 113.3 elif fileName.find('ST_t-channel_muDecays_anomwtbLVRV_LVRVunphys_13TeV-comphep-pythia8_TuneCP5') != -1: return 47.63 elif fileName.find('DYJetsToLL_CGenFilter_Zpt-200toInf_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 3.184 elif fileName.find('DYJetsToLL_M-4to50_HT-70to100_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 146.6 elif fileName.find('DYJetsToLL_M-50_HT-1200to2500_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 0.1937 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5down_PSweights_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('ST_t-channel_eDecays_anomwtbLVLT_LVLTunphys_13TeV-comphep-pythia8_TuneCP5') != -1: return 84.84 elif fileName.find('DYJetsToLL_BGenFilter_Zpt-200toInf_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 0.5327 elif fileName.find('DYJetsToLL_BGenFilter_Zpt-100to200_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 3.384 elif fileName.find('ST_tW_top_5f_hdampdown_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('DYJetsToLL_CGenFilter_Zpt-100to200_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 25.86 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5_erdON_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_t-channel_antitop_5f_TuneCP5_13TeV-powheg-madspin-pythia8_vtd_vts_prod') != -1: return 225.5 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('DYJetsToTauTau_ForcedMuDecay_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 1990.0 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_mtop1695_TuneCP5_13TeV-powheg-pythia8') != -1: return 36.65 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_mtop1715_TuneCP5_13TeV-powheg-pythia8') != -1: return 36.65 elif fileName.find('TTToSemiLepton_HT500Njet9_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 4.613 elif fileName.find('DYJetsToLL_M-50_HT-800to1200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 0.8021 elif fileName.find('DYJetsToLL_M-50_HT-2500toInf_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 0.003514 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5CR2_PSweights_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_mtop1735_TuneCP5_13TeV-powheg-pythia8') != -1: return 36.65 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5CR1_PSweights_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('ST_t-channel_top_4f_InclusiveDecays_TuneCP5_13TeV-powheg-madspin-pythia8') != -1: return 115.3 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_mtop1755_TuneCP5_13TeV-powheg-pythia8') != -1: return 36.65 elif fileName.find('TTToSemilepton_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8') != -1: return 31.06 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5up_PSweights_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('ST_t-channel_tauDecays_anomwtbLVRT_LV2RT2_13TeV-comphep-pythia8_TuneCP5') != -1: return 102.2 elif fileName.find('DYJetsToEE_M-50_LTbinned_800To2000_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.01009 elif fileName.find('DYJetsToLL_M-50_HT-100to200_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 160.7 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5down_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_tW_top_5f_inclusiveDecays_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_t-channel_tauDecays_anomwtbLVRT_LV1RT4_13TeV-comphep-pythia8_TuneCP5') != -1: return 108.3 elif fileName.find('ST_t-channel_tauDecays_anomwtbLVRT_LV3RT1_13TeV-comphep-pythia8_TuneCP5') != -1: return 54.52 elif fileName.find('DYJetsToLL_M-50_HT-200to400_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 48.63 elif fileName.find('DYJetsToLL_M-50_HT-600to800_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 1.761 elif fileName.find('DYJetsToTauTau_ForcedMuEleDecay_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 6458.0 elif fileName.find('ST_tW_top_5f_hdampup_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 34.9 elif fileName.find('DYJetsToLL_M-50_HT-400to600_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 6.993 elif fileName.find('DYJetsToEE_M-50_LTbinned_100To200_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 93.51 elif fileName.find('ST_t-channel_muDecays_anomwtbLVRT_LV1RT4_13TeV-comphep-pythia8_TuneCP5') != -1: return 108.6 elif fileName.find('tZq_ll_4f_ckm_NLO_TuneCP5CR1_QCDbased_PSweights_13TeV-amcatnlo-pythia8') != -1: return 0.07358 elif fileName.find('DYJetsToLL_M-50_VBFFilter_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8') != -1: return 266.1 elif fileName.find('DYJetsToEE_M-50_LTbinned_200To400_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 4.121 elif fileName.find('ST_t-channel_muDecays_anomwtbLVRT_LV2RT2_13TeV-comphep-pythia8_TuneCP5') != -1: return 102.7 elif fileName.find('DYJetsToLL_M-50_HT-70to100_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 146.5 elif fileName.find('ST_tW_top_5f_DS_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 33.75 elif fileName.find('ST_tW_antitop_5f_DS_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 35.13 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5CR2_GluonMove_PSweights_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('DYJetsToEE_M-50_LTbinned_400To800_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.2445 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5CR1_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5CR2_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('TTJets_SingleLeptFromTbar_genMET-150_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 6.167 elif fileName.find('ST_t-channel_muDecays_anomwtbLVRT_LV3RT1_13TeV-comphep-pythia8_TuneCP5') != -1: return 54.72 elif fileName.find('DYJetsToLL_M-5to50_HT-600toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 1.107 elif fileName.find('ST_t-channel_eDecays_anomwtbLVRT_LV2RT2_13TeV-comphep-pythia8_TuneCP5') != -1: return 102.9 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('TTTo2L2Nu_HT500Njet7_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 10.56 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5_erdON_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('DYJetsToEE_M-50_LTbinned_95To100_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 47.14 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5up_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('TTJets_SingleLeptFromTbar_genMET-80_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 31.68 elif fileName.find('ST_tW_top_5f_inclusiveDecays_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_t-channel_4f_leptonDecays_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 70.9 elif fileName.find('DYJetsToLL_M-5to50_HT-400to600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 3.628 elif fileName.find('ST_t-channel_eDecays_anomwtbLVRT_LV1RT4_13TeV-comphep-pythia8_TuneCP5') != -1: return 108.9 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5CR1_QCDbased_PSweights_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('DYJetsToLL_M-50_VBFFilter_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 202.3 elif fileName.find('DYJetsToLL_M-5to50_HT-100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 224.4 elif fileName.find('ST_t-channel_top_5f_TuneCP5_13TeV-powheg-madspin-pythia8_vtd_vts_prod') != -1: return 547.2 elif fileName.find('DYJetsToLL_M-5to50_HT-200to400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 37.87 elif fileName.find('TTWJetsToLNu_TuneCP5CR2_GluonMove_13TeV-amcatnloFXFX-madspin-pythia8') != -1: return 0.2188 elif fileName.find('DYBJetsToLL_M-50_Zpt-100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 3.088 elif fileName.find('ST_t-channel_tauDecays_anomwtbLVRT_RT4_13TeV-comphep-pythia8_TuneCP5') != -1: return 53.84 elif fileName.find('DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_CUETP8M1Down') != -1: return 5940.0 elif fileName.find('DYJetsToLL_M-1To5_HT-400to600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 65.9 elif fileName.find('TTToSemiLepton_HT500Njet9_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 4.179 elif fileName.find('DYJetsToLL_M-1To5_HT-200to400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 789.8 elif fileName.find('DYJetsToEE_M-50_LTbinned_80To85_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 174.1 elif fileName.find('DYBJetsToLL_M-50_Zpt-200toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 0.3159 elif fileName.find('DYJetsToEE_M-50_LTbinned_90To95_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 179.6 elif fileName.find('DYJetsToTauTau_ForcedMuDecay_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 6503.0 elif fileName.find('DYJetsToLL_M-1To5_HT-600toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 16.72 elif fileName.find('DYJetsToLL_M-5to50_HT-70to100_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 301.0 elif fileName.find('DYJetsToLL_M-1To5_HT-150to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 1124.0 elif fileName.find('DYJetsToEE_M-50_LTbinned_85To90_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 250.6 elif fileName.find('DYJetsToLL_M-50_HT-1200to2500_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 0.1512 elif fileName.find('TTToSemiLeptonic_TuneCP5CR2_GluonMove_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-160_MZp-2_13TeV-madgraph') != -1: return 0.0001077 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-100_MZp-8_13TeV-madgraph') != -1: return 1.563e-05 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-160_MZp-5_13TeV-madgraph') != -1: return 4.298e-05 elif fileName.find('TTToSemiLeptonic_TuneCP5CR1_QCDbased_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-150_MZp-8_13TeV-madgraph') != -1: return 5.117e-05 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-150_MZp-5_13TeV-madgraph') != -1: return 8.237e-05 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-120_MZp-2_13TeV-madgraph') != -1: return 0.0002052 elif fileName.find('TTJets_SingleLeptFromT_genMET-150_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 6.212 elif fileName.find('TTTo2L2Nu_HT500Njet7_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 12.41 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-140_MZp-8_13TeV-madgraph') != -1: return 6.504e-05 elif fileName.find('DYJetsToLL_M-50_HT-2500toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 0.003659 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-130_MZp-2_13TeV-madgraph') != -1: return 0.0002577 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-150_MZp-2_13TeV-madgraph') != -1: return 0.0002047 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-140_MZp-2_13TeV-madgraph') != -1: return 0.0002613 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-130_MZp-5_13TeV-madgraph') != -1: return 0.0001031 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-100_MZp-2_13TeV-madgraph') != -1: return 5.684e-05 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-110_MZp-8_13TeV-madgraph') != -1: return 3.331e-05 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-130_MZp-8_13TeV-madgraph') != -1: return 6.456e-05 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-100_MZp-5_13TeV-madgraph') != -1: return 2.343e-05 elif fileName.find('ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-120_13TeV_amcatnlo_pythia8') != -1: return 7.402 elif fileName.find('ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-150_13TeV_amcatnlo_pythia8') != -1: return 1.686 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-110_MZp-5_13TeV-madgraph') != -1: return 5.221e-05 elif fileName.find('ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-140_13TeV_amcatnlo_pythia8') != -1: return 3.367 elif fileName.find('ST_tW_top_5f_inclusiveDecays_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_t-channel_tauDecays_anomwtbLVRV_RV_13TeV-comphep-pythia8_TuneCP5') != -1: return 24.06 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-110_MZp-2_13TeV-madgraph') != -1: return 0.0001291 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-120_MZp-8_13TeV-madgraph') != -1: return 5.201e-05 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-140_MZp-5_13TeV-madgraph') != -1: return 0.0001043 elif fileName.find('ST_t-channel_tauDecays_anomwtbLVLT_LT_13TeV-comphep-pythia8_TuneCP5') != -1: return 71.8 elif fileName.find('ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-160_13TeV_amcatnlo_pythia8') != -1: return 0.4841 elif fileName.find('TTWJetsToLNu_TuneCP5CR1_QCDbased_13TeV-amcatnloFXFX-madspin-pythia8') != -1: return 0.2183 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5down_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ST_tW_antitop_5f_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-100_13TeV_amcatnlo_pythia8') != -1: return 11.62 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-160_MZp-8_13TeV-madgraph') != -1: return 2.687e-05 elif fileName.find('DYJetsToLL_Zpt-200toInf_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 6.733 elif fileName.find('DYJetsToLL_M-50_HT-800to1200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 0.6229 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-120_MZp-5_13TeV-madgraph') != -1: return 8.243e-05 elif fileName.find('DYJetsToLL_Zpt-100to200_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 57.3 elif fileName.find('ST_t-channel_muDecays_anomwtbLVRT_RT4_13TeV-comphep-pythia8_TuneCP5') != -1: return 53.81 elif fileName.find('DYJetsToLL_M-50_Zpt-150toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 18.36 elif fileName.find('ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-155_13TeV_amcatnlo_pythia8') != -1: return 1.008 elif fileName.find('DYJetsToLL_M-50_HT-200to400_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 41.04 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-90_MZp-8_13TeV-madgraph') != -1: return 3.684e-06 elif fileName.find('DYJetsToLL_M-105To160_TuneCP5_PSweights_13TeV-amcatnloFXFX-pythia8') != -1: return 47.05 elif fileName.find('tZq_Zhad_Wlept_4f_ckm_NLO_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 0.1518 elif fileName.find('TTJets_SingleLeptFromT_genMET-80_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 32.27 elif fileName.find('DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_CUETP8M1Up') != -1: return 5872.0 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5CR2_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-90_MZp-5_13TeV-madgraph') != -1: return 5.859e-06 elif fileName.find('TTToSemiLepton_HT500Njet9_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 4.295 elif fileName.find('DYJetsToLL_M-50_HT-100to200_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 147.4 elif fileName.find('DYJetsToLL_M-105To160_VBFFilter_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 2.026 elif fileName.find('DYJetsToLL_M-50_HT-600to800_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 1.358 elif fileName.find('ST_t-channel_muDecays_anomwtbLVRV_RV_13TeV-comphep-pythia8_TuneCP5') != -1: return 24.21 elif fileName.find('ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-90_13TeV_amcatnlo_pythia8') != -1: return 13.46 elif fileName.find('ST_t-channel_muDecays_anomwtbLVLT_LT_13TeV-comphep-pythia8_TuneCP5') != -1: return 71.67 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5CR1_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('ChargedHiggs_TTToHplusBWB_HplusToTauNu_M-80_13TeV_amcatnlo_pythia8') != -1: return 15.03 elif fileName.find('DYJetsToLL_M-50_HT-400to600_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 5.674 elif fileName.find('ST_t-channel_eDecays_anomwtbLVRT_RT4_13TeV-comphep-pythia8_TuneCP5') != -1: return 53.7 elif fileName.find('ST_tW_top_5f_DS_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 33.67 elif fileName.find('TTTo2L2Nu_ttbbFilter_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8') != -1: return 7.269 elif fileName.find('TTToHplusToWZp_WToTauNu_WuToQQ_ZpToMuMu_MH-90_MZp-2_13TeV-madgraph') != -1: return 1.318e-05 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-140_MZp-2_13TeV-madgraph') != -1: return 0.0001947 elif fileName.find('DYJetsToNuNu_PtZ-400To650_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.2783 elif fileName.find('DYJetsToLL_BGenFilter_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 255.2 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-130_MZp-8_13TeV-madgraph') != -1: return 4.803e-05 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-110_MZp-5_13TeV-madgraph') != -1: return 3.898e-05 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-110_MZp-8_13TeV-madgraph') != -1: return 2.495e-05 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-100_MZp-5_13TeV-madgraph') != -1: return 1.776e-05 elif fileName.find('DYJetsToNuNu_PtZ-100To250_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 54.86 elif fileName.find('TTToSemiLeptonic_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_TuneCP5down_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-120_MZp-8_13TeV-madgraph') != -1: return 3.87e-05 elif fileName.find('TTToSemiLeptonic_mtop178p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 584.6 elif fileName.find('DYJetsToNuNu_PtZ-250To400_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 2.073 elif fileName.find('TTToSemiLeptonic_mtop175p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 633.4 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-130_MZp-5_13TeV-madgraph') != -1: return 7.685e-05 elif fileName.find('TTToSemiLeptonic_mtop169p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 746.2 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-160_MZp-5_13TeV-madgraph') != -1: return 3.199e-05 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-160_MZp-8_13TeV-madgraph') != -1: return 1.993e-05 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-120_MZp-2_13TeV-madgraph') != -1: return 0.0001529 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-160_MZp-2_13TeV-madgraph') != -1: return 7.999e-05 elif fileName.find('DYJetsToLL_M-105To160_TuneCP5_PSweights_13TeV-madgraphMLM-pythia8') != -1: return 38.81 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-100_MZp-2_13TeV-madgraph') != -1: return 4.276e-05 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-150_MZp-5_13TeV-madgraph') != -1: return 6.133e-05 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5up_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('TTToSemiLeptonic_mtop173p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 668.6 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-140_MZp-8_13TeV-madgraph') != -1: return 4.869e-05 elif fileName.find('TTToSemiLeptonic_mtop166p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 811.4 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-150_MZp-8_13TeV-madgraph') != -1: return 3.827e-05 elif fileName.find('ST_t-channel_eDecays_anomwtbLVRV_RV_13TeV-comphep-pythia8_TuneCP5') != -1: return 24.12 elif fileName.find('DYJetsToNuNu_PtZ-650ToInf_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.02603 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-140_MZp-5_13TeV-madgraph') != -1: return 7.75e-05 elif fileName.find('ST_t-channel_eDecays_anomwtbLVLT_LT_13TeV-comphep-pythia8_TuneCP5') != -1: return 71.81 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-110_MZp-2_13TeV-madgraph') != -1: return 9.633e-05 elif fileName.find('TTWJetsToLNu_TuneCP5_PSweights_13TeV-amcatnloFXFX-madspin-pythia8') != -1: return 0.2198 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-130_MZp-2_13TeV-madgraph') != -1: return 0.0001914 elif fileName.find('TTToSemiLeptonic_mtop171p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 706.1 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-120_MZp-5_13TeV-madgraph') != -1: return 6.122e-05 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-150_MZp-2_13TeV-madgraph') != -1: return 0.000153 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-100_MZp-8_13TeV-madgraph') != -1: return 1.168e-05 elif fileName.find('DYJetsToLL_M-105To160_VBFFilter_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 1.518 elif fileName.find('DYJetsToLL_M-4to50_HT-600toInf_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 1.85 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-25_13TeV-madgraph') != -1: return 0.01724 elif fileName.find('DY2JetsToLL_M-50_LHEZpT_400-inf_TuneCP5_13TeV-amcnloFXFX-pythia8') != -1: return 0.4477 elif fileName.find('DY1JetsToLL_M-50_LHEZpT_400-inf_TuneCP5_13TeV-amcnloFXFX-pythia8') != -1: return 0.1193 elif fileName.find('DY2JetsToLL_M-50_LHEZpT_250-400_TuneCP5_13TeV-amcnloFXFX-pythia8') != -1: return 2.737 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-30_13TeV-madgraph') != -1: return 0.01416 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-35_13TeV-madgraph') != -1: return 0.02032 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-25_13TeV-madgraph') != -1: return 0.03673 elif fileName.find('DYJetsToNuNu_PtZ-50To100_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 237.2 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-90_MZp-8_13TeV-madgraph') != -1: return 2.736e-06 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-100_MA-20_13TeV-madgraph') != -1: return 0.0008489 elif fileName.find('DY1JetsToLL_M-50_LHEZpT_250-400_TuneCP5_13TeV-amcnloFXFX-pythia8') != -1: return 1.098 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-90_MZp-5_13TeV-madgraph') != -1: return 4.393e-06 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-20_13TeV-madgraph') != -1: return 0.03297 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-25_13TeV-madgraph') != -1: return 0.03162 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-10_13TeV-madgraph') != -1: return 0.01898 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-25_13TeV-madgraph') != -1: return 0.005135 elif fileName.find('DYJetsToLL_M-4to50_HT-200to400_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 54.39 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-20_13TeV-madgraph') != -1: return 0.008633 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-100_MA-10_13TeV-madgraph') != -1: return 0.002968 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-35_13TeV-madgraph') != -1: return 0.03638 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-15_13TeV-madgraph') != -1: return 0.01158 elif fileName.find('DYJetsToLL_M-4to50_HT-400to600_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 5.697 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-100_MA-15_13TeV-madgraph') != -1: return 0.002361 elif fileName.find('TTToSemiLepton_HT500Njet9_hdampDOWN_TuneCP5_13TeV-powheg-pythia8') != -1: return 3.899 elif fileName.find('ST_tW_DS_antitop_5f_inclusiveDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 35.13 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-20_13TeV-madgraph') != -1: return 0.02027 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-10_13TeV-madgraph') != -1: return 0.01418 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-25_13TeV-madgraph') != -1: return 0.03152 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-35_13TeV-madgraph') != -1: return 0.0346 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-30_13TeV-madgraph') != -1: return 0.03397 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-25_13TeV-madgraph') != -1: return 0.0188 elif fileName.find('DY1JetsToLL_M-50_LHEZpT_150-250_TuneCP5_13TeV-amcnloFXFX-pythia8') != -1: return 9.543 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-30_13TeV-madgraph') != -1: return 0.001474 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-10_13TeV-madgraph') != -1: return 0.01521 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-30_13TeV-madgraph') != -1: return 0.01928 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-15_13TeV-madgraph') != -1: return 0.02175 elif fileName.find('DYJetsToLL_M-4to50_HT-100to200_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 204.0 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-15_13TeV-madgraph') != -1: return 0.0269 elif fileName.find('TTToSemiLepton_HT500Njet9_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 4.253 elif fileName.find('DYBJetsToNuNu_Zpt-40toInf_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 48.71 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-30_13TeV-madgraph') != -1: return 0.02977 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-20_13TeV-madgraph') != -1: return 0.01481 elif fileName.find('TTToHadronic_TuneCP5CR2_GluonMove_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-20_13TeV-madgraph') != -1: return 0.03 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-15_13TeV-madgraph') != -1: return 0.01866 elif fileName.find('TTToHplusToWZp_WToLNu_WToLNu_ZpToMuMu_MH-90_MZp-2_13TeV-madgraph') != -1: return 9.812e-06 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-10_13TeV-madgraph') != -1: return 0.01839 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-15_13TeV-madgraph') != -1: return 0.02536 elif fileName.find('DY2JetsToLL_M-50_LHEZpT_150-250_TuneCP5_13TeV-amcnloFXFX-pythia8') != -1: return 15.65 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-160_MA-10_13TeV-madgraph') != -1: return 0.008011 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-15_13TeV-madgraph') != -1: return 0.009756 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-120_MA-35_13TeV-madgraph') != -1: return 0.007598 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-110_MA-10_13TeV-madgraph') != -1: return 0.008264 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-130_MA-35_13TeV-madgraph') != -1: return 0.02491 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-140_MA-30_13TeV-madgraph') != -1: return 0.03793 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-150_MA-20_13TeV-madgraph') != -1: return 0.02735 elif fileName.find('DYJetsToLL_M-50_HT-1200to2500_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 0.1933 elif fileName.find('DYJetsToLL_M-1500to2000_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.00218 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5down_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-35_13TeV-madgraph') != -1: return 0.02608 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-20_13TeV-madgraph') != -1: return 0.02245 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-20_13TeV-madgraph') != -1: return 0.02486 elif fileName.find('TTToHadronic_TuneCP5CR1_QCDbased_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-25_13TeV-madgraph') != -1: return 0.01403 elif fileName.find('DYBJetsToLL_M-50_Zpt-100to200_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 4.042 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_TuneCP5up_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('DYJetsToLL_M-1to4_HT-600toInf_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 2.453 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-30_13TeV-madgraph') != -1: return 0.0011 elif fileName.find('DYJetsToLL_M-1to4_HT-100to200_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 479.6 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-25_13TeV-madgraph') != -1: return 0.003863 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-25_13TeV-madgraph') != -1: return 0.01305 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-35_13TeV-madgraph') != -1: return 0.01856 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-30_13TeV-madgraph') != -1: return 0.02827 elif fileName.find('DY1JetsToLL_M-50_LHEZpT_50-150_TuneCP5_13TeV-amcnloFXFX-pythia8') != -1: return 316.6 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-20_13TeV-madgraph') != -1: return 0.01516 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-35_13TeV-madgraph') != -1: return 0.02718 elif fileName.find('DYJetsToLL_M-50_HT-1200to2500_TuneCP5_14TeV-madgraphMLM-pythia8') != -1: return 0.2466 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-10_13TeV-madgraph') != -1: return 0.006028 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-35_13TeV-madgraph') != -1: return 0.005625 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-35_13TeV-madgraph') != -1: return 0.01527 elif fileName.find('DYJetsToLL_M-1to4_HT-400to600_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 8.207 elif fileName.find('TTToSemiLeptonic_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 687.0 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-10_13TeV-madgraph') != -1: return 0.01143 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-20_13TeV-madgraph') != -1: return 0.006446 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-30_13TeV-madgraph') != -1: return 0.01449 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-15_13TeV-madgraph') != -1: return 0.007288 elif fileName.find('DY2JetsToLL_M-50_LHEZpT_50-150_TuneCP5_13TeV-amcnloFXFX-pythia8') != -1: return 169.6 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-20_13TeV-madgraph') != -1: return 0.02056 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-30_13TeV-madgraph') != -1: return 0.02555 elif fileName.find('DYJetsToLL_M-2000to3000_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.0005156 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-25_13TeV-madgraph') != -1: return 0.02348 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-25_13TeV-madgraph') != -1: return 0.02368 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-20_13TeV-madgraph') != -1: return 0.01108 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-10_13TeV-madgraph') != -1: return 0.01375 elif fileName.find('ST_tW_top_5f_NoFullyHadronicDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('TTTo2L2Nu_HT500Njet7_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 11.34 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-25_13TeV-madgraph') != -1: return 0.02774 elif fileName.find('DYJetsToLL_M-4to50_HT-70to100_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 145.5 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-100_MA-20_13TeV-madgraph') != -1: return 0.0006391 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-10_13TeV-madgraph') != -1: return 0.01428 elif fileName.find('DYJetsToLL_M-1000to1500_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.01636 elif fileName.find('DYJetsToEE_M-50_LTbinned_800To2000_5f_LO_13TeV-madgraph_pythia8') != -1: return 0.008352 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-100_MA-15_13TeV-madgraph') != -1: return 0.001767 elif fileName.find('DYBJetsToLL_M-50_Zpt-200toInf_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 0.4286 elif fileName.find('TTToHplusToWA_WToTauNu_WToQQ_AToMuMu_MH-90_MA-10_13TeV-madgraph') != -1: return 0.0002799 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-30_13TeV-madgraph') != -1: return 0.02227 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-130_MA-15_13TeV-madgraph') != -1: return 0.01906 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-160_MA-15_13TeV-madgraph') != -1: return 0.008748 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-150_MA-15_13TeV-madgraph') != -1: return 0.01638 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-140_MA-15_13TeV-madgraph') != -1: return 0.02024 elif fileName.find('DYJetsToLL_M-1to4_HT-200to400_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 85.85 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-100_MA-10_13TeV-madgraph') != -1: return 0.002219 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-30_13TeV-madgraph') != -1: return 0.01063 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-110_MA-10_13TeV-madgraph') != -1: return 0.006195 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-10_13TeV-madgraph') != -1: return 0.01064 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-120_MA-15_13TeV-madgraph') != -1: return 0.014 elif fileName.find('TTToSemiLepton_HT500Njet9_hdampUP_TuneCP5_13TeV-powheg-pythia8') != -1: return 4.571 elif fileName.find('DYJetsToLL_M-50_HT-2500toInf_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 0.003468 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5CR2_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('DYJetsToEE_M-50_LTbinned_200To400_5f_LO_13TeV-madgraph_pythia8') != -1: return 3.574 elif fileName.find('ST_t-channel_antitop_5f_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 71.74 elif fileName.find('TTZPrimeToMuMu_M-1700_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 9.353e-05 elif fileName.find('TTZPrimeToMuMu_M-2000_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 3.577e-05 elif fileName.find('TTZPrimeToMuMu_M-1600_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.0001325 elif fileName.find('DYJetsToLL_M-50_Zpt-150toInf_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 22.93 elif fileName.find('TTToHplusToWA_WToLNu_WToLNu_AToMuMu_MH-90_MA-10_13TeV-madgraph') != -1: return 0.0002095 elif fileName.find('DYJetsToLL_M-1to4_HT-70to100_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 626.8 elif fileName.find('TTZPrimeToMuMu_M-1300_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.0004131 elif fileName.find('DYJetsToEE_M-50_LTbinned_100To200_5f_LO_13TeV-madgraph_pythia8') != -1: return 94.34 elif fileName.find('DYJetsToEE_M-50_LTbinned_400To800_5f_LO_13TeV-madgraph_pythia8') != -1: return 0.2005 elif fileName.find('DYJetsToLL_Pt-100To250_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 81.22 elif fileName.find('DYJetsToLL_M-50_HT-800to1200_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 0.8052 elif fileName.find('TTZPrimeToMuMu_M-1500_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.0001903 elif fileName.find('TTZPrimeToMuMu_M-1900_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 4.862e-05 elif fileName.find('TTZPrimeToMuMu_M-1000_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.00154 elif fileName.find('DYJetsToLL_Pt-400To650_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.3882 elif fileName.find('TTZPrimeToMuMu_M-1800_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 6.693e-05 elif fileName.find('TTZPrimeToMuMu_M-1400_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.0002778 elif fileName.find('TTZPrimeToMuMu_M-1200_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.0006259 elif fileName.find('DYJetsToLL_Pt-250To400_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 2.991 elif fileName.find('DYJetsToLL_M-800to1000_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.03047 elif fileName.find('TTToSemiLeptonic_WspTgt150_TuneCUETP8M2T4_13TeV-powheg-pythia8') != -1: return 34.49 elif fileName.find('DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_DownPS') != -1: return 5735.0 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5CR1_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('DYJetsToLL_Pt-650ToInf_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.03737 elif fileName.find('TTZPrimeToMuMu_M-900_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.002515 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-160_MZ-2_13TeV-madgraph') != -1: return 5.559e-05 elif fileName.find('DYJetsToLL_M-700to800_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.03614 elif fileName.find('DYJetsToLL_M-200to400_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 7.77 elif fileName.find('DYJetsToLL_M-400to500_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.4065 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-140_MZ-8_13TeV-madgraph') != -1: return 4.225e-05 elif fileName.find('ST_tW_antitop_5f_inclusiveDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 34.97 elif fileName.find('DYJetsToEE_M-50_LTbinned_95To100_5f_LO_13TeV-madgraph_pythia8') != -1: return 48.2 elif fileName.find('TTZPrimeToMuMu_M-800_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.004257 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-130_MZ-2_13TeV-madgraph') != -1: return 0.000168 elif fileName.find('Test_ZprimeToTT_M-4500_W-45_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 0.000701 elif fileName.find('TTTo2L2Nu_HT500Njet7_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 11.59 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-160_MZ-8_13TeV-madgraph') != -1: return 1.365e-05 elif fileName.find('TTTo2L2Nu_TuneCP5CR2_GluonMove_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTZPrimeToMuMu_M-400_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.06842 elif fileName.find('TTToHadronic_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5up_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('TTToHadronic_mtop175p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 633.4 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-110_MZ-5_13TeV-madgraph') != -1: return 2.886e-05 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-120_MZ-5_13TeV-madgraph') != -1: return 5.067e-05 elif fileName.find('DYJetsToLL_M-500to700_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 0.2334 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-140_MZ-2_13TeV-madgraph') != -1: return 0.0001727 elif fileName.find('TTZPrimeToMuMu_M-300_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.2194 elif fileName.find('DYJetsToLL_Pt-50To100_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 354.8 elif fileName.find('TTToHadronic_mtop171p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 706.1 elif fileName.find('TTZPrimeToMuMu_M-600_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.01409 elif fileName.find('TTZPrimeToMuMu_M-500_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.0287 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-110_MZ-8_13TeV-madgraph') != -1: return 1.808e-05 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-100_MZ-2_13TeV-madgraph') != -1: return 2.652e-05 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5down_PSweights_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('TTToHadronic_mtop169p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 746.2 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-130_MZ-5_13TeV-madgraph') != -1: return 6.649e-05 elif fileName.find('TTZPrimeToMuMu_M-700_TuneCP5_PSWeights_13TeV-madgraph-pythia8') != -1: return 0.007522 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-100_MZ-8_13TeV-madgraph') != -1: return 6.686e-06 elif fileName.find('DYJetsToLL_M-50_HT-100to200_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 161.1 elif fileName.find('TTToHadronic_mtop166p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 811.4 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-130_MZ-8_13TeV-madgraph') != -1: return 4.106e-05 elif fileName.find('TTToHadronic_mtop173p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 668.6 elif fileName.find('ST_s-channel_4f_hadronicDecays_TuneCP5_13TeV-amcatnlo-pythia8') != -1: return 11.24 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-150_MZ-5_13TeV-madgraph') != -1: return 5.214e-05 elif fileName.find('DYJetsToLL_M-50_HT-600to800_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 1.743 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-120_MZ-8_13TeV-madgraph') != -1: return 3.151e-05 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-150_MZ-2_13TeV-madgraph') != -1: return 0.0001319 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-100_MZ-5_13TeV-madgraph') != -1: return 1.058e-05 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-140_MZ-5_13TeV-madgraph') != -1: return 6.855e-05 elif fileName.find('DYJetsToLL_M-50_HT-200to400_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 48.66 elif fileName.find('BdToPsi2sKst_MuTrkFilter_DGamma0_TuneCP5_13TeV-pythia8-evtgen') != -1: return 5942000.0 elif fileName.find('DYJetsToLL_M-100to200_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 226.6 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-120_MZ-2_13TeV-madgraph') != -1: return 0.0001282 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-110_MZ-2_13TeV-madgraph') != -1: return 7.276e-05 elif fileName.find('TTToHadronic_mtop178p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 584.6 elif fileName.find('DYJetsToLL_M-50_HT-400to600_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 6.968 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-150_MZ-8_13TeV-madgraph') != -1: return 3.237e-05 elif fileName.find('ST_s-channel_4f_hadronicDecays_TuneCP5_13TeV-madgraph-pythia8') != -1: return 11.24 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-160_MZ-5_13TeV-madgraph') != -1: return 2.198e-05 elif fileName.find('DYJetsToLL_Zpt-0To50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 5375.0 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-150_MZ-2_13TeV-madgraph') != -1: return 0.0001309 elif fileName.find('DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8_UpPS') != -1: return 6005.0 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-110_MZ-8_13TeV-madgraph') != -1: return 1.802e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-140_MZ-2_13TeV-madgraph') != -1: return 0.0001729 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-120_MZ-8_13TeV-madgraph') != -1: return 3.146e-05 elif fileName.find('tZq_nunu_4f_ckm_NLO_TuneCP5_PSweights_13TeV-madgraph-pythia8') != -1: return 0.1337 elif fileName.find('DYJetsToEE_M-50_LTbinned_90To95_5f_LO_13TeV-madgraph_pythia8') != -1: return 167.3 elif fileName.find('DYJetsToEE_M-50_LTbinned_80To85_5f_LO_13TeV-madgraph_pythia8') != -1: return 159.9 elif fileName.find('DYJetsToEE_M-50_LTbinned_75To80_5f_LO_13TeV-madgraph_pythia8') != -1: return 134.6 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5CR2_GluonMove_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-160_MZ-2_13TeV-madgraph') != -1: return 5.542e-05 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-90_MZ-8_13TeV-madgraph') != -1: return 9.926e-07 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-90_MZ-5_13TeV-madgraph') != -1: return 1.652e-06 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-140_MZ-5_13TeV-madgraph') != -1: return 6.851e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-110_MZ-2_13TeV-madgraph') != -1: return 7.265e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-140_MZ-8_13TeV-madgraph') != -1: return 4.231e-05 elif fileName.find('DYJetsToEE_M-50_LTbinned_85To90_5f_LO_13TeV-madgraph_pythia8') != -1: return 229.4 elif fileName.find('TTToSemilepton_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8') != -1: return 320.1 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-150_MZ-8_13TeV-madgraph') != -1: return 3.234e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-160_MZ-5_13TeV-madgraph') != -1: return 2.212e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-160_MZ-8_13TeV-madgraph') != -1: return 1.364e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-130_MZ-8_13TeV-madgraph') != -1: return 4.116e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-100_MZ-5_13TeV-madgraph') != -1: return 1.06e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-100_MZ-2_13TeV-madgraph') != -1: return 2.654e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-150_MZ-5_13TeV-madgraph') != -1: return 5.234e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-110_MZ-5_13TeV-madgraph') != -1: return 2.894e-05 elif fileName.find('TTToHplusToWZprime_WToMuNu_ZToMuMu_MH-90_MZ-2_13TeV-madgraph') != -1: return 4.124e-06 elif fileName.find('ST_tW_DS_top_5f_inclusiveDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 33.67 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-120_MZ-5_13TeV-madgraph') != -1: return 5.064e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-120_MZ-2_13TeV-madgraph') != -1: return 0.0001276 elif fileName.find('TTTo2L2Nu_TuneCP5CR1_QCDbased_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-130_MZ-2_13TeV-madgraph') != -1: return 0.0001671 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-100_MZ-8_13TeV-madgraph') != -1: return 6.706e-06 elif fileName.find('DYJetsToLL_M-50_HT-70to100_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 146.7 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-130_MZ-5_13TeV-madgraph') != -1: return 6.66e-05 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-90_MZ-2_13TeV-madgraph') != -1: return 4.126e-06 elif fileName.find('TTToSemiLeptonic_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYToMuMu_M-4500To6000_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 3.566e-07 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5_13TeV-amcatnlo-pythia8') != -1: return 3.74 elif fileName.find('DYJetsToLL_M-50_HT-40to70_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 311.4 elif fileName.find('DYToMuMu_M-3500To4500_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 3.317e-06 elif fileName.find('DYToMuMu_M-2300To3500_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 7.34e-05 elif fileName.find('ST_s-channel_4f_leptonDecays_TuneCP5_13TeV-madgraph-pythia8') != -1: return 3.74 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-90_MZ-8_13TeV-madgraph') != -1: return 9.872e-07 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5up_PSweights_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('DY1JetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 730.3 elif fileName.find('DY2JetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 387.4 elif fileName.find('DYJetsToEE_M-50_LTbinned_5To75_5f_LO_13TeV-madgraph_pythia8') != -1: return 866.2 elif fileName.find('TTToHplusToWZprime_WToENu_ZToMuMu_MH-90_MZ-5_13TeV-madgraph') != -1: return 1.655e-06 elif fileName.find('DYJetsToLL_M-10to50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 18810.0 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5CR1_QCDbased_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('DYJetsToEE_M-50_LTbinned_0To75_5f_LO_13TeV-madgraph_pythia8') != -1: return 948.2 elif fileName.find('TTToHadronic_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 687.0 elif fileName.find('TTJets_SingleLeptFromTbar_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 108.7 elif fileName.find('TTTo2L2Nu_HT500Njet7_hdampDOWN_TuneCP5_13TeV-powheg-pythia8') != -1: return 10.58 elif fileName.find('DY3JetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 95.02 elif fileName.find('TTTo2L2Nu_HT500Njet7_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 11.37 elif fileName.find('DY4JetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 36.71 elif fileName.find('TTZJetsToQQ_Dilept_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 0.0568 elif fileName.find('DYJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-herwigpp_30M') != -1: return 14240.0 elif fileName.find('DYToMuMu_M-1400To2300_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 0.001178 elif fileName.find('DYJetsToLL_M-1500to2000_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 0.002367 elif fileName.find('TTJets_DiLept_genMET-150_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 3.655 elif fileName.find('TTTo2L2Nu_mtop166p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 811.4 elif fileName.find('TTToSemiLepton_HT500Njet9_TuneCP5down_13TeV-powheg-pythia8') != -1: return 4.216 elif fileName.find('tZq_ll_4f_ckm_NLO_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 0.07358 elif fileName.find('DYToMuMu_M-800To1400_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 0.01437 elif fileName.find('DYJetsToLL_M-10to50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 16270.0 elif fileName.find('TTTo2L2Nu_hdampDOWN_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('QCD_HT1500to2000_BGenFilter_TuneCP5_13TeV-madgraph-pythia8') != -1: return 13.61 elif fileName.find('DYToMuMu_M-6000ToInf_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 1.576e-08 elif fileName.find('TTToSemiLeptonic_TuneCP5CR2_GluonMove_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('QCD_HT1000to1500_BGenFilter_TuneCP5_13TeV-madgraph-pythia8') != -1: return 138.2 elif fileName.find('DYJetsToLL_M-2000to3000_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 0.0005409 elif fileName.find('TTTo2L2Nu_mtop173p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 668.6 elif fileName.find('DYJetsToLL_M-10to50_TuneCUETP8M1_14TeV-madgraphMLM-pythia8') != -1: return 17230.0 elif fileName.find('TTTo2L2Nu_mtop169p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 746.2 elif fileName.find('TTTo2L2Nu_mtop175p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 633.4 elif fileName.find('DYJetsToLL_M-1000to1500_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 0.01828 elif fileName.find('TTTo2L2Nu_mtop178p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 584.6 elif fileName.find('TTTo2L2Nu_mtop171p5_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 706.1 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-15_13TeV-madgraph') != -1: return 0.01533 elif fileName.find('QCD_HT2000toInf_BGenFilter_TuneCP5_13TeV-madgraph-pythia8') != -1: return 2.92 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-20_13TeV-madgraph') != -1: return 0.004946 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-10_13TeV-madgraph') != -1: return 0.003822 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-25_13TeV-madgraph') != -1: return 0.00815 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-30_13TeV-madgraph') != -1: return 0.01965 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-25_13TeV-madgraph') != -1: return 0.0186 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-10_13TeV-madgraph') != -1: return 0.01061 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-20_13TeV-madgraph') != -1: return 0.01191 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-30_13TeV-madgraph') != -1: return 0.0009769 elif fileName.find('DYJetsToLL_Pt-650ToInf_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 0.04796 elif fileName.find('DYToEE_M-3500To4500_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 3.327e-06 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-100_MA-15_13TeV-madgraph') != -1: return 0.001117 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-15_13TeV-madgraph') != -1: return 0.004958 elif fileName.find('TTToSemiLeptonic_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-25_13TeV-madgraph') != -1: return 0.02274 elif fileName.find('DYJetsToLL_Pt-250To400_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 3.774 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-20_13TeV-madgraph') != -1: return 0.01947 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-35_13TeV-madgraph') != -1: return 0.005199 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-10_13TeV-madgraph') != -1: return 0.003564 elif fileName.find('TTTo2L2Nu_HT500Njet7_hdampUP_TuneCP5_13TeV-powheg-pythia8') != -1: return 12.39 elif fileName.find('DYJetsToLL_M-800to1000_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 0.03406 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-30_13TeV-madgraph') != -1: return 0.009303 elif fileName.find('DYJetsToLL_M-3000toInf_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 3.048e-05 elif fileName.find('ST_tW_top_5f_inclusiveDecays_TuneCP5_13TeV-powheg-pythia8') != -1: return 34.91 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-30_13TeV-madgraph') != -1: return 0.009536 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-35_13TeV-madgraph') != -1: return 0.01695 elif fileName.find('DYToMuMu_M-200To400_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 2.342 elif fileName.find('DYJetsToLL_Pt-400To650_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 0.5164 elif fileName.find('BdToXKst_MuTrkFilter_DGamma0_TuneCP5_13TeV-pythia8-evtgen') != -1: return 7990000.0 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-35_13TeV-madgraph') != -1: return 0.02178 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-10_13TeV-madgraph') != -1: return 0.008312 elif fileName.find('DYToEE_M-4500To6000_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 3.551e-07 elif fileName.find('DYToEE_M-2300To3500_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 7.405e-05 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-30_13TeV-madgraph') != -1: return 0.02451 elif fileName.find('TTToSemiLeptonic_TuneCP5CR1_QCDbased_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-30_13TeV-madgraph') != -1: return 0.02076 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-15_13TeV-madgraph') != -1: return 0.01426 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-110_MA-25_13TeV-madgraph') != -1: return 0.003278 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-15_13TeV-madgraph') != -1: return 0.01005 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-35_13TeV-madgraph') != -1: return 0.01012 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-10_13TeV-madgraph') != -1: return 0.007271 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-140_MA-35_13TeV-madgraph') != -1: return 0.02426 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-25_13TeV-madgraph') != -1: return 0.01975 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-10_13TeV-madgraph') != -1: return 0.01005 elif fileName.find('QCD_HT700to1000_BGenFilter_TuneCP5_13TeV-madgraph-pythia8') != -1: return 721.8 elif fileName.find('DYToEE_M-1400To2300_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 0.001177 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-100_MA-20_13TeV-madgraph') != -1: return 0.0004878 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-130_MA-20_13TeV-madgraph') != -1: return 0.01767 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-20_13TeV-madgraph') != -1: return 0.01555 elif fileName.find('DYJetsToLL_Pt-100To250_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 96.8 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-15_13TeV-madgraph') != -1: return 0.005209 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-160_MA-20_13TeV-madgraph') != -1: return 0.006725 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-100_MA-10_13TeV-madgraph') != -1: return 0.001144 elif fileName.find('TTJets_DiLept_genMET-80_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 22.45 elif fileName.find('DYJetsToLL_M-1to10_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 173100.0 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5_PSweights_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-150_MA-15_13TeV-madgraph') != -1: return 0.01206 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-120_MA-25_13TeV-madgraph') != -1: return 0.01188 elif fileName.find('DYToMuMu_M-400To800_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 0.2084 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-100_MA-15_13TeV-madgraph') != -1: return 0.001121 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-15_13TeV-madgraph') != -1: return 0.005207 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-35_13TeV-madgraph') != -1: return 0.02177 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-10_13TeV-madgraph') != -1: return 0.003565 elif fileName.find('QCD_HT500to700_BGenFilter_TuneCP5_13TeV-madgraph-pythia8') != -1: return 3078.0 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-100_MA-10_13TeV-madgraph') != -1: return 0.001146 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-25_13TeV-madgraph') != -1: return 0.003271 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-20_13TeV-madgraph') != -1: return 0.01949 elif fileName.find('DYJetsToLL_M-500to700_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 0.2558 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-30_13TeV-madgraph') != -1: return 0.0009777 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-30_13TeV-madgraph') != -1: return 0.0196 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-25_13TeV-madgraph') != -1: return 0.01853 elif fileName.find('TTToSemiLepton_HT500Njet9_TuneCP5up_13TeV-powheg-pythia8') != -1: return 4.281 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-10_13TeV-madgraph') != -1: return 0.01066 elif fileName.find('TTToHplusToWA_WToMuNu_AToMuMu_MH-90_MA-10_13TeV-madgraph') != -1: return 0.000107 elif fileName.find('TTTo2L2Nu_hdampUP_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 687.0 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-25_13TeV-madgraph') != -1: return 0.01975 elif fileName.find('TTToSemiLeptonic_widthx1p15_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-30_13TeV-madgraph') != -1: return 0.009525 elif fileName.find('ST_tWnunu_5f_LO_TuneCP5_PSweights_13TeV-madgraph-pythia8') != -1: return 0.02099 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-10_13TeV-madgraph') != -1: return 0.008305 elif fileName.find('QCD_HT200to300_BGenFilter_TuneCP5_13TeV-madgraph-pythia8') != -1: return 111700.0 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-15_13TeV-madgraph') != -1: return 0.01205 elif fileName.find('QCD_HT100to200_BGenFilter_TuneCP5_13TeV-madgraph-pythia8') != -1: return 1275000.0 elif fileName.find('DYJetsToLL_Pt-50To100_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 407.9 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-35_13TeV-madgraph') != -1: return 0.01689 elif fileName.find('DYJetsToLL_M-200to400_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 8.502 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-20_13TeV-madgraph') != -1: return 0.006756 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-30_13TeV-madgraph') != -1: return 0.00934 elif fileName.find('DYJetsToLL_M-700to800_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 0.04023 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-35_13TeV-madgraph') != -1: return 0.01011 elif fileName.find('DY4JetsToTauTau_M-50_TuneCUETP8M1_13TeV-madgraph-pythia8') != -1: return 18.17 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-15_13TeV-madgraph') != -1: return 0.01429 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-15_13TeV-madgraph') != -1: return 0.01007 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-20_13TeV-madgraph') != -1: return 0.004962 elif fileName.find('DY2JetsToTauTau_M-50_TuneCUETP8M1_13TeV-madgraph-pythia8') != -1: return 111.1 elif fileName.find('DYToEE_M-800To1400_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 0.01445 elif fileName.find('DY3JetsToTauTau_M-50_TuneCUETP8M1_13TeV-madgraph-pythia8') != -1: return 34.04 elif fileName.find('DYJetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8_Fall17') != -1: return 5350.0 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-10_13TeV-madgraph') != -1: return 0.007278 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-30_13TeV-madgraph') != -1: return 0.02073 elif fileName.find('DYJetsToLL_M-400to500_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 0.4514 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-150_MA-20_13TeV-madgraph') != -1: return 0.01554 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-15_13TeV-madgraph') != -1: return 0.01535 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-160_MA-25_13TeV-madgraph') != -1: return 0.008158 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-10_13TeV-madgraph') != -1: return 0.003828 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-20_13TeV-madgraph') != -1: return 0.0177 elif fileName.find('DYToEE_M-6000ToInf_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 1.585e-08 elif fileName.find('TTToSemiLeptonic_widthx0p85_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-25_13TeV-madgraph') != -1: return 0.0119 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-20_13TeV-madgraph') != -1: return 0.0119 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-110_MA-15_13TeV-madgraph') != -1: return 0.004967 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-25_13TeV-madgraph') != -1: return 0.02275 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-130_MA-10_13TeV-madgraph') != -1: return 0.009985 elif fileName.find('TTJets_SingleLeptFromT_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 109.6 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-100_MA-20_13TeV-madgraph') != -1: return 0.0004875 elif fileName.find('QCD_HT300to500_BGenFilter_TuneCP5_13TeV-madgraph-pythia8') != -1: return 27960.0 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-35_13TeV-madgraph') != -1: return 0.02431 elif fileName.find('DYJetsToLL_M-100to200_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 247.8 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-120_MA-35_13TeV-madgraph') != -1: return 0.00514 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-140_MA-30_13TeV-madgraph') != -1: return 0.02449 elif fileName.find('DY2JetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 334.7 elif fileName.find('TTToSemiLeptonic_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DY3JetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 102.3 elif fileName.find('DY1JetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 1012.0 elif fileName.find('DY4JetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 54.52 elif fileName.find('TTToLL_MLL_1200To1800_TuneCUETP8M1_13TeV-powheg-pythia8') != -1: return 76.63 elif fileName.find('TTToSemiLeptonic_TuneCP2_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYJetsToLL_M-50_TuneCUETP8M1_13TeV-amcatnloFXFX-pythia8') != -1: return 5941.0 elif fileName.find('TTToHplusToWA_WToENu_AToMuMu_MH-90_MA-10_13TeV-madgraph') != -1: return 0.000107 elif fileName.find('TTToSemiLeptonic_mtop166p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 811.4 elif fileName.find('TTToSemiLeptonic_widthx1p3_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToSemiLeptonic_mtop173p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 668.6 elif fileName.find('TTToSemiLeptonic_mtop178p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 584.6 elif fileName.find('DYBJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 70.08 elif fileName.find('TTTo2L2Nu_TuneCUETP8M2_ttHtranche3_13TeV-powheg-pythia8') != -1: return 76.7 elif fileName.find('DYToEE_M-200To400_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 2.341 elif fileName.find('TTToSemiLeptonic_hdampDOWN_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToSemiLeptonic_mtop169p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 746.2 elif fileName.find('TTToSemiLeptonic_mtop171p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 706.1 elif fileName.find('TTToSemiLeptonic_widthx0p7_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYToEE_M-400To800_NNPDF30NLO_TuneCUETP8M1_13TeV-pythia8') != -1: return 0.208 elif fileName.find('TTToHadronic_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTWJetsToLNu_TuneCP5_13TeV-amcatnloFXFX-madspin-pythia8') != -1: return 0.2149 elif fileName.find('TTToSemiLeptonic_mtop175p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 633.4 elif fileName.find('DYJetsToLL_M-50_TuneCUETHS1_13TeV-madgraphMLM-herwigpp') != -1: return 358.6 elif fileName.find('TTToLL_MLL_1800ToInf_TuneCUETP8M1_13TeV-powheg-pythia8') != -1: return 76.63 elif fileName.find('TTToHadronic_TuneCP5CR2_GluonMove_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYJetsToLL_Pt-0To50_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 106300.0 elif fileName.find('DYJetsToLL_M-50_TuneCUETP8M1_13TeV-madgraphMLM-pythia8') != -1: return 4963.0 elif fileName.find('TTWJetsToQQ_TuneCP5_13TeV-amcatnloFXFX-madspin-pythia8') != -1: return 0.4316 elif fileName.find('TTToSemiLepton_HT500Njet9_TuneCP5_13TeV-powheg-pythia8') != -1: return 4.239 elif fileName.find('ST_tWll_5f_LO_TuneCP5_PSweights_13TeV-madgraph-pythia8') != -1: return 0.01103 elif fileName.find('TTToLL_MLL_800To1200_TuneCUETP8M1_13TeV-powheg-pythia8') != -1: return 76.63 elif fileName.find('Test_BulkGravToWW_narrow_M-4000_13TeV_TuneCP5-madgraph') != -1: return 4.543e-05 elif fileName.find('TTJets_HT-1200to2500_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 0.1316 elif fileName.find('tZq_W_lept_Z_hadron_4f_ckm_NLO_13TeV_amcatnlo_pythia8') != -1: return 0.1573 elif fileName.find('DYJetsToLL_M-10to50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 15810 elif fileName.find('ttHTobb_ttToSemiLep_M125_TuneCP5_13TeV-powheg-pythia8') != -1: return 0.5418 elif fileName.find('TTJets_HT-2500toInf_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 0.001407 elif fileName.find('TTTo2L2Nu_HT500Njet7_TuneCP5down_13TeV-powheg-pythia8') != -1: return 11.38 elif fileName.find('TTToHadronic_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTJets_HT-800to1200_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 0.7532 elif fileName.find('TTToSemiLeptonic_hdampUP_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.0 elif fileName.find('TTToLL_MLL_500To800_TuneCUETP8M1_13TeV-powheg-pythia8') != -1: return 76.63 elif fileName.find('TTToHadronic_TuneCP5CR1_QCDbased_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTTo2L2Nu_TuneCP5down_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTZPrimeToMuMu_M-1800_TuneCP5_13TeV-madgraph-pythia8') != -1: return 6.694e-05 elif fileName.find('TTZPrimeToMuMu_M-1600_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.0001324 elif fileName.find('TTZPrimeToMuMu_M-1200_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.0006278 elif fileName.find('ST_t-channel_antitop_5f_TuneCP5_13TeV-powheg-pythia8') != -1: return 82.52 elif fileName.find('TTZPrimeToMuMu_M-1500_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.0001899 elif fileName.find('TTZPrimeToMuMu_M-1700_TuneCP5_13TeV-madgraph-pythia8') != -1: return 9.354e-05 elif fileName.find('TTJets_HT-600to800_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 1.821 elif fileName.find('TTZPrimeToMuMu_M-1000_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.001539 elif fileName.find('ST_t-channel_eleDecays_13TeV-comphep-pythia8_TuneCP5') != -1: return 24.85 elif fileName.find('ST_t-channel_tauDecays_13TeV-comphep-pythia8_TuneCP5') != -1: return 24.7 elif fileName.find('DYJetsToLL_M-5to50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 81880.0 elif fileName.find('TTZPrimeToMuMu_M-2000_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.001539 elif fileName.find('TTZPrimeToMuMu_M-1400_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.0002776 elif fileName.find('TTZPrimeToMuMu_M-1300_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.0004127 elif fileName.find('TTZPrimeToMuMu_M-1900_TuneCP5_13TeV-madgraph-pythia8') != -1: return 4.857e-05 elif fileName.find('TTToHadronic_hdampDOWN_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHadronic_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTZPrimeToMuMu_M-600_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.01408 elif fileName.find('TTToHadronic_mtop169p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 746.2 elif fileName.find('TTZPrimeToMuMu_M-300_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.22 elif fileName.find('TTToSemiLeptonic_TuneCP5_erdON_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5down_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('ST_t-channel_muDecays_13TeV-comphep-pythia8_TuneCP5') != -1: return 24.72 elif fileName.find('TTToHadronic_mtop171p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 706.1 elif fileName.find('TTZPrimeToMuMu_M-400_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.0684 elif fileName.find('DYBBJetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 14.49 elif fileName.find('TTToHadronic_mtop166p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 811.4 elif fileName.find('ttHTobb_ttTo2L2Nu_M125_TuneCP5_13TeV-powheg-pythia8') != -1: return 0.5418 elif fileName.find('TTTo2L2Nu_HT500Njet7_TuneCP5up_13TeV-powheg-pythia8') != -1: return 11.43 elif fileName.find('TTZPrimeToMuMu_M-900_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.002517 elif fileName.find('TTToHadronic_mtop178p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 584.6 elif fileName.find('TTToHadronic_mtop173p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 668.6 elif fileName.find('TTZPrimeToMuMu_M-700_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.007514 elif fileName.find('TTZPrimeToMuMu_M-500_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.02871 elif fileName.find('TTZPrimeToMuMu_M-800_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.004255 elif fileName.find('TTTo2L2Nu_TuneCP5CR2_GluonMove_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHadronic_mtop175p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 633.4 elif fileName.find('TTTo2L2Nu_noSC_TuneCUETP8M2T4_13TeV-powheg-pythia8') != -1: return 76.7 elif fileName.find('DY1JetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 877.8 elif fileName.find('DYJetsToLL_M-50_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 6529.0 elif fileName.find('QCD_HT1000to1500_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 1092.0 elif fileName.find('DY4JetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 44.03 elif fileName.find('TTTo2L2Nu_TuneCP5up_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('QCD_HT1500to2000_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 99.76 elif fileName.find('TTTo2L2Nu_TuneCP5CR1_QCDbased_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DY3JetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 111.5 elif fileName.find('DY2JetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 304.4 elif fileName.find('TTToHadrons_mtop178p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 584.6 elif fileName.find('DYJetsToQQ_HT180_13TeV_TuneCP5-madgraphMLM-pythia8') != -1: return 1728.0 elif fileName.find('DYJetsToLL_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 5343.0 elif fileName.find('QCD_HT2000toInf_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 20.35 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5up_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('TTTo2L2Nu_widthx1p15_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYTo2Mu_M1300_CUETP8M1_13TeV_Pythia8_Corrected-v3') != -1: return 0.001656 elif fileName.find('DYJetsToLL_M-50_TuneCH3_13TeV-madgraphMLM-herwig7') != -1: return 9.402 elif fileName.find('TTTo2L2Nu_HT500Njet7_TuneCP5_13TeV-powheg-pythia8') != -1: return 11.28 elif fileName.find('DYJetsToEE_M-50_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 1795.0 elif fileName.find('QCD_HT700to1000_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 6344.0 elif fileName.find('TTToSemiLeptonic_TuneCP5down_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYJetsToLL_M-50_TuneCP2_13TeV-madgraphMLM-pythia8') != -1: return 4878.0 elif fileName.find('DYJetsToLL_M-50_TuneCP1_13TeV-madgraphMLM-pythia8') != -1: return 4661.0 elif fileName.find('TTToHadronic_hdampUP_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.0 elif fileName.find('TTTo2L2Nu_widthx0p85_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYTo2E_M1300_CUETP8M1_13TeV_Pythia8_Corrected-v3') != -1: return 0.001661 elif fileName.find('DYTo2Mu_M800_CUETP8M1_13TeV_Pythia8_Corrected-v3') != -1: return 0.01419 elif fileName.find('TTTo2L2Nu_TuneCP5_PSweights_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYTo2Mu_M300_CUETP8M1_13TeV_Pythia8_Corrected-v3') != -1: return 0.5658 elif fileName.find('TTTo2L2Nu_mtop175p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 633.4 elif fileName.find('TTTo2L2Nu_mtop169p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 746.2 elif fileName.find('DYJetsToLL_1J_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 955.8 elif fileName.find('QCD_HT300to500_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 323400.0 elif fileName.find('DYToEE_M-50_NNPDF31_TuneCP5_13TeV-powheg-pythia8') != -1: return 2137.0 elif fileName.find('TTTo2L2Nu_mtop173p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 668.6 elif fileName.find('TTTo2L2Nu_hdampDOWN_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYJetsToLL_0J_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 5313.0 elif fileName.find('DYJetsToLL_2J_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 360.4 elif fileName.find('TTTo2L2Nu_mtop178p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 584.6 elif fileName.find('TTTo2L2Nu_mtop171p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 706.1 elif fileName.find('QCD_HT200to300_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 1551000.0 elif fileName.find('TTTo2L2Nu_widthx0p7_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('QCD_HT500to700_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 30140.0 elif fileName.find('TTTo2L2Nu_mtop166p5_TuneCP5_13TeV-powheg-pythia8') != -1: return 811.4 elif fileName.find('ST_t-channel_top_5f_TuneCP5_13TeV-powheg-pythia8') != -1: return 119.7 elif fileName.find('TTTo2L2Nu_widthx1p3_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('QCD_HT100to200_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 23590000.0 elif fileName.find('QCD_HT50to100_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 185300000.0 elif fileName.find('TTZToLLNuNu_M-10_TuneCP5_13TeV-amcatnlo-pythia8') != -1: return 0.2432 elif fileName.find('TTToSemiLeptonic_TuneCP5up_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTJets_DiLept_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 54.23 elif fileName.find('QCD_HT1000to1500_TuneCP5_13TeV-madgraph-pythia8') != -1: return 1088.0 elif fileName.find('TTToHadronic_TuneCP5_erdON_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToLL_MLL_500To800_41to65_NNPDF31_13TeV-powheg') != -1: return 687.1 elif fileName.find('QCD_HT1500to2000_TuneCP5_13TeV-madgraph-pythia8') != -1: return 99.11 elif fileName.find('TTZToLL_M-1to10_TuneCP5_13TeV-amcatnlo-pythia8') != -1: return 0.05324 elif fileName.find('TTTo2L2Nu_hdampUP_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.0 elif fileName.find('QCD_HT700to1000_TuneCP5_13TeV-madgraph-pythia8') != -1: return 6334.0 elif fileName.find('QCD_HT2000toInf_TuneCP5_13TeV-madgraph-pythia8') != -1: return 20.23 elif fileName.find('ST_tWlnuZ_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.001267 elif fileName.find('TTToLL_MLL_500To800_0to20_NNPDF31_13TeV-powheg') != -1: return 687.1 elif fileName.find('W4JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 544.3 elif fileName.find('QCD_HT300to500_TuneCP5_13TeV-madgraph-pythia8') != -1: return 322600.0 elif fileName.find('W2JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 2793.0 elif fileName.find('TTZZTo4b_5f_LO_TuneCP5_13TeV_madgraph_pythia8') != -1: return 0.001385 elif fileName.find('TTToSemiLeptonic_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('W3JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 992.5 elif fileName.find('QCD_HT500to700_TuneCP5_13TeV-madgraph-pythia8') != -1: return 29980.0 elif fileName.find('QCD_HT200to300_TuneCP5_13TeV-madgraph-pythia8') != -1: return 1547000.0 elif fileName.find('W1JetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 8873.0 elif fileName.find('TTToHadronic_TuneCP5down_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('QCD_HT100to200_TuneCP5_13TeV-madgraph-pythia8') != -1: return 23700000.0 elif fileName.find('ST_tWqqZ_5f_LO_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.001122 elif fileName.find('DYToMuMu_pomflux_Pt-30_TuneCP5_13TeV-pythia8') != -1: return 4.219 elif fileName.find('WJetsToLNu_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 52940.0 elif fileName.find('TTTo2L2Nu_TuneCP5_erdON_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTToHadronic_TuneCP5up_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTTo2L2Nu_TuneCUETP8M1_14TeV-powheg-pythia8') != -1: return 90.75 elif fileName.find('TTToLL_MLL_1200To1800_NNPDF31_13TeV-powheg') != -1: return 687.1 elif fileName.find('TTTo2L2Nu_TuneCP5down_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYJetsToQQ_HT180_13TeV-madgraphMLM-pythia8') != -1: return 1208.0 elif fileName.find('tZq_ll_4f_scaledown_13TeV-amcatnlo-pythia8') != -1: return 0.0758 elif fileName.find('TTToLL_MLL_1800ToInf_NNPDF31_13TeV-powheg') != -1: return 687.1 elif fileName.find('TTJets_TuneCP5_13TeV-amcatnloFXFX-pythia8') != -1: return 722.8 elif fileName.find('ttZJets_TuneCP5_13TeV_madgraphMLM_pythia8') != -1: return 0.5407 elif fileName.find('TTToHadronic_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('tZq_ll_4f_ckm_NLO_13TeV-amcatnlo-herwigpp') != -1: return 0.07579 elif fileName.find('ttWJets_TuneCP5_13TeV_madgraphMLM_pythia8') != -1: return 0.4611 elif fileName.find('TTToLL_MLL_800To1200_NNPDF31_13TeV-powheg') != -1: return 687.1 elif fileName.find('tZq_ll_4f_scaleup_13TeV-amcatnlo-pythia8') != -1: return 0.0758 elif fileName.find('DYToEE_M-50_NNPDF31_13TeV-powheg-pythia8') != -1: return 2137.0 elif fileName.find('TTJets_TuneCP5_13TeV-madgraphMLM-pythia8') != -1: return 496.1 elif fileName.find('DYToLL-M-50_3J_14TeV-madgraphMLM-pythia8') != -1: return 191.7 elif fileName.find('DYToLL-M-50_0J_14TeV-madgraphMLM-pythia8') != -1: return 3676.0 elif fileName.find('TTTo2L2Nu_TuneCP5up_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('DYToLL-M-50_1J_14TeV-madgraphMLM-pythia8') != -1: return 1090.0 elif fileName.find('DYToLL-M-50_2J_14TeV-madgraphMLM-pythia8') != -1: return 358.7 elif fileName.find('TTZToQQ_TuneCP5_13TeV-amcatnlo-pythia8') != -1: return 0.5104 elif fileName.find('TTTo2L2Nu_TuneCP5_13TeV-powheg-pythia8') != -1: return 687.1 elif fileName.find('TTZToBB_TuneCP5_13TeV-amcatnlo-pythia8') != -1: return 0.1118 elif fileName.find('DYToLL_M_1_TuneCUETP8M1_13TeV_pythia8') != -1: return 19670.0 elif fileName.find('DYToLL_2J_13TeV-amcatnloFXFX-pythia8') != -1: return 340.5 elif fileName.find('DYToLL_0J_13TeV-amcatnloFXFX-pythia8') != -1: return 4757.0 elif fileName.find('DYTo2Mu_M1300_CUETP8M1_13TeV-pythia8') != -1: return 78420000000.0 elif fileName.find('TTWZ_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.002441 elif fileName.find('TTWW_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.006979 elif fileName.find('TTZZ_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.001386 elif fileName.find('DYTo2Mu_M300_CUETP8M1_13TeV-pythia8') != -1: return 78390000000.0 elif fileName.find('TTZH_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.00113 elif fileName.find('TTTW_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.0007314 elif fileName.find('DYTo2E_M1300_CUETP8M1_13TeV-pythia8') != -1: return 78390000000.0 elif fileName.find('DYTo2Mu_M800_CUETP8M1_13TeV-pythia8') != -1: return 78420000000.0 elif fileName.find('TTWH_TuneCP5_13TeV-madgraph-pythia8') != -1: return 0.001141 elif fileName.find('WZ_TuneCP5_PSweights_13TeV-pythia8') != -1: return 27.52 elif fileName.find('WWZ_TuneCP5_13TeV-amcatnlo-pythia8') != -1: return 0.1676 elif fileName.find('DYTo2E_M800_CUETP8M1_13TeV-pythia8') != -1: return 78420000000.0 elif fileName.find('WW_TuneCP5_PSweights_13TeV-pythia8') != -1: return 76.15 elif fileName.find('ZZZ_TuneCP5_13TeV-amcatnlo-pythia8') != -1: return 0.01398 elif fileName.find('DYTo2E_M300_CUETP8M1_13TeV-pythia8') != -1: return 78420000000.0 elif fileName.find('WZZ_TuneCP5_13TeV-amcatnlo-pythia8') != -1: return 0.05565 elif fileName.find('tZq_ll_4f_13TeV-amcatnlo-herwigpp') != -1: return 0.0758 elif fileName.find('tZq_ll_4f_13TeV-amcatnlo-pythia8') != -1: return 0.0758 elif fileName.find('DYToLL_M-50_14TeV_pythia8_pilot1') != -1: return 4927.0 elif fileName.find('DYToLL_M-50_14TeV_pythia8') != -1: return 4963.0 elif fileName.find('WZ_TuneCP5_13TeV-pythia8') != -1: return 27.6 elif fileName.find('ZZ_TuneCP5_13TeV-pythia8') != -1: return 12.14 elif fileName.find('WW_TuneCP5_13TeV-pythia8') != -1: return 75.8 elif fileName.find('DYJetsToLL_Pt-100To250') != -1: return 84.014804 elif fileName.find('DYJetsToLL_Pt-400To650') != -1: return 0.436041144 elif fileName.find('DYJetsToLL_Pt-650ToInf') != -1: return 0.040981055 elif fileName.find('DYJetsToLL_Pt-250To400') != -1: return 3.228256512 elif fileName.find('DYJetsToLL_Pt-50To100') != -1: return 363.81428 elif fileName.find('DYJetsToLL_Zpt-0To50') != -1: return 5352.57924 elif fileName.find('TTToSemiLeptonic') != -1: return 365.34 elif fileName.find('TTToHadronic') != -1: return 377.96 elif fileName.find('TTJetsFXFX') != -1: return 831.76 elif fileName.find('TTTo2L2Nu') != -1: return 88.29 elif fileName.find('DYToLL_0J') != -1: return 4620.519036 elif fileName.find('DYToLL_2J') != -1: return 338.258531 elif fileName.find('DYToLL_1J') != -1: return 859.589402 elif fileName.find('SingleMuon') != -1 or fileName.find('SingleElectron') != -1 or fileName.find('JetHT') != -1 or (fileName.find('MET') != -1) or (fileName.find('MTHT') != -1): return 1.0 else: print('Cross section not defined! Returning 0 and skipping sample:\n{}\n'.format(fileName)) return 0
""" --- Day 1: Report Repair --- After saving Christmas five years in a row, you've decided to take a vacation at a nice resort on a tropical island. Surely, Christmas will go on without you. The tropical island has its own currency and is entirely cash-only. The gold coins used there have a little picture of a starfish; the locals just call them stars. None of the currency exchanges seem to have heard of them, but somehow, you'll need to find fifty of these coins by the time you arrive so you can pay the deposit on your room. To save your vacation, you need to get all fifty stars by December 25th. Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck! Before you leave, the Elves in accounting just need you to fix your expense report (your puzzle input); apparently, something isn't quite adding up. Specifically, they need you to find the two entries that sum to 2020 and then multiply those two numbers together. For example, suppose your expense report contained the following: 1721 979 366 299 675 1456 In this list, the two entries that sum to 2020 are 1721 and 299. Multiplying them together produces 1721 * 299 = 514579, so the correct answer is 514579. Of course, your expense report is much larger. Find the two entries that sum to 2020; what do you get if you multiply them together? Your puzzle answer was 898299. --- Part Two --- The Elves in accounting are thankful for your help; one of them even offers you a starfish coin they had left over from a past vacation. They offer you a second one if you can find three numbers in your expense report that meet the same criteria. Using the above example again, the three entries that sum to 2020 are 979, 366, and 675. Multiplying them together produces the answer, 241861950. In your expense report, what is the product of the three entries that sum to 2020? """ # This solution is highly inefficient, I did it at like 11pm the night of so there are better ways to do it data = ["1810", "1729", "1857", "1777", "1927", "1936", "1797", "1719", "1703", "1758", "1768", "2008", "1963", "1925", "1919", "1911", "1782", "2001", "1744", "1738", "1742", "1799", "1765", "1819", "1888", "127", "1880", "1984", "1697", "1760", "1680", "1951", "1745", "1817", "1704", "1736", "1969", "1705", "1690", "1848", "1885", "1912", "1982", "1895", "1959", "1769", "1722", "1807", "1901", "1983", "1993", "1871", "1795", "1955", "1921", "1934", "1743", "1899", "1942", "1964", "1034", "1952", "1851", "1716", "1800", "1771", "1945", "1877", "1917", "1930", "1970", "1948", "1914", "1767", "1910", "563", "1121", "1897", "1946", "1882", "1739", "1900", "1714", "1931", "2000", "311", "1881", "1876", "354", "1965", "1842", "1979", "1998", "1960", "1852", "1847", "1938", "1369", "1780", "1698", "1753", "1746", "1868", "1752", "1802", "1892", "1755", "1818", "1913", "1706", "1862", "326", "1941", "1926", "1809", "1879", "1815", "1939", "1859", "1999", "1947", "1898", "1794", "1737", "1971", "1977", "1944", "1812", "1905", "1359", "1788", "1754", "1774", "1825", "1748", "1701", "1791", "1786", "1692", "1894", "1961", "1902", "1849", "1967", "1770", "1987", "1831", "1728", "1896", "1805", "1733", "1918", "1731", "661", "1776", "1494", "2005", "2009", "2004", "1915", "1695", "1710", "1804", "1929", "1725", "1772", "1933", "609", "1708", "1822", "1978", "1811", "1816", "1073", "1874", "1845", "1989", "1696", "1953", "1823", "1923", "1907", "1834", "1806", "1861", "1785", "297", "1968", "1764", "1932", "1937", "1826", "1732", "1962", "1916", "1756", "1975", "1775", "1922", "1773"] for item in data: if item.isdigit(): item = int(item) for sub_item in data: if sub_item.isdigit(): sub_item = int(sub_item) if item + sub_item == 2020: print(f"Answer found:\n\t{item} + {sub_item} == 2020\n\t{item} * {sub_item} == {item*sub_item}") # Answer to part 1 for sub_sub_item in data: if sub_sub_item.isdigit(): # Answer to part 2 sub_sub_item = int(sub_sub_item) if item + sub_item + sub_sub_item == 2020: print(f"Answer found:\n\t{item} + {sub_item} + {sub_sub_item} == 2020\n\t{item} * {sub_item} * {sub_sub_item} == {item*sub_item * sub_sub_item}")
""" --- Day 1: Report Repair --- After saving Christmas five years in a row, you've decided to take a vacation at a nice resort on a tropical island. Surely, Christmas will go on without you. The tropical island has its own currency and is entirely cash-only. The gold coins used there have a little picture of a starfish; the locals just call them stars. None of the currency exchanges seem to have heard of them, but somehow, you'll need to find fifty of these coins by the time you arrive so you can pay the deposit on your room. To save your vacation, you need to get all fifty stars by December 25th. Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck! Before you leave, the Elves in accounting just need you to fix your expense report (your puzzle input); apparently, something isn't quite adding up. Specifically, they need you to find the two entries that sum to 2020 and then multiply those two numbers together. For example, suppose your expense report contained the following: 1721 979 366 299 675 1456 In this list, the two entries that sum to 2020 are 1721 and 299. Multiplying them together produces 1721 * 299 = 514579, so the correct answer is 514579. Of course, your expense report is much larger. Find the two entries that sum to 2020; what do you get if you multiply them together? Your puzzle answer was 898299. --- Part Two --- The Elves in accounting are thankful for your help; one of them even offers you a starfish coin they had left over from a past vacation. They offer you a second one if you can find three numbers in your expense report that meet the same criteria. Using the above example again, the three entries that sum to 2020 are 979, 366, and 675. Multiplying them together produces the answer, 241861950. In your expense report, what is the product of the three entries that sum to 2020? """ data = ['1810', '1729', '1857', '1777', '1927', '1936', '1797', '1719', '1703', '1758', '1768', '2008', '1963', '1925', '1919', '1911', '1782', '2001', '1744', '1738', '1742', '1799', '1765', '1819', '1888', '127', '1880', '1984', '1697', '1760', '1680', '1951', '1745', '1817', '1704', '1736', '1969', '1705', '1690', '1848', '1885', '1912', '1982', '1895', '1959', '1769', '1722', '1807', '1901', '1983', '1993', '1871', '1795', '1955', '1921', '1934', '1743', '1899', '1942', '1964', '1034', '1952', '1851', '1716', '1800', '1771', '1945', '1877', '1917', '1930', '1970', '1948', '1914', '1767', '1910', '563', '1121', '1897', '1946', '1882', '1739', '1900', '1714', '1931', '2000', '311', '1881', '1876', '354', '1965', '1842', '1979', '1998', '1960', '1852', '1847', '1938', '1369', '1780', '1698', '1753', '1746', '1868', '1752', '1802', '1892', '1755', '1818', '1913', '1706', '1862', '326', '1941', '1926', '1809', '1879', '1815', '1939', '1859', '1999', '1947', '1898', '1794', '1737', '1971', '1977', '1944', '1812', '1905', '1359', '1788', '1754', '1774', '1825', '1748', '1701', '1791', '1786', '1692', '1894', '1961', '1902', '1849', '1967', '1770', '1987', '1831', '1728', '1896', '1805', '1733', '1918', '1731', '661', '1776', '1494', '2005', '2009', '2004', '1915', '1695', '1710', '1804', '1929', '1725', '1772', '1933', '609', '1708', '1822', '1978', '1811', '1816', '1073', '1874', '1845', '1989', '1696', '1953', '1823', '1923', '1907', '1834', '1806', '1861', '1785', '297', '1968', '1764', '1932', '1937', '1826', '1732', '1962', '1916', '1756', '1975', '1775', '1922', '1773'] for item in data: if item.isdigit(): item = int(item) for sub_item in data: if sub_item.isdigit(): sub_item = int(sub_item) if item + sub_item == 2020: print(f'Answer found:\n\t{item} + {sub_item} == 2020\n\t{item} * {sub_item} == {item * sub_item}') for sub_sub_item in data: if sub_sub_item.isdigit(): sub_sub_item = int(sub_sub_item) if item + sub_item + sub_sub_item == 2020: print(f'Answer found:\n\t{item} + {sub_item} + {sub_sub_item} == 2020\n\t{item} * {sub_item} * {sub_sub_item} == {item * sub_item * sub_sub_item}')
# -*- coding: utf-8 -*- """ To-Do application """ def add(todos): """ Add a task """ task = input('New task: ') todos.append({ 'task': task, 'done': False }) def delete(todos, index=None): """ Delete one or all tasks """ if index is not None: del todos[index] else: del todos[:] def get_printable_todos(todos): """ Get formatted tasks """ pass def toggle_done(todos, index): """ Toggle a task """ todos[index]['done'] = not todos[index]['done'] def view(todos, index): """ Print tasks """ print('\nTo-Do list') print('=' * 40) def main(): """ Main function """ todos = [] print('Add New tasks...') add(todos) add(todos) add(todos) print(todos) print('\nThe Second one is toggled') toggle_done(todos, 1) print(todos) print('\nThe last one is removed') delete(todos, 2) print(todos) print('\nAll the todos are cleaned.') delete(todos) print(todos) if __name__ == '__main__': main()
""" To-Do application """ def add(todos): """ Add a task """ task = input('New task: ') todos.append({'task': task, 'done': False}) def delete(todos, index=None): """ Delete one or all tasks """ if index is not None: del todos[index] else: del todos[:] def get_printable_todos(todos): """ Get formatted tasks """ pass def toggle_done(todos, index): """ Toggle a task """ todos[index]['done'] = not todos[index]['done'] def view(todos, index): """ Print tasks """ print('\nTo-Do list') print('=' * 40) def main(): """ Main function """ todos = [] print('Add New tasks...') add(todos) add(todos) add(todos) print(todos) print('\nThe Second one is toggled') toggle_done(todos, 1) print(todos) print('\nThe last one is removed') delete(todos, 2) print(todos) print('\nAll the todos are cleaned.') delete(todos) print(todos) if __name__ == '__main__': main()
# Copyright 2019 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """A test rule that compares two binary files. The rule uses a Bash command (diff) on Linux/macOS/non-Windows, and a cmd.exe command (fc.exe) on Windows (no Bash is required). """ def _runfiles_path(f): if f.root.path: return f.path[len(f.root.path) + 1:] # generated file else: return f.path # source file def _diff_test_impl(ctx): if ctx.attr.is_windows: test_bin = ctx.actions.declare_file(ctx.label.name + "-test.bat") ctx.actions.write( output = test_bin, content = """@rem Generated by diff_test.bzl, do not edit. @echo off SETLOCAL ENABLEEXTENSIONS SETLOCAL ENABLEDELAYEDEXPANSION set MF=%RUNFILES_MANIFEST_FILE:/=\\% set PATH=%SYSTEMROOT%\\system32 set F1={file1} set F2={file2} if "!F1:~0,9!" equ "external/" (set F1=!F1:~9!) else (set F1=!TEST_WORKSPACE!/!F1!) if "!F2:~0,9!" equ "external/" (set F2=!F2:~9!) else (set F2=!TEST_WORKSPACE!/!F2!) for /F "tokens=2* usebackq" %%i in (`findstr.exe /l /c:"!F1! " "%MF%"`) do ( set RF1=%%i set RF1=!RF1:/=\\! ) if "!RF1!" equ "" ( echo>&2 ERROR: !F1! not found exit /b 1 ) for /F "tokens=2* usebackq" %%i in (`findstr.exe /l /c:"!F2! " "%MF%"`) do ( set RF2=%%i set RF2=!RF2:/=\\! ) if "!RF2!" equ "" ( echo>&2 ERROR: !F2! not found exit /b 1 ) fc.exe 2>NUL 1>NUL /B "!RF1!" "!RF2!" if %ERRORLEVEL% neq 0 ( if %ERRORLEVEL% equ 1 ( echo>&2 FAIL: files "{file1}" and "{file2}" differ exit /b 1 ) else ( fc.exe /B "!RF1!" "!RF2!" exit /b %errorlevel% ) ) """.format( file1 = _runfiles_path(ctx.file.file1), file2 = _runfiles_path(ctx.file.file2), ), is_executable = True, ) else: test_bin = ctx.actions.declare_file(ctx.label.name + "-test.sh") ctx.actions.write( output = test_bin, content = r"""#!/bin/bash set -euo pipefail F1="{file1}" F2="{file2}" [[ "$F1" =~ ^external/* ]] && F1="${{F1#external/}}" || F1="$TEST_WORKSPACE/$F1" [[ "$F2" =~ ^external/* ]] && F2="${{F2#external/}}" || F2="$TEST_WORKSPACE/$F2" if [[ -d "${{RUNFILES_DIR:-/dev/null}}" && "${{RUNFILES_MANIFEST_ONLY:-}}" != 1 ]]; then RF1="$RUNFILES_DIR/$F1" RF2="$RUNFILES_DIR/$F2" elif [[ -f "${{RUNFILES_MANIFEST_FILE:-/dev/null}}" ]]; then RF1="$(grep -F -m1 "$F1 " "$RUNFILES_MANIFEST_FILE" | sed 's/^[^ ]* //')" RF2="$(grep -F -m1 "$F2 " "$RUNFILES_MANIFEST_FILE" | sed 's/^[^ ]* //')" elif [[ -f "$TEST_SRCDIR/$F1" && -f "$TEST_SRCDIR/$F2" ]]; then RF1="$TEST_SRCDIR/$F1" RF2="$TEST_SRCDIR/$F2" else echo >&2 "ERROR: could not find \"{file1}\" and \"{file2}\"" exit 1 fi if ! diff "$RF1" "$RF2"; then echo >&2 "FAIL: files \"{file1}\" and \"{file2}\" differ" exit 1 fi """.format( file1 = _runfiles_path(ctx.file.file1), file2 = _runfiles_path(ctx.file.file2), ), is_executable = True, ) return DefaultInfo( executable = test_bin, files = depset(direct = [test_bin]), runfiles = ctx.runfiles(files = [test_bin, ctx.file.file1, ctx.file.file2]), ) _diff_test = rule( attrs = { "file1": attr.label( allow_single_file = True, mandatory = True, ), "file2": attr.label( allow_single_file = True, mandatory = True, ), "is_windows": attr.bool(mandatory = True), }, test = True, implementation = _diff_test_impl, ) def diff_test(name, file1, file2, **kwargs): """A test that compares two files. The test succeeds if the files' contents match. Args: name: The name of the test rule. file1: Label of the file to compare to <code>file2</code>. file2: Label of the file to compare to <code>file1</code>. **kwargs: The <a href="https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-tests">common attributes for tests</a>. """ _diff_test( name = name, file1 = file1, file2 = file2, is_windows = select({ "@bazel_tools//src/conditions:host_windows": True, "//conditions:default": False, }), **kwargs )
"""A test rule that compares two binary files. The rule uses a Bash command (diff) on Linux/macOS/non-Windows, and a cmd.exe command (fc.exe) on Windows (no Bash is required). """ def _runfiles_path(f): if f.root.path: return f.path[len(f.root.path) + 1:] else: return f.path def _diff_test_impl(ctx): if ctx.attr.is_windows: test_bin = ctx.actions.declare_file(ctx.label.name + '-test.bat') ctx.actions.write(output=test_bin, content='@rem Generated by diff_test.bzl, do not edit.\n@echo off\nSETLOCAL ENABLEEXTENSIONS\nSETLOCAL ENABLEDELAYEDEXPANSION\nset MF=%RUNFILES_MANIFEST_FILE:/=\\%\nset PATH=%SYSTEMROOT%\\system32\nset F1={file1}\nset F2={file2}\nif "!F1:~0,9!" equ "external/" (set F1=!F1:~9!) else (set F1=!TEST_WORKSPACE!/!F1!)\nif "!F2:~0,9!" equ "external/" (set F2=!F2:~9!) else (set F2=!TEST_WORKSPACE!/!F2!)\nfor /F "tokens=2* usebackq" %%i in (`findstr.exe /l /c:"!F1! " "%MF%"`) do (\n set RF1=%%i\n set RF1=!RF1:/=\\!\n)\nif "!RF1!" equ "" (\n echo>&2 ERROR: !F1! not found\n exit /b 1\n)\nfor /F "tokens=2* usebackq" %%i in (`findstr.exe /l /c:"!F2! " "%MF%"`) do (\n set RF2=%%i\n set RF2=!RF2:/=\\!\n)\nif "!RF2!" equ "" (\n echo>&2 ERROR: !F2! not found\n exit /b 1\n)\nfc.exe 2>NUL 1>NUL /B "!RF1!" "!RF2!"\nif %ERRORLEVEL% neq 0 (\n if %ERRORLEVEL% equ 1 (\n echo>&2 FAIL: files "{file1}" and "{file2}" differ\n exit /b 1\n ) else (\n fc.exe /B "!RF1!" "!RF2!"\n exit /b %errorlevel%\n )\n)\n'.format(file1=_runfiles_path(ctx.file.file1), file2=_runfiles_path(ctx.file.file2)), is_executable=True) else: test_bin = ctx.actions.declare_file(ctx.label.name + '-test.sh') ctx.actions.write(output=test_bin, content='#!/bin/bash\nset -euo pipefail\nF1="{file1}"\nF2="{file2}"\n[[ "$F1" =~ ^external/* ]] && F1="${{F1#external/}}" || F1="$TEST_WORKSPACE/$F1"\n[[ "$F2" =~ ^external/* ]] && F2="${{F2#external/}}" || F2="$TEST_WORKSPACE/$F2"\nif [[ -d "${{RUNFILES_DIR:-/dev/null}}" && "${{RUNFILES_MANIFEST_ONLY:-}}" != 1 ]]; then\n RF1="$RUNFILES_DIR/$F1"\n RF2="$RUNFILES_DIR/$F2"\nelif [[ -f "${{RUNFILES_MANIFEST_FILE:-/dev/null}}" ]]; then\n RF1="$(grep -F -m1 "$F1 " "$RUNFILES_MANIFEST_FILE" | sed \'s/^[^ ]* //\')"\n RF2="$(grep -F -m1 "$F2 " "$RUNFILES_MANIFEST_FILE" | sed \'s/^[^ ]* //\')"\nelif [[ -f "$TEST_SRCDIR/$F1" && -f "$TEST_SRCDIR/$F2" ]]; then\n RF1="$TEST_SRCDIR/$F1"\n RF2="$TEST_SRCDIR/$F2"\nelse\n echo >&2 "ERROR: could not find \\"{file1}\\" and \\"{file2}\\""\n exit 1\nfi\nif ! diff "$RF1" "$RF2"; then\n echo >&2 "FAIL: files \\"{file1}\\" and \\"{file2}\\" differ"\n exit 1\nfi\n'.format(file1=_runfiles_path(ctx.file.file1), file2=_runfiles_path(ctx.file.file2)), is_executable=True) return default_info(executable=test_bin, files=depset(direct=[test_bin]), runfiles=ctx.runfiles(files=[test_bin, ctx.file.file1, ctx.file.file2])) _diff_test = rule(attrs={'file1': attr.label(allow_single_file=True, mandatory=True), 'file2': attr.label(allow_single_file=True, mandatory=True), 'is_windows': attr.bool(mandatory=True)}, test=True, implementation=_diff_test_impl) def diff_test(name, file1, file2, **kwargs): """A test that compares two files. The test succeeds if the files' contents match. Args: name: The name of the test rule. file1: Label of the file to compare to <code>file2</code>. file2: Label of the file to compare to <code>file1</code>. **kwargs: The <a href="https://docs.bazel.build/versions/main/be/common-definitions.html#common-attributes-tests">common attributes for tests</a>. """ _diff_test(name=name, file1=file1, file2=file2, is_windows=select({'@bazel_tools//src/conditions:host_windows': True, '//conditions:default': False}), **kwargs)
class Solution: """ @param numbers: Give an array numbers of n integer @param target: An integer @return: return the sum of the three integers, the sum closest target. """ def threeSumClosest(self, numbers, target): numbers.sort() ans = None for i in range(len(numbers)): left, right = i + 1, len(numbers) - 1 while left < right: sum = numbers[left] + numbers[right] + numbers[i] if ans is None or abs(sum - target) < abs(ans - target): ans = sum if sum <= target: left += 1 else: right -= 1 return ans
class Solution: """ @param numbers: Give an array numbers of n integer @param target: An integer @return: return the sum of the three integers, the sum closest target. """ def three_sum_closest(self, numbers, target): numbers.sort() ans = None for i in range(len(numbers)): (left, right) = (i + 1, len(numbers) - 1) while left < right: sum = numbers[left] + numbers[right] + numbers[i] if ans is None or abs(sum - target) < abs(ans - target): ans = sum if sum <= target: left += 1 else: right -= 1 return ans
variant = ["_clear", "_scratched", "_crystal", "_dim", "_dark", "_bright", "_ghostly", "_ethereal", "_foreboding", "_strong"] colors = ["white", "orange", "magenta", "light_blue", "yellow", "lime", "pink", "gray", "silver", "cyan", "purple", "blue", "brown", "green", "red", "black"] for prefix in variant: with open("./glass" + prefix + ".json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:cube_ctm_cutout", "textures": { "all": "planarartifice:blocks/glass/glass''' + prefix + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''", "connected_tex": "planarartifice:blocks/glass/glass''' + prefix + '''_ctm" } }, "variants": { "normal": [{}], "inventory": [{}] } } ''') with open("./glass" + prefix + "_rainbow.json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:cube_ctm_translucent", "textures": { "all": "planarartifice:blocks/glass/glass''' + prefix + '''_rainbow", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_rainbow", "connected_tex": "planarartifice:blocks/glass/glass''' + prefix + '''_rainbow_ctm" } }, "variants": { "normal": [{}], "inventory": [{}] } } ''') with open("./glass_panel" + prefix + ".json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:panel_ctm_cutout", "textures": { "all": "planarartifice:blocks/glass/glass''' + prefix + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''", "connected_tex": "planarartifice:blocks/glass/glass''' + prefix + '''_ctm" } }, "variants": { "normal": [{}], "inventory": [{}] } } ''') with open("./glass_panel" + prefix + "_rainbow.json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:panel_ctm_translucent", "textures": { "all": "planarartifice:blocks/glass/glass''' + prefix + '''_rainbow", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_rainbow", "connected_tex": "planarartifice:blocks/glass/glass''' + prefix + '''_rainbow_ctm" } }, "variants": { "normal": [{}], "inventory": [{}] } } ''') ##################### STAINED GLASS ######### with open("./stained_glass" + prefix + ".json", "w") as f: q = '' for color in colors: q += '''"color=''' + color + '''": [{ "textures": { "all": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "connected_tex": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" } }],''' f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:cube_ctm_translucent" }, "variants": { ''' + q[:-1] + ''' } } ''') with open("./stained_glass_panel" + prefix + ".json", "w") as f: q = '' for color in colors: q += '''"color=''' + color + '''": [{ "textures": { "all": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "connected_tex": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" } }],''' f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:panel_ctm_translucent" }, "variants": { ''' + q[:-1] + ''' } } ''') ################# GLASS PANE ########### with open("./glass_pane" + prefix + ".json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "transform": "forge:default-item", "textures": { "edge" : "blocks/glass_pane_top", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_ctm" } }, "variants": { "inventory": [{ "model": "planarartifice:pane/ctm_ew" }], "east=false,north=false,south=false,west=false": [{ "model": "planarartifice:pane/post" }], "east=false,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_n" }], "east=true,north=false,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_e" }], "east=false,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_s" }], "east=false,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_w" }], "east=true,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_ne" }], "east=true,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_se" }], "east=false,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sw" }], "east=false,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_nw" }], "east=false,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_ns" }], "east=true,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_ew" }], "east=true,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_nse" }], "east=true,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sew" }], "east=false,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsw" }], "east=true,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_new" }], "east=true,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsew" }] } } ''') with open("./glass_pane" + prefix + "_rainbow.json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "transform": "forge:default-item", "textures": { "edge" : "planarartifice:blocks/glass/glass_pane_top_rainbow", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_rainbow", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_rainbow", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_rainbow_ctm" } }, "variants": { "inventory": [{ "model": "planarartifice:pane/ctm_ew_translucent" }], "east=false,north=false,south=false,west=false": [{ "model": "planarartifice:pane/post_translucent" }], "east=false,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_n_translucent" }], "east=true,north=false,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_e_translucent" }], "east=false,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_s_translucent" }], "east=false,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_w_translucent" }], "east=true,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_ne_translucent" }], "east=true,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_se_translucent" }], "east=false,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sw_translucent" }], "east=false,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_nw_translucent" }], "east=false,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_ns_translucent" }], "east=true,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_ew_translucent" }], "east=true,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_nse_translucent" }], "east=true,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sew_translucent" }], "east=false,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsw_translucent" }], "east=true,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_new_translucent" }], "east=true,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsew_translucent" }] } } ''') ############ STAINED GLASS PANE ##### with open("./stained_glass_pane" + prefix + ".json", "w") as f: q = '' for color in colors: q += '''"color=''' + color + ''',east=false,north=false,south=false,west=false": [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/post_translucent" }], "color=''' + color + ''',east=false,north=true,south=false,west=false" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_n_translucent" }], "color=''' + color + ''',east=true,north=false,south=false,west=false" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_e_translucent" }], "color=''' + color + ''',east=false,north=false,south=true,west=false" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_s_translucent" }], "color=''' + color + ''',east=false,north=false,south=false,west=true" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_w_translucent" }], "color=''' + color + ''',east=true,north=true,south=false,west=false" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_ne_translucent" }], "color=''' + color + ''',east=true,north=false,south=true,west=false" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_se_translucent" }], "color=''' + color + ''',east=false,north=false,south=true,west=true" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_sw_translucent" }], "color=''' + color + ''',east=false,north=true,south=false,west=true" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_nw_translucent" }],''' q += '''"color=''' + color + ''',east=false,north=true,south=true,west=false" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_ns_translucent" }], "color=''' + color + ''',east=true,north=false,south=false,west=true" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_ew_translucent" }], "color=''' + color + ''',east=true,north=true,south=true,west=false" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_nse_translucent" }], "color=''' + color + ''',east=true,north=false,south=true,west=true" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_sew_translucent" }], "color=''' + color + ''',east=false,north=true,south=true,west=true" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_nsw_translucent" }], "color=''' + color + ''',east=true,north=true,south=false,west=true" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_new_translucent" }], "color=''' + color + ''',east=true,north=true,south=true,west=true" : [{ "textures": { "edge" : "blocks/glass_pane_top_''' + color + '''", "pane" : "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "particle": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''", "pane_ct": "planarartifice:blocks/glass/glass''' + prefix + '''_''' + color + '''_ctm" }, "model": "planarartifice:pane/ctm_nsew_translucent" }],''' f.write(''' { "forge_marker": 1, "defaults": { "transform": "forge:default-item" }, "variants": { ''' + q[:-1] + ''' } } ''') with open("./glass_rainbow.json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:cube_ctm_translucent", "textures": { "all": "planarartifice:blocks/glass/glass_rainbow", "particle": "planarartifice:blocks/glass/glass_rainbow", "connected_tex": "planarartifice:blocks/glass/glass_rainbow_ctm" } }, "variants": { "normal": [{}], "inventory": [{}] } } ''') with open("./glass_pane_rainbow.json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "transform": "forge:default-item", "textures": { "edge" : "planarartifice:blocks/glass/glass_pane_top_rainbow", "pane" : "planarartifice:blocks/glass/glass_rainbow", "particle": "planarartifice:blocks/glass/glass_rainbow", "pane_ct": "planarartifice:blocks/glass/glass_rainbow_ctm" } }, "variants": { "inventory": [{ "model": "planarartifice:pane/ctm_ew_translucent" }], "east=false,north=false,south=false,west=false": [{ "model": "planarartifice:pane/post_translucent" }], "east=false,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_n_translucent" }], "east=true,north=false,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_e_translucent" }], "east=false,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_s_translucent" }], "east=false,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_w_translucent" }], "east=true,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_ne_translucent" }], "east=true,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_se_translucent" }], "east=false,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sw_translucent" }], "east=false,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_nw_translucent" }], "east=false,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_ns_translucent" }], "east=true,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_ew_translucent" }], "east=true,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_nse_translucent" }], "east=true,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sew_translucent" }], "east=false,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsw_translucent" }], "east=true,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_new_translucent" }], "east=true,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsew_translucent" }] } } ''') with open("./glass_panel.json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:panel_ctm_cutout", "textures": { "all": "blocks/glass", "particle": "blocks/glass", "connected_tex": "blocks/glass_ctm" } }, "variants": { "normal": [{}], "inventory": [{}] } } ''') with open("./glass_panel_rainbow.json", "w") as f: f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:panel_ctm_translucent", "textures": { "all": "planarartifice:blocks/glass/glass_rainbow", "particle": "planarartifice:blocks/glass/glass_rainbow", "connected_tex": "planarartifice:blocks/glass/glass_rainbow_ctm" } }, "variants": { "normal": [{}], "inventory": [{}] } } ''') with open("./stained_glass_panel.json", "w") as f: q = '' for color in colors: q += '''"color=''' + color + '''": [{ "textures": { "all": "blocks/glass_''' + color + '''", "particle": "blocks/glass_''' + color + '''", "connected_tex": "blocks/glass_''' + color + '''_ctm" } }],''' f.write(''' { "forge_marker": 1, "defaults": { "model": "planarartifice:panel_ctm_translucent" }, "variants": { ''' + q[:-1] + ''' } } ''')
variant = ['_clear', '_scratched', '_crystal', '_dim', '_dark', '_bright', '_ghostly', '_ethereal', '_foreboding', '_strong'] colors = ['white', 'orange', 'magenta', 'light_blue', 'yellow', 'lime', 'pink', 'gray', 'silver', 'cyan', 'purple', 'blue', 'brown', 'green', 'red', 'black'] for prefix in variant: with open('./glass' + prefix + '.json', 'w') as f: f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:cube_ctm_cutout",\n "textures": {\n "all": "planarartifice:blocks/glass/glass' + prefix + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '",\n "connected_tex": "planarartifice:blocks/glass/glass' + prefix + '_ctm"\n }\n },\n "variants": {\n "normal": [{}],\n "inventory": [{}]\n }\n }\n ') with open('./glass' + prefix + '_rainbow.json', 'w') as f: f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:cube_ctm_translucent",\n "textures": {\n "all": "planarartifice:blocks/glass/glass' + prefix + '_rainbow",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_rainbow",\n "connected_tex": "planarartifice:blocks/glass/glass' + prefix + '_rainbow_ctm"\n }\n },\n "variants": {\n "normal": [{}],\n "inventory": [{}]\n }\n }\n ') with open('./glass_panel' + prefix + '.json', 'w') as f: f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:panel_ctm_cutout",\n "textures": {\n "all": "planarartifice:blocks/glass/glass' + prefix + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '",\n "connected_tex": "planarartifice:blocks/glass/glass' + prefix + '_ctm"\n }\n },\n "variants": {\n "normal": [{}],\n "inventory": [{}]\n }\n }\n ') with open('./glass_panel' + prefix + '_rainbow.json', 'w') as f: f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:panel_ctm_translucent",\n "textures": {\n "all": "planarartifice:blocks/glass/glass' + prefix + '_rainbow",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_rainbow",\n "connected_tex": "planarartifice:blocks/glass/glass' + prefix + '_rainbow_ctm"\n }\n },\n "variants": {\n "normal": [{}],\n "inventory": [{}]\n }\n }\n ') with open('./stained_glass' + prefix + '.json', 'w') as f: q = '' for color in colors: q += '"color=' + color + '": [{\n "textures": {\n "all": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "connected_tex": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }\n }],' f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:cube_ctm_translucent"\n },\n "variants": {\n ' + q[:-1] + '\n }\n }\n ') with open('./stained_glass_panel' + prefix + '.json', 'w') as f: q = '' for color in colors: q += '"color=' + color + '": [{\n "textures": {\n "all": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "connected_tex": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }\n }],' f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:panel_ctm_translucent"\n },\n "variants": {\n ' + q[:-1] + '\n }\n }\n ') with open('./glass_pane' + prefix + '.json', 'w') as f: f.write(' \n {\n "forge_marker": 1,\n "defaults": {\n "transform": "forge:default-item",\n "textures": {\n "edge" : "blocks/glass_pane_top",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_ctm"\n }\n },\n "variants": {\n "inventory": [{ "model": "planarartifice:pane/ctm_ew" }],\n "east=false,north=false,south=false,west=false": [{ "model": "planarartifice:pane/post" }],\n\n "east=false,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_n" }],\n "east=true,north=false,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_e" }],\n "east=false,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_s" }],\n "east=false,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_w" }],\n\n "east=true,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_ne" }],\n "east=true,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_se" }],\n "east=false,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sw" }],\n "east=false,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_nw" }],\n\n "east=false,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_ns" }],\n "east=true,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_ew" }],\n\n "east=true,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_nse" }],\n "east=true,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sew" }],\n "east=false,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsw" }],\n "east=true,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_new" }],\n\n "east=true,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsew" }]\n }\n }\n ') with open('./glass_pane' + prefix + '_rainbow.json', 'w') as f: f.write(' \n {\n "forge_marker": 1,\n "defaults": {\n "transform": "forge:default-item",\n "textures": {\n "edge" : "planarartifice:blocks/glass/glass_pane_top_rainbow",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_rainbow",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_rainbow",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_rainbow_ctm"\n }\n },\n "variants": {\n "inventory": [{ "model": "planarartifice:pane/ctm_ew_translucent" }],\n "east=false,north=false,south=false,west=false": [{ "model": "planarartifice:pane/post_translucent" }],\n\n "east=false,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_n_translucent" }],\n "east=true,north=false,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_e_translucent" }],\n "east=false,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_s_translucent" }],\n "east=false,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_w_translucent" }],\n\n "east=true,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_ne_translucent" }],\n "east=true,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_se_translucent" }],\n "east=false,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sw_translucent" }],\n "east=false,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_nw_translucent" }],\n\n "east=false,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_ns_translucent" }],\n "east=true,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_ew_translucent" }],\n\n "east=true,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_nse_translucent" }],\n "east=true,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sew_translucent" }],\n "east=false,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsw_translucent" }],\n "east=true,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_new_translucent" }],\n\n "east=true,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsew_translucent" }]\n }\n }\n ') with open('./stained_glass_pane' + prefix + '.json', 'w') as f: q = '' for color in colors: q += '"color=' + color + ',east=false,north=false,south=false,west=false": [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/post_translucent" }],\n "color=' + color + ',east=false,north=true,south=false,west=false" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_n_translucent" }],\n "color=' + color + ',east=true,north=false,south=false,west=false" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_e_translucent" }],\n "color=' + color + ',east=false,north=false,south=true,west=false" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_s_translucent" }],\n "color=' + color + ',east=false,north=false,south=false,west=true" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_w_translucent" }],\n "color=' + color + ',east=true,north=true,south=false,west=false" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_ne_translucent" }],\n "color=' + color + ',east=true,north=false,south=true,west=false" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_se_translucent" }],\n "color=' + color + ',east=false,north=false,south=true,west=true" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_sw_translucent" }],\n "color=' + color + ',east=false,north=true,south=false,west=true" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_nw_translucent" }],' q += '"color=' + color + ',east=false,north=true,south=true,west=false" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_ns_translucent" }],\n "color=' + color + ',east=true,north=false,south=false,west=true" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_ew_translucent" }],\n "color=' + color + ',east=true,north=true,south=true,west=false" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_nse_translucent" }],\n "color=' + color + ',east=true,north=false,south=true,west=true" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_sew_translucent" }],\n "color=' + color + ',east=false,north=true,south=true,west=true" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_nsw_translucent" }],\n "color=' + color + ',east=true,north=true,south=false,west=true" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_new_translucent" }],\n "color=' + color + ',east=true,north=true,south=true,west=true" : [{ "textures": {\n "edge" : "blocks/glass_pane_top_' + color + '",\n "pane" : "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "particle": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '",\n "pane_ct": "planarartifice:blocks/glass/glass' + prefix + '_' + color + '_ctm"\n }, "model": "planarartifice:pane/ctm_nsew_translucent" }],' f.write(' \n {\n "forge_marker": 1,\n "defaults": {\n "transform": "forge:default-item"\n },\n "variants": {\n ' + q[:-1] + '\n }\n }\n ') with open('./glass_rainbow.json', 'w') as f: f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:cube_ctm_translucent",\n "textures": {\n "all": "planarartifice:blocks/glass/glass_rainbow",\n "particle": "planarartifice:blocks/glass/glass_rainbow",\n "connected_tex": "planarartifice:blocks/glass/glass_rainbow_ctm"\n }\n },\n "variants": {\n "normal": [{}],\n "inventory": [{}]\n }\n }\n ') with open('./glass_pane_rainbow.json', 'w') as f: f.write(' \n {\n "forge_marker": 1,\n "defaults": {\n "transform": "forge:default-item",\n "textures": {\n "edge" : "planarartifice:blocks/glass/glass_pane_top_rainbow",\n "pane" : "planarartifice:blocks/glass/glass_rainbow",\n "particle": "planarartifice:blocks/glass/glass_rainbow",\n "pane_ct": "planarartifice:blocks/glass/glass_rainbow_ctm"\n }\n },\n "variants": {\n "inventory": [{ "model": "planarartifice:pane/ctm_ew_translucent" }],\n "east=false,north=false,south=false,west=false": [{ "model": "planarartifice:pane/post_translucent" }],\n\n "east=false,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_n_translucent" }],\n "east=true,north=false,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_e_translucent" }],\n "east=false,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_s_translucent" }],\n "east=false,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_w_translucent" }],\n\n "east=true,north=true,south=false,west=false" : [{ "model": "planarartifice:pane/ctm_ne_translucent" }],\n "east=true,north=false,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_se_translucent" }],\n "east=false,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sw_translucent" }],\n "east=false,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_nw_translucent" }],\n\n "east=false,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_ns_translucent" }],\n "east=true,north=false,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_ew_translucent" }],\n\n "east=true,north=true,south=true,west=false" : [{ "model": "planarartifice:pane/ctm_nse_translucent" }],\n "east=true,north=false,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_sew_translucent" }],\n "east=false,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsw_translucent" }],\n "east=true,north=true,south=false,west=true" : [{ "model": "planarartifice:pane/ctm_new_translucent" }],\n\n "east=true,north=true,south=true,west=true" : [{ "model": "planarartifice:pane/ctm_nsew_translucent" }]\n }\n }\n ') with open('./glass_panel.json', 'w') as f: f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:panel_ctm_cutout",\n "textures": {\n "all": "blocks/glass",\n "particle": "blocks/glass",\n "connected_tex": "blocks/glass_ctm"\n }\n },\n "variants": {\n "normal": [{}],\n "inventory": [{}]\n }\n }\n ') with open('./glass_panel_rainbow.json', 'w') as f: f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:panel_ctm_translucent",\n "textures": {\n "all": "planarartifice:blocks/glass/glass_rainbow",\n "particle": "planarartifice:blocks/glass/glass_rainbow",\n "connected_tex": "planarartifice:blocks/glass/glass_rainbow_ctm"\n }\n },\n "variants": {\n "normal": [{}],\n "inventory": [{}]\n }\n }\n ') with open('./stained_glass_panel.json', 'w') as f: q = '' for color in colors: q += '"color=' + color + '": [{\n "textures": {\n "all": "blocks/glass_' + color + '",\n "particle": "blocks/glass_' + color + '",\n "connected_tex": "blocks/glass_' + color + '_ctm"\n }\n }],' f.write('\n {\n "forge_marker": 1,\n "defaults": {\n "model": "planarartifice:panel_ctm_translucent"\n },\n "variants": {\n ' + q[:-1] + '\n }\n }\n ')
[ { 'date': '2011-01-01', 'description': 'Nieuwjaarsdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NF' }, { 'date': '2011-04-22', 'description': 'Goede Vrijdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV' }, { 'date': '2011-04-24', 'description': 'Eerste Paasdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV' }, { 'date': '2011-04-25', 'description': 'Tweede Paasdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV' }, { 'date': '2011-04-30', 'description': 'Koninginnedag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NV' }, { 'date': '2011-05-04', 'description': 'Dodenherdenking', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'F' }, { 'date': '2011-05-05', 'description': 'Bevrijdingsdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NF' }, { 'date': '2011-06-02', 'description': 'Hemelvaartsdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV' }, { 'date': '2011-06-12', 'description': 'Eerste Pinksterdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV' }, { 'date': '2011-06-13', 'description': 'Tweede Pinksterdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV' }, { 'date': '2011-12-05', 'description': 'Sinterklaas', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'RF' }, { 'date': '2011-12-15', 'description': 'Koninkrijksdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NV' }, { 'date': '2011-12-25', 'description': 'Eerste Kerstdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRF' }, { 'date': '2011-12-26', 'description': 'Tweede Kerstdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRF' } ]
[{'date': '2011-01-01', 'description': 'Nieuwjaarsdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NF'}, {'date': '2011-04-22', 'description': 'Goede Vrijdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV'}, {'date': '2011-04-24', 'description': 'Eerste Paasdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV'}, {'date': '2011-04-25', 'description': 'Tweede Paasdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV'}, {'date': '2011-04-30', 'description': 'Koninginnedag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NV'}, {'date': '2011-05-04', 'description': 'Dodenherdenking', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'F'}, {'date': '2011-05-05', 'description': 'Bevrijdingsdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NF'}, {'date': '2011-06-02', 'description': 'Hemelvaartsdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV'}, {'date': '2011-06-12', 'description': 'Eerste Pinksterdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV'}, {'date': '2011-06-13', 'description': 'Tweede Pinksterdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRV'}, {'date': '2011-12-05', 'description': 'Sinterklaas', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'RF'}, {'date': '2011-12-15', 'description': 'Koninkrijksdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NV'}, {'date': '2011-12-25', 'description': 'Eerste Kerstdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRF'}, {'date': '2011-12-26', 'description': 'Tweede Kerstdag', 'locale': 'nl-NL', 'notes': '', 'region': '', 'type': 'NRF'}]
#!/usr/bin/python # -*- coding: utf-8 -*- __author__ = 'liying' class Latest(object): def __init__(self): self.package = None self.latest_version = None
__author__ = 'liying' class Latest(object): def __init__(self): self.package = None self.latest_version = None
ES_HOST = 'localhost:9200' ES_INDEX = 'pending-dgidb' ES_DOC_TYPE = 'association' API_PREFIX = 'dgidb' API_VERSION = ''
es_host = 'localhost:9200' es_index = 'pending-dgidb' es_doc_type = 'association' api_prefix = 'dgidb' api_version = ''
class CSVUpperTriangularPlugin: def input(self, filename): infile = open(filename, 'r') self.colnames = infile.readline().strip().split(',') # Assume rownames=colnames self.ADJ = [] for line in infile: self.ADJ.append(line.strip().split(',')[1:]) def run(self): pass def output(self, filename): outfile = open(filename, 'w') outfile.write("X1,X2,Value\n") for i in range(0, len(self.ADJ)): for j in range(0, len(self.ADJ[i])): if (i < j): outfile.write(self.colnames[i]+","+self.colnames[j]+","+self.ADJ[i][j]+"\n")
class Csvuppertriangularplugin: def input(self, filename): infile = open(filename, 'r') self.colnames = infile.readline().strip().split(',') self.ADJ = [] for line in infile: self.ADJ.append(line.strip().split(',')[1:]) def run(self): pass def output(self, filename): outfile = open(filename, 'w') outfile.write('X1,X2,Value\n') for i in range(0, len(self.ADJ)): for j in range(0, len(self.ADJ[i])): if i < j: outfile.write(self.colnames[i] + ',' + self.colnames[j] + ',' + self.ADJ[i][j] + '\n')
""" Python program to remove an empty element from a list. """ list_in = ['Hello', 34, 45, '', 40] # result = ['Hello', 34, 45, 40] for item in list_in: if not item: list_in.remove(item) print(list_in)
""" Python program to remove an empty element from a list. """ list_in = ['Hello', 34, 45, '', 40] for item in list_in: if not item: list_in.remove(item) print(list_in)
class GithubError(Exception): pass class GithubAPIError(GithubError): pass
class Githuberror(Exception): pass class Githubapierror(GithubError): pass
""" if the number of petals is greater than the length of the list, reduce the number of petals by the length loop though list, checking if the number of petals is greater than the length of the list reduce the number of petals by the length of the list after every iteration until the number is less than or equal to length of the list, in this case: it is either 1-6 return the value at that index """ def how_much_i_love_you(nb_petals): love = ["I love you", "a little", "a lot", "passionately", "madly", "not at all"] while nb_petals > len(love): nb_petals -= len(love) if nb_petals in range(0, len(love)): break else: continue return love[nb_petals - 1] def how_much_i_love_you_2(nb_petals): return ["I love you", "a little", "a lot", "passionately", "madly", "not at all"][nb_petals % 6 - 1]
""" if the number of petals is greater than the length of the list, reduce the number of petals by the length loop though list, checking if the number of petals is greater than the length of the list reduce the number of petals by the length of the list after every iteration until the number is less than or equal to length of the list, in this case: it is either 1-6 return the value at that index """ def how_much_i_love_you(nb_petals): love = ['I love you', 'a little', 'a lot', 'passionately', 'madly', 'not at all'] while nb_petals > len(love): nb_petals -= len(love) if nb_petals in range(0, len(love)): break else: continue return love[nb_petals - 1] def how_much_i_love_you_2(nb_petals): return ['I love you', 'a little', 'a lot', 'passionately', 'madly', 'not at all'][nb_petals % 6 - 1]
# Write a function to find the longest common prefix string amongst an array of strings. class Solution(object): def longestCommonPrefix(self, strs): if len(strs) == 0: return "" standard = strs[0] longest_length = len(standard) for string in strs[1:]: index = 0 while index < len(string) and index < len(standard) and string[index] == standard[index]: index += 1 longest_length = min(index, longest_length) return strs[0][:longest_length]
class Solution(object): def longest_common_prefix(self, strs): if len(strs) == 0: return '' standard = strs[0] longest_length = len(standard) for string in strs[1:]: index = 0 while index < len(string) and index < len(standard) and (string[index] == standard[index]): index += 1 longest_length = min(index, longest_length) return strs[0][:longest_length]
# Copyright Notice: # Copyright 2016-2019 DMTF. All rights reserved. # License: BSD 3-Clause License. For full text see link: https://github.com/DMTF/Redfish-Interface-Emulator/blob/master/LICENSE.md # Redfish template REDFISH_TEMPLATE = { "@odata.context": "{rest_base}$metadata#Systems/cs_puid", "@odata.id": "{rest_base}Systems/{cs_puid}", "@odata.type": '#ComputerSystem.1.0.0.ComputerSystem', "Id": None, "Name": "WebFrontEnd483", "SystemType": "Virtual", "AssetTag": "Chicago-45Z-2381", "Manufacturer": "Redfish Computers", "Model": "3500RX", "SKU": "8675309", "SerialNumber": None, "PartNumber": "224071-J23", "Description": "Web Front End node", "UUID": None, "HostName":"web483", "Status": { "State": "Enabled", "Health": "OK", "HealthRollUp": "OK" }, "IndicatorLED": "Off", "PowerState": "On", "Boot": { "BootSourceOverrideEnabled": "Once", "BootSourceOverrideTarget": "Pxe", "BootSourceOverrideTarget@DMTF.AllowableValues": [ "None", "Pxe", "Floppy", "Cd", "Usb", "Hdd", "BiosSetup", "Utilities", "Diags", "UefiTarget" ], "UefiTargetBootSourceOverride": "/0x31/0x33/0x01/0x01" }, "Oem":{}, "BiosVersion": "P79 v1.00 (09/20/2013)", "Processors": { "Count": 8, "Model": "Multi-Core Intel(R) Xeon(R) processor 7xxx Series", "Status": { "State": "Enabled", "Health": "OK", "HealthRollUp": "OK" } }, "Memory": { "TotalSystemMemoryGB": 16, "Status": { "State": "Enabled", "Health": "OK", "HealthRollUp": "OK" } }, "Links": { "Chassis": [ { "@odata.id": "/redfish/v1/Chassis/1" } ], "ManagedBy": [ { "@odata.id": "/redfish/v1/Managers/1" } ], "Processors": { "@odata.id": "/redfish/v1/Systems/{cs_puid}/Processors" }, "EthernetInterfaces": { "@odata.id": "/redfish/v1/Systems/{cs_puid}/EthernetInterfaces" }, "SimpleStorage": { "@odata.id": "/redfish/v1/Systems/{cs_puid}/SimpleStorage" }, "LogService": { "@odata.id": "/redfish/v1/Systems/1/Logs" } }, "Actions": { "#ComputerSystem.Reset": { "target": "/redfish/v1/Systems/{cs_puid}/Actions/ComputerSystem.Reset", "ResetType@DMTF.AllowableValues": [ "On", "ForceOff", "GracefulRestart", "ForceRestart", "Nmi", "GracefulRestart", "ForceOn", "PushPowerButton" ] }, "Oem": { "http://Contoso.com/Schema/CustomTypes#Contoso.Reset": { "target": "/redfish/v1/Systems/1/OEM/Contoso/Actions/Contoso.Reset" } } }, "Oem": { "Contoso": { "@odata.type": "http://Contoso.com/Schema#Contoso.ComputerSystem", "ProductionLocation": { "FacilityName": "PacWest Production Facility", "Country": "USA" } }, "Chipwise": { "@odata.type": "http://Chipwise.com/Schema#Chipwise.ComputerSystem", "Style": "Executive" } } }
redfish_template = {'@odata.context': '{rest_base}$metadata#Systems/cs_puid', '@odata.id': '{rest_base}Systems/{cs_puid}', '@odata.type': '#ComputerSystem.1.0.0.ComputerSystem', 'Id': None, 'Name': 'WebFrontEnd483', 'SystemType': 'Virtual', 'AssetTag': 'Chicago-45Z-2381', 'Manufacturer': 'Redfish Computers', 'Model': '3500RX', 'SKU': '8675309', 'SerialNumber': None, 'PartNumber': '224071-J23', 'Description': 'Web Front End node', 'UUID': None, 'HostName': 'web483', 'Status': {'State': 'Enabled', 'Health': 'OK', 'HealthRollUp': 'OK'}, 'IndicatorLED': 'Off', 'PowerState': 'On', 'Boot': {'BootSourceOverrideEnabled': 'Once', 'BootSourceOverrideTarget': 'Pxe', 'BootSourceOverrideTarget@DMTF.AllowableValues': ['None', 'Pxe', 'Floppy', 'Cd', 'Usb', 'Hdd', 'BiosSetup', 'Utilities', 'Diags', 'UefiTarget'], 'UefiTargetBootSourceOverride': '/0x31/0x33/0x01/0x01'}, 'Oem': {}, 'BiosVersion': 'P79 v1.00 (09/20/2013)', 'Processors': {'Count': 8, 'Model': 'Multi-Core Intel(R) Xeon(R) processor 7xxx Series', 'Status': {'State': 'Enabled', 'Health': 'OK', 'HealthRollUp': 'OK'}}, 'Memory': {'TotalSystemMemoryGB': 16, 'Status': {'State': 'Enabled', 'Health': 'OK', 'HealthRollUp': 'OK'}}, 'Links': {'Chassis': [{'@odata.id': '/redfish/v1/Chassis/1'}], 'ManagedBy': [{'@odata.id': '/redfish/v1/Managers/1'}], 'Processors': {'@odata.id': '/redfish/v1/Systems/{cs_puid}/Processors'}, 'EthernetInterfaces': {'@odata.id': '/redfish/v1/Systems/{cs_puid}/EthernetInterfaces'}, 'SimpleStorage': {'@odata.id': '/redfish/v1/Systems/{cs_puid}/SimpleStorage'}, 'LogService': {'@odata.id': '/redfish/v1/Systems/1/Logs'}}, 'Actions': {'#ComputerSystem.Reset': {'target': '/redfish/v1/Systems/{cs_puid}/Actions/ComputerSystem.Reset', 'ResetType@DMTF.AllowableValues': ['On', 'ForceOff', 'GracefulRestart', 'ForceRestart', 'Nmi', 'GracefulRestart', 'ForceOn', 'PushPowerButton']}, 'Oem': {'http://Contoso.com/Schema/CustomTypes#Contoso.Reset': {'target': '/redfish/v1/Systems/1/OEM/Contoso/Actions/Contoso.Reset'}}}, 'Oem': {'Contoso': {'@odata.type': 'http://Contoso.com/Schema#Contoso.ComputerSystem', 'ProductionLocation': {'FacilityName': 'PacWest Production Facility', 'Country': 'USA'}}, 'Chipwise': {'@odata.type': 'http://Chipwise.com/Schema#Chipwise.ComputerSystem', 'Style': 'Executive'}}}
class Solution: def findMaxConsecutiveOnes(self, nums: List[int]) -> int: consecutive = 0 ret = 0 for i in range(len(nums) + 1): if i == len(nums) or nums[i] == 0: ret = max(ret, consecutive) consecutive = 0 else: consecutive += 1 return ret
class Solution: def find_max_consecutive_ones(self, nums: List[int]) -> int: consecutive = 0 ret = 0 for i in range(len(nums) + 1): if i == len(nums) or nums[i] == 0: ret = max(ret, consecutive) consecutive = 0 else: consecutive += 1 return ret
""" Router memory information """ class Mem(object): """ Router memory information """ def __init__(self, usage, total, hz, type): self._usage = usage self._total = total self._hz = hz self._type = type def get_usage(self): return self._usage def get_total(self): return self._total def get_hz(self): return self._hz def get_type(self): return self._type def create_mem_from_json(json_entry): return Mem(json_entry['usage'], json_entry['total'], json_entry['hz'], json_entry['type'])
""" Router memory information """ class Mem(object): """ Router memory information """ def __init__(self, usage, total, hz, type): self._usage = usage self._total = total self._hz = hz self._type = type def get_usage(self): return self._usage def get_total(self): return self._total def get_hz(self): return self._hz def get_type(self): return self._type def create_mem_from_json(json_entry): return mem(json_entry['usage'], json_entry['total'], json_entry['hz'], json_entry['type'])
def get_max_increasing_sub_sequence(arr): i = 1 n = len(arr) j = 0 dp = arr[:] while i < n: while j < i: if dp[j] < dp[i] < dp[i] + dp[j]: dp[i] = dp[j] + dp[i] j += 1 i += 1 return max(dp) if __name__ == '__main__': # arr = [1, 101, 2, 3, 100, 4, 5] # print(get_max_increasing_sub_sequence(arr)) test_cases = int(input()) for t_case in range(test_cases): n = map(int, input().split()) array = list(map(int, input().split())) print(get_max_increasing_sub_sequence(array))
def get_max_increasing_sub_sequence(arr): i = 1 n = len(arr) j = 0 dp = arr[:] while i < n: while j < i: if dp[j] < dp[i] < dp[i] + dp[j]: dp[i] = dp[j] + dp[i] j += 1 i += 1 return max(dp) if __name__ == '__main__': test_cases = int(input()) for t_case in range(test_cases): n = map(int, input().split()) array = list(map(int, input().split())) print(get_max_increasing_sub_sequence(array))
# Author : BIZZOZZERO Nicolas # Completed on Sun, 24 Jan 2016, 22:38 # # This program find the solution of the problem 1 of the Project Euler. # The problem is the following : # # If we list all the natural numbers below 10 that are multiples of 3 or # 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. # Find the sum of all the multiples of 3 or 5 below 1000. # # The answer to this problem is : # 233168 def is_divisible_by(n: int, divisor: int) -> bool: """Return True if n is divisible by divisor, False otherwise. """ return n % divisor == 0 def main(): set_of_multiples = set() for i in range(1001): if is_divisible_by(i, 3) or is_divisible_by(i, 5): set_of_multiples.add(i) print(sum(set_of_multiples)) if __name__ == '__main__': main()
def is_divisible_by(n: int, divisor: int) -> bool: """Return True if n is divisible by divisor, False otherwise. """ return n % divisor == 0 def main(): set_of_multiples = set() for i in range(1001): if is_divisible_by(i, 3) or is_divisible_by(i, 5): set_of_multiples.add(i) print(sum(set_of_multiples)) if __name__ == '__main__': main()
# -*- coding: utf-8 -*- ######################################## # Created on Sun Feb 11 13:35:07 2018 # # @author: guenther.wasser ######################################## # # Problem 7: # ---------- # # Implement a function that meets the specifications below. # # def applyF_filterG(L, f, g): # """ # Assumes L is a list of integers # Assume functions f and g are defined for you. # f takes in an integer, applies a function, returns another integer # g takes in an integer, applies a Boolean function, # returns either True or False # Mutates L such that, for each element i originally in L, L contains # i if g(f(i)) returns True, and no other elements # Returns the largest element in the mutated L or -1 if the list is empty # """ # For example, the following functions, f, g, and test code: # # def f(i): # return i + 2 # def g(i): # return i > 5 # # L = [0, -10, 5, 6, -4] # print(applyF_filterG(L, f, g)) # print(L) # Should print: # # 6 # [5, 6] # For this question, you will not be able to see the test cases we run. # This problem will test your ability to come up with your own test cases. # # ---------- def f(i): """Add 2 to a value Args: i ([int]): integer value Returns: [int]: integer value """ return i + 2 def g(i): """Evaluates value to be greater than 5 Args: i ([int]): integer value Returns: [bool]: True if value is greater than 5 """ return i > 5 def applyF_filterG(L, f, g): """Mutates a list of integers Mutates L such that, for each element i originally in L, L contains i if g(f(i)) returns True, and no other elements Decorators: guenther.wasser Args: L ([list]): List of integer values f ([function]): [description] g ([type]): [description] """ newList = [] L2 = L[:] maxValue = 0 # Empty list return -1 if len(L) == 0: return -1 # Create new List for i in L: if g(f(i)): newList.append(i) # Alter original List for i in L2: if i not in newList: L.remove(i) # Find max value for i in newList: if i > maxValue: maxValue = i return maxValue L = [0, -10, 5, 6, -4] print(applyF_filterG(L, f, g)) print(L) L = [7, -1, 3, 4, -4, 8, -9] print(applyF_filterG(L, f, g)) print(L) L = [] print(applyF_filterG(L, f, g)) print(L) L = [1, 2, 3, 4, 5, 6, 7] print(applyF_filterG(L, f, g)) print(L) # Only 16 from 20 points earned!
def f(i): """Add 2 to a value Args: i ([int]): integer value Returns: [int]: integer value """ return i + 2 def g(i): """Evaluates value to be greater than 5 Args: i ([int]): integer value Returns: [bool]: True if value is greater than 5 """ return i > 5 def apply_f_filter_g(L, f, g): """Mutates a list of integers Mutates L such that, for each element i originally in L, L contains i if g(f(i)) returns True, and no other elements Decorators: guenther.wasser Args: L ([list]): List of integer values f ([function]): [description] g ([type]): [description] """ new_list = [] l2 = L[:] max_value = 0 if len(L) == 0: return -1 for i in L: if g(f(i)): newList.append(i) for i in L2: if i not in newList: L.remove(i) for i in newList: if i > maxValue: max_value = i return maxValue l = [0, -10, 5, 6, -4] print(apply_f_filter_g(L, f, g)) print(L) l = [7, -1, 3, 4, -4, 8, -9] print(apply_f_filter_g(L, f, g)) print(L) l = [] print(apply_f_filter_g(L, f, g)) print(L) l = [1, 2, 3, 4, 5, 6, 7] print(apply_f_filter_g(L, f, g)) print(L)
# this file defines available actions # reference: https://github.com/TeamFightingICE/FightingICE/blob/master/python/Feature%20Extractor%20in%20Python/action.py class Actions: def __init__(self): # map digits to actions self.actions = [ "NEUTRAL", "STAND", "FORWARD_WALK", "DASH", "BACK_STEP", "CROUCH", "JUMP", "FOR_JUMP", "BACK_JUMP", "AIR", "STAND_GUARD", "CROUCH_GUARD", "AIR_GUARD", "STAND_GUARD_RECOV", "CROUCH_GUARD_RECOV", "AIR_GUARD_RECOV", "STAND_RECOV", "CROUCH_RECOV", "AIR_RECOV", "CHANGE_DOWN", "DOWN", "RISE", "LANDING", "THROW_A", "THROW_B", "THROW_HIT", "THROW_SUFFER", "STAND_A", "STAND_B", "CROUCH_A", "CROUCH_B", "AIR_A", "AIR_B", "AIR_DA", "AIR_DB", "STAND_FA", "STAND_FB", "CROUCH_FA", "CROUCH_FB", "AIR_FA", "AIR_FB", "AIR_UA", "AIR_UB", "STAND_D_DF_FA", "STAND_D_DF_FB", "STAND_F_D_DFA", "STAND_F_D_DFB", "STAND_D_DB_BA", "STAND_D_DB_BB", "AIR_D_DF_FA", "AIR_D_DF_FB", "AIR_F_D_DFA", "AIR_F_D_DFB", "AIR_D_DB_BA", "AIR_D_DB_BB", "STAND_D_DF_FC" ] # map action to digits self.actions_map = { m:i for i, m in enumerate(self.actions) } # set number of actions self.count = 56 assert len(self.actions) == self.count # set other types of actions self.actions_digits_useless = [ self.actions_map[m] for m in [ "STAND", "AIR", "STAND_GUARD_RECOV", "CROUCH_GUARD_RECOV", "AIR_GUARD_RECOV", "STAND_RECOV", "CROUCH_RECOV", "AIR_RECOV", "CHANGE_DOWN", "DOWN", "RISE", "LANDING", "THROW_HIT", "THROW_SUFFER" ] ] self.actions_digits_useful = [ i for i in range(self.count) if i not in self.actions_digits_useless ] self.count_useful = len(self.actions_digits_useful) self.actions_map_useful = { i:self.actions[n] for i,n in enumerate(self.actions_digits_useful) } self.actions_digits_air = [ self.actions_map[m] for m in [ "AIR_GUARD", "AIR_A", "AIR_B", "AIR_DA", "AIR_DB", "AIR_FA", "AIR_FB", "AIR_UA", "AIR_UB", "AIR_D_DF_FA", "AIR_D_DF_FB", "AIR_F_D_DFA", "AIR_F_D_DFB", "AIR_D_DB_BA", "AIR_D_DB_BB" ] ] self.actions_digits_ground = [ self.actions_map[m] for m in [ "STAND_D_DB_BA", "BACK_STEP", "FORWARD_WALK", "DASH", "JUMP", "FOR_JUMP", "BACK_JUMP", "STAND_GUARD", "CROUCH_GUARD", "THROW_A", "THROW_B", "STAND_A", "STAND_B", "CROUCH_A", "CROUCH_B", "STAND_FA", "STAND_FB", "CROUCH_FA", "CROUCH_FB", "STAND_D_DF_FA", "STAND_D_DF_FB", "STAND_F_D_DFA", "STAND_F_D_DFB", "STAND_D_DB_BB" ] ]
class Actions: def __init__(self): self.actions = ['NEUTRAL', 'STAND', 'FORWARD_WALK', 'DASH', 'BACK_STEP', 'CROUCH', 'JUMP', 'FOR_JUMP', 'BACK_JUMP', 'AIR', 'STAND_GUARD', 'CROUCH_GUARD', 'AIR_GUARD', 'STAND_GUARD_RECOV', 'CROUCH_GUARD_RECOV', 'AIR_GUARD_RECOV', 'STAND_RECOV', 'CROUCH_RECOV', 'AIR_RECOV', 'CHANGE_DOWN', 'DOWN', 'RISE', 'LANDING', 'THROW_A', 'THROW_B', 'THROW_HIT', 'THROW_SUFFER', 'STAND_A', 'STAND_B', 'CROUCH_A', 'CROUCH_B', 'AIR_A', 'AIR_B', 'AIR_DA', 'AIR_DB', 'STAND_FA', 'STAND_FB', 'CROUCH_FA', 'CROUCH_FB', 'AIR_FA', 'AIR_FB', 'AIR_UA', 'AIR_UB', 'STAND_D_DF_FA', 'STAND_D_DF_FB', 'STAND_F_D_DFA', 'STAND_F_D_DFB', 'STAND_D_DB_BA', 'STAND_D_DB_BB', 'AIR_D_DF_FA', 'AIR_D_DF_FB', 'AIR_F_D_DFA', 'AIR_F_D_DFB', 'AIR_D_DB_BA', 'AIR_D_DB_BB', 'STAND_D_DF_FC'] self.actions_map = {m: i for (i, m) in enumerate(self.actions)} self.count = 56 assert len(self.actions) == self.count self.actions_digits_useless = [self.actions_map[m] for m in ['STAND', 'AIR', 'STAND_GUARD_RECOV', 'CROUCH_GUARD_RECOV', 'AIR_GUARD_RECOV', 'STAND_RECOV', 'CROUCH_RECOV', 'AIR_RECOV', 'CHANGE_DOWN', 'DOWN', 'RISE', 'LANDING', 'THROW_HIT', 'THROW_SUFFER']] self.actions_digits_useful = [i for i in range(self.count) if i not in self.actions_digits_useless] self.count_useful = len(self.actions_digits_useful) self.actions_map_useful = {i: self.actions[n] for (i, n) in enumerate(self.actions_digits_useful)} self.actions_digits_air = [self.actions_map[m] for m in ['AIR_GUARD', 'AIR_A', 'AIR_B', 'AIR_DA', 'AIR_DB', 'AIR_FA', 'AIR_FB', 'AIR_UA', 'AIR_UB', 'AIR_D_DF_FA', 'AIR_D_DF_FB', 'AIR_F_D_DFA', 'AIR_F_D_DFB', 'AIR_D_DB_BA', 'AIR_D_DB_BB']] self.actions_digits_ground = [self.actions_map[m] for m in ['STAND_D_DB_BA', 'BACK_STEP', 'FORWARD_WALK', 'DASH', 'JUMP', 'FOR_JUMP', 'BACK_JUMP', 'STAND_GUARD', 'CROUCH_GUARD', 'THROW_A', 'THROW_B', 'STAND_A', 'STAND_B', 'CROUCH_A', 'CROUCH_B', 'STAND_FA', 'STAND_FB', 'CROUCH_FA', 'CROUCH_FB', 'STAND_D_DF_FA', 'STAND_D_DF_FB', 'STAND_F_D_DFA', 'STAND_F_D_DFB', 'STAND_D_DB_BB']]
#!/usr/bin/python3 """ implement strongly connected components algorithm using 'SCC.txt' adjusency list. Problem answer (first 5): [434821, 968, 459, 313, 211] """
""" implement strongly connected components algorithm using 'SCC.txt' adjusency list. Problem answer (first 5): [434821, 968, 459, 313, 211] """
''' Created on 16-10-2012 @author: Jacek Przemieniecki ''' class Mixture(object): def _calc_groups(self): self._groups = {} groups = self._groups tot_grps = 0 for mol in self.moles: m_groups = self.moles[mol].get_groups() for m_grp in m_groups: groups[m_grp] = groups.get(m_grp, 0) + m_groups[m_grp]*self.quantities[mol] tot_grps += m_groups[m_grp]*self.quantities[mol] for grp in groups: groups[grp] = groups[grp]/tot_grps def _calc_ordered(self): total_moles = sum(self.quantities.values()) for mol in self.moles: self._ordered_moles.append(self.moles[mol]) self._ordered_mol_fractions.append(self.quantities[mol]/total_moles) def _finalize(self): self._calc_groups() self._calc_ordered() self._finalized = True def __init__(self): self.moles = {} self.quantities = {} self._finalized = False self._groups = None # Those two lists must be ordered so that moles[i] # corresponds to quantities[i] self._ordered_moles = [] self._ordered_mol_fractions = [] def add(self, iden, mol, amount): if self._finalized: raise Exception() # TODO: Exception handling if iden in self.moles: self.quantities[iden] += amount else: self.moles[iden] = mol self.quantities[iden] = amount def get_moles(self): if not self._finalized: self._finalize() return self._ordered_moles def get_groups(self): if not self._finalized: self._finalize() return self._groups def get_mole_fractions(self): if not self._finalized: self._finalize() return self._ordered_mol_fractions
""" Created on 16-10-2012 @author: Jacek Przemieniecki """ class Mixture(object): def _calc_groups(self): self._groups = {} groups = self._groups tot_grps = 0 for mol in self.moles: m_groups = self.moles[mol].get_groups() for m_grp in m_groups: groups[m_grp] = groups.get(m_grp, 0) + m_groups[m_grp] * self.quantities[mol] tot_grps += m_groups[m_grp] * self.quantities[mol] for grp in groups: groups[grp] = groups[grp] / tot_grps def _calc_ordered(self): total_moles = sum(self.quantities.values()) for mol in self.moles: self._ordered_moles.append(self.moles[mol]) self._ordered_mol_fractions.append(self.quantities[mol] / total_moles) def _finalize(self): self._calc_groups() self._calc_ordered() self._finalized = True def __init__(self): self.moles = {} self.quantities = {} self._finalized = False self._groups = None self._ordered_moles = [] self._ordered_mol_fractions = [] def add(self, iden, mol, amount): if self._finalized: raise exception() if iden in self.moles: self.quantities[iden] += amount else: self.moles[iden] = mol self.quantities[iden] = amount def get_moles(self): if not self._finalized: self._finalize() return self._ordered_moles def get_groups(self): if not self._finalized: self._finalize() return self._groups def get_mole_fractions(self): if not self._finalized: self._finalize() return self._ordered_mol_fractions
extractable_regions = ["TextRegion", "ImageRegion", "LineDrawingRegion", "GraphicRegion", "TableRegion", "ChartRegion", "MapRegion", "SeparatorRegion", "MathsRegion", "ChemRegion", "MusicRegion", "AdvertRegion", "NoiseRegion", "NoiseRegion", "UnknownRegion", "CustomRegion", "TextLine"] TEXT_COUNT_SUPPORTED_ELEMS = ["TextRegion", "TextLine", "Word"]
extractable_regions = ['TextRegion', 'ImageRegion', 'LineDrawingRegion', 'GraphicRegion', 'TableRegion', 'ChartRegion', 'MapRegion', 'SeparatorRegion', 'MathsRegion', 'ChemRegion', 'MusicRegion', 'AdvertRegion', 'NoiseRegion', 'NoiseRegion', 'UnknownRegion', 'CustomRegion', 'TextLine'] text_count_supported_elems = ['TextRegion', 'TextLine', 'Word']
#!/usr/local/bin/python # -*- coding: utf-8 -*- """ Score handler Score operation handler""" class Score(object): def __init__(self, kind): """ init about importer This module assume about import module. Argument of 'kind' indicates the way of judging. In __init__, dicide what module is need.""" score_dir = kind score_module = kind.lower() """ Import only necessary module """ import_module = "score.%s.%s" % (score_dir, score_module) from_list = ["Calculation, Registration"] self.main_module = __import__(import_module, fromlist=from_list) def calc(self, score): score_cls = self.main_module.Calculation(score) return score_cls.main() def register(self, score=1): score_reg = self.main_module.Registration(score) score_reg.main() def catch_total(self): return self.main_module.Overall() if __name__ == "__main__": hand = Handler()
""" Score handler Score operation handler""" class Score(object): def __init__(self, kind): """ init about importer This module assume about import module. Argument of 'kind' indicates the way of judging. In __init__, dicide what module is need.""" score_dir = kind score_module = kind.lower() ' Import only necessary module ' import_module = 'score.%s.%s' % (score_dir, score_module) from_list = ['Calculation, Registration'] self.main_module = __import__(import_module, fromlist=from_list) def calc(self, score): score_cls = self.main_module.Calculation(score) return score_cls.main() def register(self, score=1): score_reg = self.main_module.Registration(score) score_reg.main() def catch_total(self): return self.main_module.Overall() if __name__ == '__main__': hand = handler()
"""Repository rule for ROCm autoconfiguration. `rocm_configure` depends on the following environment variables: * `TF_NEED_ROCM`: Whether to enable building with ROCm. * `GCC_HOST_COMPILER_PATH`: The GCC host compiler path * `ROCM_TOOLKIT_PATH`: The path to the ROCm toolkit. Default is `/opt/rocm`. * `TF_ROCM_VERSION`: The version of the ROCm toolkit. If this is blank, then use the system default. * `TF_MIOPEN_VERSION`: The version of the MIOpen library. * `TF_ROCM_AMDGPU_TARGETS`: The AMDGPU targets. """ load( ":cuda_configure.bzl", "make_copy_dir_rule", "make_copy_files_rule", "to_list_of_strings", ) load( "//third_party/remote_config:common.bzl", "config_repo_label", "err_out", "execute", "files_exist", "get_bash_bin", "get_cpu_value", "get_host_environ", "raw_exec", "realpath", "which", ) _GCC_HOST_COMPILER_PATH = "GCC_HOST_COMPILER_PATH" _GCC_HOST_COMPILER_PREFIX = "GCC_HOST_COMPILER_PREFIX" _ROCM_TOOLKIT_PATH = "ROCM_PATH" _TF_ROCM_VERSION = "TF_ROCM_VERSION" _TF_MIOPEN_VERSION = "TF_MIOPEN_VERSION" _TF_ROCM_AMDGPU_TARGETS = "TF_ROCM_AMDGPU_TARGETS" _TF_ROCM_CONFIG_REPO = "TF_ROCM_CONFIG_REPO" _DEFAULT_ROCM_VERSION = "" _DEFAULT_MIOPEN_VERSION = "" _DEFAULT_ROCM_TOOLKIT_PATH = "/opt/rocm" def verify_build_defines(params): """Verify all variables that crosstool/BUILD.rocm.tpl expects are substituted. Args: params: dict of variables that will be passed to the BUILD.tpl template. """ missing = [] for param in [ "cxx_builtin_include_directories", "extra_no_canonical_prefixes_flags", "host_compiler_path", "host_compiler_prefix", "linker_bin_path", "unfiltered_compile_flags", ]: if ("%{" + param + "}") not in params: missing.append(param) if missing: auto_configure_fail( "BUILD.rocm.tpl template is missing these variables: " + str(missing) + ".\nWe only got: " + str(params) + ".", ) def find_cc(repository_ctx): """Find the C++ compiler.""" # Return a dummy value for GCC detection here to avoid error target_cc_name = "gcc" cc_path_envvar = _GCC_HOST_COMPILER_PATH cc_name = target_cc_name cc_name_from_env = get_host_environ(repository_ctx, cc_path_envvar) if cc_name_from_env: cc_name = cc_name_from_env if cc_name.startswith("/"): # Absolute path, maybe we should make this supported by our which function. return cc_name cc = which(repository_ctx, cc_name) if cc == None: fail(("Cannot find {}, either correct your path or set the {}" + " environment variable").format(target_cc_name, cc_path_envvar)) return cc _INC_DIR_MARKER_BEGIN = "#include <...>" def _cxx_inc_convert(path): """Convert path returned by cc -E xc++ in a complete path.""" path = path.strip() return path def _get_cxx_inc_directories_impl(repository_ctx, cc, lang_is_cpp): """Compute the list of default C or C++ include directories.""" if lang_is_cpp: lang = "c++" else: lang = "c" # TODO: We pass -no-canonical-prefixes here to match the compiler flags, # but in rocm_clang CROSSTOOL file that is a `feature` and we should # handle the case when it's disabled and no flag is passed result = raw_exec(repository_ctx, [ cc, "-no-canonical-prefixes", "-E", "-x" + lang, "-", "-v", ]) stderr = err_out(result) index1 = stderr.find(_INC_DIR_MARKER_BEGIN) if index1 == -1: return [] index1 = stderr.find("\n", index1) if index1 == -1: return [] index2 = stderr.rfind("\n ") if index2 == -1 or index2 < index1: return [] index2 = stderr.find("\n", index2 + 1) if index2 == -1: inc_dirs = stderr[index1 + 1:] else: inc_dirs = stderr[index1 + 1:index2].strip() return [ str(repository_ctx.path(_cxx_inc_convert(p))) for p in inc_dirs.split("\n") ] def get_cxx_inc_directories(repository_ctx, cc): """Compute the list of default C and C++ include directories.""" # For some reason `clang -xc` sometimes returns include paths that are # different from the ones from `clang -xc++`. (Symlink and a dir) # So we run the compiler with both `-xc` and `-xc++` and merge resulting lists includes_cpp = _get_cxx_inc_directories_impl(repository_ctx, cc, True) includes_c = _get_cxx_inc_directories_impl(repository_ctx, cc, False) includes_cpp_set = depset(includes_cpp) return includes_cpp + [ inc for inc in includes_c if inc not in includes_cpp_set.to_list() ] def auto_configure_fail(msg): """Output failure message when rocm configuration fails.""" red = "\033[0;31m" no_color = "\033[0m" fail("\n%sROCm Configuration Error:%s %s\n" % (red, no_color, msg)) def auto_configure_warning(msg): """Output warning message during auto configuration.""" yellow = "\033[1;33m" no_color = "\033[0m" print("\n%sAuto-Configuration Warning:%s %s\n" % (yellow, no_color, msg)) # END cc_configure common functions (see TODO above). def _rocm_include_path(repository_ctx, rocm_config, bash_bin): """Generates the cxx_builtin_include_directory entries for rocm inc dirs. Args: repository_ctx: The repository context. rocm_config: The path to the gcc host compiler. Returns: A string containing the Starlark string for each of the gcc host compiler include directories, which can be added to the CROSSTOOL file. """ inc_dirs = [] # Add HSA headers (needs to match $HSA_PATH) inc_dirs.append(rocm_config.rocm_toolkit_path + "/hsa/include") # Add HIP headers (needs to match $HIP_PATH) inc_dirs.append(rocm_config.rocm_toolkit_path + "/hip/include") # Add HIP-Clang headers (realpath relative to compiler binary) rocm_toolkit_path = realpath(repository_ctx, rocm_config.rocm_toolkit_path, bash_bin) inc_dirs.append(rocm_toolkit_path + "/llvm/lib/clang/8.0/include") inc_dirs.append(rocm_toolkit_path + "/llvm/lib/clang/9.0.0/include") inc_dirs.append(rocm_toolkit_path + "/llvm/lib/clang/10.0.0/include") inc_dirs.append(rocm_toolkit_path + "/llvm/lib/clang/11.0.0/include") # Support hcc based off clang 10.0.0 (for ROCm 3.3) inc_dirs.append(rocm_toolkit_path + "/hcc/compiler/lib/clang/10.0.0/include/") inc_dirs.append(rocm_toolkit_path + "/hcc/lib/clang/10.0.0/include") # Add hcc headers inc_dirs.append(rocm_toolkit_path + "/hcc/include") return inc_dirs def _enable_rocm(repository_ctx): enable_rocm = get_host_environ(repository_ctx, "TF_NEED_ROCM") if enable_rocm == "1": if get_cpu_value(repository_ctx) != "Linux": auto_configure_warning("ROCm configure is only supported on Linux") return False return True return False def _rocm_toolkit_path(repository_ctx, bash_bin): """Finds the rocm toolkit directory. Args: repository_ctx: The repository context. Returns: A speculative real path of the rocm toolkit install directory. """ rocm_toolkit_path = get_host_environ(repository_ctx, _ROCM_TOOLKIT_PATH, _DEFAULT_ROCM_TOOLKIT_PATH) if files_exist(repository_ctx, [rocm_toolkit_path], bash_bin) != [True]: auto_configure_fail("Cannot find rocm toolkit path.") return rocm_toolkit_path def _amdgpu_targets(repository_ctx, rocm_toolkit_path, bash_bin): """Returns a list of strings representing AMDGPU targets.""" amdgpu_targets_str = get_host_environ(repository_ctx, _TF_ROCM_AMDGPU_TARGETS) if not amdgpu_targets_str: cmd = "%s/bin/rocm_agent_enumerator" % rocm_toolkit_path result = execute(repository_ctx, [bash_bin, "-c", cmd]) targets = [target for target in result.stdout.strip().split("\n") if target != "gfx000"] amdgpu_targets_str = ",".join(targets) amdgpu_targets = amdgpu_targets_str.split(",") for amdgpu_target in amdgpu_targets: if amdgpu_target[:3] != "gfx" or not amdgpu_target[3:].isdigit(): auto_configure_fail("Invalid AMDGPU target: %s" % amdgpu_target) return amdgpu_targets def _hipcc_env(repository_ctx): """Returns the environment variable string for hipcc. Args: repository_ctx: The repository context. Returns: A string containing environment variables for hipcc. """ hipcc_env = "" for name in [ "HIP_CLANG_PATH", "DEVICE_LIB_PATH", "HIP_VDI_HOME", "HIPCC_VERBOSE", "HIPCC_COMPILE_FLAGS_APPEND", "HIPPCC_LINK_FLAGS_APPEND", "HCC_AMDGPU_TARGET", "HIP_PLATFORM", ]: env_value = get_host_environ(repository_ctx, name) if env_value: hipcc_env = (hipcc_env + " " + name + "=\"" + env_value + "\";") return hipcc_env.strip() def _hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin): """Returns if hipcc is based on hip-clang toolchain. Args: repository_ctx: The repository context. rocm_config: The path to the hip compiler. bash_bin: the path to the bash interpreter Returns: A string "True" if hipcc is based on hip-clang toolchain. The functions returns "False" if not (ie: based on HIP/HCC toolchain). """ # check user-defined hip-clang environment variables for name in ["HIP_CLANG_PATH", "HIP_VDI_HOME"]: if get_host_environ(repository_ctx, name): return "True" # grep for "HIP_COMPILER=clang" in /opt/rocm/hip/lib/.hipInfo cmd = "grep HIP_COMPILER=clang %s/hip/lib/.hipInfo || true" % rocm_config.rocm_toolkit_path grep_result = execute(repository_ctx, [bash_bin, "-c", cmd], empty_stdout_fine = True) result = grep_result.stdout.strip() if result == "HIP_COMPILER=clang": return "True" return "False" def _if_hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin, if_true, if_false = []): """ Returns either the if_true or if_false arg based on whether hipcc is based on the hip-clang toolchain Args : repository_ctx: The repository context. rocm_config: The path to the hip compiler. if_true : value to return if hipcc is hip-clang based if_false : value to return if hipcc is not hip-clang based (optional, defaults to empty list) Returns : either the if_true arg or the of_False arg """ if _hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin) == "True": return if_true return if_false def _crosstool_verbose(repository_ctx): """Returns the environment variable value CROSSTOOL_VERBOSE. Args: repository_ctx: The repository context. Returns: A string containing value of environment variable CROSSTOOL_VERBOSE. """ return get_host_environ(repository_ctx, "CROSSTOOL_VERBOSE", "0") def _lib_name(lib, version = "", static = False): """Constructs the name of a library on Linux. Args: lib: The name of the library, such as "hip" version: The version of the library. static: True the library is static or False if it is a shared object. Returns: The platform-specific name of the library. """ if static: return "lib%s.a" % lib else: if version: version = ".%s" % version return "lib%s.so%s" % (lib, version) def _rocm_lib_paths(repository_ctx, lib, basedir): file_name = _lib_name(lib, version = "", static = False) return [ repository_ctx.path("%s/lib64/%s" % (basedir, file_name)), repository_ctx.path("%s/lib64/stubs/%s" % (basedir, file_name)), repository_ctx.path("%s/lib/x86_64-linux-gnu/%s" % (basedir, file_name)), repository_ctx.path("%s/lib/%s" % (basedir, file_name)), repository_ctx.path("%s/%s" % (basedir, file_name)), ] def _batch_files_exist(repository_ctx, libs_paths, bash_bin): all_paths = [] for _, lib_paths in libs_paths: for lib_path in lib_paths: all_paths.append(lib_path) return files_exist(repository_ctx, all_paths, bash_bin) def _select_rocm_lib_paths(repository_ctx, libs_paths, bash_bin): test_results = _batch_files_exist(repository_ctx, libs_paths, bash_bin) libs = {} i = 0 for name, lib_paths in libs_paths: selected_path = None for path in lib_paths: if test_results[i] and selected_path == None: # For each lib select the first path that exists. selected_path = path i = i + 1 if selected_path == None: auto_configure_fail("Cannot find rocm library %s" % name) libs[name] = struct(file_name = selected_path.basename, path = realpath(repository_ctx, selected_path, bash_bin)) return libs def _find_libs(repository_ctx, rocm_config, bash_bin): """Returns the ROCm libraries on the system. Args: repository_ctx: The repository context. rocm_config: The ROCm config as returned by _get_rocm_config bash_bin: the path to the bash interpreter Returns: Map of library names to structs of filename and path """ libs_paths = [ (name, _rocm_lib_paths(repository_ctx, name, path)) for name, path in [ ("hip_hcc", rocm_config.rocm_toolkit_path + "/hip"), ("rocblas", rocm_config.rocm_toolkit_path + "/rocblas"), ("rocfft", rocm_config.rocm_toolkit_path + "/rocfft"), ("hiprand", rocm_config.rocm_toolkit_path + "/hiprand"), ("MIOpen", rocm_config.rocm_toolkit_path + "/miopen"), ("rccl", rocm_config.rocm_toolkit_path + "/rccl"), ("hipsparse", rocm_config.rocm_toolkit_path + "/hipsparse"), ] ] return _select_rocm_lib_paths(repository_ctx, libs_paths, bash_bin) def _get_rocm_config(repository_ctx, bash_bin): """Detects and returns information about the ROCm installation on the system. Args: repository_ctx: The repository context. bash_bin: the path to the path interpreter Returns: A struct containing the following fields: rocm_toolkit_path: The ROCm toolkit installation directory. amdgpu_targets: A list of the system's AMDGPU targets. """ rocm_toolkit_path = _rocm_toolkit_path(repository_ctx, bash_bin) return struct( rocm_toolkit_path = rocm_toolkit_path, amdgpu_targets = _amdgpu_targets(repository_ctx, rocm_toolkit_path, bash_bin), ) def _tpl_path(repository_ctx, labelname): return repository_ctx.path(Label("//third_party/gpus/%s.tpl" % labelname)) def _tpl(repository_ctx, tpl, substitutions = {}, out = None): if not out: out = tpl.replace(":", "/") repository_ctx.template( out, _tpl_path(repository_ctx, tpl), substitutions, ) _DUMMY_CROSSTOOL_BZL_FILE = """ def error_gpu_disabled(): fail("ERROR: Building with --config=rocm but TensorFlow is not configured " + "to build with GPU support. Please re-run ./configure and enter 'Y' " + "at the prompt to build with GPU support.") native.genrule( name = "error_gen_crosstool", outs = ["CROSSTOOL"], cmd = "echo 'Should not be run.' && exit 1", ) native.filegroup( name = "crosstool", srcs = [":CROSSTOOL"], output_licenses = ["unencumbered"], ) """ _DUMMY_CROSSTOOL_BUILD_FILE = """ load("//crosstool:error_gpu_disabled.bzl", "error_gpu_disabled") error_gpu_disabled() """ def _create_dummy_repository(repository_ctx): # Set up BUILD file for rocm/. _tpl( repository_ctx, "rocm:build_defs.bzl", { "%{rocm_is_configured}": "False", "%{rocm_extra_copts}": "[]", "%{rocm_gpu_architectures}": "[]", }, ) _tpl( repository_ctx, "rocm:BUILD", { "%{hip_lib}": _lib_name("hip"), "%{rocblas_lib}": _lib_name("rocblas"), "%{miopen_lib}": _lib_name("miopen"), "%{rccl_lib}": _lib_name("rccl"), "%{rocfft_lib}": _lib_name("rocfft"), "%{hiprand_lib}": _lib_name("hiprand"), "%{hipsparse_lib}": _lib_name("hipsparse"), "%{copy_rules}": "", "%{rocm_headers}": "", }, ) # Create dummy files for the ROCm toolkit since they are still required by # tensorflow/core/platform/default/build_config:rocm. repository_ctx.file("rocm/hip/include/hip/hip_runtime.h", "") # Set up rocm_config.h, which is used by # tensorflow/stream_executor/dso_loader.cc. _tpl( repository_ctx, "rocm:rocm_config.h", { "%{rocm_toolkit_path}": _DEFAULT_ROCM_TOOLKIT_PATH, }, "rocm/rocm/rocm_config.h", ) # If rocm_configure is not configured to build with GPU support, and the user # attempts to build with --config=rocm, add a dummy build rule to intercept # this and fail with an actionable error message. repository_ctx.file( "crosstool/error_gpu_disabled.bzl", _DUMMY_CROSSTOOL_BZL_FILE, ) repository_ctx.file("crosstool/BUILD", _DUMMY_CROSSTOOL_BUILD_FILE) def _norm_path(path): """Returns a path with '/' and remove the trailing slash.""" path = path.replace("\\", "/") if path[-1] == "/": path = path[:-1] return path def _genrule(src_dir, genrule_name, command, outs): """Returns a string with a genrule. Genrule executes the given command and produces the given outputs. """ return ( "genrule(\n" + ' name = "' + genrule_name + '",\n' + " outs = [\n" + outs + "\n ],\n" + ' cmd = """\n' + command + '\n """,\n' + ")\n" ) def _compute_rocm_extra_copts(repository_ctx, amdgpu_targets): amdgpu_target_flags = ["--amdgpu-target=" + amdgpu_target for amdgpu_target in amdgpu_targets] return str(amdgpu_target_flags) def _create_local_rocm_repository(repository_ctx): """Creates the repository containing files set up to build with ROCm.""" tpl_paths = {labelname: _tpl_path(repository_ctx, labelname) for labelname in [ "rocm:build_defs.bzl", "rocm:BUILD", "crosstool:BUILD.rocm", "crosstool:hipcc_cc_toolchain_config.bzl", "crosstool:clang/bin/crosstool_wrapper_driver_rocm", "rocm:rocm_config.h", ]} bash_bin = get_bash_bin(repository_ctx) rocm_config = _get_rocm_config(repository_ctx, bash_bin) # Copy header and library files to execroot. # rocm_toolkit_path rocm_toolkit_path = rocm_config.rocm_toolkit_path copy_rules = [ make_copy_dir_rule( repository_ctx, name = "rocm-include", src_dir = rocm_toolkit_path + "/include", out_dir = "rocm/include", exceptions = ["gtest", "gmock"], ), make_copy_dir_rule( repository_ctx, name = "rocfft-include", src_dir = rocm_toolkit_path + "/rocfft/include", out_dir = "rocm/include/rocfft", ), make_copy_dir_rule( repository_ctx, name = "rocblas-include", src_dir = rocm_toolkit_path + "/rocblas/include", out_dir = "rocm/include/rocblas", ), make_copy_dir_rule( repository_ctx, name = "miopen-include", src_dir = rocm_toolkit_path + "/miopen/include", out_dir = "rocm/include/miopen", ), make_copy_dir_rule( repository_ctx, name = "rccl-include", src_dir = rocm_toolkit_path + "/rccl/include", out_dir = "rocm/include/rccl", ), make_copy_dir_rule( repository_ctx, name = "hipsparse-include", src_dir = rocm_toolkit_path + "/hipsparse/include", out_dir = "rocm/include/hipsparse", ), ] rocm_libs = _find_libs(repository_ctx, rocm_config, bash_bin) rocm_lib_srcs = [] rocm_lib_outs = [] for lib in rocm_libs.values(): rocm_lib_srcs.append(lib.path) rocm_lib_outs.append("rocm/lib/" + lib.file_name) copy_rules.append(make_copy_files_rule( repository_ctx, name = "rocm-lib", srcs = rocm_lib_srcs, outs = rocm_lib_outs, )) clang_offload_bundler_path = rocm_toolkit_path + _if_hipcc_is_hipclang( repository_ctx, rocm_config, bash_bin, "/llvm/bin/", "/hcc/bin/", ) + "clang-offload-bundler" # copy files mentioned in third_party/gpus/rocm/BUILD copy_rules.append(make_copy_files_rule( repository_ctx, name = "rocm-bin", srcs = [ clang_offload_bundler_path, ], outs = [ "rocm/bin/" + "clang-offload-bundler", ], )) # Set up BUILD file for rocm/ repository_ctx.template( "rocm/build_defs.bzl", tpl_paths["rocm:build_defs.bzl"], { "%{rocm_is_configured}": "True", "%{rocm_extra_copts}": _compute_rocm_extra_copts( repository_ctx, rocm_config.amdgpu_targets, ), "%{rocm_gpu_architectures}": str(rocm_config.amdgpu_targets), }, ) repository_ctx.template( "rocm/BUILD", tpl_paths["rocm:BUILD"], { "%{hip_lib}": rocm_libs["hip_hcc"].file_name, "%{rocblas_lib}": rocm_libs["rocblas"].file_name, "%{rocfft_lib}": rocm_libs["rocfft"].file_name, "%{hiprand_lib}": rocm_libs["hiprand"].file_name, "%{miopen_lib}": rocm_libs["MIOpen"].file_name, "%{rccl_lib}": rocm_libs["rccl"].file_name, "%{hipsparse_lib}": rocm_libs["hipsparse"].file_name, "%{copy_rules}": "\n".join(copy_rules), "%{rocm_headers}": ('":rocm-include",\n' + '":rocfft-include",\n' + '":rocblas-include",\n' + '":miopen-include",\n' + '":rccl-include",\n' + '":hipsparse-include",'), }, ) # Set up crosstool/ cc = find_cc(repository_ctx) host_compiler_includes = get_cxx_inc_directories(repository_ctx, cc) host_compiler_prefix = get_host_environ(repository_ctx, _GCC_HOST_COMPILER_PREFIX, "/usr/bin") rocm_defines = {} rocm_defines["%{host_compiler_prefix}"] = host_compiler_prefix rocm_defines["%{linker_bin_path}"] = rocm_config.rocm_toolkit_path + "/hcc/compiler/bin" # For gcc, do not canonicalize system header paths; some versions of gcc # pick the shortest possible path for system includes when creating the # .d file - given that includes that are prefixed with "../" multiple # time quickly grow longer than the root of the tree, this can lead to # bazel's header check failing. rocm_defines["%{extra_no_canonical_prefixes_flags}"] = "\"-fno-canonical-system-headers\"" rocm_defines["%{unfiltered_compile_flags}"] = to_list_of_strings([ "-DTENSORFLOW_USE_ROCM=1", "-D__HIP_PLATFORM_HCC__", "-DEIGEN_USE_HIP", ] + _if_hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin, [ # # define "TENSORFLOW_COMPILER_IS_HIP_CLANG" when we are using clang # based hipcc to compile/build tensorflow # # Note that this #define should not be used to check whether or not # tensorflow is being built with ROCm support # (only TENSORFLOW_USE_ROCM should be used for that purpose) # "-DTENSORFLOW_COMPILER_IS_HIP_CLANG=1", ])) rocm_defines["%{host_compiler_path}"] = "clang/bin/crosstool_wrapper_driver_is_not_gcc" rocm_defines["%{cxx_builtin_include_directories}"] = to_list_of_strings( host_compiler_includes + _rocm_include_path(repository_ctx, rocm_config, bash_bin), ) verify_build_defines(rocm_defines) # Only expand template variables in the BUILD file repository_ctx.template( "crosstool/BUILD", tpl_paths["crosstool:BUILD.rocm"], rocm_defines, ) # No templating of cc_toolchain_config - use attributes and templatize the # BUILD file. repository_ctx.template( "crosstool/cc_toolchain_config.bzl", tpl_paths["crosstool:hipcc_cc_toolchain_config.bzl"], ) repository_ctx.template( "crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc", tpl_paths["crosstool:clang/bin/crosstool_wrapper_driver_rocm"], { "%{cpu_compiler}": str(cc), "%{hipcc_path}": rocm_config.rocm_toolkit_path + "/hip/bin/hipcc", "%{hipcc_env}": _hipcc_env(repository_ctx), "%{hipcc_is_hipclang}": _hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin), "%{rocr_runtime_path}": rocm_config.rocm_toolkit_path + "/lib", "%{rocr_runtime_library}": "hsa-runtime64", "%{hip_runtime_path}": rocm_config.rocm_toolkit_path + "/hip/lib", "%{hip_runtime_library}": "hip_hcc", "%{hcc_runtime_path}": rocm_config.rocm_toolkit_path + "/hcc/lib", "%{hcc_runtime_library}": "mcwamp", "%{crosstool_verbose}": _crosstool_verbose(repository_ctx), "%{gcc_host_compiler_path}": str(cc), }, ) # Set up rocm_config.h, which is used by # tensorflow/stream_executor/dso_loader.cc. repository_ctx.template( "rocm/rocm/rocm_config.h", tpl_paths["rocm:rocm_config.h"], { "%{rocm_amdgpu_targets}": ",".join( ["\"%s\"" % c for c in rocm_config.amdgpu_targets], ), "%{rocm_toolkit_path}": rocm_config.rocm_toolkit_path, }, ) def _create_remote_rocm_repository(repository_ctx, remote_config_repo): """Creates pointers to a remotely configured repo set up to build with ROCm.""" _tpl( repository_ctx, "rocm:build_defs.bzl", { "%{rocm_is_configured}": "True", "%{rocm_extra_copts}": _compute_rocm_extra_copts( repository_ctx, [], #_compute_capabilities(repository_ctx) ), }, ) repository_ctx.template( "rocm/BUILD", config_repo_label(remote_config_repo, "rocm:BUILD"), {}, ) repository_ctx.template( "rocm/build_defs.bzl", config_repo_label(remote_config_repo, "rocm:build_defs.bzl"), {}, ) repository_ctx.template( "rocm/rocm/rocm_config.h", config_repo_label(remote_config_repo, "rocm:rocm/rocm_config.h"), {}, ) repository_ctx.template( "crosstool/BUILD", config_repo_label(remote_config_repo, "crosstool:BUILD"), {}, ) repository_ctx.template( "crosstool/cc_toolchain_config.bzl", config_repo_label(remote_config_repo, "crosstool:cc_toolchain_config.bzl"), {}, ) repository_ctx.template( "crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc", config_repo_label(remote_config_repo, "crosstool:clang/bin/crosstool_wrapper_driver_is_not_gcc"), {}, ) def _rocm_autoconf_impl(repository_ctx): """Implementation of the rocm_autoconf repository rule.""" if not _enable_rocm(repository_ctx): _create_dummy_repository(repository_ctx) elif get_host_environ(repository_ctx, _TF_ROCM_CONFIG_REPO) != None: _create_remote_rocm_repository( repository_ctx, get_host_environ(repository_ctx, _TF_ROCM_CONFIG_REPO), ) else: _create_local_rocm_repository(repository_ctx) _ENVIRONS = [ _GCC_HOST_COMPILER_PATH, _GCC_HOST_COMPILER_PREFIX, "TF_NEED_ROCM", _ROCM_TOOLKIT_PATH, _TF_ROCM_VERSION, _TF_MIOPEN_VERSION, _TF_ROCM_AMDGPU_TARGETS, ] remote_rocm_configure = repository_rule( implementation = _create_local_rocm_repository, environ = _ENVIRONS, remotable = True, attrs = { "environ": attr.string_dict(), }, ) rocm_configure = repository_rule( implementation = _rocm_autoconf_impl, environ = _ENVIRONS + [_TF_ROCM_CONFIG_REPO], ) """Detects and configures the local ROCm toolchain. Add the following to your WORKSPACE FILE: ```python rocm_configure(name = "local_config_rocm") ``` Args: name: A unique name for this workspace rule. """
"""Repository rule for ROCm autoconfiguration. `rocm_configure` depends on the following environment variables: * `TF_NEED_ROCM`: Whether to enable building with ROCm. * `GCC_HOST_COMPILER_PATH`: The GCC host compiler path * `ROCM_TOOLKIT_PATH`: The path to the ROCm toolkit. Default is `/opt/rocm`. * `TF_ROCM_VERSION`: The version of the ROCm toolkit. If this is blank, then use the system default. * `TF_MIOPEN_VERSION`: The version of the MIOpen library. * `TF_ROCM_AMDGPU_TARGETS`: The AMDGPU targets. """ load(':cuda_configure.bzl', 'make_copy_dir_rule', 'make_copy_files_rule', 'to_list_of_strings') load('//third_party/remote_config:common.bzl', 'config_repo_label', 'err_out', 'execute', 'files_exist', 'get_bash_bin', 'get_cpu_value', 'get_host_environ', 'raw_exec', 'realpath', 'which') _gcc_host_compiler_path = 'GCC_HOST_COMPILER_PATH' _gcc_host_compiler_prefix = 'GCC_HOST_COMPILER_PREFIX' _rocm_toolkit_path = 'ROCM_PATH' _tf_rocm_version = 'TF_ROCM_VERSION' _tf_miopen_version = 'TF_MIOPEN_VERSION' _tf_rocm_amdgpu_targets = 'TF_ROCM_AMDGPU_TARGETS' _tf_rocm_config_repo = 'TF_ROCM_CONFIG_REPO' _default_rocm_version = '' _default_miopen_version = '' _default_rocm_toolkit_path = '/opt/rocm' def verify_build_defines(params): """Verify all variables that crosstool/BUILD.rocm.tpl expects are substituted. Args: params: dict of variables that will be passed to the BUILD.tpl template. """ missing = [] for param in ['cxx_builtin_include_directories', 'extra_no_canonical_prefixes_flags', 'host_compiler_path', 'host_compiler_prefix', 'linker_bin_path', 'unfiltered_compile_flags']: if '%{' + param + '}' not in params: missing.append(param) if missing: auto_configure_fail('BUILD.rocm.tpl template is missing these variables: ' + str(missing) + '.\nWe only got: ' + str(params) + '.') def find_cc(repository_ctx): """Find the C++ compiler.""" target_cc_name = 'gcc' cc_path_envvar = _GCC_HOST_COMPILER_PATH cc_name = target_cc_name cc_name_from_env = get_host_environ(repository_ctx, cc_path_envvar) if cc_name_from_env: cc_name = cc_name_from_env if cc_name.startswith('/'): return cc_name cc = which(repository_ctx, cc_name) if cc == None: fail(('Cannot find {}, either correct your path or set the {}' + ' environment variable').format(target_cc_name, cc_path_envvar)) return cc _inc_dir_marker_begin = '#include <...>' def _cxx_inc_convert(path): """Convert path returned by cc -E xc++ in a complete path.""" path = path.strip() return path def _get_cxx_inc_directories_impl(repository_ctx, cc, lang_is_cpp): """Compute the list of default C or C++ include directories.""" if lang_is_cpp: lang = 'c++' else: lang = 'c' result = raw_exec(repository_ctx, [cc, '-no-canonical-prefixes', '-E', '-x' + lang, '-', '-v']) stderr = err_out(result) index1 = stderr.find(_INC_DIR_MARKER_BEGIN) if index1 == -1: return [] index1 = stderr.find('\n', index1) if index1 == -1: return [] index2 = stderr.rfind('\n ') if index2 == -1 or index2 < index1: return [] index2 = stderr.find('\n', index2 + 1) if index2 == -1: inc_dirs = stderr[index1 + 1:] else: inc_dirs = stderr[index1 + 1:index2].strip() return [str(repository_ctx.path(_cxx_inc_convert(p))) for p in inc_dirs.split('\n')] def get_cxx_inc_directories(repository_ctx, cc): """Compute the list of default C and C++ include directories.""" includes_cpp = _get_cxx_inc_directories_impl(repository_ctx, cc, True) includes_c = _get_cxx_inc_directories_impl(repository_ctx, cc, False) includes_cpp_set = depset(includes_cpp) return includes_cpp + [inc for inc in includes_c if inc not in includes_cpp_set.to_list()] def auto_configure_fail(msg): """Output failure message when rocm configuration fails.""" red = '\x1b[0;31m' no_color = '\x1b[0m' fail('\n%sROCm Configuration Error:%s %s\n' % (red, no_color, msg)) def auto_configure_warning(msg): """Output warning message during auto configuration.""" yellow = '\x1b[1;33m' no_color = '\x1b[0m' print('\n%sAuto-Configuration Warning:%s %s\n' % (yellow, no_color, msg)) def _rocm_include_path(repository_ctx, rocm_config, bash_bin): """Generates the cxx_builtin_include_directory entries for rocm inc dirs. Args: repository_ctx: The repository context. rocm_config: The path to the gcc host compiler. Returns: A string containing the Starlark string for each of the gcc host compiler include directories, which can be added to the CROSSTOOL file. """ inc_dirs = [] inc_dirs.append(rocm_config.rocm_toolkit_path + '/hsa/include') inc_dirs.append(rocm_config.rocm_toolkit_path + '/hip/include') rocm_toolkit_path = realpath(repository_ctx, rocm_config.rocm_toolkit_path, bash_bin) inc_dirs.append(rocm_toolkit_path + '/llvm/lib/clang/8.0/include') inc_dirs.append(rocm_toolkit_path + '/llvm/lib/clang/9.0.0/include') inc_dirs.append(rocm_toolkit_path + '/llvm/lib/clang/10.0.0/include') inc_dirs.append(rocm_toolkit_path + '/llvm/lib/clang/11.0.0/include') inc_dirs.append(rocm_toolkit_path + '/hcc/compiler/lib/clang/10.0.0/include/') inc_dirs.append(rocm_toolkit_path + '/hcc/lib/clang/10.0.0/include') inc_dirs.append(rocm_toolkit_path + '/hcc/include') return inc_dirs def _enable_rocm(repository_ctx): enable_rocm = get_host_environ(repository_ctx, 'TF_NEED_ROCM') if enable_rocm == '1': if get_cpu_value(repository_ctx) != 'Linux': auto_configure_warning('ROCm configure is only supported on Linux') return False return True return False def _rocm_toolkit_path(repository_ctx, bash_bin): """Finds the rocm toolkit directory. Args: repository_ctx: The repository context. Returns: A speculative real path of the rocm toolkit install directory. """ rocm_toolkit_path = get_host_environ(repository_ctx, _ROCM_TOOLKIT_PATH, _DEFAULT_ROCM_TOOLKIT_PATH) if files_exist(repository_ctx, [rocm_toolkit_path], bash_bin) != [True]: auto_configure_fail('Cannot find rocm toolkit path.') return rocm_toolkit_path def _amdgpu_targets(repository_ctx, rocm_toolkit_path, bash_bin): """Returns a list of strings representing AMDGPU targets.""" amdgpu_targets_str = get_host_environ(repository_ctx, _TF_ROCM_AMDGPU_TARGETS) if not amdgpu_targets_str: cmd = '%s/bin/rocm_agent_enumerator' % rocm_toolkit_path result = execute(repository_ctx, [bash_bin, '-c', cmd]) targets = [target for target in result.stdout.strip().split('\n') if target != 'gfx000'] amdgpu_targets_str = ','.join(targets) amdgpu_targets = amdgpu_targets_str.split(',') for amdgpu_target in amdgpu_targets: if amdgpu_target[:3] != 'gfx' or not amdgpu_target[3:].isdigit(): auto_configure_fail('Invalid AMDGPU target: %s' % amdgpu_target) return amdgpu_targets def _hipcc_env(repository_ctx): """Returns the environment variable string for hipcc. Args: repository_ctx: The repository context. Returns: A string containing environment variables for hipcc. """ hipcc_env = '' for name in ['HIP_CLANG_PATH', 'DEVICE_LIB_PATH', 'HIP_VDI_HOME', 'HIPCC_VERBOSE', 'HIPCC_COMPILE_FLAGS_APPEND', 'HIPPCC_LINK_FLAGS_APPEND', 'HCC_AMDGPU_TARGET', 'HIP_PLATFORM']: env_value = get_host_environ(repository_ctx, name) if env_value: hipcc_env = hipcc_env + ' ' + name + '="' + env_value + '";' return hipcc_env.strip() def _hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin): """Returns if hipcc is based on hip-clang toolchain. Args: repository_ctx: The repository context. rocm_config: The path to the hip compiler. bash_bin: the path to the bash interpreter Returns: A string "True" if hipcc is based on hip-clang toolchain. The functions returns "False" if not (ie: based on HIP/HCC toolchain). """ for name in ['HIP_CLANG_PATH', 'HIP_VDI_HOME']: if get_host_environ(repository_ctx, name): return 'True' cmd = 'grep HIP_COMPILER=clang %s/hip/lib/.hipInfo || true' % rocm_config.rocm_toolkit_path grep_result = execute(repository_ctx, [bash_bin, '-c', cmd], empty_stdout_fine=True) result = grep_result.stdout.strip() if result == 'HIP_COMPILER=clang': return 'True' return 'False' def _if_hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin, if_true, if_false=[]): """ Returns either the if_true or if_false arg based on whether hipcc is based on the hip-clang toolchain Args : repository_ctx: The repository context. rocm_config: The path to the hip compiler. if_true : value to return if hipcc is hip-clang based if_false : value to return if hipcc is not hip-clang based (optional, defaults to empty list) Returns : either the if_true arg or the of_False arg """ if _hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin) == 'True': return if_true return if_false def _crosstool_verbose(repository_ctx): """Returns the environment variable value CROSSTOOL_VERBOSE. Args: repository_ctx: The repository context. Returns: A string containing value of environment variable CROSSTOOL_VERBOSE. """ return get_host_environ(repository_ctx, 'CROSSTOOL_VERBOSE', '0') def _lib_name(lib, version='', static=False): """Constructs the name of a library on Linux. Args: lib: The name of the library, such as "hip" version: The version of the library. static: True the library is static or False if it is a shared object. Returns: The platform-specific name of the library. """ if static: return 'lib%s.a' % lib else: if version: version = '.%s' % version return 'lib%s.so%s' % (lib, version) def _rocm_lib_paths(repository_ctx, lib, basedir): file_name = _lib_name(lib, version='', static=False) return [repository_ctx.path('%s/lib64/%s' % (basedir, file_name)), repository_ctx.path('%s/lib64/stubs/%s' % (basedir, file_name)), repository_ctx.path('%s/lib/x86_64-linux-gnu/%s' % (basedir, file_name)), repository_ctx.path('%s/lib/%s' % (basedir, file_name)), repository_ctx.path('%s/%s' % (basedir, file_name))] def _batch_files_exist(repository_ctx, libs_paths, bash_bin): all_paths = [] for (_, lib_paths) in libs_paths: for lib_path in lib_paths: all_paths.append(lib_path) return files_exist(repository_ctx, all_paths, bash_bin) def _select_rocm_lib_paths(repository_ctx, libs_paths, bash_bin): test_results = _batch_files_exist(repository_ctx, libs_paths, bash_bin) libs = {} i = 0 for (name, lib_paths) in libs_paths: selected_path = None for path in lib_paths: if test_results[i] and selected_path == None: selected_path = path i = i + 1 if selected_path == None: auto_configure_fail('Cannot find rocm library %s' % name) libs[name] = struct(file_name=selected_path.basename, path=realpath(repository_ctx, selected_path, bash_bin)) return libs def _find_libs(repository_ctx, rocm_config, bash_bin): """Returns the ROCm libraries on the system. Args: repository_ctx: The repository context. rocm_config: The ROCm config as returned by _get_rocm_config bash_bin: the path to the bash interpreter Returns: Map of library names to structs of filename and path """ libs_paths = [(name, _rocm_lib_paths(repository_ctx, name, path)) for (name, path) in [('hip_hcc', rocm_config.rocm_toolkit_path + '/hip'), ('rocblas', rocm_config.rocm_toolkit_path + '/rocblas'), ('rocfft', rocm_config.rocm_toolkit_path + '/rocfft'), ('hiprand', rocm_config.rocm_toolkit_path + '/hiprand'), ('MIOpen', rocm_config.rocm_toolkit_path + '/miopen'), ('rccl', rocm_config.rocm_toolkit_path + '/rccl'), ('hipsparse', rocm_config.rocm_toolkit_path + '/hipsparse')]] return _select_rocm_lib_paths(repository_ctx, libs_paths, bash_bin) def _get_rocm_config(repository_ctx, bash_bin): """Detects and returns information about the ROCm installation on the system. Args: repository_ctx: The repository context. bash_bin: the path to the path interpreter Returns: A struct containing the following fields: rocm_toolkit_path: The ROCm toolkit installation directory. amdgpu_targets: A list of the system's AMDGPU targets. """ rocm_toolkit_path = _rocm_toolkit_path(repository_ctx, bash_bin) return struct(rocm_toolkit_path=rocm_toolkit_path, amdgpu_targets=_amdgpu_targets(repository_ctx, rocm_toolkit_path, bash_bin)) def _tpl_path(repository_ctx, labelname): return repository_ctx.path(label('//third_party/gpus/%s.tpl' % labelname)) def _tpl(repository_ctx, tpl, substitutions={}, out=None): if not out: out = tpl.replace(':', '/') repository_ctx.template(out, _tpl_path(repository_ctx, tpl), substitutions) _dummy_crosstool_bzl_file = '\ndef error_gpu_disabled():\n fail("ERROR: Building with --config=rocm but TensorFlow is not configured " +\n "to build with GPU support. Please re-run ./configure and enter \'Y\' " +\n "at the prompt to build with GPU support.")\n\n native.genrule(\n name = "error_gen_crosstool",\n outs = ["CROSSTOOL"],\n cmd = "echo \'Should not be run.\' && exit 1",\n )\n\n native.filegroup(\n name = "crosstool",\n srcs = [":CROSSTOOL"],\n output_licenses = ["unencumbered"],\n )\n' _dummy_crosstool_build_file = '\nload("//crosstool:error_gpu_disabled.bzl", "error_gpu_disabled")\n\nerror_gpu_disabled()\n' def _create_dummy_repository(repository_ctx): _tpl(repository_ctx, 'rocm:build_defs.bzl', {'%{rocm_is_configured}': 'False', '%{rocm_extra_copts}': '[]', '%{rocm_gpu_architectures}': '[]'}) _tpl(repository_ctx, 'rocm:BUILD', {'%{hip_lib}': _lib_name('hip'), '%{rocblas_lib}': _lib_name('rocblas'), '%{miopen_lib}': _lib_name('miopen'), '%{rccl_lib}': _lib_name('rccl'), '%{rocfft_lib}': _lib_name('rocfft'), '%{hiprand_lib}': _lib_name('hiprand'), '%{hipsparse_lib}': _lib_name('hipsparse'), '%{copy_rules}': '', '%{rocm_headers}': ''}) repository_ctx.file('rocm/hip/include/hip/hip_runtime.h', '') _tpl(repository_ctx, 'rocm:rocm_config.h', {'%{rocm_toolkit_path}': _DEFAULT_ROCM_TOOLKIT_PATH}, 'rocm/rocm/rocm_config.h') repository_ctx.file('crosstool/error_gpu_disabled.bzl', _DUMMY_CROSSTOOL_BZL_FILE) repository_ctx.file('crosstool/BUILD', _DUMMY_CROSSTOOL_BUILD_FILE) def _norm_path(path): """Returns a path with '/' and remove the trailing slash.""" path = path.replace('\\', '/') if path[-1] == '/': path = path[:-1] return path def _genrule(src_dir, genrule_name, command, outs): """Returns a string with a genrule. Genrule executes the given command and produces the given outputs. """ return 'genrule(\n' + ' name = "' + genrule_name + '",\n' + ' outs = [\n' + outs + '\n ],\n' + ' cmd = """\n' + command + '\n """,\n' + ')\n' def _compute_rocm_extra_copts(repository_ctx, amdgpu_targets): amdgpu_target_flags = ['--amdgpu-target=' + amdgpu_target for amdgpu_target in amdgpu_targets] return str(amdgpu_target_flags) def _create_local_rocm_repository(repository_ctx): """Creates the repository containing files set up to build with ROCm.""" tpl_paths = {labelname: _tpl_path(repository_ctx, labelname) for labelname in ['rocm:build_defs.bzl', 'rocm:BUILD', 'crosstool:BUILD.rocm', 'crosstool:hipcc_cc_toolchain_config.bzl', 'crosstool:clang/bin/crosstool_wrapper_driver_rocm', 'rocm:rocm_config.h']} bash_bin = get_bash_bin(repository_ctx) rocm_config = _get_rocm_config(repository_ctx, bash_bin) rocm_toolkit_path = rocm_config.rocm_toolkit_path copy_rules = [make_copy_dir_rule(repository_ctx, name='rocm-include', src_dir=rocm_toolkit_path + '/include', out_dir='rocm/include', exceptions=['gtest', 'gmock']), make_copy_dir_rule(repository_ctx, name='rocfft-include', src_dir=rocm_toolkit_path + '/rocfft/include', out_dir='rocm/include/rocfft'), make_copy_dir_rule(repository_ctx, name='rocblas-include', src_dir=rocm_toolkit_path + '/rocblas/include', out_dir='rocm/include/rocblas'), make_copy_dir_rule(repository_ctx, name='miopen-include', src_dir=rocm_toolkit_path + '/miopen/include', out_dir='rocm/include/miopen'), make_copy_dir_rule(repository_ctx, name='rccl-include', src_dir=rocm_toolkit_path + '/rccl/include', out_dir='rocm/include/rccl'), make_copy_dir_rule(repository_ctx, name='hipsparse-include', src_dir=rocm_toolkit_path + '/hipsparse/include', out_dir='rocm/include/hipsparse')] rocm_libs = _find_libs(repository_ctx, rocm_config, bash_bin) rocm_lib_srcs = [] rocm_lib_outs = [] for lib in rocm_libs.values(): rocm_lib_srcs.append(lib.path) rocm_lib_outs.append('rocm/lib/' + lib.file_name) copy_rules.append(make_copy_files_rule(repository_ctx, name='rocm-lib', srcs=rocm_lib_srcs, outs=rocm_lib_outs)) clang_offload_bundler_path = rocm_toolkit_path + _if_hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin, '/llvm/bin/', '/hcc/bin/') + 'clang-offload-bundler' copy_rules.append(make_copy_files_rule(repository_ctx, name='rocm-bin', srcs=[clang_offload_bundler_path], outs=['rocm/bin/' + 'clang-offload-bundler'])) repository_ctx.template('rocm/build_defs.bzl', tpl_paths['rocm:build_defs.bzl'], {'%{rocm_is_configured}': 'True', '%{rocm_extra_copts}': _compute_rocm_extra_copts(repository_ctx, rocm_config.amdgpu_targets), '%{rocm_gpu_architectures}': str(rocm_config.amdgpu_targets)}) repository_ctx.template('rocm/BUILD', tpl_paths['rocm:BUILD'], {'%{hip_lib}': rocm_libs['hip_hcc'].file_name, '%{rocblas_lib}': rocm_libs['rocblas'].file_name, '%{rocfft_lib}': rocm_libs['rocfft'].file_name, '%{hiprand_lib}': rocm_libs['hiprand'].file_name, '%{miopen_lib}': rocm_libs['MIOpen'].file_name, '%{rccl_lib}': rocm_libs['rccl'].file_name, '%{hipsparse_lib}': rocm_libs['hipsparse'].file_name, '%{copy_rules}': '\n'.join(copy_rules), '%{rocm_headers}': '":rocm-include",\n' + '":rocfft-include",\n' + '":rocblas-include",\n' + '":miopen-include",\n' + '":rccl-include",\n' + '":hipsparse-include",'}) cc = find_cc(repository_ctx) host_compiler_includes = get_cxx_inc_directories(repository_ctx, cc) host_compiler_prefix = get_host_environ(repository_ctx, _GCC_HOST_COMPILER_PREFIX, '/usr/bin') rocm_defines = {} rocm_defines['%{host_compiler_prefix}'] = host_compiler_prefix rocm_defines['%{linker_bin_path}'] = rocm_config.rocm_toolkit_path + '/hcc/compiler/bin' rocm_defines['%{extra_no_canonical_prefixes_flags}'] = '"-fno-canonical-system-headers"' rocm_defines['%{unfiltered_compile_flags}'] = to_list_of_strings(['-DTENSORFLOW_USE_ROCM=1', '-D__HIP_PLATFORM_HCC__', '-DEIGEN_USE_HIP'] + _if_hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin, ['-DTENSORFLOW_COMPILER_IS_HIP_CLANG=1'])) rocm_defines['%{host_compiler_path}'] = 'clang/bin/crosstool_wrapper_driver_is_not_gcc' rocm_defines['%{cxx_builtin_include_directories}'] = to_list_of_strings(host_compiler_includes + _rocm_include_path(repository_ctx, rocm_config, bash_bin)) verify_build_defines(rocm_defines) repository_ctx.template('crosstool/BUILD', tpl_paths['crosstool:BUILD.rocm'], rocm_defines) repository_ctx.template('crosstool/cc_toolchain_config.bzl', tpl_paths['crosstool:hipcc_cc_toolchain_config.bzl']) repository_ctx.template('crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc', tpl_paths['crosstool:clang/bin/crosstool_wrapper_driver_rocm'], {'%{cpu_compiler}': str(cc), '%{hipcc_path}': rocm_config.rocm_toolkit_path + '/hip/bin/hipcc', '%{hipcc_env}': _hipcc_env(repository_ctx), '%{hipcc_is_hipclang}': _hipcc_is_hipclang(repository_ctx, rocm_config, bash_bin), '%{rocr_runtime_path}': rocm_config.rocm_toolkit_path + '/lib', '%{rocr_runtime_library}': 'hsa-runtime64', '%{hip_runtime_path}': rocm_config.rocm_toolkit_path + '/hip/lib', '%{hip_runtime_library}': 'hip_hcc', '%{hcc_runtime_path}': rocm_config.rocm_toolkit_path + '/hcc/lib', '%{hcc_runtime_library}': 'mcwamp', '%{crosstool_verbose}': _crosstool_verbose(repository_ctx), '%{gcc_host_compiler_path}': str(cc)}) repository_ctx.template('rocm/rocm/rocm_config.h', tpl_paths['rocm:rocm_config.h'], {'%{rocm_amdgpu_targets}': ','.join(['"%s"' % c for c in rocm_config.amdgpu_targets]), '%{rocm_toolkit_path}': rocm_config.rocm_toolkit_path}) def _create_remote_rocm_repository(repository_ctx, remote_config_repo): """Creates pointers to a remotely configured repo set up to build with ROCm.""" _tpl(repository_ctx, 'rocm:build_defs.bzl', {'%{rocm_is_configured}': 'True', '%{rocm_extra_copts}': _compute_rocm_extra_copts(repository_ctx, [])}) repository_ctx.template('rocm/BUILD', config_repo_label(remote_config_repo, 'rocm:BUILD'), {}) repository_ctx.template('rocm/build_defs.bzl', config_repo_label(remote_config_repo, 'rocm:build_defs.bzl'), {}) repository_ctx.template('rocm/rocm/rocm_config.h', config_repo_label(remote_config_repo, 'rocm:rocm/rocm_config.h'), {}) repository_ctx.template('crosstool/BUILD', config_repo_label(remote_config_repo, 'crosstool:BUILD'), {}) repository_ctx.template('crosstool/cc_toolchain_config.bzl', config_repo_label(remote_config_repo, 'crosstool:cc_toolchain_config.bzl'), {}) repository_ctx.template('crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc', config_repo_label(remote_config_repo, 'crosstool:clang/bin/crosstool_wrapper_driver_is_not_gcc'), {}) def _rocm_autoconf_impl(repository_ctx): """Implementation of the rocm_autoconf repository rule.""" if not _enable_rocm(repository_ctx): _create_dummy_repository(repository_ctx) elif get_host_environ(repository_ctx, _TF_ROCM_CONFIG_REPO) != None: _create_remote_rocm_repository(repository_ctx, get_host_environ(repository_ctx, _TF_ROCM_CONFIG_REPO)) else: _create_local_rocm_repository(repository_ctx) _environs = [_GCC_HOST_COMPILER_PATH, _GCC_HOST_COMPILER_PREFIX, 'TF_NEED_ROCM', _ROCM_TOOLKIT_PATH, _TF_ROCM_VERSION, _TF_MIOPEN_VERSION, _TF_ROCM_AMDGPU_TARGETS] remote_rocm_configure = repository_rule(implementation=_create_local_rocm_repository, environ=_ENVIRONS, remotable=True, attrs={'environ': attr.string_dict()}) rocm_configure = repository_rule(implementation=_rocm_autoconf_impl, environ=_ENVIRONS + [_TF_ROCM_CONFIG_REPO]) 'Detects and configures the local ROCm toolchain.\n\nAdd the following to your WORKSPACE FILE:\n\n```python\nrocm_configure(name = "local_config_rocm")\n```\n\nArgs:\n name: A unique name for this workspace rule.\n'
# Copyright 2016 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. def cram_test(name, srcs, deps=[]): for s in srcs: testname = name + '_' + s script = testname + '_script.sh' gr = "_gen_" + script # This genrule is a kludge, and at some point we should move # to a real rule # (http://bazel.io/docs/skylark/rules.html). What this does is # it builds a "bash script" whose first line execs cram on the # script. Conveniently, that first line is a comment as far as # cram is concerned (it's not indented at all), so everything # just works. native.genrule(name=gr, srcs=[s], outs=[script], cmd=("echo 'exec $${TEST_SRCDIR}/copybara/integration/cram " + "--xunit-file=$$XML_OUTPUT_FILE $$0' > \"$@\" ; " + "cat $(SRCS) >> \"$@\""), ) native.sh_test(name=testname, srcs=[script], data=["//copybara/integration:cram"] + deps, )
def cram_test(name, srcs, deps=[]): for s in srcs: testname = name + '_' + s script = testname + '_script.sh' gr = '_gen_' + script native.genrule(name=gr, srcs=[s], outs=[script], cmd="echo 'exec $${TEST_SRCDIR}/copybara/integration/cram " + '--xunit-file=$$XML_OUTPUT_FILE $$0\' > "$@" ; ' + 'cat $(SRCS) >> "$@"') native.sh_test(name=testname, srcs=[script], data=['//copybara/integration:cram'] + deps)
class Graph: """ The purpose of the class is to provide a clean way to define a graph for a searching algorithm: """ def __init__(self): self.edges = {} # dictionary of edges NODE: NEIGHBOURS self.weights = {} # dictionary of NODES and their COSTS self.herist={} def neighbours(self, node): """ The function returns the neighbour of the node passed to it, which is essentially the value of the key in the edges dictionary. :params node: (string) a node in the graph :return: (list) neighbouring nodes """ return self.edges[node] def get_cost(self, from_node, to_node): """ Gets the cost of a connection between adjacent nodes. :params from_node: (string) starting node :params to_node: (string) ending node :return: (int) """ return self.weights[(from_node + to_node)] def get_h(self, node): """ This function will give our the heuristic from the node to goal. :params node: (String) current node / any node :return: (int) heuristic to the goal """ return self.herist[node] if __name__ == "__main__": # testing out the graph class graph = Graph() # setting up nodes and neighbours graph.edges = { 'A': set(['B','C','D']), 'B': set(['E','F']), 'C':set(['G','H']), 'D':set(['I',"J"]), 'H':set(['K']) } # setting up connection costs graph.herist={'A':3,'B':4,'C':6,'D':5,'E':3,'F':2,'G':7,'H':8,'I':6,'J':7,'K':9} print(graph.get_h("A"))
class Graph: """ The purpose of the class is to provide a clean way to define a graph for a searching algorithm: """ def __init__(self): self.edges = {} self.weights = {} self.herist = {} def neighbours(self, node): """ The function returns the neighbour of the node passed to it, which is essentially the value of the key in the edges dictionary. :params node: (string) a node in the graph :return: (list) neighbouring nodes """ return self.edges[node] def get_cost(self, from_node, to_node): """ Gets the cost of a connection between adjacent nodes. :params from_node: (string) starting node :params to_node: (string) ending node :return: (int) """ return self.weights[from_node + to_node] def get_h(self, node): """ This function will give our the heuristic from the node to goal. :params node: (String) current node / any node :return: (int) heuristic to the goal """ return self.herist[node] if __name__ == '__main__': graph = graph() graph.edges = {'A': set(['B', 'C', 'D']), 'B': set(['E', 'F']), 'C': set(['G', 'H']), 'D': set(['I', 'J']), 'H': set(['K'])} graph.herist = {'A': 3, 'B': 4, 'C': 6, 'D': 5, 'E': 3, 'F': 2, 'G': 7, 'H': 8, 'I': 6, 'J': 7, 'K': 9} print(graph.get_h('A'))
# # PySNMP MIB module RADLAN-DHCP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/RADLAN-DHCP-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:01:12 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion, ValueRangeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion", "ValueRangeConstraint", "SingleValueConstraint") rnd, = mibBuilder.importSymbols("RADLAN-MIB", "rnd") SnmpAdminString, = mibBuilder.importSymbols("SNMP-FRAMEWORK-MIB", "SnmpAdminString") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") IpAddress, Counter64, ObjectIdentity, Counter32, Gauge32, MibIdentifier, Unsigned32, ModuleIdentity, iso, TimeTicks, NotificationType, Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits = mibBuilder.importSymbols("SNMPv2-SMI", "IpAddress", "Counter64", "ObjectIdentity", "Counter32", "Gauge32", "MibIdentifier", "Unsigned32", "ModuleIdentity", "iso", "TimeTicks", "NotificationType", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits") DisplayString, RowStatus, TruthValue, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "RowStatus", "TruthValue", "TextualConvention") rsDHCP = ModuleIdentity((1, 3, 6, 1, 4, 1, 89, 38)) rsDHCP.setRevisions(('2003-10-18 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: rsDHCP.setRevisionsDescriptions(('Initial version of this MIB.',)) if mibBuilder.loadTexts: rsDHCP.setLastUpdated('200310180000Z') if mibBuilder.loadTexts: rsDHCP.setOrganization('') if mibBuilder.loadTexts: rsDHCP.setContactInfo('') if mibBuilder.loadTexts: rsDHCP.setDescription('The private MIB module definition for DHCP server support.') rsDhcpMibVersion = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 14), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rsDhcpMibVersion.setStatus('current') if mibBuilder.loadTexts: rsDhcpMibVersion.setDescription("DHCP MIB's version, the current version is 4.") rlDhcpRelayEnable = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 25), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpRelayEnable.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayEnable.setDescription('Enable or disable the use of the DHCP relay.') rlDhcpRelayExists = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 26), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlDhcpRelayExists.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayExists.setDescription('This variable shows whether the device can function as a DHCP Relay Agent.') rlDhcpRelayNextServerTable = MibTable((1, 3, 6, 1, 4, 1, 89, 38, 27), ) if mibBuilder.loadTexts: rlDhcpRelayNextServerTable.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerTable.setDescription('The DHCP Relay Next Servers configuration Table') rlDhcpRelayNextServerEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 38, 27, 1), ).setIndexNames((0, "RADLAN-DHCP-MIB", "rlDhcpRelayNextServerIpAddr")) if mibBuilder.loadTexts: rlDhcpRelayNextServerEntry.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerEntry.setDescription('The row definition for this table. DHCP requests are relayed to the specified next server according to their threshold values.') rlDhcpRelayNextServerIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 27, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlDhcpRelayNextServerIpAddr.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerIpAddr.setDescription('The IPAddress of the next configuration server. DHCP Server may act as a DHCP relay if this parameter is not equal to 0.0.0.0.') rlDhcpRelayNextServerSecThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 27, 1, 2), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpRelayNextServerSecThreshold.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerSecThreshold.setDescription('DHCP requests are relayed only if their SEC field is greater or equal to the threshold value in order to allow local DHCP Servers to answer first.') rlDhcpRelayNextServerRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 27, 1, 3), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpRelayNextServerRowStatus.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerRowStatus.setDescription("This variable displays the validity or invalidity of the entry. Setting it to 'destroy' has the effect of rendering it inoperative. The internal effect (row removal) is implementation dependent.") rlDhcpSrvEnable = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 30), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvEnable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvEnable.setDescription('Enable or Disable the use of the DHCP Server.') rlDhcpSrvExists = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 31), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlDhcpSrvExists.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvExists.setDescription('This variable shows whether the device can function as a DHCP Server.') rlDhcpSrvDbLocation = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 32), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("nvram", 1), ("flash", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: rlDhcpSrvDbLocation.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDbLocation.setDescription('Describes where DHCP Server database is stored.') rlDhcpSrvMaxNumOfClients = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 33), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlDhcpSrvMaxNumOfClients.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvMaxNumOfClients.setDescription('This variable shows maximum number of clients that can be supported by DHCP Server dynamic allocation.') rlDhcpSrvDbNumOfActiveEntries = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 34), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlDhcpSrvDbNumOfActiveEntries.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDbNumOfActiveEntries.setDescription('This variable shows number of active entries stored in database.') rlDhcpSrvDbErase = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 35), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvDbErase.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDbErase.setDescription('The value is always false. Setting this variable to true causes erasing all entries in DHCP database.') rlDhcpSrvProbeEnable = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 36), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvProbeEnable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvProbeEnable.setDescription('Enable or Disable the use of the DHCP probe before allocating an IP address.') rlDhcpSrvProbeTimeout = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 37), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(300, 10000))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvProbeTimeout.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvProbeTimeout.setDescription('Indicates the peiod of time in milliseconds the DHCP probe will wait before issuing a new trial or deciding that no other device on the network has the IP address which DHCP considers allocating.') rlDhcpSrvProbeRetries = MibScalar((1, 3, 6, 1, 4, 1, 89, 38, 38), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 10))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvProbeRetries.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvProbeRetries.setDescription('Indicates how many times DHCP will probe before deciding that no other device on the network has the IP address which DHCP considers allocating.') rlDhcpSrvIpAddrTable = MibTable((1, 3, 6, 1, 4, 1, 89, 38, 45), ) if mibBuilder.loadTexts: rlDhcpSrvIpAddrTable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrTable.setDescription('Table of IP Addresses allocated by DHCP Server by static and dynamic allocations.') rlDhcpSrvIpAddrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 38, 45, 1), ).setIndexNames((0, "RADLAN-DHCP-MIB", "rlDhcpSrvIpAddrIpAddr")) if mibBuilder.loadTexts: rlDhcpSrvIpAddrEntry.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrEntry.setDescription('The row definition for this table. Parameters of DHCP allocated IP Addresses table.') rlDhcpSrvIpAddrIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 1), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvIpAddrIpAddr.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIpAddr.setDescription('The IP address that was allocated by DHCP Server.') rlDhcpSrvIpAddrIpNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvIpAddrIpNetMask.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIpNetMask.setDescription('The subnet mask associated with the IP address of this entry. The value of the mask is an IP address with all the network bits set to 1 and all the hosts bits set to 0.') rlDhcpSrvIpAddrIdentifier = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvIpAddrIdentifier.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIdentifier.setDescription('Unique Identifier for client. Either physical address or DHCP Client Identifier.') rlDhcpSrvIpAddrIdentifierType = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 4), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("physAddr", 1), ("clientId", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvIpAddrIdentifierType.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIdentifierType.setDescription('Identifier Type. Either physical address or DHCP Client Identifier.') rlDhcpSrvIpAddrClnHostName = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 5), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvIpAddrClnHostName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrClnHostName.setDescription('Client Host Name. DHCP Server will use it to update DNS Server. Must be unique per client.') rlDhcpSrvIpAddrMechanism = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("manual", 1), ("automatic", 2), ("dynamic", 3)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvIpAddrMechanism.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrMechanism.setDescription('Mechanism of allocation IP Address by DHCP Server. The only value that can be set by user is manual.') rlDhcpSrvIpAddrAgeTime = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlDhcpSrvIpAddrAgeTime.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrAgeTime.setDescription('Age time of the IP Address.') rlDhcpSrvIpAddrPoolName = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 8), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvIpAddrPoolName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrPoolName.setDescription('Ip address pool name. A unique name for host pool static allocation, or network pool name in case of dynamic allocation.') rlDhcpSrvIpAddrConfParamsName = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvIpAddrConfParamsName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrConfParamsName.setDescription('This variable points (serves as key) to appropriate set of parameters in the DHCP Server configuration parameters table.') rlDhcpSrvIpAddrRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 10), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvIpAddrRowStatus.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrRowStatus.setDescription('The row status variable, used according to row installation and removal conventions.') rlDhcpSrvDynamicTable = MibTable((1, 3, 6, 1, 4, 1, 89, 38, 46), ) if mibBuilder.loadTexts: rlDhcpSrvDynamicTable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicTable.setDescription("The DHCP Dynamic Server's configuration Table") rlDhcpSrvDynamicEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 38, 46, 1), ).setIndexNames((0, "RADLAN-DHCP-MIB", "rlDhcpSrvDynamicPoolName")) if mibBuilder.loadTexts: rlDhcpSrvDynamicEntry.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicEntry.setDescription('The row definition for this table. Parameters sent in as a DHCP Reply to DHCP Request with specified indices') rlDhcpSrvDynamicPoolName = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvDynamicPoolName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicPoolName.setDescription('The name of DHCP dynamic addresses pool.') rlDhcpSrvDynamicIpAddrFrom = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvDynamicIpAddrFrom.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicIpAddrFrom.setDescription('The first IP address allocated in this row.') rlDhcpSrvDynamicIpAddrTo = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 3), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvDynamicIpAddrTo.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicIpAddrTo.setDescription('The last IP address allocated in this row.') rlDhcpSrvDynamicIpNetMask = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 4), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvDynamicIpNetMask.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicIpNetMask.setDescription('The subnet mask associated with the IP addresses of this entry. The value of the mask is an IP address with all the network bits set to 1 and all the hosts bits set to 0.') rlDhcpSrvDynamicLeaseTime = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 5), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvDynamicLeaseTime.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicLeaseTime.setDescription('Maximum lease-time in seconds granted to a requesting DHCP client. For automatic allocation use 0xFFFFFFFF. To exclude addresses from allocation mechanism, set this value to 0.') rlDhcpSrvDynamicProbeEnable = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 6), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvDynamicProbeEnable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicProbeEnable.setDescription('Enable or Disable the use of the DHCP probe before allocating the address.') rlDhcpSrvDynamicTotalNumOfAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 7), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlDhcpSrvDynamicTotalNumOfAddr.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicTotalNumOfAddr.setDescription('Total number of addresses in space.') rlDhcpSrvDynamicFreeNumOfAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 8), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: rlDhcpSrvDynamicFreeNumOfAddr.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicFreeNumOfAddr.setDescription('Free number of addresses in space.') rlDhcpSrvDynamicConfParamsName = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 9), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvDynamicConfParamsName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicConfParamsName.setDescription('This variable points (serves as key) to appropriate set of parameters in the DHCP Server configuration parameters table.') rlDhcpSrvDynamicRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 10), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvDynamicRowStatus.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicRowStatus.setDescription('The row status variable, used according to row installation and removal conventions.') rlDhcpSrvConfParamsTable = MibTable((1, 3, 6, 1, 4, 1, 89, 38, 47), ) if mibBuilder.loadTexts: rlDhcpSrvConfParamsTable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsTable.setDescription('The DHCP Configuration Parameters Table') rlDhcpSrvConfParamsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 89, 38, 47, 1), ).setIndexNames((0, "RADLAN-DHCP-MIB", "rlDhcpSrvConfParamsName")) if mibBuilder.loadTexts: rlDhcpSrvConfParamsEntry.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsEntry.setDescription('The row definition for this table. Each entry corresponds to one specific parameters set.') rlDhcpSrvConfParamsName = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsName.setDescription('This value is a unique index for the entry in the rlDhcpSrvConfParamsTable.') rlDhcpSrvConfParamsNextServerIp = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 2), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsNextServerIp.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNextServerIp.setDescription('The IP of next server for client to use in configuration process.') rlDhcpSrvConfParamsNextServerName = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 3), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 64))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsNextServerName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNextServerName.setDescription('The mame of next server for client to use in configuration process.') rlDhcpSrvConfParamsBootfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 4), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsBootfileName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsBootfileName.setDescription('Name of file for client to request from next server.') rlDhcpSrvConfParamsRoutersList = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 5), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsRoutersList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsRoutersList.setDescription("The value of option code 3, which defines default routers list. Each IP address is represented in dotted decimal notation format with ';' between them.") rlDhcpSrvConfParamsTimeSrvList = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 6), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsTimeSrvList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsTimeSrvList.setDescription("The value of option code 4, which defines time servers list. Each IP address is represented in dotted decimal notation format with ';' between them.") rlDhcpSrvConfParamsDnsList = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 7), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsDnsList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsDnsList.setDescription("The value of option code 6, which defines the list of DNSs. Each IP address is represented in dotted decimal notation format with ';' between them.") rlDhcpSrvConfParamsDomainName = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 8), SnmpAdminString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsDomainName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsDomainName.setDescription('The value option code 15, which defines the domain name..') rlDhcpSrvConfParamsNetbiosNameList = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 9), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsNetbiosNameList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNetbiosNameList.setDescription("The value option code 44, which defines the list of NETBios Name Servers. Each IP address is represented in dotted decimal notation format with ';' between them.") rlDhcpSrvConfParamsNetbiosNodeType = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 10), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 4, 8))).clone(namedValues=NamedValues(("b-node", 1), ("p-node", 2), ("m-node", 4), ("h-node", 8)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsNetbiosNodeType.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNetbiosNodeType.setDescription('The value option code 46, which defines the NETBios node type. The option will be added only if rlDhcpSrvConfParamsNetbiosNameList is not empty.') rlDhcpSrvConfParamsCommunity = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 11), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsCommunity.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsCommunity.setDescription('The value of site-specific option 128, which defines Community. The option will be added only if rlDhcpSrvConfParamsNmsIp is set.') rlDhcpSrvConfParamsNmsIp = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 12), IpAddress()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsNmsIp.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNmsIp.setDescription('The value of site-specific option 129, which defines IP of Network Manager.') rlDhcpSrvConfParamsOptionsList = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 13), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsOptionsList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsOptionsList.setDescription("The sequence of option segments. Each option segment is represented by a triplet <code/length/value>. The code defines the code of each supported option. The length defines the length of each supported option. The value defines the value of the supported option. If there is a number of elements in the value field, they are divided by ','. Each element of type IP address in value field is represented in dotted decimal notation format.") rlDhcpSrvConfParamsRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 14), RowStatus()).setMaxAccess("readwrite") if mibBuilder.loadTexts: rlDhcpSrvConfParamsRowStatus.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsRowStatus.setDescription('The row status variable, used according to row installation and removal conventions.') mibBuilder.exportSymbols("RADLAN-DHCP-MIB", rlDhcpSrvDynamicRowStatus=rlDhcpSrvDynamicRowStatus, rlDhcpRelayEnable=rlDhcpRelayEnable, rlDhcpSrvConfParamsNetbiosNameList=rlDhcpSrvConfParamsNetbiosNameList, rlDhcpSrvDbErase=rlDhcpSrvDbErase, rlDhcpSrvConfParamsOptionsList=rlDhcpSrvConfParamsOptionsList, rlDhcpSrvIpAddrIdentifier=rlDhcpSrvIpAddrIdentifier, rlDhcpSrvConfParamsRoutersList=rlDhcpSrvConfParamsRoutersList, rlDhcpSrvDynamicLeaseTime=rlDhcpSrvDynamicLeaseTime, rlDhcpSrvDynamicTotalNumOfAddr=rlDhcpSrvDynamicTotalNumOfAddr, rlDhcpSrvDynamicIpAddrTo=rlDhcpSrvDynamicIpAddrTo, rlDhcpSrvIpAddrPoolName=rlDhcpSrvIpAddrPoolName, rlDhcpSrvConfParamsDomainName=rlDhcpSrvConfParamsDomainName, rlDhcpSrvIpAddrAgeTime=rlDhcpSrvIpAddrAgeTime, rlDhcpRelayNextServerSecThreshold=rlDhcpRelayNextServerSecThreshold, rlDhcpSrvConfParamsNextServerName=rlDhcpSrvConfParamsNextServerName, rlDhcpSrvDynamicConfParamsName=rlDhcpSrvDynamicConfParamsName, rlDhcpSrvConfParamsBootfileName=rlDhcpSrvConfParamsBootfileName, rlDhcpSrvDbLocation=rlDhcpSrvDbLocation, rlDhcpRelayNextServerTable=rlDhcpRelayNextServerTable, rlDhcpSrvIpAddrEntry=rlDhcpSrvIpAddrEntry, rlDhcpSrvIpAddrIpNetMask=rlDhcpSrvIpAddrIpNetMask, rlDhcpSrvIpAddrIdentifierType=rlDhcpSrvIpAddrIdentifierType, rlDhcpSrvConfParamsCommunity=rlDhcpSrvConfParamsCommunity, rlDhcpSrvDynamicEntry=rlDhcpSrvDynamicEntry, PYSNMP_MODULE_ID=rsDHCP, rsDHCP=rsDHCP, rlDhcpSrvIpAddrRowStatus=rlDhcpSrvIpAddrRowStatus, rlDhcpSrvConfParamsTimeSrvList=rlDhcpSrvConfParamsTimeSrvList, rlDhcpSrvConfParamsName=rlDhcpSrvConfParamsName, rlDhcpSrvConfParamsNextServerIp=rlDhcpSrvConfParamsNextServerIp, rlDhcpSrvMaxNumOfClients=rlDhcpSrvMaxNumOfClients, rlDhcpSrvEnable=rlDhcpSrvEnable, rsDhcpMibVersion=rsDhcpMibVersion, rlDhcpSrvConfParamsEntry=rlDhcpSrvConfParamsEntry, rlDhcpSrvDynamicFreeNumOfAddr=rlDhcpSrvDynamicFreeNumOfAddr, rlDhcpRelayNextServerEntry=rlDhcpRelayNextServerEntry, rlDhcpSrvIpAddrMechanism=rlDhcpSrvIpAddrMechanism, rlDhcpRelayNextServerIpAddr=rlDhcpRelayNextServerIpAddr, rlDhcpRelayNextServerRowStatus=rlDhcpRelayNextServerRowStatus, rlDhcpSrvDynamicIpAddrFrom=rlDhcpSrvDynamicIpAddrFrom, rlDhcpSrvProbeRetries=rlDhcpSrvProbeRetries, rlDhcpSrvDynamicPoolName=rlDhcpSrvDynamicPoolName, rlDhcpSrvDbNumOfActiveEntries=rlDhcpSrvDbNumOfActiveEntries, rlDhcpSrvIpAddrClnHostName=rlDhcpSrvIpAddrClnHostName, rlDhcpSrvDynamicTable=rlDhcpSrvDynamicTable, rlDhcpSrvConfParamsTable=rlDhcpSrvConfParamsTable, rlDhcpSrvDynamicProbeEnable=rlDhcpSrvDynamicProbeEnable, rlDhcpSrvProbeTimeout=rlDhcpSrvProbeTimeout, rlDhcpSrvDynamicIpNetMask=rlDhcpSrvDynamicIpNetMask, rlDhcpSrvConfParamsNetbiosNodeType=rlDhcpSrvConfParamsNetbiosNodeType, rlDhcpSrvIpAddrIpAddr=rlDhcpSrvIpAddrIpAddr, rlDhcpRelayExists=rlDhcpRelayExists, rlDhcpSrvExists=rlDhcpSrvExists, rlDhcpSrvIpAddrTable=rlDhcpSrvIpAddrTable, rlDhcpSrvConfParamsRowStatus=rlDhcpSrvConfParamsRowStatus, rlDhcpSrvConfParamsNmsIp=rlDhcpSrvConfParamsNmsIp, rlDhcpSrvIpAddrConfParamsName=rlDhcpSrvIpAddrConfParamsName, rlDhcpSrvConfParamsDnsList=rlDhcpSrvConfParamsDnsList, rlDhcpSrvProbeEnable=rlDhcpSrvProbeEnable)
(octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_intersection, constraints_union, value_range_constraint, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsIntersection', 'ConstraintsUnion', 'ValueRangeConstraint', 'SingleValueConstraint') (rnd,) = mibBuilder.importSymbols('RADLAN-MIB', 'rnd') (snmp_admin_string,) = mibBuilder.importSymbols('SNMP-FRAMEWORK-MIB', 'SnmpAdminString') (notification_group, module_compliance) = mibBuilder.importSymbols('SNMPv2-CONF', 'NotificationGroup', 'ModuleCompliance') (ip_address, counter64, object_identity, counter32, gauge32, mib_identifier, unsigned32, module_identity, iso, time_ticks, notification_type, integer32, mib_scalar, mib_table, mib_table_row, mib_table_column, bits) = mibBuilder.importSymbols('SNMPv2-SMI', 'IpAddress', 'Counter64', 'ObjectIdentity', 'Counter32', 'Gauge32', 'MibIdentifier', 'Unsigned32', 'ModuleIdentity', 'iso', 'TimeTicks', 'NotificationType', 'Integer32', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits') (display_string, row_status, truth_value, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'RowStatus', 'TruthValue', 'TextualConvention') rs_dhcp = module_identity((1, 3, 6, 1, 4, 1, 89, 38)) rsDHCP.setRevisions(('2003-10-18 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: rsDHCP.setRevisionsDescriptions(('Initial version of this MIB.',)) if mibBuilder.loadTexts: rsDHCP.setLastUpdated('200310180000Z') if mibBuilder.loadTexts: rsDHCP.setOrganization('') if mibBuilder.loadTexts: rsDHCP.setContactInfo('') if mibBuilder.loadTexts: rsDHCP.setDescription('The private MIB module definition for DHCP server support.') rs_dhcp_mib_version = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 14), integer32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rsDhcpMibVersion.setStatus('current') if mibBuilder.loadTexts: rsDhcpMibVersion.setDescription("DHCP MIB's version, the current version is 4.") rl_dhcp_relay_enable = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 25), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpRelayEnable.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayEnable.setDescription('Enable or disable the use of the DHCP relay.') rl_dhcp_relay_exists = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 26), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlDhcpRelayExists.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayExists.setDescription('This variable shows whether the device can function as a DHCP Relay Agent.') rl_dhcp_relay_next_server_table = mib_table((1, 3, 6, 1, 4, 1, 89, 38, 27)) if mibBuilder.loadTexts: rlDhcpRelayNextServerTable.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerTable.setDescription('The DHCP Relay Next Servers configuration Table') rl_dhcp_relay_next_server_entry = mib_table_row((1, 3, 6, 1, 4, 1, 89, 38, 27, 1)).setIndexNames((0, 'RADLAN-DHCP-MIB', 'rlDhcpRelayNextServerIpAddr')) if mibBuilder.loadTexts: rlDhcpRelayNextServerEntry.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerEntry.setDescription('The row definition for this table. DHCP requests are relayed to the specified next server according to their threshold values.') rl_dhcp_relay_next_server_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 27, 1, 1), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlDhcpRelayNextServerIpAddr.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerIpAddr.setDescription('The IPAddress of the next configuration server. DHCP Server may act as a DHCP relay if this parameter is not equal to 0.0.0.0.') rl_dhcp_relay_next_server_sec_threshold = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 27, 1, 2), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpRelayNextServerSecThreshold.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerSecThreshold.setDescription('DHCP requests are relayed only if their SEC field is greater or equal to the threshold value in order to allow local DHCP Servers to answer first.') rl_dhcp_relay_next_server_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 27, 1, 3), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpRelayNextServerRowStatus.setStatus('current') if mibBuilder.loadTexts: rlDhcpRelayNextServerRowStatus.setDescription("This variable displays the validity or invalidity of the entry. Setting it to 'destroy' has the effect of rendering it inoperative. The internal effect (row removal) is implementation dependent.") rl_dhcp_srv_enable = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 30), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvEnable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvEnable.setDescription('Enable or Disable the use of the DHCP Server.') rl_dhcp_srv_exists = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 31), truth_value()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlDhcpSrvExists.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvExists.setDescription('This variable shows whether the device can function as a DHCP Server.') rl_dhcp_srv_db_location = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 32), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('nvram', 1), ('flash', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: rlDhcpSrvDbLocation.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDbLocation.setDescription('Describes where DHCP Server database is stored.') rl_dhcp_srv_max_num_of_clients = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 33), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlDhcpSrvMaxNumOfClients.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvMaxNumOfClients.setDescription('This variable shows maximum number of clients that can be supported by DHCP Server dynamic allocation.') rl_dhcp_srv_db_num_of_active_entries = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 34), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlDhcpSrvDbNumOfActiveEntries.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDbNumOfActiveEntries.setDescription('This variable shows number of active entries stored in database.') rl_dhcp_srv_db_erase = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 35), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvDbErase.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDbErase.setDescription('The value is always false. Setting this variable to true causes erasing all entries in DHCP database.') rl_dhcp_srv_probe_enable = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 36), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvProbeEnable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvProbeEnable.setDescription('Enable or Disable the use of the DHCP probe before allocating an IP address.') rl_dhcp_srv_probe_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 37), unsigned32().subtype(subtypeSpec=value_range_constraint(300, 10000))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvProbeTimeout.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvProbeTimeout.setDescription('Indicates the peiod of time in milliseconds the DHCP probe will wait before issuing a new trial or deciding that no other device on the network has the IP address which DHCP considers allocating.') rl_dhcp_srv_probe_retries = mib_scalar((1, 3, 6, 1, 4, 1, 89, 38, 38), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 10))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvProbeRetries.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvProbeRetries.setDescription('Indicates how many times DHCP will probe before deciding that no other device on the network has the IP address which DHCP considers allocating.') rl_dhcp_srv_ip_addr_table = mib_table((1, 3, 6, 1, 4, 1, 89, 38, 45)) if mibBuilder.loadTexts: rlDhcpSrvIpAddrTable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrTable.setDescription('Table of IP Addresses allocated by DHCP Server by static and dynamic allocations.') rl_dhcp_srv_ip_addr_entry = mib_table_row((1, 3, 6, 1, 4, 1, 89, 38, 45, 1)).setIndexNames((0, 'RADLAN-DHCP-MIB', 'rlDhcpSrvIpAddrIpAddr')) if mibBuilder.loadTexts: rlDhcpSrvIpAddrEntry.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrEntry.setDescription('The row definition for this table. Parameters of DHCP allocated IP Addresses table.') rl_dhcp_srv_ip_addr_ip_addr = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 1), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIpAddr.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIpAddr.setDescription('The IP address that was allocated by DHCP Server.') rl_dhcp_srv_ip_addr_ip_net_mask = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIpNetMask.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIpNetMask.setDescription('The subnet mask associated with the IP address of this entry. The value of the mask is an IP address with all the network bits set to 1 and all the hosts bits set to 0.') rl_dhcp_srv_ip_addr_identifier = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIdentifier.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIdentifier.setDescription('Unique Identifier for client. Either physical address or DHCP Client Identifier.') rl_dhcp_srv_ip_addr_identifier_type = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 4), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('physAddr', 1), ('clientId', 2)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIdentifierType.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrIdentifierType.setDescription('Identifier Type. Either physical address or DHCP Client Identifier.') rl_dhcp_srv_ip_addr_cln_host_name = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 5), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvIpAddrClnHostName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrClnHostName.setDescription('Client Host Name. DHCP Server will use it to update DNS Server. Must be unique per client.') rl_dhcp_srv_ip_addr_mechanism = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 6), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('manual', 1), ('automatic', 2), ('dynamic', 3)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvIpAddrMechanism.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrMechanism.setDescription('Mechanism of allocation IP Address by DHCP Server. The only value that can be set by user is manual.') rl_dhcp_srv_ip_addr_age_time = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 7), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlDhcpSrvIpAddrAgeTime.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrAgeTime.setDescription('Age time of the IP Address.') rl_dhcp_srv_ip_addr_pool_name = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 8), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvIpAddrPoolName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrPoolName.setDescription('Ip address pool name. A unique name for host pool static allocation, or network pool name in case of dynamic allocation.') rl_dhcp_srv_ip_addr_conf_params_name = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 9), display_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvIpAddrConfParamsName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrConfParamsName.setDescription('This variable points (serves as key) to appropriate set of parameters in the DHCP Server configuration parameters table.') rl_dhcp_srv_ip_addr_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 45, 1, 10), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvIpAddrRowStatus.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvIpAddrRowStatus.setDescription('The row status variable, used according to row installation and removal conventions.') rl_dhcp_srv_dynamic_table = mib_table((1, 3, 6, 1, 4, 1, 89, 38, 46)) if mibBuilder.loadTexts: rlDhcpSrvDynamicTable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicTable.setDescription("The DHCP Dynamic Server's configuration Table") rl_dhcp_srv_dynamic_entry = mib_table_row((1, 3, 6, 1, 4, 1, 89, 38, 46, 1)).setIndexNames((0, 'RADLAN-DHCP-MIB', 'rlDhcpSrvDynamicPoolName')) if mibBuilder.loadTexts: rlDhcpSrvDynamicEntry.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicEntry.setDescription('The row definition for this table. Parameters sent in as a DHCP Reply to DHCP Request with specified indices') rl_dhcp_srv_dynamic_pool_name = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvDynamicPoolName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicPoolName.setDescription('The name of DHCP dynamic addresses pool.') rl_dhcp_srv_dynamic_ip_addr_from = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvDynamicIpAddrFrom.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicIpAddrFrom.setDescription('The first IP address allocated in this row.') rl_dhcp_srv_dynamic_ip_addr_to = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 3), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvDynamicIpAddrTo.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicIpAddrTo.setDescription('The last IP address allocated in this row.') rl_dhcp_srv_dynamic_ip_net_mask = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 4), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvDynamicIpNetMask.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicIpNetMask.setDescription('The subnet mask associated with the IP addresses of this entry. The value of the mask is an IP address with all the network bits set to 1 and all the hosts bits set to 0.') rl_dhcp_srv_dynamic_lease_time = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 5), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvDynamicLeaseTime.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicLeaseTime.setDescription('Maximum lease-time in seconds granted to a requesting DHCP client. For automatic allocation use 0xFFFFFFFF. To exclude addresses from allocation mechanism, set this value to 0.') rl_dhcp_srv_dynamic_probe_enable = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 6), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvDynamicProbeEnable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicProbeEnable.setDescription('Enable or Disable the use of the DHCP probe before allocating the address.') rl_dhcp_srv_dynamic_total_num_of_addr = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 7), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlDhcpSrvDynamicTotalNumOfAddr.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicTotalNumOfAddr.setDescription('Total number of addresses in space.') rl_dhcp_srv_dynamic_free_num_of_addr = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 8), unsigned32()).setMaxAccess('readonly') if mibBuilder.loadTexts: rlDhcpSrvDynamicFreeNumOfAddr.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicFreeNumOfAddr.setDescription('Free number of addresses in space.') rl_dhcp_srv_dynamic_conf_params_name = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 9), display_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvDynamicConfParamsName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicConfParamsName.setDescription('This variable points (serves as key) to appropriate set of parameters in the DHCP Server configuration parameters table.') rl_dhcp_srv_dynamic_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 46, 1, 10), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvDynamicRowStatus.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvDynamicRowStatus.setDescription('The row status variable, used according to row installation and removal conventions.') rl_dhcp_srv_conf_params_table = mib_table((1, 3, 6, 1, 4, 1, 89, 38, 47)) if mibBuilder.loadTexts: rlDhcpSrvConfParamsTable.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsTable.setDescription('The DHCP Configuration Parameters Table') rl_dhcp_srv_conf_params_entry = mib_table_row((1, 3, 6, 1, 4, 1, 89, 38, 47, 1)).setIndexNames((0, 'RADLAN-DHCP-MIB', 'rlDhcpSrvConfParamsName')) if mibBuilder.loadTexts: rlDhcpSrvConfParamsEntry.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsEntry.setDescription('The row definition for this table. Each entry corresponds to one specific parameters set.') rl_dhcp_srv_conf_params_name = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsName.setDescription('This value is a unique index for the entry in the rlDhcpSrvConfParamsTable.') rl_dhcp_srv_conf_params_next_server_ip = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 2), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNextServerIp.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNextServerIp.setDescription('The IP of next server for client to use in configuration process.') rl_dhcp_srv_conf_params_next_server_name = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 3), display_string().subtype(subtypeSpec=value_size_constraint(0, 64))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNextServerName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNextServerName.setDescription('The mame of next server for client to use in configuration process.') rl_dhcp_srv_conf_params_bootfile_name = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 4), display_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsBootfileName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsBootfileName.setDescription('Name of file for client to request from next server.') rl_dhcp_srv_conf_params_routers_list = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 5), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsRoutersList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsRoutersList.setDescription("The value of option code 3, which defines default routers list. Each IP address is represented in dotted decimal notation format with ';' between them.") rl_dhcp_srv_conf_params_time_srv_list = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 6), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsTimeSrvList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsTimeSrvList.setDescription("The value of option code 4, which defines time servers list. Each IP address is represented in dotted decimal notation format with ';' between them.") rl_dhcp_srv_conf_params_dns_list = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 7), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsDnsList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsDnsList.setDescription("The value of option code 6, which defines the list of DNSs. Each IP address is represented in dotted decimal notation format with ';' between them.") rl_dhcp_srv_conf_params_domain_name = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 8), snmp_admin_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsDomainName.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsDomainName.setDescription('The value option code 15, which defines the domain name..') rl_dhcp_srv_conf_params_netbios_name_list = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 9), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNetbiosNameList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNetbiosNameList.setDescription("The value option code 44, which defines the list of NETBios Name Servers. Each IP address is represented in dotted decimal notation format with ';' between them.") rl_dhcp_srv_conf_params_netbios_node_type = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 10), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 4, 8))).clone(namedValues=named_values(('b-node', 1), ('p-node', 2), ('m-node', 4), ('h-node', 8)))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNetbiosNodeType.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNetbiosNodeType.setDescription('The value option code 46, which defines the NETBios node type. The option will be added only if rlDhcpSrvConfParamsNetbiosNameList is not empty.') rl_dhcp_srv_conf_params_community = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 11), display_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsCommunity.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsCommunity.setDescription('The value of site-specific option 128, which defines Community. The option will be added only if rlDhcpSrvConfParamsNmsIp is set.') rl_dhcp_srv_conf_params_nms_ip = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 12), ip_address()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNmsIp.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsNmsIp.setDescription('The value of site-specific option 129, which defines IP of Network Manager.') rl_dhcp_srv_conf_params_options_list = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 13), display_string()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsOptionsList.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsOptionsList.setDescription("The sequence of option segments. Each option segment is represented by a triplet <code/length/value>. The code defines the code of each supported option. The length defines the length of each supported option. The value defines the value of the supported option. If there is a number of elements in the value field, they are divided by ','. Each element of type IP address in value field is represented in dotted decimal notation format.") rl_dhcp_srv_conf_params_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 89, 38, 47, 1, 14), row_status()).setMaxAccess('readwrite') if mibBuilder.loadTexts: rlDhcpSrvConfParamsRowStatus.setStatus('current') if mibBuilder.loadTexts: rlDhcpSrvConfParamsRowStatus.setDescription('The row status variable, used according to row installation and removal conventions.') mibBuilder.exportSymbols('RADLAN-DHCP-MIB', rlDhcpSrvDynamicRowStatus=rlDhcpSrvDynamicRowStatus, rlDhcpRelayEnable=rlDhcpRelayEnable, rlDhcpSrvConfParamsNetbiosNameList=rlDhcpSrvConfParamsNetbiosNameList, rlDhcpSrvDbErase=rlDhcpSrvDbErase, rlDhcpSrvConfParamsOptionsList=rlDhcpSrvConfParamsOptionsList, rlDhcpSrvIpAddrIdentifier=rlDhcpSrvIpAddrIdentifier, rlDhcpSrvConfParamsRoutersList=rlDhcpSrvConfParamsRoutersList, rlDhcpSrvDynamicLeaseTime=rlDhcpSrvDynamicLeaseTime, rlDhcpSrvDynamicTotalNumOfAddr=rlDhcpSrvDynamicTotalNumOfAddr, rlDhcpSrvDynamicIpAddrTo=rlDhcpSrvDynamicIpAddrTo, rlDhcpSrvIpAddrPoolName=rlDhcpSrvIpAddrPoolName, rlDhcpSrvConfParamsDomainName=rlDhcpSrvConfParamsDomainName, rlDhcpSrvIpAddrAgeTime=rlDhcpSrvIpAddrAgeTime, rlDhcpRelayNextServerSecThreshold=rlDhcpRelayNextServerSecThreshold, rlDhcpSrvConfParamsNextServerName=rlDhcpSrvConfParamsNextServerName, rlDhcpSrvDynamicConfParamsName=rlDhcpSrvDynamicConfParamsName, rlDhcpSrvConfParamsBootfileName=rlDhcpSrvConfParamsBootfileName, rlDhcpSrvDbLocation=rlDhcpSrvDbLocation, rlDhcpRelayNextServerTable=rlDhcpRelayNextServerTable, rlDhcpSrvIpAddrEntry=rlDhcpSrvIpAddrEntry, rlDhcpSrvIpAddrIpNetMask=rlDhcpSrvIpAddrIpNetMask, rlDhcpSrvIpAddrIdentifierType=rlDhcpSrvIpAddrIdentifierType, rlDhcpSrvConfParamsCommunity=rlDhcpSrvConfParamsCommunity, rlDhcpSrvDynamicEntry=rlDhcpSrvDynamicEntry, PYSNMP_MODULE_ID=rsDHCP, rsDHCP=rsDHCP, rlDhcpSrvIpAddrRowStatus=rlDhcpSrvIpAddrRowStatus, rlDhcpSrvConfParamsTimeSrvList=rlDhcpSrvConfParamsTimeSrvList, rlDhcpSrvConfParamsName=rlDhcpSrvConfParamsName, rlDhcpSrvConfParamsNextServerIp=rlDhcpSrvConfParamsNextServerIp, rlDhcpSrvMaxNumOfClients=rlDhcpSrvMaxNumOfClients, rlDhcpSrvEnable=rlDhcpSrvEnable, rsDhcpMibVersion=rsDhcpMibVersion, rlDhcpSrvConfParamsEntry=rlDhcpSrvConfParamsEntry, rlDhcpSrvDynamicFreeNumOfAddr=rlDhcpSrvDynamicFreeNumOfAddr, rlDhcpRelayNextServerEntry=rlDhcpRelayNextServerEntry, rlDhcpSrvIpAddrMechanism=rlDhcpSrvIpAddrMechanism, rlDhcpRelayNextServerIpAddr=rlDhcpRelayNextServerIpAddr, rlDhcpRelayNextServerRowStatus=rlDhcpRelayNextServerRowStatus, rlDhcpSrvDynamicIpAddrFrom=rlDhcpSrvDynamicIpAddrFrom, rlDhcpSrvProbeRetries=rlDhcpSrvProbeRetries, rlDhcpSrvDynamicPoolName=rlDhcpSrvDynamicPoolName, rlDhcpSrvDbNumOfActiveEntries=rlDhcpSrvDbNumOfActiveEntries, rlDhcpSrvIpAddrClnHostName=rlDhcpSrvIpAddrClnHostName, rlDhcpSrvDynamicTable=rlDhcpSrvDynamicTable, rlDhcpSrvConfParamsTable=rlDhcpSrvConfParamsTable, rlDhcpSrvDynamicProbeEnable=rlDhcpSrvDynamicProbeEnable, rlDhcpSrvProbeTimeout=rlDhcpSrvProbeTimeout, rlDhcpSrvDynamicIpNetMask=rlDhcpSrvDynamicIpNetMask, rlDhcpSrvConfParamsNetbiosNodeType=rlDhcpSrvConfParamsNetbiosNodeType, rlDhcpSrvIpAddrIpAddr=rlDhcpSrvIpAddrIpAddr, rlDhcpRelayExists=rlDhcpRelayExists, rlDhcpSrvExists=rlDhcpSrvExists, rlDhcpSrvIpAddrTable=rlDhcpSrvIpAddrTable, rlDhcpSrvConfParamsRowStatus=rlDhcpSrvConfParamsRowStatus, rlDhcpSrvConfParamsNmsIp=rlDhcpSrvConfParamsNmsIp, rlDhcpSrvIpAddrConfParamsName=rlDhcpSrvIpAddrConfParamsName, rlDhcpSrvConfParamsDnsList=rlDhcpSrvConfParamsDnsList, rlDhcpSrvProbeEnable=rlDhcpSrvProbeEnable)
def lerp(a, b, amount): return (amount * a) + ((1 - amount) * b) def smoothstep(edge0, edge1, amount): x = clamp((amount - edge0) / (edge1 - edge0), 0.0, 1.0) return x * x * (3 - 2 * x) def smootherstep(edge0, edge1, amount): x = clamp((amount - edge0) / (edge1 - edge0), 0.0, 1.0) return x * x * x * (x * (x * 6 - 15) + 10) def smoothererstep(edge0, edge1, amount): x = clamp(amount, 0.0, 1.0) return x^5 def clamp(x, lower_limit, upper_limit): if (x < lower_limit): x = lower_limit if (x > upper_limit): x = upper_limit return x def manhattan_dist(x0, y0, x1, y1): return abs(x0 - x1) + abs(y0 - y1) def create_hit_box(width, height): w2 = width / 2 h2 = height / 2 return [ [-w2, -h2], [-w2, h2], [w2, h2], [w2, -h2] ]
def lerp(a, b, amount): return amount * a + (1 - amount) * b def smoothstep(edge0, edge1, amount): x = clamp((amount - edge0) / (edge1 - edge0), 0.0, 1.0) return x * x * (3 - 2 * x) def smootherstep(edge0, edge1, amount): x = clamp((amount - edge0) / (edge1 - edge0), 0.0, 1.0) return x * x * x * (x * (x * 6 - 15) + 10) def smoothererstep(edge0, edge1, amount): x = clamp(amount, 0.0, 1.0) return x ^ 5 def clamp(x, lower_limit, upper_limit): if x < lower_limit: x = lower_limit if x > upper_limit: x = upper_limit return x def manhattan_dist(x0, y0, x1, y1): return abs(x0 - x1) + abs(y0 - y1) def create_hit_box(width, height): w2 = width / 2 h2 = height / 2 return [[-w2, -h2], [-w2, h2], [w2, h2], [w2, -h2]]
# Time: O(n); Space: O(n) def next_greater_element(nums1, nums2): stack = [] d = {} i = len(nums2) - 1 while i >= 0: num = nums2[i] if not stack: d[num] = -1 stack.append(num) i -= 1 elif stack[-1] > num: d[num] = stack[-1] stack.append(num) i -= 1 else: stack.pop() ans = [] for num in nums1: ans.append(d[num]) return ans # Better implementation def next_greater_element2(nums1, nums2): d = {} stack = [] for i in range(len(nums2) - 1, -1, -1): num = nums2[i] while stack and stack[-1] <= num: stack.pop() if stack: d[num] = stack[-1] else: d[num] = -1 stack.append(num) return [d[num] for num in nums1] # Test cases: print(next_greater_element(nums1=[4, 1, 2], nums2=[1, 3, 4, 2])) print(next_greater_element(nums1=[2, 4], nums2=[1, 2, 3, 4]))
def next_greater_element(nums1, nums2): stack = [] d = {} i = len(nums2) - 1 while i >= 0: num = nums2[i] if not stack: d[num] = -1 stack.append(num) i -= 1 elif stack[-1] > num: d[num] = stack[-1] stack.append(num) i -= 1 else: stack.pop() ans = [] for num in nums1: ans.append(d[num]) return ans def next_greater_element2(nums1, nums2): d = {} stack = [] for i in range(len(nums2) - 1, -1, -1): num = nums2[i] while stack and stack[-1] <= num: stack.pop() if stack: d[num] = stack[-1] else: d[num] = -1 stack.append(num) return [d[num] for num in nums1] print(next_greater_element(nums1=[4, 1, 2], nums2=[1, 3, 4, 2])) print(next_greater_element(nums1=[2, 4], nums2=[1, 2, 3, 4]))
#!/usr/bin/python # -*- coding: utf-8 -*- DEFAULT_HOST = '127.0.01' DEFAULT_PORT = 3306 DEFAULT_USER_NAME = 'root' DEFAULT_USER_PASS = 'root123' DEFAULT_USER_LIST = 'accounts/user.list' DEFAULT_WORD_LIST = 'accounts/word.list' # text color in console
default_host = '127.0.01' default_port = 3306 default_user_name = 'root' default_user_pass = 'root123' default_user_list = 'accounts/user.list' default_word_list = 'accounts/word.list'
# mock resource classes from peeringdb-py client class Organization: pass class Facility: pass class Network: pass class InternetExchange: pass class InternetExchangeFacility: pass class InternetExchangeLan: pass class InternetExchangeLanPrefix: pass class NetworkFacility: pass class NetworkIXLan: pass class NetworkContact: pass
class Organization: pass class Facility: pass class Network: pass class Internetexchange: pass class Internetexchangefacility: pass class Internetexchangelan: pass class Internetexchangelanprefix: pass class Networkfacility: pass class Networkixlan: pass class Networkcontact: pass