content
stringlengths
7
1.05M
"""Escriba una función recursiva para calcular la secuencia de Fibonacci. ¿Cómo se compara el desempeño de la función recursiva con el de una versión iterativa? """ def fibonacci(numero): if (numero==0 or numero==1): return 1 else: return (fibonacci(numero-1)+fibonacci(numero-2))
class Residuals: def __init__(self, resnet_layer): resnet_layer.register_forward_hook(self.hook) def hook(self, module, input, output): self.features = output
''' (c) Copyright 2013 Telefonica, I+D. Printed in Spain (Europe). All Rights Reserved. The copyright to the software program(s) is property of Telefonica I+D. The program(s) may be used and or copied only with the express written consent of Telefonica I+D or in accordance with the terms and conditions stipulated in the agreement/contract under which the program(s) have been supplied. ''' class NotFoundException(Exception): """ Add details to represent error message for all exceptions. Subclasses will have details message and all parames needed for exception_mapper. """ def __init__(self, details=None): self._details = details def __str__(self): return repr(self._details)
# N, M, K를 공백으로 구분하여 입력받기 n, m, k = map(int, input().split()) # N개의 수를 공백으로 구분하여 입력받기 data = list(map(int,input().split())) data.sort() # 입력받은 수 정렬 first = data[n-1] # 가장 큰 수 second = data[n-2] # 두 번째로 큰 수 count = int(m/(k+1))*k count += m % (k+1) result = 0 result += (count) * first # 가장 큰 수 더하기 result += (m-count) * second # 두 번째로 큰 수 더하기 print(result)
class Enum: """Create an enumerated type, then add var/value pairs to it. The constructor and the method .ints(names) take a list of variable names, and assign them consecutive integers as values. The method .strs(names) assigns each variable name to itself (that is variable 'v' has value 'v'). The method .vals(a=99, b=200) allows you to assign any value to variables. A 'list of variable names' can also be a string, which will be .split(). The method .end() returns one more than the maximum int value. Example: opcodes = Enum("add sub load store").vals(illegal=255).""" def __init__(self, names=[]): self.ints(names) def set(self, var, val): """Set var to the value val in the enum.""" if var in vars(self).keys(): raise AttributeError("duplicate var in enum") if val in vars(self).values(): raise ValueError("duplicate value in enum") vars(self)[var] = val return self def strs(self, names): """Set each of the names to itself (as a string) in the enum.""" for var in self._parse(names): self.set(var, var) return self def ints(self, names): """Set each of the names to the next highest int in the enum.""" for var in self._parse(names): self.set(var, self.end()) return self def vals(self, **entries): """Set each of var=val pairs in the enum.""" for (var, val) in entries.items(): self.set(var, val) return self def end(self): """One more than the largest int value in the enum, or 0 if none.""" try: return max([x for x in vars(self).values() if type(x)==type(0)]) + 1 except ValueError: return 0 def _parse(self, names): ### If names is a string, parse it as a list of names. if type(names) == type(""): return names.split() else: return names
class Solution(object): def climbStairs(self, n): """ :type n: int :rtype: int """ prev = 1 curr = 1 for i in range(1, n): prev, curr = curr, prev + curr return curr
#!/usr/bin/env python # Copyright Singapore-MIT Alliance for Research and Technology class Road: def __init__(self, name): self.name = name self.sections = list()
#!/usr/bin/env python # encoding: utf-8 ''' @author: Jason Lee @license: (C) Copyright @ Jason Lee @contact: [email protected] @file: 238.py @time: 2019/5/16 23:33 @desc: ''' class Solution: def productExceptSelf(self, nums: List[int]) -> List[int]: if len(nums) <= 1: return 0 res = [1 for i in range(len(nums))] for i in range(1, len(nums)): res[i] = res[i] * nums[i - 1] temp = 1 for i in range(len(nums) - 2, -1, -1): temp = temp * nums[i + 1] res[i] = res[i] * temp return res
def func(): a = int(input("enter the 1st value")) b = int(input("enter the 2nd value")) c = int(input("enter the 3rd value")) if (a >= b) and (a >= c): print(f"{a} is greatest") elif (b >= a) and (b >= c): print(f"{b} is greatest") else: print(f"greatest value is {c}") func()
def factorial(x): if x == 1 or x == 0: return 1 else: return x * factorial(x-1) x = factorial(5) print("el factorial es:",x)
""" function best_sum(target_sum, numbers) takes target_sum and an array of positive or zero numbers as arguments. The function should return the minimum length combination of elements that add up to exactly the target_sum. Only one combination is returned. If no combination is found the return value is None. """ def best_sum_(target_sum, numbers): if target_sum == 0: return [] elif target_sum < 0: return None mx = [] for n in numbers: a = best_sum_(target_sum - n, numbers) if a is not None: comb = a + [n] if not mx or (len(comb) < len(mx)): mx = comb if mx: return mx else: return None def best_sum(target_sum, numbers): for n in numbers: if n < 0: raise RuntimeError('numbers can only be positive or zero.') return best_sum_(target_sum, [n for n in numbers if (n > 0)]) def best_sum_m_(target_sum, numbers, memo): if target_sum in memo: return memo[target_sum] elif target_sum == 0: return [] elif target_sum < 0: return None mx = [] for n in numbers: a = best_sum_m_(target_sum - n, numbers, memo) if a is not None: comb = a + [n] if not mx or (len(comb) < len(mx)): mx = comb memo[target_sum] = mx if mx: return mx else: return None def best_sum_m(target_sum, numbers): for n in numbers: if n < 0: raise RuntimeError('numbers can only be positive or zero.') return best_sum_m_(target_sum, [n for n in numbers if (n > 0)], {}) def best_sum_t(target_sum, numbers): for n in numbers: if n < 0: raise RuntimeError('numbers can only be positive or zero.') tab = {} for i in range(target_sum + 1): tab[i] = None tab[0] = [] for i in range(target_sum): if tab[i] is not None: for n in numbers: comb = tab[i] + [n] if (i + n) <= target_sum: if tab[i + n] is None or (len(comb) < len(tab[i + n])): tab[i + n] = comb return tab[target_sum]
# https://leetcode.com/problems/first-bad-version/ # @param version, an integer # @return an integer # def isBadVersion(version): class Solution: def firstBadVersion(self, n): """ :type n: int :rtype: int """ i = 1 j = n while i < j: k = (i+j)//2 if isBadVersion(k): j = k else: i = k+1 return i
######################### # 属性property ######################### class Money1(object): def __init__(self): self.__money = 0 def getMoney(self): print("Money1 get") return self.__money def setMoney(self, value): print("Money1 set") if isinstance(value, int): self.__money = value else: print("error:不是整型数字") money = property(getMoney, setMoney) class Money2(object): def __init__(self): self.__money = 0 @property def money(self): print("Money2 get") return self.__money @money.setter def money(self, value): print("Money2 set") if isinstance(value, int): self.__money = value else: print("error:不是整型数字") money1 = Money1() money1.money = 200 money2 = Money2() money2.money = 100
r = 300 K = 15000 files = ["H3_a.txt", "H3_c.txt"] def get_data_from_file(filename): with open("./data/" + filename) as file: return [int(x) for x in file.read().splitlines()] def load_data(): data = list(map(list, zip(get_data_from_file(files[0]), get_data_from_file(files[1])))) print(f'Data load successfully') # All data have parameters, if i should use them, or not, and first index print(f'Východiskové riešenie --> batoh so všetkými predmetmi.') for index, x in enumerate(data): data[index] += (True, index + 1) # sort for better search data.sort(key=lambda t: t[0]) return data def main(): data = load_data() sum_of_weights = sum(i for i, _, k, _ in data if k) sum_of_costs = sum(j for _, j, k, _ in data if k) number_of_items = len([k for _, _, k, _ in data if k]) print(f"HUF on start is: {sum_of_costs}\n" f"Number of items in knapsack is: {number_of_items}\n" f"Sum_of_weights in knapsack is: {sum_of_weights}") while sum_of_weights > K and number_of_items > r: min_weight = min((x for x in data if x[2]), key=lambda x: x[0]) min_weight_index = data.index(min_weight) # i have sorted data, that mean, i cant find nothing lower than this values if sum_of_weights - min_weight[0] < K: break data[min_weight_index][2] = False sum_of_weights -= data[min_weight_index][0] sum_of_costs -= data[min_weight_index][1] number_of_items -= 1 # print(f'HUF is {sum_of_costs}, removed: {min_weight[0]}/{min_weight[1]}') data.sort(key=lambda t: t[3]) check_solution(data, sum_of_weights, sum_of_costs, number_of_items) print(f'\nSOLUTION:\n' f'HUF is: {sum_of_costs}\n' f'Number of items in knapsack is: {number_of_items}\n' f'Sum of_weights in knapsack is: {sum_of_weights}\n' f'Sum of costs in knapsack is: {sum_of_costs}\n') # TODO write into file with open("solution.txt", "w") as outfile: outfile.writelines(list("%s\n" % item for item in data)) def check_solution(data, sum_of_weights, sum_of_costs, number_of_items): if sum(i for i, _, k, _ in data if k) != sum_of_weights: raise Exception("Check values for sum of weights in knapsack do not match!") if sum(j for _, j, k, _ in data if k) != sum_of_costs: raise Exception("Check values for sum of costs in knapsack do not match!") if len([k for _, _, k, _ in data if k]) != number_of_items: raise Exception("Check values for number of items in knapsack do not match!") if __name__ == "__main__": # execute only if run as a script main()
# # PySNMP MIB module HP-ICF-MVRP-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HP-ICF-MVRP-MIB # Produced by pysmi-0.3.4 at Wed May 1 13:34:47 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") SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion") hpSwitch, = mibBuilder.importSymbols("HP-ICF-OID", "hpSwitch") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") EnabledStatus, = mibBuilder.importSymbols("P-BRIDGE-MIB", "EnabledStatus") VlanId, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "VlanId") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, Unsigned32, NotificationType, Counter32, IpAddress, iso, Counter64, ObjectIdentity, Gauge32, MibIdentifier, ModuleIdentity, Bits, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Unsigned32", "NotificationType", "Counter32", "IpAddress", "iso", "Counter64", "ObjectIdentity", "Gauge32", "MibIdentifier", "ModuleIdentity", "Bits", "TimeTicks") TextualConvention, TruthValue, DisplayString, TimeInterval = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TruthValue", "DisplayString", "TimeInterval") hpicfMvrpMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117)) hpicfMvrpMIB.setRevisions(('2015-04-20 00:00', '2015-03-24 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: hpicfMvrpMIB.setRevisionsDescriptions(('Updated the default value and description.', 'Initial revision.',)) if mibBuilder.loadTexts: hpicfMvrpMIB.setLastUpdated('201504200000Z') if mibBuilder.loadTexts: hpicfMvrpMIB.setOrganization('HP Networking') if mibBuilder.loadTexts: hpicfMvrpMIB.setContactInfo('Hewlett-Packard Company 8000 Foothills Blvd. Roseville, CA 95747') if mibBuilder.loadTexts: hpicfMvrpMIB.setDescription('This MIB module describes objects to configure the MVRP feature.') hpicfMvrpNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 0)) hpicfMvrpObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1)) hpicfMvrpConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 3)) hpicfMvrpConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 1)) hpicfMvrpStats = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2)) hpicfMvrpGlobalClearStats = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 1, 1), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMvrpGlobalClearStats.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpGlobalClearStats.setDescription('Defines the global clear statistics control for MVRP. True(1) indicates that MVRP should clear all statistic counters related to all ports in the system. A write operation of False(0) leads to a no operation and a GET request for this object always returns FALSE.') hpicfMvrpMaxVlanLimit = MibScalar((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 1, 2), Integer32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMvrpMaxVlanLimit.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpMaxVlanLimit.setDescription('Defines the maximum number of dynamic VLANs that can be created on the system by MVRP. If the number of VLANs created by MVRP reaches this limit, the system will prevent MVRP from creating additional VLANs. A write operation for this object is not supported.') hpicfMvrpPortConfigTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 1, 3), ) if mibBuilder.loadTexts: hpicfMvrpPortConfigTable.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortConfigTable.setDescription('A table containing MVRP port configuration information.') hpicfMvrpPortConfigEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 1, 3, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hpicfMvrpPortConfigEntry.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortConfigEntry.setDescription('An MVRP port configuration entry.') hpicfMvrpPortConfigRegistrarMode = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 1, 3, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("normal", 1), ("fixed", 2))).clone('normal')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMvrpPortConfigRegistrarMode.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortConfigRegistrarMode.setDescription('Defines the mode of operation of all the registrar state machines associated to the port. normal - Registration as well as de-registration of VLANs are allowed. fixed - The Registrar ignores all MRP messages and remains in IN state(Registered). NOTE: Forbidden Registration Mode will be managed by ieee8021QBridgeVlanForbiddenEgressPorts.') hpicfMvrpPortConfigPeriodicTimer = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 1, 3, 1, 2), TimeInterval().subtype(subtypeSpec=ValueRangeConstraint(100, 1000000)).clone(100)).setUnits('centi-seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMvrpPortConfigPeriodicTimer.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortConfigPeriodicTimer.setDescription('Interval at which the Periodic transmission state machine of an MVRP instance generates transmission opportunities for the MVRP instance.') hpicfMvrpPortConfigPeriodicTransmissionStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 1, 3, 1, 3), EnabledStatus().clone('enabled')).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMvrpPortConfigPeriodicTransmissionStatus.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortConfigPeriodicTransmissionStatus.setDescription('Used to enable or disable the Periodic transmission state machine of an MVRP instance.') hpicfMvrpPortStatsClearStats = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 1, 3, 1, 4), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: hpicfMvrpPortStatsClearStats.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsClearStats.setDescription('Clear all statistics parameters corresponding to this port. True(1) indicates that MVRP will clear all statistic counters related to this port. A write operation of False(0) leads to a no operation and a GET request for this object always returns FALSE.') hpicfMvrpPortStatsTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1), ) if mibBuilder.loadTexts: hpicfMvrpPortStatsTable.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsTable.setDescription('A table containing MVRP port statistics information.') hpicfMvrpPortStatsEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hpicfMvrpPortStatsEntry.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsEntry.setDescription('An MVRP port statistics entry.') hpicfMvrpPortStatsNewReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsNewReceived.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsNewReceived.setDescription('The number of New messages received.') hpicfMvrpPortStatsJoinInReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsJoinInReceived.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsJoinInReceived.setDescription('The number of Join In messages received.') hpicfMvrpPortStatsJoinEmptyReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsJoinEmptyReceived.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsJoinEmptyReceived.setDescription('The number of Join Empty messages received.') hpicfMvrpPortStatsLeaveReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsLeaveReceived.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsLeaveReceived.setDescription('The number of Leave messages received.') hpicfMvrpPortStatsInReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsInReceived.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsInReceived.setDescription('The number of In messages received.') hpicfMvrpPortStatsEmptyReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsEmptyReceived.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsEmptyReceived.setDescription('The number of Empty messages received.') hpicfMvrpPortStatsLeaveAllReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsLeaveAllReceived.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsLeaveAllReceived.setDescription('The number of Leave all messages received.') hpicfMvrpPortStatsNewTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsNewTransmitted.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsNewTransmitted.setDescription('The number of New messages transmitted.') hpicfMvrpPortStatsJoinInTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsJoinInTransmitted.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsJoinInTransmitted.setDescription('The number of Join In messages transmitted.') hpicfMvrpPortStatsJoinEmptyTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsJoinEmptyTransmitted.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsJoinEmptyTransmitted.setDescription('The number of Join Empty messages transmitted.') hpicfMvrpPortStatsLeaveTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsLeaveTransmitted.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsLeaveTransmitted.setDescription('The number of Leave messages transmitted.') hpicfMvrpPortStatsInTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsInTransmitted.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsInTransmitted.setDescription('The number of In messages transmitted.') hpicfMvrpPortStatsEmptyTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsEmptyTransmitted.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsEmptyTransmitted.setDescription('The number of Empty messages transmitted.') hpicfMvrpPortStatsLeaveAllTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsLeaveAllTransmitted.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsLeaveAllTransmitted.setDescription('The number of Leave all messages transmitted.') hpicfMvrpPortStatsTotalPDUReceived = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsTotalPDUReceived.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsTotalPDUReceived.setDescription('The total number of MVRP PDUs received.') hpicfMvrpPortStatsTotalPDUTransmitted = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsTotalPDUTransmitted.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsTotalPDUTransmitted.setDescription('The total number of MVRP PDUs transmitted.') hpicfMvrpPortStatsFramesDiscarded = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpPortStatsFramesDiscarded.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsFramesDiscarded.setDescription('The number of Invalid messages received.') hpicfBridgeMvrpStateTable = MibTable((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 2), ) if mibBuilder.loadTexts: hpicfBridgeMvrpStateTable.setStatus('current') if mibBuilder.loadTexts: hpicfBridgeMvrpStateTable.setDescription('A table that contains information about the MVRP state Machine(s) configuration.') hpicfBridgeMvrpStateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 2, 1), ).setIndexNames((0, "HP-ICF-MVRP-MIB", "hpicfMvrpVlanId"), (0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: hpicfBridgeMvrpStateEntry.setStatus('current') if mibBuilder.loadTexts: hpicfBridgeMvrpStateEntry.setDescription('A row in a table that contains the VLAN ID and port list.') hpicfMvrpVlanId = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 2, 1, 1), VlanId()) if mibBuilder.loadTexts: hpicfMvrpVlanId.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpVlanId.setDescription('The VLAN ID to which this entry belongs.') hpicfMvrpApplicantState = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 2, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11))).clone(namedValues=NamedValues(("aa", 0), ("qa", 1), ("la", 2), ("vp", 3), ("ap", 4), ("qp", 5), ("vo", 6), ("ao", 7), ("qo", 8), ("lo", 9), ("vn", 10), ("an", 11)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpApplicantState.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpApplicantState.setDescription(' This MIB provides the Applicant State Machine values of the MVRP enabled port as follows: 0 = aa, 1 = qa, 2 = la, 3 = vp, 4 = ap, 5 = qp, 6 = vo, 7 = ao, 8 = qo, 9 = lo, 10 = vn, 11 = an. The first letter indicates the state: V for Very anxious, A for Anxious, Q for Quiet, and L for Leaving. The second letter indicates the membership state: A for Active member, P for Passive member, O for Observer and N for New.') hpicfMvrpRegistrarState = MibTableColumn((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 1, 2, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("in", 1), ("lv", 2), ("mt", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: hpicfMvrpRegistrarState.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpRegistrarState.setDescription('This MIB provides the Registrar state machine value for the MVRP enabled port as follows: 1 = registered, 2 = leaving, 3 = empty.') hpicfMvrpVlanLimitReachedEvent = NotificationType((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 0, 1)).setObjects(("HP-ICF-MVRP-MIB", "hpicfMvrpMaxVlanLimit")) if mibBuilder.loadTexts: hpicfMvrpVlanLimitReachedEvent.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpVlanLimitReachedEvent.setDescription('The number of VLANs learned dynamically by MVRP has reached a configured limit. Notify the management entity with the number of VLANs learned dynamically by MVRP and the configured MVRP VLAN limit.') hpicfMvrpCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 3, 1)) hpicfMvrpGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 3, 2)) hpicfMvrpCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 3, 1, 1)).setObjects(("HP-ICF-MVRP-MIB", "hpicfMvrpBaseGroup"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortConfigGroup"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsGroup"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStateGroup"), ("HP-ICF-MVRP-MIB", "hpicfMvrpNotifyGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMvrpCompliance = hpicfMvrpCompliance.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpCompliance.setDescription('Compliance statement for MVRP.') hpicfMvrpBaseGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 3, 2, 1)).setObjects(("HP-ICF-MVRP-MIB", "hpicfMvrpGlobalClearStats"), ("HP-ICF-MVRP-MIB", "hpicfMvrpMaxVlanLimit")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMvrpBaseGroup = hpicfMvrpBaseGroup.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpBaseGroup.setDescription('Collection of objects for management of MVRP Base Group.') hpicfMvrpPortConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 3, 2, 2)).setObjects(("HP-ICF-MVRP-MIB", "hpicfMvrpPortConfigRegistrarMode"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortConfigPeriodicTimer"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortConfigPeriodicTransmissionStatus"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsClearStats")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMvrpPortConfigGroup = hpicfMvrpPortConfigGroup.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortConfigGroup.setDescription('Collection of objects for management of MVRP Port Configuration Table.') hpicfMvrpPortStatsGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 3, 2, 3)).setObjects(("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsNewReceived"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsJoinInReceived"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsJoinEmptyReceived"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsLeaveReceived"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsInReceived"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsEmptyReceived"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsLeaveAllReceived"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsNewTransmitted"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsJoinInTransmitted"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsJoinEmptyTransmitted"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsLeaveTransmitted"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsInTransmitted"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsEmptyTransmitted"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsLeaveAllTransmitted"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsTotalPDUReceived"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsTotalPDUTransmitted"), ("HP-ICF-MVRP-MIB", "hpicfMvrpPortStatsFramesDiscarded")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMvrpPortStatsGroup = hpicfMvrpPortStatsGroup.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStatsGroup.setDescription('Collection of objects for management of MVRP Statistics Table.') hpicfMvrpPortStateGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 3, 2, 4)).setObjects(("HP-ICF-MVRP-MIB", "hpicfMvrpApplicantState"), ("HP-ICF-MVRP-MIB", "hpicfMvrpRegistrarState")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMvrpPortStateGroup = hpicfMvrpPortStateGroup.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpPortStateGroup.setDescription('Collection of objects to display Applicant and Registrar state machine of the ports.') hpicfMvrpNotifyGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 11, 2, 14, 11, 5, 1, 117, 3, 2, 5)).setObjects(("HP-ICF-MVRP-MIB", "hpicfMvrpVlanLimitReachedEvent")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): hpicfMvrpNotifyGroup = hpicfMvrpNotifyGroup.setStatus('current') if mibBuilder.loadTexts: hpicfMvrpNotifyGroup.setDescription('MVRP notification group.') mibBuilder.exportSymbols("HP-ICF-MVRP-MIB", hpicfMvrpNotifyGroup=hpicfMvrpNotifyGroup, hpicfMvrpPortStatsInReceived=hpicfMvrpPortStatsInReceived, hpicfMvrpPortStatsJoinInTransmitted=hpicfMvrpPortStatsJoinInTransmitted, hpicfMvrpPortConfigRegistrarMode=hpicfMvrpPortConfigRegistrarMode, hpicfMvrpGroups=hpicfMvrpGroups, hpicfMvrpPortConfigPeriodicTransmissionStatus=hpicfMvrpPortConfigPeriodicTransmissionStatus, hpicfMvrpPortConfigGroup=hpicfMvrpPortConfigGroup, hpicfMvrpBaseGroup=hpicfMvrpBaseGroup, hpicfMvrpVlanLimitReachedEvent=hpicfMvrpVlanLimitReachedEvent, hpicfMvrpPortStateGroup=hpicfMvrpPortStateGroup, hpicfMvrpConformance=hpicfMvrpConformance, hpicfMvrpPortStatsGroup=hpicfMvrpPortStatsGroup, PYSNMP_MODULE_ID=hpicfMvrpMIB, hpicfMvrpObjects=hpicfMvrpObjects, hpicfMvrpStats=hpicfMvrpStats, hpicfMvrpPortStatsJoinEmptyTransmitted=hpicfMvrpPortStatsJoinEmptyTransmitted, hpicfMvrpPortStatsEmptyTransmitted=hpicfMvrpPortStatsEmptyTransmitted, hpicfMvrpMaxVlanLimit=hpicfMvrpMaxVlanLimit, hpicfMvrpPortConfigEntry=hpicfMvrpPortConfigEntry, hpicfMvrpPortStatsJoinEmptyReceived=hpicfMvrpPortStatsJoinEmptyReceived, hpicfMvrpMIB=hpicfMvrpMIB, hpicfMvrpPortStatsEntry=hpicfMvrpPortStatsEntry, hpicfMvrpConfig=hpicfMvrpConfig, hpicfMvrpPortStatsNewReceived=hpicfMvrpPortStatsNewReceived, hpicfMvrpPortStatsTable=hpicfMvrpPortStatsTable, hpicfMvrpPortStatsTotalPDUReceived=hpicfMvrpPortStatsTotalPDUReceived, hpicfMvrpPortConfigPeriodicTimer=hpicfMvrpPortConfigPeriodicTimer, hpicfMvrpPortStatsNewTransmitted=hpicfMvrpPortStatsNewTransmitted, hpicfMvrpCompliances=hpicfMvrpCompliances, hpicfMvrpApplicantState=hpicfMvrpApplicantState, hpicfMvrpVlanId=hpicfMvrpVlanId, hpicfBridgeMvrpStateEntry=hpicfBridgeMvrpStateEntry, hpicfMvrpPortStatsInTransmitted=hpicfMvrpPortStatsInTransmitted, hpicfMvrpPortStatsLeaveReceived=hpicfMvrpPortStatsLeaveReceived, hpicfMvrpPortStatsLeaveTransmitted=hpicfMvrpPortStatsLeaveTransmitted, hpicfBridgeMvrpStateTable=hpicfBridgeMvrpStateTable, hpicfMvrpPortStatsLeaveAllReceived=hpicfMvrpPortStatsLeaveAllReceived, hpicfMvrpPortStatsEmptyReceived=hpicfMvrpPortStatsEmptyReceived, hpicfMvrpCompliance=hpicfMvrpCompliance, hpicfMvrpPortStatsTotalPDUTransmitted=hpicfMvrpPortStatsTotalPDUTransmitted, hpicfMvrpRegistrarState=hpicfMvrpRegistrarState, hpicfMvrpNotifications=hpicfMvrpNotifications, hpicfMvrpGlobalClearStats=hpicfMvrpGlobalClearStats, hpicfMvrpPortStatsFramesDiscarded=hpicfMvrpPortStatsFramesDiscarded, hpicfMvrpPortStatsClearStats=hpicfMvrpPortStatsClearStats, hpicfMvrpPortStatsLeaveAllTransmitted=hpicfMvrpPortStatsLeaveAllTransmitted, hpicfMvrpPortConfigTable=hpicfMvrpPortConfigTable, hpicfMvrpPortStatsJoinInReceived=hpicfMvrpPortStatsJoinInReceived)
n=int(input("Enter the number")) for i in range(2,n): if n%i ==0: print("Not Prime number") break else: print("Prime Number")
# Copyright 2018 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. """Unit tests for new_sets.bzl.""" load("//:lib.bzl", "new_sets", "asserts", "unittest") def _is_equal_test(ctx): """Unit tests for new_sets.is_equal. Note that if this test fails, the results for the other `sets` tests will be inconclusive because they use `asserts.new_set_equals`, which in turn calls `new_sets.is_equal`. """ env = unittest.begin(ctx) asserts.true(env, new_sets.is_equal(new_sets.make(), new_sets.make())) asserts.false(env, new_sets.is_equal(new_sets.make(), new_sets.make([1]))) asserts.false(env, new_sets.is_equal(new_sets.make([1]), new_sets.make())) asserts.true(env, new_sets.is_equal(new_sets.make([1]), new_sets.make([1]))) asserts.false(env, new_sets.is_equal(new_sets.make([1]), new_sets.make([1, 2]))) asserts.false(env, new_sets.is_equal(new_sets.make([1]), new_sets.make([2]))) asserts.false(env, new_sets.is_equal(new_sets.make([1]), new_sets.make([1, 2]))) # Verify that the implementation is not using == on the sets directly. asserts.true(env, new_sets.is_equal(new_sets.make(depset([1])), new_sets.make(depset([1])))) # If passing a list, verify that duplicate elements are ignored. asserts.true(env, new_sets.is_equal(new_sets.make([1, 1]), new_sets.make([1]))) unittest.end(env) is_equal_test = unittest.make(_is_equal_test) def _is_subset_test(ctx): """Unit tests for new_sets.is_subset.""" env = unittest.begin(ctx) asserts.true(env, new_sets.is_subset(new_sets.make(), new_sets.make())) asserts.true(env, new_sets.is_subset(new_sets.make(), new_sets.make([1]))) asserts.false(env, new_sets.is_subset(new_sets.make([1]), new_sets.make())) asserts.true(env, new_sets.is_subset(new_sets.make([1]), new_sets.make([1]))) asserts.true(env, new_sets.is_subset(new_sets.make([1]), new_sets.make([1, 2]))) asserts.false(env, new_sets.is_subset(new_sets.make([1]), new_sets.make([2]))) asserts.true(env, new_sets.is_subset(new_sets.make([1]), new_sets.make(depset([1, 2])))) # If passing a list, verify that duplicate elements are ignored. asserts.true(env, new_sets.is_subset(new_sets.make([1, 1]), new_sets.make([1, 2]))) unittest.end(env) is_subset_test = unittest.make(_is_subset_test) def _disjoint_test(ctx): """Unit tests for new_sets.disjoint.""" env = unittest.begin(ctx) asserts.true(env, new_sets.disjoint(new_sets.make(), new_sets.make())) asserts.true(env, new_sets.disjoint(new_sets.make(), new_sets.make([1]))) asserts.true(env, new_sets.disjoint(new_sets.make([1]), new_sets.make())) asserts.false(env, new_sets.disjoint(new_sets.make([1]), new_sets.make([1]))) asserts.false(env, new_sets.disjoint(new_sets.make([1]), new_sets.make([1, 2]))) asserts.true(env, new_sets.disjoint(new_sets.make([1]), new_sets.make([2]))) asserts.true(env, new_sets.disjoint(new_sets.make([1]), new_sets.make(depset([2])))) # If passing a list, verify that duplicate elements are ignored. asserts.false(env, new_sets.disjoint(new_sets.make([1, 1]), new_sets.make([1, 2]))) unittest.end(env) disjoint_test = unittest.make(_disjoint_test) def _intersection_test(ctx): """Unit tests for new_sets.intersection.""" env = unittest.begin(ctx) asserts.new_set_equals(env, new_sets.make(), new_sets.intersection(new_sets.make(), new_sets.make())) asserts.new_set_equals(env, new_sets.make(), new_sets.intersection(new_sets.make(), new_sets.make([1]))) asserts.new_set_equals(env, new_sets.make(), new_sets.intersection(new_sets.make([1]), new_sets.make())) asserts.new_set_equals(env, new_sets.make([1]), new_sets.intersection(new_sets.make([1]), new_sets.make([1]))) asserts.new_set_equals(env, new_sets.make([1]), new_sets.intersection(new_sets.make([1]), new_sets.make([1, 2]))) asserts.new_set_equals(env, new_sets.make(), new_sets.intersection(new_sets.make([1]), new_sets.make([2]))) asserts.new_set_equals(env, new_sets.make([1]), new_sets.intersection(new_sets.make([1]), new_sets.make(depset([1])))) # If passing a list, verify that duplicate elements are ignored. asserts.new_set_equals(env, new_sets.make([1]), new_sets.intersection(new_sets.make([1, 1]), new_sets.make([1, 2]))) unittest.end(env) intersection_test = unittest.make(_intersection_test) def _union_test(ctx): """Unit tests for new_sets.union.""" env = unittest.begin(ctx) asserts.new_set_equals(env, new_sets.make(), new_sets.union()) asserts.new_set_equals(env, new_sets.make([1]), new_sets.union(new_sets.make([1]))) asserts.new_set_equals(env, new_sets.make(), new_sets.union(new_sets.make(), new_sets.make())) asserts.new_set_equals(env, new_sets.make([1]), new_sets.union(new_sets.make(), new_sets.make([1]))) asserts.new_set_equals(env, new_sets.make([1]), new_sets.union(new_sets.make([1]), new_sets.make())) asserts.new_set_equals(env, new_sets.make([1]), new_sets.union(new_sets.make([1]), new_sets.make([1]))) asserts.new_set_equals(env, new_sets.make([1, 2]), new_sets.union(new_sets.make([1]), new_sets.make([1, 2]))) asserts.new_set_equals(env, new_sets.make([1, 2]), new_sets.union(new_sets.make([1]), new_sets.make([2]))) asserts.new_set_equals(env, new_sets.make([1]), new_sets.union(new_sets.make([1]), new_sets.make(depset([1])))) # If passing a list, verify that duplicate elements are ignored. asserts.new_set_equals(env, new_sets.make([1, 2]), new_sets.union(new_sets.make([1, 1]), new_sets.make([1, 2]))) unittest.end(env) union_test = unittest.make(_union_test) def _difference_test(ctx): """Unit tests for new_sets.difference.""" env = unittest.begin(ctx) asserts.new_set_equals(env, new_sets.make(), new_sets.difference(new_sets.make(), new_sets.make())) asserts.new_set_equals(env, new_sets.make(), new_sets.difference(new_sets.make(), new_sets.make([1]))) asserts.new_set_equals(env, new_sets.make([1]), new_sets.difference(new_sets.make([1]), new_sets.make())) asserts.new_set_equals(env, new_sets.make(), new_sets.difference(new_sets.make([1]), new_sets.make([1]))) asserts.new_set_equals(env, new_sets.make(), new_sets.difference(new_sets.make([1]), new_sets.make([1, 2]))) asserts.new_set_equals(env, new_sets.make([1]), new_sets.difference(new_sets.make([1]), new_sets.make([2]))) asserts.new_set_equals(env, new_sets.make(), new_sets.difference(new_sets.make([1]), new_sets.make(depset([1])))) # If passing a list, verify that duplicate elements are ignored. asserts.new_set_equals(env, new_sets.make([2]), new_sets.difference(new_sets.make([1, 2]), new_sets.make([1, 1]))) unittest.end(env) difference_test = unittest.make(_difference_test) def _to_list_test(ctx): """Unit tests for new_sets.to_list.""" env = unittest.begin(ctx) asserts.equals(env, [], new_sets.to_list(new_sets.make())) asserts.equals(env, [1], new_sets.to_list(new_sets.make([1, 1, 1]))) asserts.equals(env, [1, 2, 3], new_sets.to_list(new_sets.make([1, 2, 3]))) unittest.end(env) to_list_test = unittest.make(_to_list_test) def _make_test(ctx): """Unit tests for new_sets.make.""" env = unittest.begin(ctx) asserts.equals(env, {}, new_sets.make()._values) asserts.equals(env, {x: None for x in [1, 2, 3]}, new_sets.make([1, 1, 2, 2, 3, 3])._values) asserts.equals(env, {1: None, 2: None}, new_sets.make(depset([1, 2]))._values) unittest.end(env) make_test = unittest.make(_make_test) def _copy_test(ctx): """Unit tests for new_sets.copy.""" env = unittest.begin(ctx) asserts.new_set_equals(env, new_sets.copy(new_sets.make()), new_sets.make()) asserts.new_set_equals(env, new_sets.copy(new_sets.make([1, 2, 3])), new_sets.make([1, 2, 3])) # Ensure mutating the copy does not mutate the original original = new_sets.make([1, 2, 3]) copy = new_sets.copy(original) copy._values[5] = None asserts.false(env, new_sets.is_equal(original, copy)) unittest.end(env) copy_test = unittest.make(_copy_test) def _insert_test(ctx): """Unit tests for new_sets.insert.""" env = unittest.begin(ctx) asserts.new_set_equals(env, new_sets.make([1, 2, 3]), new_sets.insert(new_sets.make([1, 2]), 3)) # Ensure mutating the inserted set does mutate the original set. original = new_sets.make([1, 2, 3]) after_insert = new_sets.insert(original, 4) asserts.new_set_equals(env, original, after_insert, msg="Insert creates a new set which is an O(n) operation, insert should be O(1).") unittest.end(env) insert_test = unittest.make(_insert_test) def _contains_test(ctx): """Unit tests for new_sets.contains.""" env = unittest.begin(ctx) asserts.false(env, new_sets.contains(new_sets.make(), 1)) asserts.true(env, new_sets.contains(new_sets.make([1]), 1)) asserts.true(env, new_sets.contains(new_sets.make([1, 2]), 1)) asserts.false(env, new_sets.contains(new_sets.make([2, 3]), 1)) unittest.end(env) contains_test = unittest.make(_contains_test) def _length_test(ctx): """Unit test for new_sets.length.""" env = unittest.begin(ctx) asserts.equals(env, 0, new_sets.length(new_sets.make())) asserts.equals(env, 1, new_sets.length(new_sets.make([1]))) asserts.equals(env, 2, new_sets.length(new_sets.make([1, 2]))) unittest.end(env) length_test = unittest.make(_length_test) def _remove_test(ctx): """Unit test for new_sets.remove.""" env = unittest.begin(ctx) asserts.new_set_equals(env, new_sets.make([1, 2]), new_sets.remove(new_sets.make([1, 2, 3]), 3)) # Ensure mutating the inserted set does mutate the original set. original = new_sets.make([1, 2, 3]) after_removal = new_sets.remove(original, 3) asserts.new_set_equals(env, original, after_removal) unittest.end(env) remove_test = unittest.make(_remove_test) def new_sets_test_suite(): """Creates the test targets and test suite for new_sets.bzl tests.""" unittest.suite( "new_sets_tests", disjoint_test, intersection_test, is_equal_test, is_subset_test, difference_test, union_test, to_list_test, make_test, copy_test, insert_test, contains_test, length_test, remove_test, )
class Node: def __init__(self, item: int, prev=None): self.item = item self.prev = prev class Stack: def __init__(self): self.last = None def push(self, item): self.last = Node(item, self.last) def pop(self): item = self.last.item self.last = self.last.prev return item class ListNode: def __init__(self,data, next=None): self.val = data self.next = next def add(self, data): node = self while node.next: node = node.next node.next = ListNode(data) def __getitem__(self, n): node = self if n == 0: return node.val for i in range(n): node = node.next return node.val def printall(self): node = self while node: print(node.val) node = node.next
def sonarqube_coverage_generator_binary(): deps = ["@remote_coverage_tools//:all_lcov_merger_lib"] native.java_binary( name = "SonarQubeCoverageGenerator", srcs = [ "src/main/java/com/google/devtools/coverageoutputgenerator/SonarQubeCoverageGenerator.java", "src/main/java/com/google/devtools/coverageoutputgenerator/SonarQubeCoverageReportPrinter.java", ], main_class = "com.google.devtools.coverageoutputgenerator.SonarQubeCoverageGenerator", deps = deps, ) def _build_sonar_project_properties(ctx, sq_properties_file): module_path = ctx.build_file_path.replace("BUILD", "") depth = len(module_path.split("/")) - 1 parent_path = "../" * depth # SonarQube requires test reports to be named like TEST-foo.xml, so we step # through `test_targets` to find the matching `test_reports` values, and # symlink them to the usable name if hasattr(ctx.attr, "test_targets") and ctx.attr.test_targets and hasattr(ctx.attr, "test_reports") and ctx.attr.test_reports and ctx.files.test_reports: test_reports_path = module_path + "test-reports" test_reports_runfiles = [] for t in ctx.attr.test_targets: test_target = ctx.label.relative(t) bazel_test_report_path = "bazel-testlogs/" + test_target.package + "/" + test_target.name + "/test.xml" matching_test_reports = [t for t in ctx.files.test_reports if t.short_path == bazel_test_report_path] if matching_test_reports: bazel_test_report = matching_test_reports[0] sq_test_report = ctx.actions.declare_file("%s/TEST-%s.xml" % (test_reports_path, test_target.name)) ctx.actions.symlink( output = sq_test_report, target_file = bazel_test_report, ) test_reports_runfiles.append(sq_test_report) inc += 1 else: print("Expected Bazel test report for %s with path %s" % (test_target, bazel_test_report_path)) else: test_reports_path = "" test_reports_runfiles = [] if hasattr(ctx.attr, "coverage_report") and ctx.attr.coverage_report: coverage_report_path = parent_path + ctx.file.coverage_report.short_path coverage_runfiles = [ctx.file.coverage_report] else: coverage_report_path = "" coverage_runfiles = [] java_files = _get_java_files([t for t in ctx.attr.targets if t[JavaInfo]]) ctx.actions.expand_template( template = ctx.file.sq_properties_template, output = sq_properties_file, substitutions = { "{PROJECT_KEY}": ctx.attr.project_key, "{PROJECT_NAME}": ctx.attr.project_name, "{SOURCES}": ",".join([parent_path + f.short_path for f in ctx.files.srcs]), "{TEST_SOURCES}": ",".join([parent_path + f.short_path for f in ctx.files.test_srcs]), "{SOURCE_ENCODING}": ctx.attr.source_encoding, "{JAVA_BINARIES}": ",".join([parent_path + j.short_path for j in java_files["output_jars"].to_list()]), "{JAVA_LIBRARIES}": ",".join([parent_path + j.short_path for j in java_files["deps_jars"].to_list()]), "{MODULES}": ",".join(ctx.attr.modules.values()), "{TEST_REPORTS}": test_reports_path, "{COVERAGE_REPORT}": coverage_report_path, }, is_executable = False, ) return ctx.runfiles( files = [sq_properties_file] + ctx.files.srcs + ctx.files.test_srcs + test_reports_runfiles + coverage_runfiles, transitive_files = depset(transitive = [java_files["output_jars"], java_files["deps_jars"]]), ) def _get_java_files(java_targets): return { "output_jars": depset(direct = [j.class_jar for t in java_targets for j in t[JavaInfo].outputs.jars]), "deps_jars": depset(transitive = [t[JavaInfo].transitive_deps for t in java_targets] + [t[JavaInfo].transitive_runtime_deps for t in java_targets]), } def _test_report_path(parent_path, test_target): return parent_path + "bazel-testlogs/" + test_target.package + "/" + test_target.name def _sonarqube_impl(ctx): sq_properties_file = ctx.actions.declare_file("sonar-project.properties") local_runfiles = _build_sonar_project_properties(ctx, sq_properties_file) module_runfiles = ctx.runfiles(files = []) for module in ctx.attr.modules.keys(): module_runfiles = module_runfiles.merge(module[DefaultInfo].default_runfiles) ctx.actions.write( output = ctx.outputs.executable, content = "\n".join([ "#!/bin/bash", #"echo 'Dereferencing bazel runfiles symlinks for accurate SCM resolution...'", #"for f in $(find $(dirname %s) -type l); do echo $f; done" % sq_properties_file.short_path, #"echo '... done.'", # "find $(dirname %s) -type l -exec bash -c 'ln -f $(readlink $0) $0' {} \\;" % sq_properties_file.short_path, "exec %s -Dproject.settings=%s $@" % (ctx.executable.sonar_scanner.short_path, sq_properties_file.short_path), ]), is_executable = True, ) return [DefaultInfo( runfiles = ctx.runfiles(files = [ctx.executable.sonar_scanner] + ctx.files.scm_info).merge(ctx.attr.sonar_scanner[DefaultInfo].default_runfiles).merge(local_runfiles).merge(module_runfiles), )] _COMMON_ATTRS = dict(dict(), **{ "project_key": attr.string( mandatory = True, doc = """SonarQube project key, e.g. `com.example.project:module`.""", ), "project_name": attr.string( doc = """SonarQube project display name.""", ), "srcs": attr.label_list( allow_files = True, default = [], doc = """Project sources to be analysed by SonarQube.""", ), "source_encoding": attr.string( default = "UTF-8", doc = """Source file encoding.""", ), "targets": attr.label_list( default = [], doc = """Bazel targets to be analysed by SonarQube. These may be used to provide additional provider information to the SQ analysis , e.g. Java classpath context. """, ), "modules": attr.label_keyed_string_dict( default = {}, doc = """Sub-projects to associate with this SonarQube project.""", ), "test_srcs": attr.label_list( allow_files = True, default = [], doc = """Project test sources to be analysed by SonarQube. This must be set along with `test_reports` and `test_sources` for accurate test reporting.""", ), "test_targets": attr.string_list( default = [], doc = """A list of test targets relevant to the SQ project. This will be used with the `test_reports` attribute to generate the report paths in sonar-project.properties.""", ), "test_reports": attr.label_list( allow_files = True, default = [], doc = """Junit-format execution reports, e.g. `filegroup(name = "test_reports", srcs = glob(["bazel-testlogs/**/test.xml"]))`""", ), "sq_properties_template": attr.label( allow_single_file = True, default = "@bazel_sonarqube//:sonar-project.properties.tpl", doc = """Template file for sonar-project.properties.""", ), "sq_properties": attr.output(), }) _sonarqube = rule( attrs = dict(_COMMON_ATTRS, **{ "coverage_report": attr.label( allow_single_file = True, mandatory = False, doc = """Coverage file in SonarQube generic coverage report format.""", ), "scm_info": attr.label_list( allow_files = True, doc = """Source code metadata, e.g. `filegroup(name = "git_info", srcs = glob([".git/**"], exclude = [".git/**/*[*"], # gitk creates temp files with []))`""", ), "sonar_scanner": attr.label( executable = True, default = "@bazel_sonarqube//:sonar_scanner", cfg = "host", doc = """Bazel binary target to execute the SonarQube CLI Scanner""", ), }), fragments = ["jvm"], host_fragments = ["jvm"], implementation = _sonarqube_impl, executable = True, ) def sonarqube( name, project_key, scm_info, coverage_report = None, project_name = None, srcs = [], source_encoding = None, targets = [], test_srcs = [], test_targets = [], test_reports = [], modules = {}, sonar_scanner = None, sq_properties_template = None, tags = [], visibility = []): _sonarqube( name = name, project_key = project_key, project_name = project_name, scm_info = scm_info, srcs = srcs, source_encoding = source_encoding, targets = targets, modules = modules, test_srcs = test_srcs, test_targets = test_targets, test_reports = test_reports, coverage_report = coverage_report, sonar_scanner = sonar_scanner, sq_properties_template = sq_properties_template, sq_properties = "sonar-project.properties", tags = tags, visibility = visibility, ) def _sq_project_impl(ctx): local_runfiles = _build_sonar_project_properties(ctx, ctx.outputs.sq_properties) return [DefaultInfo( runfiles = local_runfiles, )] _sq_project = rule( attrs = _COMMON_ATTRS, implementation = _sq_project_impl, ) def sq_project( name, project_key, project_name = None, srcs = [], source_encoding = None, targets = [], test_srcs = [], test_targets = [], test_reports = [], modules = {}, sq_properties_template = None, tags = [], visibility = []): _sq_project( name = name, project_key = project_key, project_name = project_name, srcs = srcs, test_srcs = test_srcs, source_encoding = source_encoding, targets = targets, test_targets = test_targets, test_reports = test_reports, modules = modules, sq_properties_template = sq_properties_template, sq_properties = "sonar-project.properties", tags = tags, visibility = visibility, )
class Stack: __stack = None def __init__(self): self.__stack = [] def push(self, val): self.__stack.append(val) def peek(self): if len(self.__stack) != 0: return self.__stack[len(self.__stack) - 1] def pop(self): if len(self.__stack) != 0: return self.__stack.pop() def len(self): return len(self.__stack) def convert_to_list(self): return self.__stack
#!/usr/bin/env python # -*- coding: utf-8 -*- SECRET_KEY = 'hunter2' TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'APP_DIRS': True, }, ] INSTALLED_APPS = [ 'octicons.apps.OcticonsConfig' ]
# Copyright (C) 2017 Verizon. All Rights Reserved. # # File: exceptions.py # Author: John Hickey, Phil Chandler # Date: 2017-02-17 # # 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. """ Exceptions for this project """ class PyDCIMException(Exception): """ Parent exception for all exceptions from this library """ class PyDCIMNotSupported(PyDCIMException): """ For calls that reference DCIM objects we do not know about """ # ***************************************************************** # Exceptions for WSMAN and lower level DRAC interactions # ***************************************************************** class WSMANClientException(PyDCIMException): """ Base exception for WSMAN client exceptions """ # HTTP/Service level exceptions class WSMANTransportError(WSMANClientException): """Transport level exception base (auth, connection, etc)""" class WSMANConnectionError(WSMANTransportError): """ For HTTP level connection errors """ class WSMANHTTPError(WSMANTransportError): """ For HTTP status code errors """ class WSMANAuthError(WSMANHTTPError): """ For HTTP auth errors """ # Envelope Errors class WSMANSOAPEnvelopeError(WSMANClientException): """ Base exception for making message envelopes """ # # Parse Errors # class WSMANSOAPResponseError(WSMANClientException): """ For error that occur during parsing """ class WSMANFault(WSMANSOAPResponseError): """ For responses that contain a fault """ class WSMANElementNotFound(WSMANSOAPResponseError): """ For elements that we expected but weren't there """ # # DCIM base class errors # class DCIMException(PyDCIMException): """ Base class for API exceptions """ class DCIMValueError(DCIMException): """ For missing values in return data, etc """ class DCIMCommandError(DCIMException): """ For asserting a return value """ def __init__(self, message, message_id=None, return_value=None): self.message = message self.message_id = message_id self.return_value = return_value class DCIMAttributeError(DCIMException): """ For problems with class attributes """ class DCIMArgumentError(DCIMException): """ For argument issues """ # # dractor.dcim.Client exceptions # class DCIMClientException(PyDCIMException): """ Base class for client level problems """ class UnsupportedLCVersion(DCIMClientException): """ Exception for LC versions too old """ # # dractor.recipe exceptions # class RecipeException(PyDCIMException): """ Base class for recipe exceptions """ class RecipeConfigurationError(RecipeException): """ For configuration errors """ class RecipeExecutionError(RecipeException): """ Failures to run recipe as expected """ class LCHalted(RecipeException): """ For when the server is stuck at a prompt """ class LCTimeout(RecipeException): """ General timeout """ class LCJobError(RecipeException): """ Job failed """ class LCDataError(RecipeException): """ DRAC yielding bad data """
STATE_WAIT = 0b000001 STATE_START = 0b000010 STATE_COMPLETE = 0b000100 STATE_CANCEL = 0b001000 STATE_REJECT = 0b010000 STATE_VIOLATE = 0b100000 COMPLETE_BY_CANCEL = STATE_COMPLETE | STATE_CANCEL COMPLETE_BY_REJECT = STATE_COMPLETE | STATE_REJECT COMPLETE_BY_VIOLATE = STATE_COMPLETE | STATE_VIOLATE def isWait(s): return bool(s & STATE_WAIT) def isStart(s): return bool(s & STATE_START) def isComplete(s): return bool(s & STATE_COMPLETE) def isCancel(s): return bool(s & STATE_CANCEL) def isReject(s): return bool(s & STATE_REJECT) def isViolate(s): return bool(s & STATE_VIOLATE)
class Node: def __init__(self): self.out = 0.0 self.last_out = 0.0 self.incoming_connections = [] self.has_output = False
# This for loop only prints 0 through 4 and 6 through 9. for i in range(10): if i == 5: continue print(i)
# Python List | SGVP386100 | 18:00 21F19 # https://www.geeksforgeeks.org/python-list/ List = [] print("Initial blank List: ") print(List) # Creating a List with the use of a String List = ['GeeksForGeeks'] print("\nList with the use of String: ") print(List) # 18:51 26F19 # Creating a List with the use of mulitple values List = ["Geeks", "For", "Geeks"] print("\nList containing multiple values: ") print(List[0]) print(List[2]) #Creating a Multi-Dimensional List #(By Nesting a list inside a List) List = [['Geeks', 'For'], ['Geeks']] print("\nMulti-Dimensional List: ") print(List) # Creating a List with # the use of Numbers # (Having duplicate values) List = [1, 2, 4, 4, 3, 3, 3, 6, 5] print("\nList with the use of Numbers: ") print(List) # Creating a List with # mixed type of values # (Having numbers and strings) List = [1, 2, 'Geeks', 4, 'For', 6, 'Geeks'] print("\nList with the use of Mixed Values: ") print(List) # Python program to demonstrate # Addition of elements in a List # Creating a List List = [] print("Intial blank List: ") print(List) # Addition of Elements in the List List.append(1) List.append(2) List.append(4) print("\nList after Addition of Three elements: ") print(List) # Adding elements to the List # using Iterator for i in range(1, 4): List.append(i) print("\nList after Addition of elements from 1-3: ") print(List)
REGISTRATION_MAIL_TEMPLATE = """ Hello {username}, this mail is auto generated by the bot on TUM Heilbronn Discord server. Please send the message below in the #registration channel to register yourself as a student. /register {register_code} If you have any problem regarding to this registering process, please contact taiki#2104 on Discord or <[email protected]>. Kind regards, Your TUM Heilbronn Discord server maintainance team (mainly me). """
class Variable: """A config variable """ def __init__(self, name, default, description, type, is_list=False, possible_values=None): # Variable name, used as key in yaml, or to get variable via command line and env varaibles self.name = name # Description of the variable, used for --help self.description = description # Type of the variable, can be int, float, str self.type = type self.is_list = is_list # The value of the variable self._value = None self._possible_values = possible_values self.set_value(default) def __str__(self): return f"name: {self.name}" def get_value(self): return self._value def set_value(self, value): """Check if the value match the type of the variable and set it Args: value: The new value of the variable, will be checked before updating the var Raises: TypeError: if the type of value doesn't matche the type of the variable """ if type(self._possible_values) is list: assert value in self._possible_values, f"{value} need to be inside {self._possible_values}" if self.is_list: assert type(value) in [str, list], f"{value} need to be a list or a string" if type(value) == str: value = value.split(",") end_list = [] for element in value: end_list.append(self._convert_type(element)) self._value = end_list else: self._value = self._convert_type(value) def _convert_type(self, value): # str and float values can be parsed without issues in all cases if self.type in [str, float]: return self.type(value) if self.type == int: return self._convert_type_int(value) if self.type == bool: return self._convert_type_bool(value) return value def _convert_type_int(self, value): """convert a value in any data type to int Args: value: a value read from the json file or from python or from the command line Raises: ValueError: [description] """ if type(value) == str: value = float(value) if type(value) == float: if int(value) == value: value = int(value) else: raise ValueError("value should have type {} but have type {}".format(self.type, type(value))) return value def _convert_type_bool(self, value): if type(value) == str: if value.lower() == "true": return True if value.lower() == "false": return False raise ValueError(f"Can't parse boolean {value}") return bool(value)
# # PySNMP MIB module Unisphere-Data-OSPF-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Unisphere-Data-OSPF-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:32:07 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") ValueSizeConstraint, SingleValueConstraint, ValueRangeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "SingleValueConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "ConstraintsUnion") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") ospfAddressLessIf, ospfIfIpAddress, ospfIfEntry, ospfNbrEntry, ospfAreaEntry, ospfVirtIfEntry = mibBuilder.importSymbols("OSPF-MIB", "ospfAddressLessIf", "ospfIfIpAddress", "ospfIfEntry", "ospfNbrEntry", "ospfAreaEntry", "ospfVirtIfEntry") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") Integer32, TimeTicks, Unsigned32, MibIdentifier, IpAddress, Counter64, NotificationType, ObjectIdentity, iso, Bits, ModuleIdentity, Gauge32, MibScalar, MibTable, MibTableRow, MibTableColumn, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "TimeTicks", "Unsigned32", "MibIdentifier", "IpAddress", "Counter64", "NotificationType", "ObjectIdentity", "iso", "Bits", "ModuleIdentity", "Gauge32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Counter32") DisplayString, TruthValue, TextualConvention, RowStatus = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TruthValue", "TextualConvention", "RowStatus") usDataMibs, = mibBuilder.importSymbols("Unisphere-Data-MIBs", "usDataMibs") usdOspfMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14)) usdOspfMIB.setRevisions(('2002-04-05 21:20', '2000-05-23 00:00', '1999-09-28 00:00',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: usdOspfMIB.setRevisionsDescriptions(('Added usdOspfVpnRouteTag, usdOspfDomainId, usdOspfAreaTeCapable and usdOspfMplsTeRtrIdIfIndex objects.', 'Key revisions include: o Corrected description for usdOspfProcessId. o Added usdOspfNetworkRangeTable. o Added usdOspfOperState.', 'Initial version of this MIB module.',)) if mibBuilder.loadTexts: usdOspfMIB.setLastUpdated('200204052120Z') if mibBuilder.loadTexts: usdOspfMIB.setOrganization('Unisphere Networks, Inc.') if mibBuilder.loadTexts: usdOspfMIB.setContactInfo(' Unisphere Networks, Inc. Postal: 10 Technology Park Drive Westford, MA 01886 USA Tel: +1 978 589 5800 E-mail: [email protected]') if mibBuilder.loadTexts: usdOspfMIB.setDescription('The OSPF Protocol MIB for the Unisphere Networks Inc. enterprise.') usdOspfObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1)) usdOspfGeneralGroup = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1)) usdOspfProcessId = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 65535))).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfProcessId.setStatus('current') if mibBuilder.loadTexts: usdOspfProcessId.setDescription("An identifier having special semantics when set. When this object's value is zero, OSPF is disabled and cannot be configured. Setting this object to a nonzero value enables OSPF operation and permits further OSPF configuration to be performed. Once set to a nonzero value, this object cannot be modified.") usdOspfMaxPathSplits = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 16))).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfMaxPathSplits.setStatus('current') if mibBuilder.loadTexts: usdOspfMaxPathSplits.setDescription('The maximum number of equal-cost routes that will be maintained by the OSPF protocol. A change in this value will be taken into account at the next shortest-path-first recalculation.') usdOspfSpfHoldInterval = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 5))).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfSpfHoldInterval.setStatus('current') if mibBuilder.loadTexts: usdOspfSpfHoldInterval.setDescription('The minimum amount of time that must elapse between shortest-path-first recalculations. Reducing this value can cause an immediate SPF recalulation if the new value is less than the current value of usdOspfSpfHoldTimeRemaining and other SPF-inducing protocol events have occurred.') usdOspfNumActiveAreas = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfNumActiveAreas.setStatus('current') if mibBuilder.loadTexts: usdOspfNumActiveAreas.setDescription('The number of active areas.') usdOspfSpfTime = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfSpfTime.setStatus('current') if mibBuilder.loadTexts: usdOspfSpfTime.setDescription('The SPF schedule delay.') usdOspfRefBw = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 4294967295)).clone(100)).setUnits('bits per second').setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfRefBw.setStatus('current') if mibBuilder.loadTexts: usdOspfRefBw.setDescription('The reference bandwith, in bits per second. This object is used when OSPF automatic interface cost calculation is used.') usdOspfAutoVlink = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 7), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfAutoVlink.setStatus('current') if mibBuilder.loadTexts: usdOspfAutoVlink.setDescription('Set this object to true(1) in order to have virtual links automatically configured.') usdOspfIntraDistance = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 8), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfIntraDistance.setStatus('current') if mibBuilder.loadTexts: usdOspfIntraDistance.setDescription('Default distance for intra-area routes.') usdOspfInterDistance = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 9), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfInterDistance.setStatus('current') if mibBuilder.loadTexts: usdOspfInterDistance.setDescription('Default distance for inter-area routes.') usdOspfExtDistance = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 10), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 255))).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfExtDistance.setStatus('current') if mibBuilder.loadTexts: usdOspfExtDistance.setDescription('Default distance for external type 5 and type 7 routes.') usdOspfHelloPktsRcv = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfHelloPktsRcv.setStatus('current') if mibBuilder.loadTexts: usdOspfHelloPktsRcv.setDescription('Number of hello packets received.') usdOspfDDPktsRcv = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfDDPktsRcv.setStatus('current') if mibBuilder.loadTexts: usdOspfDDPktsRcv.setDescription('Number of database description packets received.') usdOspfLsrPktsRcv = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 13), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfLsrPktsRcv.setStatus('current') if mibBuilder.loadTexts: usdOspfLsrPktsRcv.setDescription('Number of link state request packets received.') usdOspfLsuPktsRcv = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 14), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfLsuPktsRcv.setStatus('current') if mibBuilder.loadTexts: usdOspfLsuPktsRcv.setDescription('Number of link state update packets received.') usdOspfLsAckPktsRcv = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 15), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfLsAckPktsRcv.setStatus('current') if mibBuilder.loadTexts: usdOspfLsAckPktsRcv.setDescription('Number of link state ACK packets received.') usdOspfTotalRcv = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 16), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfTotalRcv.setStatus('current') if mibBuilder.loadTexts: usdOspfTotalRcv.setDescription('Number of OSPF packets received.') usdOspfLsaDiscardCnt = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfLsaDiscardCnt.setStatus('current') if mibBuilder.loadTexts: usdOspfLsaDiscardCnt.setDescription('Number of LSA packets discarded.') usdOspfHelloPktsSent = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 18), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfHelloPktsSent.setStatus('current') if mibBuilder.loadTexts: usdOspfHelloPktsSent.setDescription('Number of hello packets sent.') usdOspfDDPktsSent = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 19), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfDDPktsSent.setStatus('current') if mibBuilder.loadTexts: usdOspfDDPktsSent.setDescription('Number of database description packets sent.') usdOspfLsrPktsSent = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfLsrPktsSent.setStatus('current') if mibBuilder.loadTexts: usdOspfLsrPktsSent.setDescription('Number of link state request packets sent.') usdOspfLsuPktsSent = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 21), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfLsuPktsSent.setStatus('current') if mibBuilder.loadTexts: usdOspfLsuPktsSent.setDescription('Number of link state update packets sent.') usdOspfLsAckPktsSent = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 22), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfLsAckPktsSent.setStatus('current') if mibBuilder.loadTexts: usdOspfLsAckPktsSent.setDescription('Number of link state ACK packets sent.') usdOspfErrPktsSent = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 23), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfErrPktsSent.setStatus('current') if mibBuilder.loadTexts: usdOspfErrPktsSent.setDescription('Number of packets dropped.') usdOspfTotalSent = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 24), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfTotalSent.setStatus('current') if mibBuilder.loadTexts: usdOspfTotalSent.setDescription('Number of OSPF packets sent.') usdOspfCsumErrPkts = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 25), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfCsumErrPkts.setStatus('current') if mibBuilder.loadTexts: usdOspfCsumErrPkts.setDescription('Number of packets received with a checksum error.') usdOspfAllocFailNbr = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 26), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAllocFailNbr.setStatus('current') if mibBuilder.loadTexts: usdOspfAllocFailNbr.setDescription('Number of neighbor allocation failures.') usdOspfAllocFailLsa = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 27), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAllocFailLsa.setStatus('current') if mibBuilder.loadTexts: usdOspfAllocFailLsa.setDescription('Number of LSA allocation failures.') usdOspfAllocFailLsd = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 28), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAllocFailLsd.setStatus('current') if mibBuilder.loadTexts: usdOspfAllocFailLsd.setDescription('Number of LSA HDR allocation failures.') usdOspfAllocFailDbRequest = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 29), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAllocFailDbRequest.setStatus('current') if mibBuilder.loadTexts: usdOspfAllocFailDbRequest.setDescription('Number of database request allocation failures.') usdOspfAllocFailRtx = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 30), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAllocFailRtx.setStatus('current') if mibBuilder.loadTexts: usdOspfAllocFailRtx.setDescription('Number of RTX allocation failures.') usdOspfAllocFailAck = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 31), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAllocFailAck.setStatus('current') if mibBuilder.loadTexts: usdOspfAllocFailAck.setDescription('Number of LS ACK allocation failures.') usdOspfAllocFailDbPkt = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 32), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAllocFailDbPkt.setStatus('current') if mibBuilder.loadTexts: usdOspfAllocFailDbPkt.setDescription('Number of DD packet allocation failures.') usdOspfAllocFailCirc = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 33), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAllocFailCirc.setStatus('current') if mibBuilder.loadTexts: usdOspfAllocFailCirc.setDescription('Number of OSPF interface allocation failures.') usdOspfAllocFailPkt = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 34), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAllocFailPkt.setStatus('current') if mibBuilder.loadTexts: usdOspfAllocFailPkt.setDescription('Number of OSPF general packet allocation failures.') usdOspfOperState = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 35), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfOperState.setStatus('current') if mibBuilder.loadTexts: usdOspfOperState.setDescription('A flag to note whether this router is operational.') usdOspfVpnRouteTag = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 36), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfVpnRouteTag.setStatus('current') if mibBuilder.loadTexts: usdOspfVpnRouteTag.setDescription('VPN route tag value.') usdOspfDomainId = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 37), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4294967295))).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfDomainId.setStatus('current') if mibBuilder.loadTexts: usdOspfDomainId.setDescription('OSPF domain ID.') usdOspfMplsTeRtrIdIfIndex = MibScalar((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 1, 38), InterfaceIndex()).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfMplsTeRtrIdIfIndex.setStatus('current') if mibBuilder.loadTexts: usdOspfMplsTeRtrIdIfIndex.setDescription('Configure the stable router interface id to designate it as TE capable.') usdOspfAreaTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 2), ) if mibBuilder.loadTexts: usdOspfAreaTable.setStatus('current') if mibBuilder.loadTexts: usdOspfAreaTable.setDescription('The Unisphere OSPF area table describes the OSPF-specific characteristics of areas.') usdOspfAreaEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 2, 1), ) ospfAreaEntry.registerAugmentions(("Unisphere-Data-OSPF-MIB", "usdOspfAreaEntry")) usdOspfAreaEntry.setIndexNames(*ospfAreaEntry.getIndexNames()) if mibBuilder.loadTexts: usdOspfAreaEntry.setStatus('current') if mibBuilder.loadTexts: usdOspfAreaEntry.setDescription('The OSPF area entry describes OSPF-specific characteristics of one area.') usdOspfAreaType = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 2, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("transitArea", 1), ("stubArea", 2), ("nssaArea", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfAreaType.setStatus('current') if mibBuilder.loadTexts: usdOspfAreaType.setDescription('The type of this area.') usdOspfAreaTeCapable = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 2, 1, 2), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: usdOspfAreaTeCapable.setStatus('current') if mibBuilder.loadTexts: usdOspfAreaTeCapable.setDescription('Configure the specified area TE capable to flood the TE information.') usdOspfIfTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 7), ) if mibBuilder.loadTexts: usdOspfIfTable.setStatus('current') if mibBuilder.loadTexts: usdOspfIfTable.setDescription('The Unisphere OSPF interface table describes the OSPF-specific characteristics of interfaces.') usdOspfIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 7, 1), ) ospfIfEntry.registerAugmentions(("Unisphere-Data-OSPF-MIB", "usdOspfIfEntry")) usdOspfIfEntry.setIndexNames(*ospfIfEntry.getIndexNames()) if mibBuilder.loadTexts: usdOspfIfEntry.setStatus('current') if mibBuilder.loadTexts: usdOspfIfEntry.setDescription('The OSPF interface entry describes OSPF-specific characteristics of one interface.') usdOspfIfCost = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 7, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535)).clone(10)).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfIfCost.setStatus('current') if mibBuilder.loadTexts: usdOspfIfCost.setDescription('The cost value for this interface.') usdOspfIfMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 7, 1, 2), IpAddress()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfIfMask.setStatus('current') if mibBuilder.loadTexts: usdOspfIfMask.setDescription('The mask used to derive the network range of this interface.') usdOspfIfPassiveFlag = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 7, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfIfPassiveFlag.setStatus('current') if mibBuilder.loadTexts: usdOspfIfPassiveFlag.setDescription('Flag to indicate whether routing updates should be suppressed on this interface. To actively perform routing updates, set this object to disabled(0).') usdOspfIfNbrCount = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 7, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfIfNbrCount.setStatus('current') if mibBuilder.loadTexts: usdOspfIfNbrCount.setDescription('Number of OSPF neighbors from this interface.') usdOspfIfAdjNbrCount = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 7, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfIfAdjNbrCount.setStatus('current') if mibBuilder.loadTexts: usdOspfIfAdjNbrCount.setDescription('Number of OSPF adjacent neighbors from this interface.') usdOspfIfMd5AuthKey = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 7, 1, 6), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfIfMd5AuthKey.setStatus('current') if mibBuilder.loadTexts: usdOspfIfMd5AuthKey.setDescription('The MD5 authentication key. When setting this object, the usdOspfIfMd5AuthKeyId must be specified on the same PDU. For simple text authentication type, use ospfIfAuthKey. Setting this object will have the side effect of adding or updating the correspondent entry in usdOspfMd5IntfKeyTable. If key given has less than 16 octets, such value will be appended with zeros to complete 16 octets. The zeros will appended to the right of the given key. Reading this object always results in an OCTET STRING of length zero.') usdOspfIfMd5AuthKeyId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 7, 1, 7), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfIfMd5AuthKeyId.setStatus('current') if mibBuilder.loadTexts: usdOspfIfMd5AuthKeyId.setDescription('The MD5 authentication key ID. When setting this object, usdOspfIfMd5AuthKey must be specified on the same PDU.') usdOspfVirtIfTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 9), ) if mibBuilder.loadTexts: usdOspfVirtIfTable.setStatus('current') if mibBuilder.loadTexts: usdOspfVirtIfTable.setDescription('The Unisphere OSPF virtual interface table describes the OSPF-specific characteristics of virtual interfaces.') usdOspfVirtIfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 9, 1), ) ospfVirtIfEntry.registerAugmentions(("Unisphere-Data-OSPF-MIB", "usdOspfVirtIfEntry")) usdOspfVirtIfEntry.setIndexNames(*ospfVirtIfEntry.getIndexNames()) if mibBuilder.loadTexts: usdOspfVirtIfEntry.setStatus('current') if mibBuilder.loadTexts: usdOspfVirtIfEntry.setDescription('The OSPF virtual interface entry describes OSPF-specific characteristics of one virtual interface.') usdOspfVirtIfMd5AuthKey = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 9, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfVirtIfMd5AuthKey.setStatus('current') if mibBuilder.loadTexts: usdOspfVirtIfMd5AuthKey.setDescription('The MD5 authentication key. When setting this object, the usdOspfVirtIfMd5AuthKeyId must be specified on the same PDU. For simple text authentication type, use ospfVirtIfAuthKey. Setting this object will have the side effect of adding or updating the correspondent entry in usdOspfMd5IntfKeyTable. If key given has less than 16 octets, such value will be appended with zeros to complete 16 octets. The zeros will appended to the right of the given key. Reading this object always results in an OCTET STRING of length zero.') usdOspfVirtIfMd5AuthKeyId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 9, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfVirtIfMd5AuthKeyId.setStatus('current') if mibBuilder.loadTexts: usdOspfVirtIfMd5AuthKeyId.setDescription('The MD5 authentication key id. When setting this object, usdOspfVirtIfMd5AuthKey must be specified on the same psu.') usdOspfNbrTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 10), ) if mibBuilder.loadTexts: usdOspfNbrTable.setStatus('current') if mibBuilder.loadTexts: usdOspfNbrTable.setDescription('The Unisphere OSPF neighbor table describes the OSPF-specific characteristics of neighbors.') usdOspfNbrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 10, 1), ) ospfNbrEntry.registerAugmentions(("Unisphere-Data-OSPF-MIB", "usdOspfNbrEntry")) usdOspfNbrEntry.setIndexNames(*ospfNbrEntry.getIndexNames()) if mibBuilder.loadTexts: usdOspfNbrEntry.setStatus('current') if mibBuilder.loadTexts: usdOspfNbrEntry.setDescription('The OSPF neighbor entry describes OSPF-specific characteristics of one neighbor.') usdOspfNbrLocalIpAddr = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 10, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfNbrLocalIpAddr.setStatus('current') if mibBuilder.loadTexts: usdOspfNbrLocalIpAddr.setDescription('The local IP address on this OSPF circuit.') usdOspfNbrDR = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 10, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfNbrDR.setStatus('current') if mibBuilder.loadTexts: usdOspfNbrDR.setDescription("The neighbor's idea of designated router.") usdOspfNbrBDR = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 10, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfNbrBDR.setStatus('current') if mibBuilder.loadTexts: usdOspfNbrBDR.setDescription("The neighbor's idea of backup designated router.") usdOspfSummImportTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 15), ) if mibBuilder.loadTexts: usdOspfSummImportTable.setStatus('current') if mibBuilder.loadTexts: usdOspfSummImportTable.setDescription('The Unisphere OSPF summary import table describes the OSPF-specific characteristics of network aggregation into the OSPF autonomous system. With this table, the load of advertising many external routes can be reduced by specifying a range which includes some or all of the external routes.') usdOspfSummImportEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 15, 1), ).setIndexNames((0, "Unisphere-Data-OSPF-MIB", "usdOspfSummAggNet"), (0, "Unisphere-Data-OSPF-MIB", "usdOspfSummAggMask")) if mibBuilder.loadTexts: usdOspfSummImportEntry.setStatus('current') if mibBuilder.loadTexts: usdOspfSummImportEntry.setDescription('The OSPF summary import entry describes OSPF-specific characteristics of one summary report.') usdOspfSummAggNet = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 15, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfSummAggNet.setStatus('current') if mibBuilder.loadTexts: usdOspfSummAggNet.setDescription('The summary address for a range of addresses.') usdOspfSummAggMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 15, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfSummAggMask.setStatus('current') if mibBuilder.loadTexts: usdOspfSummAggMask.setDescription('The subnet mask used for the summary route.') usdOspfSummAdminStat = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 15, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(0, 1))).clone(namedValues=NamedValues(("disabled", 0), ("enabled", 1)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfSummAdminStat.setStatus('current') if mibBuilder.loadTexts: usdOspfSummAdminStat.setDescription('The admin status of this summary aggregation.') usdOspfSummRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 15, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfSummRowStatus.setStatus('current') if mibBuilder.loadTexts: usdOspfSummRowStatus.setDescription('This variable displays the status of the entry.') usdOspfMd5IntfTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 16), ) if mibBuilder.loadTexts: usdOspfMd5IntfTable.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5IntfTable.setDescription('The Unisphere OSPF interface MD5 key table describes OSPF-specific characteristics of the MD5 authentication key for the OSPF interfaces. This table is not to be used for the simple password authentication.') usdOspfMd5IntfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 16, 1), ).setIndexNames((0, "OSPF-MIB", "ospfIfIpAddress"), (0, "OSPF-MIB", "ospfAddressLessIf"), (0, "Unisphere-Data-OSPF-MIB", "usdOspfMd5IntfKeyId")) if mibBuilder.loadTexts: usdOspfMd5IntfEntry.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5IntfEntry.setDescription("The OSPF interface MD5 key entry describes OSPF-specific characteristics of one MD5 authentication's interface.") usdOspfMd5IntfKeyId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 16, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfMd5IntfKeyId.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5IntfKeyId.setDescription('The OSPF interface this key belongs to.') usdOspfMd5IntfKeyActive = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 16, 1, 2), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfMd5IntfKeyActive.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5IntfKeyActive.setDescription('Set this object to true(1) in order to have this key active.') usdOspfMd5IntfAuthKey = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 16, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfMd5IntfAuthKey.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5IntfAuthKey.setDescription('The MD5 authentication key. If key given has less than 16 octets, such value will be appended with zeros to complete 16 octets. The zeros will appended to the right of the given key. Reading this object always results in an OCTET STRING of length zero.') usdOspfMd5IntfRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 16, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfMd5IntfRowStatus.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5IntfRowStatus.setDescription('This variable displays the status of the entry.') usdOspfMd5VirtIntfTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 17), ) if mibBuilder.loadTexts: usdOspfMd5VirtIntfTable.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5VirtIntfTable.setDescription('The Unisphere OSPF interface MD5 key table describes OSPF-specific characteristics of the MD5 authentication key for the OSPF interfaces. This table is not to be used for the simple password authentication.') usdOspfMd5VirtIntfEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 17, 1), ).setIndexNames((0, "Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfAreaId"), (0, "Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfNeighbor"), (0, "Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfKeyId")) if mibBuilder.loadTexts: usdOspfMd5VirtIntfEntry.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5VirtIntfEntry.setDescription("The OSPF Interface MD5 Key entry describes OSPF-specific characteristics of one MD5 authentication's interface.") usdOspfMd5VirtIntfAreaId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 17, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfMd5VirtIntfAreaId.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5VirtIntfAreaId.setDescription('The OSPF area ID this key belongs to.') usdOspfMd5VirtIntfNeighbor = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 17, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfMd5VirtIntfNeighbor.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5VirtIntfNeighbor.setDescription('The OSPF neightbor this key belongs to.') usdOspfMd5VirtIntfKeyId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 17, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfMd5VirtIntfKeyId.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5VirtIntfKeyId.setDescription('The OSPF virtual interface this key belongs to.') usdOspfMd5VirtIntfKeyActive = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 17, 1, 4), TruthValue()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfMd5VirtIntfKeyActive.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5VirtIntfKeyActive.setDescription('Set this object to true(1) in order to have this key active.') usdOspfMd5VirtIntfAuthKey = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 17, 1, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 16))).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfMd5VirtIntfAuthKey.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5VirtIntfAuthKey.setDescription('The MD5 authentication key. If key given has less than 16 octets, such value will be appended with zeros to complete 16 octets. The zeros will appended to the right of the given key. Reading this object always results in an OCTET STRING of length zero.') usdOspfMd5VirtIntfRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 17, 1, 6), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfMd5VirtIntfRowStatus.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5VirtIntfRowStatus.setDescription('This variable displays the status of the entry.') usdOspfNetworkRangeTable = MibTable((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 18), ) if mibBuilder.loadTexts: usdOspfNetworkRangeTable.setStatus('current') if mibBuilder.loadTexts: usdOspfNetworkRangeTable.setDescription('The Unisphere OSPF network range table describes the OSPF-specific characteristics of network ranges, encompassing one or multiple OSPF interfaces.') usdOspfNetworkRangeEntry = MibTableRow((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 18, 1), ).setIndexNames((0, "Unisphere-Data-OSPF-MIB", "usdOspfNetRangeNet"), (0, "Unisphere-Data-OSPF-MIB", "usdOspfNetRangeMask"), (0, "Unisphere-Data-OSPF-MIB", "usdOspfNetRangeAreaId")) if mibBuilder.loadTexts: usdOspfNetworkRangeEntry.setStatus('current') if mibBuilder.loadTexts: usdOspfNetworkRangeEntry.setDescription('The Unisphere OSPF network range entry describes OSPF-specific characteristics of one OSPF network range.') usdOspfNetRangeNet = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 18, 1, 1), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfNetRangeNet.setStatus('current') if mibBuilder.loadTexts: usdOspfNetRangeNet.setDescription('The network range address.') usdOspfNetRangeMask = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 18, 1, 2), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfNetRangeMask.setStatus('current') if mibBuilder.loadTexts: usdOspfNetRangeMask.setDescription('The subnet mask used for the network range. Unlike the mask used under the command line interface (CLI), this object is set in the non-inversed format (i.e. not a wild-card mask).') usdOspfNetRangeAreaId = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 18, 1, 3), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: usdOspfNetRangeAreaId.setStatus('current') if mibBuilder.loadTexts: usdOspfNetRangeAreaId.setDescription('The OSPF area ID this network range belongs to.') usdOspfNetRangeRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 1, 18, 1, 4), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: usdOspfNetRangeRowStatus.setStatus('current') if mibBuilder.loadTexts: usdOspfNetRangeRowStatus.setDescription('This variable displays the status of the entry.') usdOspfConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4)) usdOspfCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 1)) usdOspfGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2)) usdOspfCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 1, 1)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfBasicGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfAreaGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfIfGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfVirtIfGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfNbrGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfSummImportGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5IntfGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfNetRangeGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfCompliance = usdOspfCompliance.setStatus('obsolete') if mibBuilder.loadTexts: usdOspfCompliance.setDescription('Obsolete compliance statement for entities which implement the Unisphere OSPF MIB. This statement became obsolete when usdOspfVpnRouteTag, usdOspfDomainId, usdOspfAreaTeCapable and usdOspfMplsTeRtrIdIfIndex were added to the basic group.') usdOspfCompliance2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 1, 2)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfBasicGroup2"), ("Unisphere-Data-OSPF-MIB", "usdOspfAreaGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfIfGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfVirtIfGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfNbrGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfSummImportGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5IntfGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfGroup"), ("Unisphere-Data-OSPF-MIB", "usdOspfNetRangeGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfCompliance2 = usdOspfCompliance2.setStatus('current') if mibBuilder.loadTexts: usdOspfCompliance2.setDescription('The compliance statement for entities which implement the Unisphere OSPF MIB.') usdOspfBasicGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 1)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfProcessId"), ("Unisphere-Data-OSPF-MIB", "usdOspfMaxPathSplits"), ("Unisphere-Data-OSPF-MIB", "usdOspfSpfHoldInterval"), ("Unisphere-Data-OSPF-MIB", "usdOspfNumActiveAreas"), ("Unisphere-Data-OSPF-MIB", "usdOspfSpfTime"), ("Unisphere-Data-OSPF-MIB", "usdOspfRefBw"), ("Unisphere-Data-OSPF-MIB", "usdOspfAutoVlink"), ("Unisphere-Data-OSPF-MIB", "usdOspfIntraDistance"), ("Unisphere-Data-OSPF-MIB", "usdOspfInterDistance"), ("Unisphere-Data-OSPF-MIB", "usdOspfExtDistance"), ("Unisphere-Data-OSPF-MIB", "usdOspfHelloPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfDDPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsrPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsuPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsAckPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfTotalRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsaDiscardCnt"), ("Unisphere-Data-OSPF-MIB", "usdOspfHelloPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfDDPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsrPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsuPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsAckPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfErrPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfTotalSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfCsumErrPkts"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailNbr"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailLsa"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailLsd"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailDbRequest"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailRtx"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailAck"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailDbPkt"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailCirc"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailPkt"), ("Unisphere-Data-OSPF-MIB", "usdOspfOperState")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfBasicGroup = usdOspfBasicGroup.setStatus('obsolete') if mibBuilder.loadTexts: usdOspfBasicGroup.setDescription('Obsolete collection of objects for managing general OSPF capabilities in a Unisphere product. This group became obsolete when usdOspfVpnRouteTag, usdOspfDomainId, usdOspfAreaTeCapable and usdOspfMplsTeRtrIdIfIndex were added.') usdOspfIfGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 2)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfIfCost"), ("Unisphere-Data-OSPF-MIB", "usdOspfIfMask"), ("Unisphere-Data-OSPF-MIB", "usdOspfIfPassiveFlag"), ("Unisphere-Data-OSPF-MIB", "usdOspfIfNbrCount"), ("Unisphere-Data-OSPF-MIB", "usdOspfIfAdjNbrCount"), ("Unisphere-Data-OSPF-MIB", "usdOspfIfMd5AuthKey"), ("Unisphere-Data-OSPF-MIB", "usdOspfIfMd5AuthKeyId")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfIfGroup = usdOspfIfGroup.setStatus('current') if mibBuilder.loadTexts: usdOspfIfGroup.setDescription('A collection of objects which augments the standard MIB objects for managing OSPF Interface capabilities in a Unisphere product.') usdOspfAreaGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 3)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfAreaType"), ("Unisphere-Data-OSPF-MIB", "usdOspfAreaTeCapable")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfAreaGroup = usdOspfAreaGroup.setStatus('current') if mibBuilder.loadTexts: usdOspfAreaGroup.setDescription('An object which augments the standard MIB objects for managing OSPF areas capabilities in a Unisphere product.') usdOspfVirtIfGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 4)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfVirtIfMd5AuthKey"), ("Unisphere-Data-OSPF-MIB", "usdOspfVirtIfMd5AuthKeyId")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfVirtIfGroup = usdOspfVirtIfGroup.setStatus('current') if mibBuilder.loadTexts: usdOspfVirtIfGroup.setDescription('A collection of objects which augments the standard MIB objects for managing OSPF virtual interface capabilities in a Unisphere product.') usdOspfNbrGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 5)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfNbrLocalIpAddr"), ("Unisphere-Data-OSPF-MIB", "usdOspfNbrDR"), ("Unisphere-Data-OSPF-MIB", "usdOspfNbrBDR")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfNbrGroup = usdOspfNbrGroup.setStatus('current') if mibBuilder.loadTexts: usdOspfNbrGroup.setDescription('A collection of objects which augments the standard MIB objects for managing OSPF neighbor capabilities in a Unisphere product.') usdOspfSummImportGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 6)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfSummAggNet"), ("Unisphere-Data-OSPF-MIB", "usdOspfSummAggMask"), ("Unisphere-Data-OSPF-MIB", "usdOspfSummAdminStat"), ("Unisphere-Data-OSPF-MIB", "usdOspfSummRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfSummImportGroup = usdOspfSummImportGroup.setStatus('current') if mibBuilder.loadTexts: usdOspfSummImportGroup.setDescription('A collection of objects for managing OSPF summary report capabilities in a Unisphere product.') usdOspfMd5IntfGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 7)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfMd5IntfKeyId"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5IntfKeyActive"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5IntfAuthKey"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5IntfRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfMd5IntfGroup = usdOspfMd5IntfGroup.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5IntfGroup.setDescription('A collection of objects for managing OSPF MD5 interfaces capabilities in a Unisphere product.') usdOspfMd5VirtIntfGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 8)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfAreaId"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfNeighbor"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfKeyId"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfKeyActive"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfAuthKey"), ("Unisphere-Data-OSPF-MIB", "usdOspfMd5VirtIntfRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfMd5VirtIntfGroup = usdOspfMd5VirtIntfGroup.setStatus('current') if mibBuilder.loadTexts: usdOspfMd5VirtIntfGroup.setDescription('A collection of objects for managing OSPF MD5 virtual interfaces capabilities in a Unisphere product.') usdOspfNetRangeGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 9)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfNetRangeNet"), ("Unisphere-Data-OSPF-MIB", "usdOspfNetRangeMask"), ("Unisphere-Data-OSPF-MIB", "usdOspfNetRangeAreaId"), ("Unisphere-Data-OSPF-MIB", "usdOspfNetRangeRowStatus")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfNetRangeGroup = usdOspfNetRangeGroup.setStatus('current') if mibBuilder.loadTexts: usdOspfNetRangeGroup.setDescription('A collection of objects for managing OSPF network range capabilities in a Unisphere product.') usdOspfBasicGroup2 = ObjectGroup((1, 3, 6, 1, 4, 1, 4874, 2, 2, 14, 4, 2, 10)).setObjects(("Unisphere-Data-OSPF-MIB", "usdOspfProcessId"), ("Unisphere-Data-OSPF-MIB", "usdOspfMaxPathSplits"), ("Unisphere-Data-OSPF-MIB", "usdOspfSpfHoldInterval"), ("Unisphere-Data-OSPF-MIB", "usdOspfNumActiveAreas"), ("Unisphere-Data-OSPF-MIB", "usdOspfSpfTime"), ("Unisphere-Data-OSPF-MIB", "usdOspfRefBw"), ("Unisphere-Data-OSPF-MIB", "usdOspfAutoVlink"), ("Unisphere-Data-OSPF-MIB", "usdOspfIntraDistance"), ("Unisphere-Data-OSPF-MIB", "usdOspfInterDistance"), ("Unisphere-Data-OSPF-MIB", "usdOspfExtDistance"), ("Unisphere-Data-OSPF-MIB", "usdOspfHelloPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfDDPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsrPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsuPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsAckPktsRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfTotalRcv"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsaDiscardCnt"), ("Unisphere-Data-OSPF-MIB", "usdOspfHelloPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfDDPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsrPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsuPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfLsAckPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfErrPktsSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfTotalSent"), ("Unisphere-Data-OSPF-MIB", "usdOspfCsumErrPkts"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailNbr"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailLsa"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailLsd"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailDbRequest"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailRtx"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailAck"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailDbPkt"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailCirc"), ("Unisphere-Data-OSPF-MIB", "usdOspfAllocFailPkt"), ("Unisphere-Data-OSPF-MIB", "usdOspfOperState"), ("Unisphere-Data-OSPF-MIB", "usdOspfVpnRouteTag"), ("Unisphere-Data-OSPF-MIB", "usdOspfDomainId"), ("Unisphere-Data-OSPF-MIB", "usdOspfMplsTeRtrIdIfIndex")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): usdOspfBasicGroup2 = usdOspfBasicGroup2.setStatus('current') if mibBuilder.loadTexts: usdOspfBasicGroup2.setDescription('A collection of objects for managing general OSPF capabilities in a Unisphere product.') mibBuilder.exportSymbols("Unisphere-Data-OSPF-MIB", usdOspfSpfHoldInterval=usdOspfSpfHoldInterval, usdOspfTotalRcv=usdOspfTotalRcv, usdOspfNetworkRangeEntry=usdOspfNetworkRangeEntry, usdOspfIfEntry=usdOspfIfEntry, usdOspfDDPktsRcv=usdOspfDDPktsRcv, usdOspfNetRangeRowStatus=usdOspfNetRangeRowStatus, usdOspfAllocFailPkt=usdOspfAllocFailPkt, usdOspfIfPassiveFlag=usdOspfIfPassiveFlag, usdOspfSummImportEntry=usdOspfSummImportEntry, usdOspfLsuPktsSent=usdOspfLsuPktsSent, usdOspfMd5VirtIntfAuthKey=usdOspfMd5VirtIntfAuthKey, usdOspfVpnRouteTag=usdOspfVpnRouteTag, usdOspfAreaTable=usdOspfAreaTable, usdOspfMd5VirtIntfGroup=usdOspfMd5VirtIntfGroup, usdOspfAllocFailLsd=usdOspfAllocFailLsd, usdOspfMaxPathSplits=usdOspfMaxPathSplits, usdOspfMd5IntfKeyActive=usdOspfMd5IntfKeyActive, usdOspfLsAckPktsRcv=usdOspfLsAckPktsRcv, usdOspfDDPktsSent=usdOspfDDPktsSent, usdOspfNbrDR=usdOspfNbrDR, usdOspfAllocFailDbPkt=usdOspfAllocFailDbPkt, usdOspfMd5IntfEntry=usdOspfMd5IntfEntry, usdOspfCsumErrPkts=usdOspfCsumErrPkts, usdOspfIntraDistance=usdOspfIntraDistance, usdOspfGroups=usdOspfGroups, usdOspfMIB=usdOspfMIB, usdOspfNbrLocalIpAddr=usdOspfNbrLocalIpAddr, usdOspfAreaType=usdOspfAreaType, usdOspfMd5VirtIntfAreaId=usdOspfMd5VirtIntfAreaId, usdOspfAllocFailDbRequest=usdOspfAllocFailDbRequest, usdOspfIfCost=usdOspfIfCost, usdOspfDomainId=usdOspfDomainId, usdOspfNetworkRangeTable=usdOspfNetworkRangeTable, usdOspfCompliance2=usdOspfCompliance2, usdOspfGeneralGroup=usdOspfGeneralGroup, usdOspfMd5IntfKeyId=usdOspfMd5IntfKeyId, usdOspfNbrBDR=usdOspfNbrBDR, usdOspfInterDistance=usdOspfInterDistance, usdOspfCompliance=usdOspfCompliance, usdOspfAllocFailCirc=usdOspfAllocFailCirc, usdOspfNbrGroup=usdOspfNbrGroup, usdOspfVirtIfMd5AuthKeyId=usdOspfVirtIfMd5AuthKeyId, usdOspfMd5VirtIntfKeyId=usdOspfMd5VirtIntfKeyId, usdOspfAllocFailAck=usdOspfAllocFailAck, usdOspfSummRowStatus=usdOspfSummRowStatus, usdOspfVirtIfGroup=usdOspfVirtIfGroup, usdOspfSummAdminStat=usdOspfSummAdminStat, usdOspfLsAckPktsSent=usdOspfLsAckPktsSent, usdOspfLsaDiscardCnt=usdOspfLsaDiscardCnt, usdOspfMd5IntfRowStatus=usdOspfMd5IntfRowStatus, usdOspfMd5VirtIntfRowStatus=usdOspfMd5VirtIntfRowStatus, usdOspfExtDistance=usdOspfExtDistance, usdOspfSummImportGroup=usdOspfSummImportGroup, usdOspfIfAdjNbrCount=usdOspfIfAdjNbrCount, usdOspfSummImportTable=usdOspfSummImportTable, usdOspfHelloPktsSent=usdOspfHelloPktsSent, usdOspfMd5VirtIntfNeighbor=usdOspfMd5VirtIntfNeighbor, usdOspfIfMd5AuthKeyId=usdOspfIfMd5AuthKeyId, usdOspfNetRangeMask=usdOspfNetRangeMask, usdOspfAllocFailNbr=usdOspfAllocFailNbr, usdOspfAutoVlink=usdOspfAutoVlink, usdOspfLsuPktsRcv=usdOspfLsuPktsRcv, usdOspfNbrTable=usdOspfNbrTable, usdOspfAreaTeCapable=usdOspfAreaTeCapable, usdOspfBasicGroup2=usdOspfBasicGroup2, usdOspfMd5IntfTable=usdOspfMd5IntfTable, usdOspfNumActiveAreas=usdOspfNumActiveAreas, usdOspfIfMd5AuthKey=usdOspfIfMd5AuthKey, usdOspfSummAggMask=usdOspfSummAggMask, usdOspfAreaEntry=usdOspfAreaEntry, usdOspfIfGroup=usdOspfIfGroup, usdOspfOperState=usdOspfOperState, usdOspfIfMask=usdOspfIfMask, usdOspfMd5IntfAuthKey=usdOspfMd5IntfAuthKey, usdOspfSummAggNet=usdOspfSummAggNet, usdOspfMplsTeRtrIdIfIndex=usdOspfMplsTeRtrIdIfIndex, usdOspfLsrPktsSent=usdOspfLsrPktsSent, usdOspfNetRangeAreaId=usdOspfNetRangeAreaId, usdOspfSpfTime=usdOspfSpfTime, usdOspfHelloPktsRcv=usdOspfHelloPktsRcv, usdOspfNbrEntry=usdOspfNbrEntry, usdOspfMd5IntfGroup=usdOspfMd5IntfGroup, usdOspfNetRangeGroup=usdOspfNetRangeGroup, usdOspfIfNbrCount=usdOspfIfNbrCount, usdOspfVirtIfTable=usdOspfVirtIfTable, PYSNMP_MODULE_ID=usdOspfMIB, usdOspfErrPktsSent=usdOspfErrPktsSent, usdOspfRefBw=usdOspfRefBw, usdOspfVirtIfMd5AuthKey=usdOspfVirtIfMd5AuthKey, usdOspfAllocFailRtx=usdOspfAllocFailRtx, usdOspfObjects=usdOspfObjects, usdOspfAreaGroup=usdOspfAreaGroup, usdOspfLsrPktsRcv=usdOspfLsrPktsRcv, usdOspfCompliances=usdOspfCompliances, usdOspfBasicGroup=usdOspfBasicGroup, usdOspfTotalSent=usdOspfTotalSent, usdOspfConformance=usdOspfConformance, usdOspfVirtIfEntry=usdOspfVirtIfEntry, usdOspfIfTable=usdOspfIfTable, usdOspfMd5VirtIntfTable=usdOspfMd5VirtIntfTable, usdOspfNetRangeNet=usdOspfNetRangeNet, usdOspfMd5VirtIntfEntry=usdOspfMd5VirtIntfEntry, usdOspfMd5VirtIntfKeyActive=usdOspfMd5VirtIntfKeyActive, usdOspfProcessId=usdOspfProcessId, usdOspfAllocFailLsa=usdOspfAllocFailLsa)
Student=[] for i in range(1,11): names=input("enter names=") Student.append(names) print(Student) for j in range(1,11): subjects = input("enter subjects=") Student.append(subjects) print("list=",Student) #removes the element at index 1 Student.remove(Student[1]) print("Elemet at index 1 is removed=",Student) #removes the last element Student.remove(Student[-1]) print("Elemet at last index is removed=",Student) #prints the list in reverse order Student.reverse() print("Elements are printed in reverse order=",Student)
# Returns the settings config for an experiment # class Settings(): def __init__(self, client): self.client = client # Return the settings corresponding to the experiment. # '/alpha/settings/' GET # # experiment - Experiment id to filter by. def get(self, experiment, options = {}): body = options['query'] if 'query' in options else {} body['experiment'] = experiment response = self.client.get('/alpha/settings/', body, options) return response
def print_formatted(number): length = len(format(number, 'b')) for i in range(1, number + 1): print(f'{i:{length}d} {i:{length}o} {i:{length}X} {i:{length}b}') if __name__ == '__main__': n = 20 print_formatted(n)
# author: brian dillmann # for rscs class State: def __init__(self, name): if not isinstance(name, basestring): raise TypeError('State name must be a string') if not len(name): raise ValueError('Cannot create State with empty name') self.name = name self.transitions = [] self.outputs = {} def addOutputVal(self, deviceName, val): self.outputs[deviceName] = bool(val) def addTransition(self, transition): self.transitions.push(transition)
# -*- encoding: UTF-8 -*- """ 权限, 权限对象为 Festival, 每个 Festival 都包含 owner 和 access 两部分. access 即对 Festival 的 "增删改查" 操作. 将其简化为读/写两类, 分别为: * 读: 查 * 写: 增删改 其管理对象为 User, 分为两类: owner 和 other. owner 为创建 Festival 的 User. 另外, 还有一类特殊的 User -- root, 其包含所有 Festival 的读/写权限. 权限的读/写表示用 bit 来表达. 从低位到高位, 分别为读, 写. 0 表示不具备该权限, 1 则表示有该权限. 例如: * owner = 3, 表示 owner 拥有读/写权限 * other = 2, 表示 other 拥有写权限, 但是不具备读权限 (虽然这样不合逻辑) """ class Access(object): """ 权限对象 """ rbit = 0x01 # 读的 bit wbit = 0x02 # 写的 bit def __init__(self, owner, other): assert 0 <= owner <= 3, 'invalid owner access' self.owner = owner assert 0 <= other <= 3, 'invalid other access' self.other = other @property def other_read(self): """ other 是否有读的权限 :return: 返回 other 是否有读的权限 """ return bool(self.other & self.__class__.rbit) @property def other_write(self): """ other 是否有写的权限 :return: 返回 other 是否有写的权限 """ return bool(self.other & self.__class__.wbit) @property def owner_read(self): """ owner 是否有读的权限 :return: 返回 owner 是否有读的权限 """ return bool(self.owner & self.__class__.rbit) @property def owner_write(self): """ owner 是否有写的权限 :return: 返回 owner 是否有写的权限 """ return bool(self.owner & self.__class__.wbit) # 公共节日的权限, 作为预设. # * owner (root) -> 读/写 # * other -> 读 public_festival_access = Access(3, 1) # 私人节日的权限, 作为预设. # * owner -> 读/写 # * other -> 没有权限 private_festival_access = Access(3, 0)
ids = dict() for line in open('feature/fluidin.csv'): id=line.split(',')[1] ids[id] = ids.get(id, 0) + 1 print(ids)
""" Relation Extraction. """ __version__ = 0.3
# Written by Matheus Violaro Bellini ######################################## # This is a quick tool to visualize the values # that a half floating point can achieve # # To use this code, simply input the index # of the binary you want to change in the # list shown and it will update its value. ######################################## # half (16 bits) normalized expression: (-1)^s * (1.d1d2d3...dt) * 2^(e - 15) def interpret_float(num): result = 0 base = 0 is_negative = 0 if (num[0] == 1): is_negative = 1 # special values is_zero = (num[2] == num[3] == num[4] == num[5] == num[6] == 0) is_one = (num[2] == num[3] == num[4] == num[5] == num[6] == 1) if (is_zero): return 0 elif (is_one and is_negative): return "-Inf" elif (is_one and ~is_negative): return "inf" # mantissa j = 17 for i in range(-10, 0): result += num[j] * (2 ** i) j = j - 1 result += 1 # rest j = 6 for i in range(0, 5): base += num[j] * (2 ** i) j = j -1 result = result * (2 ** (base - 15)) if (is_negative): return -result return result my_half = [0, "|", 0, 0, 0, 0, 0, "|", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] while(1): print(str(my_half) + " = " + str(interpret_float(my_half))) index = int(input("index: ")) value = int(input("value: ")) if (my_half[index] != "|"): my_half[index] = value
def sum_fibs(n): fibo = [] a, b = 0, 1 even_sum = 0 for i in range(2, n+1): a, b = b, a+b fibo.append(b) for x in fibo: if x % 2 == 0: even_sum = even_sum + x return even_sum print(sum_fibs(9))
# Recursion needs two things: # 1: A base case (if x then y) # 2: A Recursive (inductive) case # a way to simplify the problem after simple ops. # 1: factorial def factorial(fact): if fact <= 1: # Base Case: x=1 return 1 else: return fact * factorial(fact-1) print(factorial(6)) def exponential(b, n): if n == 1: return b else: return b * exponential(b, n-1) print(exponential(2, 5)) def palindrome(strPalindrome): if len(strPalindrome) <= 1: return True else: return strPalindrome[0] == strPalindrome[-1] and palindrome(strPalindrome[1:-1]) print(palindrome('racecar')) def fibonacci(n): # Assumes input > 0 if n<=1: return 1 else: return fibonacci(n-1)+fibonacci(n-2) #rabbits model #1 pair of rabits start #sexual maturity and gestation period of 1 month #never die #always produces 1 pair
# Subset rows from India, Hyderabad to Iraq, Baghdad print(temperatures_srt.loc[("India", "Hyderabad"):("Iraq", "Baghdad")]) # Subset columns from date to avg_temp_c print(temperatures_srt.loc[:, "date":"avg_temp_c"]) # Subset in both directions at once print(temperatures_srt.loc[("India", "Hyderabad"):("Iraq", "Baghdad"), "date":"avg_temp_c"])
class CronMonth(int): """ Job Manager cron scheduling month. -1 represents all months and only supported for cron schedule create and modify. Range : [-1..11]. """ @staticmethod def get_api_name(): return "cron-month"
# 15/15 number_of_lines = int(input()) compressed_messages = [] for _ in range(number_of_lines): decompressed = input() compressed = "" symbol = "" count = 0 for character in decompressed: if not symbol: symbol = character count = 1 continue if character == symbol: count += 1 continue compressed += f"{count}{symbol}" symbol = character count = 1 compressed += f"{count}{symbol}" compressed_messages.append(compressed) for message in compressed_messages: print(message)
total = 0 mil = 0 menor = 0 barato = '' while True: nome_produto = str(input('Nome do produto: ')).upper() preco_produto = float(input('Preço do Produto: ')) total += preco_produto if preco_produto >= 1000: mil += 1 if mil == 1: menor = preco_produto barato = nome_produto else: if preco_produto < menor: menor = preco_produto barato = nome_produto continuar = str(input('Quer continuar? [S/N]: ')).strip().upper() if continuar == 'N': break print(f'O valor total da compra é R${total}') print(f'{mil} Produtos custam menos de R$ 1.000') print(f'O produto mais barato foi {nome_produto} que custa R${menor}')
class Score: def __init__(self): self._score = 0 def get_score(self): return self._score def add_score(self, score): self._score += score
h, w = map(int, input().split()) a = [] for i in range(h):#h:高さ a.append([int(m) for m in input().split()]) n = 0 printlist= [] for i in range(h): for j in range(w): if i % 2 == 0 and j == w - 1: nx = j ny = i + 1 if i == h - 1: break elif i % 2 == 0 and j != w - 1: nx = j + 1 ny = i elif i % 2 != 0 and j == w - 1: j = w - j - 1 nx = j ny = i + 1 if i == h - 1: break elif i % 2 != 0 and j != w - 1: j = w - j - 1 nx = j - 1 ny = i if a[i][j] % 2 != 0: a[i][j] -= 1 a[ny][nx] += 1 printlist.append([i + 1, j + 1, ny + 1, nx + 1]) n += 1 print(n) for i in range(n): print(printlist[i][0], printlist[i][1], printlist[i][2], printlist[i][3])
# -*- coding: utf-8 -*- """ step9.data.version1.BeaconV1 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BeaconV1 class :copyright: Conceptual Vision Consulting LLC 2018-2019, see AUTHORS for more details. :license: MIT, see LICENSE for more details. """ class BeaconV1(dict): def __init__(self, id, site_id, type, udi, label, center, radius): super(BeaconV1, self).__init__() self['id'] = id self['site_id'] = site_id self['type'] = type self['udi'] = udi self['label'] = label self['center'] = center self['radius'] = radius # set class attributes in runtime for attr in self: setattr(self, attr, self[attr])
''' 1. def A(a): best=int(max(a)) res=0 for i in a: i=int(i) if i>=best-10: print('Student '+str(res)+' socore is '+str(i)+' and grade is A') elif i>=best-20: print('Student '+str(res)+' socore is '+str(i)+' and grade is B') elif i >=best-30: print('Student '+str(res)+' socore is '+str(i)+' and grade is C') elif i>= best-40: print('Student '+str(res)+' socore is '+str(i)+' and grade is D') else: print('Student '+str(res)+' socore is '+str(i)+' and grade is F') res+=1 a,b,c,d=eval(input()) s=[a,b,c,d] A(s) ''' ''' 2. def a(b): print(b[::-1]) c=str(input()) c=c.split() a(c) ''' ''' 3. def count(num): num = num.split() s = [] for q in range(0, 102): s.append(0) for i in range(len(num)): s[int(num[i])] += 1 for i in range(0, 102): if s[i] != 0: if s[i] == 1: print(str(i) + " occurs " + str(s[i]) + " time") else: print(str(i) + " occurs " + str(s[i]) + " times") num = input("Enter integers between 1 and 100: ") count(num) ''' ''' 4. def a(b): s=0 n=0 y=0 z=0 for i in b: i=int(i) s=s+i n+=1 p=s/n for x in b: x=int(x) if x<p: y+=1 elif x>p: z+=1 print('大于 '+str(z)+' 小于 '+str(y)) c=input() c=c.split() a(c) ''' ''' 5. def a(): import random counts=[] for i in range(10): counts.append(0) s=[] for n in range(1000): z=random.randint(0,9) s.append(z) for m in s: counts[m]+=1 for x in range(len(counts)): print(str(x)+' : '+str(counts[x])) a() ''' ''' 6. def index0fSmallestElement(lst): c=min(lst) for i in range(len(lst)): if c==lst[i]: print(lst[i],i) break a=input() a=a.split() index0fSmallestElement(a) ''' ''' 7. def a(b): import random c=[] x=len(b) for i in range(len(b)): z=random.randint(0,x-1) x-=1 y=b.pop(z) c.append(y) print(c) u=input() u=u.split() a(u) ''' ''' 8. def a(b): x=[] for i in b: if i not in x: x.append(i) print(x) c=input() c=c.split() a(c) ''' ''' 9. def a(b): for i in range(1,len(b)): if int(b[i])>=int(b[i-1]): if i ==len(b)-1: print('The list is already sorted') else: print('The list is not sorted') break c=input() c=c.split() a(c) ''' ''' 10. def a(b): for n in range(len(b)-1): for i in range(len(b)-n-1): if int(b[i])>int(b[i+1]): b[i],b[i+1]=b[i+1],b[i] print(b) c=input() c=c.split() a(c) ''' ''' 11. def a(): import random m=0 b=['1','2','3','4','5','6','7','8','9','10','11','12','13'] c=['hongtao','heitao','meihua','fangkuai'] while 1: z=[] for i in range(4): x=random.randint(0,len(b)-1) y=random.randint(0,len(c)-1) z.append(b[x]) z.append(c[y]) m+=1 g=z[0]+z[1] h=z[2]+z[3] j=z[4]+z[5] k=z[6]+z[7] if z[1]!=z[3] and z[1]!=z[5] and z[1]!=z[7] and z[3]!=z[5] and z[3]!=z[7] and z[5]!=z[7]: print(m,' 牌 ',g,h,j,k) break a() ''' ''' 12. def a(b): m=0 for i in range(len(b)-3): if b[i]==b[i+1] and b[i]==b[i+2] and b[i]==b[i+3]: print('包含') else: m+=1 if m==len(b)-3: print('不包含') c=input() c=c.split() a(c) '''
# coding: utf-8 password_livechan = 'annacookie' url = 'https://kotchan.org' kotch_url = 'http://0.0.0.0:8888'
"""Familytable module.""" def add_inst(client, instance, file_=None): """Add a new instance to a family table. Creates a family table if one does not exist. Args: client (obj): creopyson Client. instance (str): New instance name. `file_` (str, optional): File name. Defaults is currently active model. Returns: None """ data = {"instance": instance} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "add_inst", data) def create_inst(client, instance, file_=None): """Create a new model from a family table row. Args: client (obj): creopyson Client. instance (str): Instance name. `file_` (str, optional): File name. Defaults is currently active model. Returns: (str): New model name. """ data = {"instance": instance} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "create_inst", data, "name") def delete_inst(client, instance, file_=None): """Delete an instance from a family table. Args: client (obj): creopyson Client. instance (str): Instance name. `file_` (str, optional): File name. Defaults is currently active model. Returns: None """ data = {"instance": instance} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "delete_inst", data) def delete(client, file_=None): """Delete an entire family table. Args: client (obj): creopyson Client. `file_` (str, optional): File name (wildcards allowed: True). Defaults is currently active model. Returns: None """ data = {} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "delete", data) def exists(client, instance, file_=None): """Check whether an instance exists in a family table. Args: client (obj): creopyson Client. instance (str): Instance name. `file_` (str, optional): File name. Defaults is currently active model. Returns: (boolean): Whether the instance exists in the model's family table; returns false if there is no family table in the model. """ data = {"instance": instance} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "exists", data, "exists") def get_cell(client, instance, colid, file_=None): """Get one cell of a family table. Args: client (obj): creopyson Client. instance (str): Instance name. colid (str): Colimn ID. `file_` (str, optional): File name. Defaults is currently active model. Returns: (dict): instance (str): Family Table instance name. colid (str): Column ID. value (depends on datatype): Cell value. datatype (str): Data type. coltype (str): Column Type; a string corresponding to the Creo column type. """ data = {"instance": instance, "colid": colid} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "get_cell", data) def get_header(client, file_=None): """Get the header of a family table. Args: client (obj): creopyson Client. `file_` (str, optional): File name. Defaults is currently active model. Returns: (list:dict): colid (str): Column ID. value (depends on date type): Cell value. datatype (str): Data type. Valid values: STRING, DOUBLE, INTEGER, BOOL, NOTE. coltype (str): Column Type; a string corresponding to the Creo column type. """ data = {} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "get_header", data, "columns") def get_parents(client, file_=None): """Get the parent instances of a model in a nested family table. Args: client (obj): creopyson Client. `file_` (str, optional): File name. Defaults is currently active model. Returns: (list:str): List of parent instance names, starting with the immediate parent and working back. """ data = {} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "get_parents", data, "parents") def get_row(client, instance, file_=None): """Get one row of a family table. Args: client (obj): creopyson Client. instance (str): Instance name. `file_` (str, optional): File name. Defaults is currently active model. Returns: (dict): colid (str): Column ID. value (depends on datatype): Cell value. datatype (str): Data type. coltype (str): Column Type; a string corresponding to the Creo column type. """ data = {"instance": instance} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "get_row", data, "columns") def list_(client, file_=None, instance=None): """List the instance names in a family table. Args: client (obj): creopyson Client. instance (str, optional): Instance name filter (wildcards allowed: True). Defaults is all instances. `file_` (str, optional): File name. Defaults is currently active model. Returns: (list:str): List of matching instance names """ data = {} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] if instance: data["instance"] = instance return client._creoson_post("familytable", "list", data, "instances") def list_tree(client, file_=None, erase=None): """Get a hierarchical structure of a nested family table. Args: client (obj): creopyson Client. `file_` (str, optional): File name. Defaults is currently active model. erase (boolean, optional): Erase model and non-displayed models afterwards. Defaults is `False`. Returns: (list:str): List of child instances total (int): Count of all child instances including their decendants. children (list:dict): name (str): Name of the family table instance. total (int): Count of all child instances including their decendants. children (list:dict): List of child instances. """ data = {} if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] if erase: data["erase"] = erase return client._creoson_post("familytable", "list_tree", data, "children") def replace(client, cur_model, new_inst, file_=None, cur_inst=None, path=None): """Replace a model in an assembly with another inst in the same family table. You must specify either cur_inst or path. Args: client (obj): creopyson Client. cur_model (str): Generic model containing the instances. new_inst (str): New instance name. `file_` (str, optional): File name (usually an assembly). Defaults is currently active model. cur_inst (str): Instance name to replace. Defaults to None. path (list:int, optional): Path to component to replace. Defaults to None. Returns: None """ data = { "cur_model": cur_model, "new_inst": new_inst, } if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] if cur_inst: data["cur_inst"] = cur_inst if path: data["path"] = path return client._creoson_post("familytable", "replace", data) # TODO: path/cur_inst def set_cell(client, instance, colid, value, file_=None): """Set the value of one cell of a family table. Args: client (obj): creopyson Client. instance (str): Family Table instance name. colid (str): Column ID. value (depends on data type): Cell value. `file_` (str, optional): File name (usually an assembly). Defaults is currently active model. Returns: None """ data = { "instance": instance, "colid": colid, "value": value, } if file_ is not None: data["file"] = file_ else: active_file = client.file_get_active() if active_file: data["file"] = active_file["file"] return client._creoson_post("familytable", "set_cell", data)
a=input() k = -1 for i in range(len(a)): if a[i] == '(': k=i print(a[:k].count('@='),a[k+5:].count('=@'))
# -*- coding: utf-8 -*- def main(): s = input() k = int(input()) one_count = 0 for si in s: if si == '1': one_count += 1 else: break if s[0] == '1': if k == 1: print(s[0]) elif one_count >= k: print(1) elif one_count < k: print(s[one_count]) else: print(s[1]) else: print(s[0]) if __name__ == '__main__': main()
# Huu Hung Nguyen # 09/19/2021 # windchill.py # The program prompts the user for the temperature in Celsius, # and the wind velocity in kilometers per hour. # It then calculates the wind chill temperature and prints the result. # Prompt user for temperature in Celsius temp = float(input('Enter temperature in degrees Celsius: ')) # Prompt user for wind velocity in kilometers per hour wind_velocity = float(input('Enter wind velocity in kilometers/hour: ')) # Calculate wind chill temperature wind_chill_temp = 13.12 + (0.6215 * temp) - (11.37 * wind_velocity**0.16) + (0.3965 * temp * wind_velocity**0.16) # Print result print(f'The wind chill temperature in degrees Celsius is {wind_chill_temp:.3f}.')
def read_next(*args, **kwargs): for arg in args: for elem in arg: yield elem for item in kwargs.keys(): yield item for item in read_next("string", (2,), {"d": 1, "I": 2, "c": 3, "t": 4}): print(item, end='') for i in read_next("Need", (2, 3), ["words", "."]): print(i)
class Enrollment: def __init__(self, eid, s, c, g): self.enroll_id = eid self.course = c self.student = s self.grade = g
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def getIntersectionNode(self, headA: ListNode, headB: ListNode) -> ListNode: cl = headA cr = headB cc = {} while cl != None: cc[cl] = 1 cl = cl.next while cr != None: if cr in cc: return cr else: cr = cr.next return None
class Light: def __init__(self, always_on: bool, timeout: int): self.always_on = always_on self.timeout = timeout
class PrimeNumbers: def getAllPrimes(self, n): sieves = [True] * (n + 1) for i in range(2, n + 1): if i * i > n: break if sieves[i]: for j in range(i + i, n + 1, i): sieves[j] = False for i in range(2, n + 1): if sieves[i]: print(i) pn = PrimeNumbers() pn.getAllPrimes(29)
""" Data for testing """ POP_ACTIVITY = """ $=================================================== $ Carbon activity data in the fcc phase $=================================================== CREATE_NEW_EQUILIBRIUM 1 1 CHANGE_STATUS PHASE FCC_A1=FIX 1 CHANGE_STATUS PHASE GRAPHITE=D SET_REFERENCE_STATE C GRAPHITE,,,, SET_CONDITION P=101325 T=1273 X(MN)=0.03 SET_CONDITION X(C)=0.03 EXPERIMENT ACR(C)=0.29:5% LABEL ACTI """ POP_DRIVING_FORCE = """ $=================================================== $ DRIVING FORCE CONSTRAINTS ORT - (ORT+Delta) $=================================================== $ $ CREATE_NEW_EQUILIBRIUM 5,1 CHANGE_STATUS PHASE *=SUS CHANGE_STATUS PHASE ORT=FIX 1 CHANGE_STATUS PHASE DEL=DOR SET_REFERENCE_STATE Ti,HCP,,,,,, SET_REFERENCE_STATE U,ORT,,,,,, SET_CONDITION P=102325,T=673 SET_CONDITION X(Ti)=0.03 EXPERIMENT DGMR(ORT)>0:0.001 EXPERIMENT DGMR(DEL)<0:0.001 SET_START_VALUE T=673,X(Ti)=0.03 LABEL ADRIV """ POP_ENTROPY = """ $ $=================================================== $ Entropy at 298.15 K of Cu2O $=================================================== CREATE_NEW_EQUILIBRIUM 1 1 CHANGE_STATUS PHASE CU2O=FIX 1 CHANGE_STATUS PHASE CUO=FIX 0 SET_CONDITION P=101325 T=298.15 EXPERIMENT S=92.36:1 EXPERIMENT ACR(C)=0.29:5% LABEL AENT """ POP_EUTECTOID = """ $---------------------------------------------------------- $ EUTECTOID BCC(Ti,U) - (Ti)rt + TiU2 $ T=928 X(Ti)=.85 $========================================================= CREATE_NEW_EQUILIBRIUM 1,1 CHANGE_STATUS PHASE BCC,HCP,DEL=FIX 1 SET_CONDITION P=102325 EXPERIMENT T=928:10 EXPERIMENT X(BCC,Ti)=0.85:0.03 EXPERIMENT X(HCP,Ti)=0.99:0.03 EXPERIMENT X(DEL,Ti) =0.33:0.03 SET_ALTERNATE_CONDITION X(HCP,Ti)=0.99:0.03 SET_ALTERNATE_CONDITION X(DEL,Ti)=0.33:0.03 LABEL AEUO SET_START_VALUE T=928,X(Ti)=0.85 """ POP_GIBBS_ENERGY = """ $ $=================================================== $ Gibbs energy of formation of NiAl2O4 $=================================================== CREATE_NEW_EQUILIBRIUM 1 1 CHANGE_STATUS PHASE SPINEL=ENT 1 CHANGE_STATUS PHASE FCC O2GAS=DORM SET_REFERENCE_STATE NI FCC,,,, SET_REFERENCE_STATE AL FCC,,,, SET_REFERENCE_STATE O O2GAS,,,, SET_CONDITION P=101325 T=1000 N(NI)=1 N(AL)=2 SET_CONDITION N(O)=4 EXPERIMENT GM=-298911:5% LABEL AGEN $ ----------- """ POP_HEAT_CAPACITY = """ $ $=================================================== $ Heat capacity of MgFe2O4 $=================================================== CREATE_NEW_EQUILIBRIUM 1 1 CHANGE_STATUS PHASE SPINEL=ENT 1 SET_CONDITION P=101325 N(FE)=2 N(MG)=1 N(O)=4 SET_CONDITION T=800 ENTER_SYMBOL FUNCTION CP=H.T; EXPERIMENT CP=207:5% LABEL ACP $ ----------- """ POP_LATTICE_PARAMETER = """ $ $=================================================== $ Lattice parameter for fcc $=================================================== CREATE_NEW_EQUILIBRIUM 1 1 CHANGE_STATUS PHASE FCC_A1=ENT 1 SET_CONDITION P=101325 N=1 T=298.15 SET_CONDITION X(CR)=0.05 EXPERIMENT LPFCC=4.02:5% LABEL ALAT """ POP_LATTICE_PARAMETER_ABBREVIATED_EXPERIMENT = """ $ $=================================================== $ Lattice parameter for fcc $=================================================== CREATE_NEW_EQUILIBRIUM 1 1 CHANGE_STATUS PHASE FCC_A1=ENT 1 SET_CONDITION P=101325 N=1 T=298.15 SET_CONDITION X(CR)=0.05 EXP LPFCC=4.02:5% LABEL ALAT """ POP_TABLE_X_HMR = """ $=================================================== $ BCC FORMATION ENTHALPIES X(TI)=0.1 TO 0.6 $=================================================== TABLE_HEAD 540 CREATE_NEW_EQUILIBRIUM @@,1 CHANGE_STATUS PHASE *=SUS CHANGE_STATUS PHASE BCC_A2=FIXED 1 SET_REFERENCE_STATE U BCC_A2,,,,,, SET_REFERENCE_STATE Ti BCC_A2,,,,,, SET_CONDITION P=102325 T=200 SET_CONDITION X(Ti)=@1 LABEL AHMR1 EXPERIMENT HMR(BCC_A2)=@2:500 TABLE_VALUES $ X(Ti) HMR 0.10 2450 0.20 3000 0.30 2990 0.40 2430 0.50 1400 0.60 -65 TABLE_END $ ----------- """ POP_TABLE_EXPERIMENT_FIRST_COLUMN = """ TABLE_HEAD 40 CREATE_NEW_EQUILIBRIUM @@,1 CHANGE_STATUS PHASE *=SUS CHANGE_STATUS PHASE LIQUID=FIX 1 CHANGE_STATUS PHASE BCC=FIX 0 SET_CONDITION P=102325 SET_CONDITION T=@2 EXPERIMENT X(LIQUID,Ti)=@1:0.01 LABEL AREV SET_START_VALUE X(LIQUID,Ti)=@1 TABLE_VALUES $ X(Ti) T 0.00 1406 0.0045 1420 0.01 1445 0.02 1446 0.03 1495 0.04 1563 0.05 1643 0.10 1957 0.15 2093 0.20 2117 0.30 2198 TABLE_END $---------------------------------------------------------- """ POP_FROM_PARROT = """ $ *** OUTPUT FROM THERMO-OPTIMIZER MODULE PARROT *** $ Date 2010. 6.15 $ This output should be possible to use as input to the COMPILE command. $ $ Note that the following problems remain: $ 1. Long lines not handeled gracefully $ 2. Tables for experiments not used $ 3. Some functions may have to be moved to an equilibria ENTER_SYMBOL CONSTANT L21=5837.3631,L22=-2.6370082,L25=4056.0954 ENTER_SYMBOL CONSTANT L26=1.3646155, EXTERNAL L21#21, L22#22, L25#25, L26#26; ENTER_SYMBOL FUNCTION DX=X(LIQUID,ZR)-X(BCC_A2#1,ZR) ; ENTER_SYMBOL FUNCTION DY1=X(LIQUID,ZR).T ; ENTER_SYMBOL FUNCTION DY2=X(LIQUID,ZR).T ; ENTER_SYMBOL FUNCTION DY3=X(LIQUID,ZR).T ; ENTER_SYMBOL FUNCTION DY4=X(LIQUID,ZR).T ; ENTER_SYMBOL FUNCTION DY5=X(LIQUID,ZR).T ; ENTER_SYMBOL FUNCTION DY6=X(LIQUID,ZR).T ; ENTER_SYMBOL FUNCTION DY7=X(LIQUID,ZR).T ; $ ----------- CREATE_NEW_EQUILIBRIUM 108, 1 CHANGE_STATUS COMPONENT VA NP ZR =ENTERED SET_REFERENCE_STATE NP ORTHO_AC * 100000 SET_REFERENCE_STATE ZR HCP_A3 * 100000 CHANGE_STATUS PHASE TETRAG_AD#1=DORMANT CHANGE_STATUS PHASE DELTA =FIXED 0 CHANGE_STATUS PHASE HCP_A3=FIXED 1 SET_CONDITION P=102325 T=573 SET_WEIGHT 2,,, EXPERIMENT X(HCP_A3,ZR)=0.988:1E-2 EXPERIMENT DGMR(TETRAG_AD#1)<0:1E-2 SET_START_VAL Y(DELTA,NP)=0.34172 Y(DELTA,ZR)=0.65828 SET_START_VAL Y(HCP_A3,NP)=1.1121E-2 Y(HCP_A3,ZR)=0.98888 SET_START_VAL Y(TETRAG_AD#1,NP)=0.96637 Y(TETRAG_AD#1,ZR)=3.3633E-2 $ ----------- SAVE """ WORKING_MG_NI_POP = """ $ note that this has some of the original equilibria with complex conditions removed. E-SYM CON P0=1E5 R0=8.314 @@ THERMOCHEMICAL DATA IN LIQUID @@ 100-300 TABLE 100 C-N @@,1 CH P LIQ=F 1 S-R-S MG LIQ,,,,, S-C T=1073, P=P0, X(NI)=@1 LABEL ALA1 EXPERIMENT ACR(MG)=@2:5% TABLE_VALUE 0.20230 0.771 0.22600 0.722 0.25400 0.672 0.28390 0.623 0.18470 0.746 0.20840 0.710 0.23580 0.667 0.25950 0.626 0.28900 0.570 0.21590 0.709 0.24690 0.656 0.28040 0.600 0.19450 0.740 0.22560 0.681 0.25880 0.635 0.28950 0.577 0.32410 0.519 0.15000 0.822 0.17210 0.787 0.19280 0.748 0.21300 0.708 0.23170 0.678 0.25270 0.640 0.27040 0.607 0.29050 0.577 0.31020 0.550 0.34380 0.506 TABLE_END EN-SYM FUN HMRT=HMR/1000; TABLE 200 C-N @@,1 CH P LIQ=F 1 S-R-S MG LIQ,,,,, S-R-S NI LIQ,,,,, S-C T=1005, P=P0, X(NI)=@1 EXPERIMENT HMRT=@2:10% LABEL ALA2 TABLE_VALUE 0.04800 -2.880 0.10200 -5.780 0.15300 -8.010 0.05300 -3.080 0.09900 -5.490 0.14600 -7.330 0.19400 -9.170 0.02700 -1.620 0.05600 -3.200 0.08500 -4.620 0.05100 -3.220 0.10500 -5.820 0.15700 -7.940 TABLE_END ent fun ph1=(hmr+hmr.x(ni)-x(ni)*hmr.x(ni))/1000; TABLE 300 C-N @@,1 CH P LIQ=F 1 S-R-S MG LIQ,,,,, S-R-S NI LIQ,,,,, S-C T=1005, P=P0, X(NI)=@1 EXPERIMENT PH1=@2:10% LABEL ALA3 TABLE_VALUE 0.02400 -60.360 0.07500 -53.410 0.12800 -44.960 0.02700 -57.860 0.07600 -52.630 0.12200 -41.420 0.17000 -39.540 0.01300 -61.030 0.04100 -54.390 0.07000 -48.550 0.02500 -63.440 0.07800 -48.580 0.13100 -42.170 TABLE_END @@ WE NOW DEAL WITH 2 PHASE EQUILIBRIA @@ LIQ-FCC, LIQ-HCP_A3 @@ REFERENCE @@ 1000- TABLE 1000 C-N @@,1 CH P LIQ HCP_A3=F 1 S-C T=@1, P=P0 EXPERIMENT X(LIQ,NI)=@2:5% EXPERIMENT X(HCP_A3,NI)<0.01:1E-2 S-S-V X(HCP_A3,NI)=1E-3 LABEL ALHC TABLE_VALUE 900.7 .0235 869.4 .052 836.8 .0741 812.1 .0938 781.0 .1129 TABLE_END TABLE 1100 C-N @@,1 CH P LIQ FCC=F 1 S-C T=@1, P=P0 EXPERIMENT X(LIQ,NI)=@2:5% EXPERIMENT X(FCC,NI)>0.98:1E-2 S-S-V X(FCC,NI)=0.9999 LABEL ALFC TABLE_VALUE 1428 .8265 1545 .8872 1708 .9762 TABLE_END @@NOW DEAL WITH THE EUTECTIC POINT ON THE NI RICH END C-N 2,1 CH P LIQ,MGNI2,FCC=F 1 S-C P=P0 EXPERIMENT T=1370:2 EXPERIMENT X(LIQ,NI)=0.803:5% LABEL AIEU @@THIS THEN DEALS WITH THE TWO PHASE EQUILIBRIA IN L+MGNI2 TABLE 2000 C-N @@,1 CH P LIQ MGNI2=F 1 S-C X(LIQ,NI)=@2, P=P0 EXPERIMENT T=@1:5 LABEL ALM2 TABLE_VALUE 1054.4 .3004 1140.4 .3298 1163.9 .3388 1345 .3832 1385 .4347 1412 .4914 1418 .554 1417 .6236 1418 .6536 1413 .7012 1370 .7349 TABLE_END @@ THIS DEALS WITH THE PERITECTIC MG2NI REACTION C-N 10,1 CH P LIQ,MGNI2,MG2NI=F 1 S-C P=P0 EXPERIMENT T=1033:2 EXPERIMENT X(LIQ,NI)=0.29:5% LABEL APER @@THIS THEN TAKES CARE OF THE EUTECTIC ON THE MG RICH END C-N 11,1 CH P LIQ,HCP_A3,MG2NI=F 1 S-C P=P0 EXPERIMENT T=779:2 EXPERIMENT X(LIQ,NI)=0.113:5% LABEL AEMG @@THE FOLLOWING TABLE TAKES CARE OF THE LIQUID MG2NI TWO PHASE @@EQUILIBIA TABLE 3000 C-N @@,1 CH P LIQ MG2NI=F 1 S-C X(LIQ,NI)=@2, P=P0 EXPERIMENT T=@1:5 LABEL AM2N TABLE_VALUE 834.2 .1236 879.9 .1393 917.6 .1563 960.6 .1836 994.5 .2192 1012.7 .2395 1023.2 .2662 TABLE_END @@ STABILITY EQUILIBRIA RESTRICTIONS TABLE 4000 C-N @@,1 CH P FCC MGNI2=F 1 CH P MG2NI=D S-C T=@1, P=P0 EXPERIMENT DGM(MG2NI)<0:1E-2 LABEL AST1 TABLE_VALUE 1300 1200 1100 1000 900 800 700 600 500 400 300 200 TABLE_END TABLE 5000 C-N @@,1 CH P HCP_A3 MG2NI=F 1 CH P MGNI2=D S-C T=@1, P=P0 EXPERIMENT DGM(MGNI2)<0:1E-2 LABEL AST2 TABLE_VALUE 700 600 500 400 300 200 TABLE_END E-SY FUNCTION GLDD=MU(NI).X(NI); TABLE 6000 C-N @@,1 CH P LIQ=F 1 S-C T=2500, P=P0, X(NI)=@1 EXPERIMENT GLDD>0:1E-2 LABEL ALDD TABLE_VALUE 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 TABLE_END SAVE """ POP_CONDITION_EXPRESSIONS = """ $ from Mg-Ni example ENT-SYM CONST P0=101325 @@NOW THE ENTHALPY OF FORMATION OF MGNI2 C-N 3,1 CH P MGNI2=F 1 S-C P=P0 T=298.15 3*X(MG)=1 EXPERIMENT H=-59000:500 LABEL AENF C-N 12,1 CH P MG2NI=F 1 S-C P=P0 T=298.15 3*X(MG)=2 EXPERIMENT H=-40000:500 LABEL AENF E-SYM FUN CPM2N=H.T; TABLE 1200 C-N @@,1 CH P MG2NI=F 1 S-C T=@1, P=P0, 3*X(MG)=2 EXPERIMENT CPM2N=@2:2% LABEL AM2C TABLE_VALUE 3.35000E+0002 7.06800000E+0001 3.45000E+0002 7.12500000E+0001 3.55000E+0002 7.16400000E+0001 3.65000E+0002 7.19400000E+0001 3.75000E+0002 7.28100000E+0001 3.85000E+0002 7.29900000E+0001 3.95000E+0002 7.31700000E+0001 4.05000E+0002 7.36800000E+0001 4.15000E+0002 7.41600000E+0001 4.25000E+0002 7.44600000E+0001 4.35000E+0002 7.45200000E+0001 4.45000E+0002 7.51500000E+0001 4.55000E+0002 7.51200000E+0001 4.65000E+0002 7.52700000E+0001 4.75000E+0002 7.53600000E+0001 4.85000E+0002 7.59300000E+0001 4.95000E+0002 7.62600000E+0001 5.05000E+0002 7.62300000E+0001 5.15000E+0002 7.67400000E+0001 5.25000E+0002 7.68600000E+0001 5.35000E+0002 7.68000000E+0001 5.45000E+0002 7.68300000E+0001 5.55000E+0002 7.71900000E+0001 5.65000E+0002 7.74300000E+0001 5.75000E+0002 7.74900000E+0001 5.85000E+0002 7.77900000E+0001 5.95000E+0002 7.80900000E+0001 6.05000E+0002 7.82100000E+0001 6.15000E+0002 7.85700000E+0001 6.25000E+0002 7.86300000E+0001 6.35000E+0002 7.84500000E+0001 6.45000E+0002 7.90800000E+0001 6.55000E+0002 7.89900000E+0001 6.65000E+0002 7.89900000E+0001 6.75000E+0002 7.92000000E+0001 6.85000E+0002 7.95600000E+0001 6.95000E+0002 7.96200000E+0001 TABLE_END """ POP_COMPLEX_CONDITIONS = """ ENT-SYM CONST P0=101325 @@NOW DEAL WITH THE CONGRUENT MELTING OF MGNI2 @@ LIQ-MGNI2 @@ REFERENCE C-N 1,1 CH P LIQ,MGNI2=F 1 S-C P=P0, X(LIQ,MG)-X(MGNI2,MG)=0 EXPERIMENT T=1420:3 LABEL ACM """
""" 2407 : 조합 URL : https://www.acmicpc.net/problem/2407 Input : 100 6 Output : 1192052400 """ MAX_N = 101 MAX_M = 101 cache = [[-1 for _ in range(MAX_M)] for _ in range(MAX_N)] cache[0][0] = 1 cache[1][0] = 1 cache[1][1] = 1 def binomial(n, m): if m == 0 or m == n: return 1 if cache[n][m] != -1: return cache[n][m] cache[n][m] = binomial(n - 1, m - 1) + binomial(n - 1, m) return cache[n][m] n, m = map(int, input().split(' ')) print(binomial(n, m))
for i in range(int(input())): s = input() prev = s[0] cnt = 1 for i in range(1,len(s)): if prev == s[i]: cnt+=1 else: print("{}{}".format(cnt,prev),end="") prev = s[i] cnt =1 print("{}{}".format(cnt,prev))
""" Reto: Imprimir todos los numeros enteros (opuestos a naturales tambien) pares e impares dependiendo del valor n que escoja el usuario. Le he sumado varios grados de complejidad al enunciado del problema. Curso: Pensamiento computacional. Plataforma: Platzi. Profesor: David Aroesti. Alumno: @edinsonrequena. """ def pares(numero): """ Imprime todos los numeros pares existen entre 0 y n o entre n y 0 int n returns n """ if numero < 0 and numero % 2 != 0: for i in range(numero+1, 0, 2): print(i) elif numero < 0 and numero % 2 == 0: for i in range(numero, 0, 2): print(i) else: for i in range(0, numero, 2): print(i) def impares(numero): """imprime todo los numeros impares que existen entre 1 y n o entre n y 1 int n returns n """ if numero < 0 and numero % 2 == 0: for i in range(numero+1, 1, 2): print(i) elif numero < 0 and numero % 2 != 0: for i in range(numero, 1, 2): print(i) else: for i in range(1, numero, 2): print(i) if __name__ == '__main__': num = int(input('Escribe un entero: ')) impares(num) print('Numeros Impares\n') pares(num) print('Numeros Pares')
#!/usr/bin/python3 if __name__ == "__main__": # open text file to read file = open('write_file.txt', 'w') # read a line from the file file.write('I am excited to learn Python using Raspberry Pi Zero\n') file.close() file = open('write_file.txt', 'r') data = file.read() print(data) file.close()
#!/usr/bin/env python3 # -*- coding: utf-8 -*- class Frame: def __init__(self, control): self.control=control self.player=[] self.timer=self.control.timer self.weapons=self.control.rocket_types self.any_key=True def draw(self): self.player=self.control.world.gamers[self.control.worm_no] health=self.control.worm.health/0.008 x=700 y=700 if sum(self.control.alive_worms) > 1: text="PLAYER: "+ self.player +", HEALTH: %.2f" % health text2="TIME REMAINING: "+ str(self.control.timer.time_remaining) text3="WEAPON: " + str(self.weapons[self.control.worm.rocket_type]) te=[text3, text, text2] for t in te: self.write(t, x, y+40*te.index(t), 30) x2=x-500 te=["WEAPON CHANGE: SPACE","PLAYER CHANGE: TAB", "SHOOT: R", "MOVE: ARROWS"] for t in te: self.write(t, x2, y+40*te.index(t), 30) else: self.winner() self.control.game.over() if self.any_key: t="PRESS ANY KEY (OTHER THAN SPACE) TO START THE GAME" self.write(t, x-350, y-200, 30) def write(self, text, x, y, size): self.control.write(text, (0,255,0), x, y, size) def key(self): self.any_key=False def winner(self): x=400 y=600 a=self.control.alive_worms if sum(self.control.alive_worms) > 0: winner_number=[i for i, v in enumerate(a) if v==1] text="WINNER: "+ str(self.control.world.gamers[winner_number[0]]) else: text="WINNER: NONE" text2="GAME OVER" self.write(text2, x, y+50, 30) self.write(text, x, y, 30)
class UndergroundSystem: def __init__(self): self.inMap = {} self.outMap = {} def checkIn(self, id: int, stationName: str, t: int) -> None: self.inMap[id] = (stationName, t) def checkOut(self, id: int, stationName: str, t: int) -> None: start = self.inMap[id][1] route = self.inMap[id][0] + '-' + stationName if route in self.outMap: time, count = self.outMap[route] self.outMap[route] = (time + t - start, count + 1) else: self.outMap[route] = (t - start, 1) def getAverageTime(self, startStation: str, endStation: str) -> float: time, count = self.outMap[startStation + '-' + endStation] return time / count # Your UndergroundSystem object will be instantiated and called as such: # obj = UndergroundSystem() # obj.checkIn(id,stationName,t) # obj.checkOut(id,stationName,t) # param_3 = obj.getAverageTime(startStation,endStation)
class Hangman: text = [ '''\ ____ | | | o | /|\\ | | | / \\ _|_ | |______ | | |__________|\ ''', '''\ ____ | | | o | /|\\ | | | / _|_ | |______ | | |__________|\ ''', '''\ ____ | | | o | /|\\ | | | _|_ | |______ | | |__________|\ ''', '''\ ____ | | | o | /| | | | _|_ | |______ | | |__________|\ ''', '''\ ____ | | | o | | | | | _|_ | |______ | | |__________|\ ''', '''\ ____ | | | o | | | _|_ | |______ | | |__________|\ ''', '''\ ____ | | | | | | _|_ | |______ | | |__________|\ ''', ] def __init__(self): self.remainingLives = len(self.text) - 1 def decreaseLife(self): self.remainingLives -= 1 def currentShape(self): return self.text[self.remainingLives] def is_live(self): return True if self.remainingLives > 0 else False
# Reverse bits of a given 32 bits unsigned integer. # For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), # return 964176192 (represented in binary as 00111001011110000010100101000000). # # Follow up: # If this function is called many times, how would you optimize it? # https://www.programcreek.com/2014/03/leetcode-reverse-bits-java/ def reverse_bits(d, bits_to_fill=32): print("{0:b}".format(d)) # Get number of bits. n = d.bit_length() rev_d = 0 need_to_shift = 0 for shift in range(n): need_to_shift +=1 print("{0:b}".format(d >> shift)) if d & (1 << shift): rev_d = rev_d << need_to_shift | 1 need_to_shift = 0 # Fill to 32 bits. if d.bit_length() < bits_to_fill: for _ in range(bits_to_fill-d.bit_length()): rev_d = rev_d << 1 print("d : {0:b}".format(d)) print("Rev d: {0:b}".format(rev_d)) return rev_d if __name__ == "__main__": d = 43261596 print(reverse_bits(d,-1))
print("Welcome to Civil War Predictor, which predicts whether your country will get in Civil War 100% Correctly.\nUnless It Doesn't.") country = input("What country would you like to predict Civil War for? ") if 'America' in country: #note that this does not include the middle east or literally any-fucking-where else, its a joke ok? print('Your country will have a civil war soon!') else: print('Your country will not have a civil war soon...')
class CUFS: START: str = "/{SYMBOL}/Account/LogOn?ReturnUrl=%2F{SYMBOL}%2FFS%2FLS%3Fwa%3Dwsignin1.0%26wtrealm%3D{REALM}" LOGOUT: str = "/{SYMBOL}/FS/LS?wa=wsignout1.0" class UONETPLUS: START: str = "/{SYMBOL}/LoginEndpoint.aspx" GETKIDSLUCKYNUMBERS: str = "/{SYMBOL}/Start.mvc/GetKidsLuckyNumbers" GETSTUDENTDIRECTORINFORMATIONS: str = ( "/{SYMBOL}/Start.mvc/GetStudentDirectorInformations" ) class UZYTKOWNIK: NOWAWIADOMOSC_GETJEDNOSTKIUZYTKOWNIKA: str = ( "/{SYMBOL}/NowaWiadomosc.mvc/GetJednostkiUzytkownika" ) class UCZEN: START: str = "/{SYMBOL}/{SCHOOLID}/Start" UCZENDZIENNIK_GET: str = "/{SYMBOL}/{SCHOOLID}/UczenDziennik.mvc/Get" OCENY_GET: str = "/{SYMBOL}/{SCHOOLID}/Oceny.mvc/Get" STATYSTYKI_GETOCENYCZASTKOWE: str = ( "/{SYMBOL}/{SCHOOLID}/Statystyki.mvc/GetOcenyCzastkowe" ) UWAGIIOSIAGNIECIA_GET: str = "/{SYMBOL}/{SCHOOLID}/UwagiIOsiagniecia.mvc/Get" ZEBRANIA_GET: str = "/{SYMBOL}/{SCHOOLID}/Zebrania.mvc/Get" SZKOLAINAUCZYCIELE_GET: str = "/{SYMBOL}/{SCHOOLID}/SzkolaINauczyciele.mvc/Get" ZAREJESTROWANEURZADZENIA_GET: str = "/{SYMBOL}/{SCHOOLID}/ZarejestrowaneUrzadzenia.mvc/Get" ZAREJESTROWANEURZADZENIA_DELETE: str = "/{SYMBOL}/{SCHOOLID}/ZarejestrowaneUrzadzenia.mvc/Delete" REJESTRACJAURZADZENIATOKEN_GET: str = "/{SYMBOL}/{SCHOOLID}/RejestracjaUrzadzeniaToken.mvc/Get"
#escribir un programa que: #Le pregunta al usuario su cumpleaños (en el formato AAAAMMDD o AAAADMM o MMDDAAAA; # en realidad, el orden de los dígitos no importa). #Da como salida El Dígito de la Vida para la fecha ingresada. def obtenerDigitoVida(birthday): ddlV = 0 listaDigitos = list(birthday) for digito in listaDigitos: ddlV += int(digito) if ddlV > 9: ddlV = obtenerDigitoVida(str(ddlV)) return ddlV birthday = input("""Ingresa tu fecha de nacimiento Formatos AAAAMMDD o AAAADMM o MMDDAAAA: \n""") if birthday.isdigit() and len(birthday) >= 7: ddlV = obtenerDigitoVida(birthday) print("Digito de la vida = ", ddlV) else: print("Debes introducir un valor con el formato señalado...")
class Person: # pass #lader en lave en tom class ellers ville den komme med fejl species = 'Mammel' # class variable # self skal altid være først i metode header, sådan er det bare når det er OOP i guess def __init__(self, name): # hvis man laver en metode nedunder denne med samme navn så overider den bare den øverste self.name = name # 'Sebastian' # instance variable #def __init1__(self, *args): # *args er tuple så her kan man skrive så meget man vil i parametre og så skriver den dem ud i tuple # self.arguments = args def name_age(self): return self.name + " " + str(self.age) p = Person('Christopher') #p1 = Person('Christopher', 12, 1234) her for eksempel virker det med tuple #print(p1.arguments) print(p.name) print(p.species) print(p.__dict__) # dictionary p.name = 'Tykke-Lars' print(p.name) p.age = 12 # man kan bare smide flere ting på objectet bare sån print(p.__dict__) Person.species = 'Retard' # ændre class variable print(p.species) print(p.name_age()) print(ord('*')) #værdi af * print(chr(42)) # teg tilhørende værdien 42 i ASCII måske eller hex eller hvad det hedder :O class Instructor: def __init__(self, course): self.course = course class Student(Person, Instructor): # tager fra superklassen som nu er person i tilfældet af to superklasser, så er super metoden i student den sidste klasse def __init__(self, name, course): # super().__init__(name) # kalder super init metode som er constructor med variable name som den skal bruge en Person.__init__(self, name) # når to implementeres i calss header så skal man kalde dem som disse to Instructor.__init__(self, course) student = Student('Lars', 'ITP') print(student.name + " " + student.course) def __repr__(self): #formal representation return f'{self.name}' def __str__(self): #informal representation lav disse som toStrings return f'{self.name}'
#!/usr/bin/python #coding=utf-8 ''' @author: sheng @license: ''' SPELL=u'xíngjiān' CN=u'行间' NAME=u'xingjian21' CHANNEL='liver' CHANNEL_FULLNAME='LiverChannelofFoot-Jueyin' SEQ='LR2' if __name__ == '__main__': pass
""" from flask_restplus import Api from log import log from config import api_restplus_config as config api = Api(version=config.VERSION, title=config.TITLE, description=config.DESCRIPTION, prefix=config.PREFIX, doc=config.DOC ) @api.errorhandler def default_error_handler(e): message = 'An unhandled exception occurred.' log.exception(message) return {'message': message}, 500 """
# Copyright 2013, Michael H. Goldwasser # # Developed for use with the book: # # Data Structures and Algorithms in Python # Michael T. Goodrich, Roberto Tamassia, and Michael H. Goldwasser # John Wiley & Sons, 2013 # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. def merge(S1, S2, S): """Merge two sorted Python lists S1 and S2 into properly sized list S.""" i = j = 0 while i + j < len(S): if j == len(S2) or (i < len(S1) and S1[i] < S2[j]): S[i + j] = S1[i] # copy ith element of S1 as next item of S i += 1 else: S[i + j] = S2[j] # copy jth element of S2 as next item of S j += 1 def merge_sort(S): """Sort the elements of Python list S using the merge-sort algorithm.""" n = len(S) if n < 2: return # list is already sorted # divide mid = n // 2 S1 = S[0:mid] # copy of first half S2 = S[mid:n] # copy of second half # conquer (with recursion) merge_sort(S1) # sort copy of first half merge_sort(S2) # sort copy of second half # merge results merge(S1, S2, S) # merge sorted halves back into S
class Solution: def minimumDeletions(self, s: str) -> int: answer=sys.maxsize hasa=0 hasb=0 numa=[0]*len(s) numb=[0]*len(s) for i in range(len(s)): numb[i]=hasb if s[i]=='b': hasb+=1 for i in range(len(s)-1,-1,-1): numa[i]=hasa if s[i]=='a': hasa+=1 for i in range(len(s)): answer=min(answer,numa[i]+numb[i]) return answer
def fibona(n): a = 0 b = 1 for _ in range(n): a, b = b, a + b yield a def main(): for i in fibona(10): print(i) if __name__ == "__main__": main()
def is_palindrome(s): for i in range(len(s)): if not (s[i] == s[::-1][i]): return False return True def longest_palindrome(s): candidates = [] for i in range(len(s)): st = s[i:] while st: if is_palindrome(st): candidates.append(st) break else: st = st[:-1] return sorted(candidates, key=lambda x: len(x), reverse=True)[0] def longestPalindrome(s): ans = "" while len(s) > len(ans): for i in range(len(s) - 1, -1, -1): if ( s[0] == s[i] and s[0 : i + 1] == s[i::-1] and len(s[0 : i + 1]) > len(ans) ): ans = s[0 : i + 1] s = s[1:] return ans if __name__ == "__main__": sample = "babad" r = longest_palindrome(sample) print(r) longestPalindrome(sample)
a = 23 b = 143 c = a + b d = 1000 e = d + c F = 300 print(a) print(b) print(d) print(e)
"""Top-level package for Magic: The Gathering Card Generator.""" __author__ = """João Pedro R. Mattos""" __email__ = '[email protected]' __version__ = '0.1.0'
# Copyright 2017 Google Inc. 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. AIRPORTS = { u'ABQ': u'Albuquerque International Sunport Airport', u'ACA': u'General Juan N Alvarez International Airport', u'ADW': u'Andrews Air Force Base', u'AFW': u'Fort Worth Alliance Airport', u'AGS': u'Augusta Regional At Bush Field', u'AMA': u'Rick Husband Amarillo International Airport', u'ANC': u'Ted Stevens Anchorage International Airport', u'ATL': u'Hartsfield Jackson Atlanta International Airport', u'AUS': u'Austin Bergstrom International Airport', u'AVL': u'Asheville Regional Airport', u'BAB': u'Beale Air Force Base', u'BAD': u'Barksdale Air Force Base', u'BDL': u'Bradley International Airport', u'BFI': u'Boeing Field King County International Airport', u'BGR': u'Bangor International Airport', u'BHM': u'Birmingham-Shuttlesworth International Airport', u'BIL': u'Billings Logan International Airport', u'BLV': u'Scott AFB/Midamerica Airport', u'BMI': u'Central Illinois Regional Airport at Bloomington-Normal', u'BNA': u'Nashville International Airport', u'BOI': u'Boise Air Terminal/Gowen field', u'BOS': u'General Edward Lawrence Logan International Airport', u'BTR': u'Baton Rouge Metropolitan, Ryan Field', u'BUF': u'Buffalo Niagara International Airport', u'BWI': u'Baltimore/Washington International Thurgood Marshall Airport', u'CAE': u'Columbia Metropolitan Airport', u'CBM': u'Columbus Air Force Base', u'CHA': u'Lovell Field', u'CHS': u'Charleston Air Force Base-International Airport', u'CID': u'The Eastern Iowa Airport', u'CLE': u'Cleveland Hopkins International Airport', u'CLT': u'Charlotte Douglas International Airport', u'CMH': u'Port Columbus International Airport', u'COS': u'City of Colorado Springs Municipal Airport', u'CPR': u'Casper-Natrona County International Airport', u'CRP': u'Corpus Christi International Airport', u'CRW': u'Yeager Airport', u'CUN': u'Canc\xfan International Airport', u'CVG': u'Cincinnati Northern Kentucky International Airport', u'CVS': u'Cannon Air Force Base', u'DAB': u'Daytona Beach International Airport', u'DAL': u'Dallas Love Field', u'DAY': u'James M Cox Dayton International Airport', u'DBQ': u'Dubuque Regional Airport', u'DCA': u'Ronald Reagan Washington National Airport', u'DEN': u'Denver International Airport', u'DFW': u'Dallas Fort Worth International Airport', u'DLF': u'Laughlin Air Force Base', u'DLH': u'Duluth International Airport', u'DOV': u'Dover Air Force Base', u'DSM': u'Des Moines International Airport', u'DTW': u'Detroit Metropolitan Wayne County Airport', u'DYS': u'Dyess Air Force Base', u'EDW': u'Edwards Air Force Base', u'END': u'Vance Air Force Base', u'ERI': u'Erie International Tom Ridge Field', u'EWR': u'Newark Liberty International Airport', u'FAI': u'Fairbanks International Airport', u'FFO': u'Wright-Patterson Air Force Base', u'FLL': u'Fort Lauderdale Hollywood International Airport', u'FSM': u'Fort Smith Regional Airport', u'FTW': u'Fort Worth Meacham International Airport', u'FWA': u'Fort Wayne International Airport', u'GDL': u'Don Miguel Hidalgo Y Costilla International Airport', u'GEG': u'Spokane International Airport', u'GPT': u'Gulfport Biloxi International Airport', u'GRB': u'Austin Straubel International Airport', u'GSB': u'Seymour Johnson Air Force Base', u'GSO': u'Piedmont Triad International Airport', u'GSP': u'Greenville Spartanburg International Airport', u'GUS': u'Grissom Air Reserve Base', u'HIB': u'Range Regional Airport', u'HMN': u'Holloman Air Force Base', u'HMO': u'General Ignacio P. Garcia International Airport', u'HNL': u'Honolulu International Airport', u'HOU': u'William P Hobby Airport', u'HSV': u'Huntsville International Carl T Jones Field', u'HTS': u'Tri-State/Milton J. Ferguson Field', u'IAD': u'Washington Dulles International Airport', u'IAH': u'George Bush Intercontinental Houston Airport', u'ICT': u'Wichita Mid Continent Airport', u'IND': u'Indianapolis International Airport', u'JAN': u'Jackson-Medgar Wiley Evers International Airport', u'JAX': u'Jacksonville International Airport', u'JFK': u'John F Kennedy International Airport', u'JLN': u'Joplin Regional Airport', u'LAS': u'McCarran International Airport', u'LAX': u'Los Angeles International Airport', u'LBB': u'Lubbock Preston Smith International Airport', u'LCK': u'Rickenbacker International Airport', u'LEX': u'Blue Grass Airport', u'LFI': u'Langley Air Force Base', u'LFT': u'Lafayette Regional Airport', u'LGA': u'La Guardia Airport', u'LIT': u'Bill & Hillary Clinton National Airport/Adams Field', u'LTS': u'Altus Air Force Base', u'LUF': u'Luke Air Force Base', u'MBS': u'MBS International Airport', u'MCF': u'Mac Dill Air Force Base', u'MCI': u'Kansas City International Airport', u'MCO': u'Orlando International Airport', u'MDW': u'Chicago Midway International Airport', u'MEM': u'Memphis International Airport', u'MEX': u'Licenciado Benito Juarez International Airport', u'MGE': u'Dobbins Air Reserve Base', u'MGM': u'Montgomery Regional (Dannelly Field) Airport', u'MHT': u'Manchester Airport', u'MIA': u'Miami International Airport', u'MKE': u'General Mitchell International Airport', u'MLI': u'Quad City International Airport', u'MLU': u'Monroe Regional Airport', u'MOB': u'Mobile Regional Airport', u'MSN': u'Dane County Regional Truax Field', u'MSP': u'Minneapolis-St Paul International/Wold-Chamberlain Airport', u'MSY': u'Louis Armstrong New Orleans International Airport', u'MTY': u'General Mariano Escobedo International Airport', u'MUO': u'Mountain Home Air Force Base', u'OAK': u'Metropolitan Oakland International Airport', u'OKC': u'Will Rogers World Airport', u'ONT': u'Ontario International Airport', u'ORD': u"Chicago O'Hare International Airport", u'ORF': u'Norfolk International Airport', u'PAM': u'Tyndall Air Force Base', u'PBI': u'Palm Beach International Airport', u'PDX': u'Portland International Airport', u'PHF': u'Newport News Williamsburg International Airport', u'PHL': u'Philadelphia International Airport', u'PHX': u'Phoenix Sky Harbor International Airport', u'PIA': u'General Wayne A. Downing Peoria International Airport', u'PIT': u'Pittsburgh International Airport', u'PPE': u'Mar de Cort\xe9s International Airport', u'PVR': u'Licenciado Gustavo D\xedaz Ordaz International Airport', u'PWM': u'Portland International Jetport Airport', u'RDU': u'Raleigh Durham International Airport', u'RFD': u'Chicago Rockford International Airport', u'RIC': u'Richmond International Airport', u'RND': u'Randolph Air Force Base', u'RNO': u'Reno Tahoe International Airport', u'ROA': u'Roanoke\u2013Blacksburg Regional Airport', u'ROC': u'Greater Rochester International Airport', u'RST': u'Rochester International Airport', u'RSW': u'Southwest Florida International Airport', u'SAN': u'San Diego International Airport', u'SAT': u'San Antonio International Airport', u'SAV': u'Savannah Hilton Head International Airport', u'SBN': u'South Bend Regional Airport', u'SDF': u'Louisville International Standiford Field', u'SEA': u'Seattle Tacoma International Airport', u'SFB': u'Orlando Sanford International Airport', u'SFO': u'San Francisco International Airport', u'SGF': u'Springfield Branson National Airport', u'SHV': u'Shreveport Regional Airport', u'SJC': u'Norman Y. Mineta San Jose International Airport', u'SJD': u'Los Cabos International Airport', u'SKA': u'Fairchild Air Force Base', u'SLC': u'Salt Lake City International Airport', u'SMF': u'Sacramento International Airport', u'SNA': u'John Wayne Airport-Orange County Airport', u'SPI': u'Abraham Lincoln Capital Airport', u'SPS': u'Sheppard Air Force Base-Wichita Falls Municipal Airport', u'SRQ': u'Sarasota Bradenton International Airport', u'SSC': u'Shaw Air Force Base', u'STL': u'Lambert St Louis International Airport', u'SUS': u'Spirit of St Louis Airport', u'SUU': u'Travis Air Force Base', u'SUX': u'Sioux Gateway Col. Bud Day Field', u'SYR': u'Syracuse Hancock International Airport', u'SZL': u'Whiteman Air Force Base', u'TCM': u'McChord Air Force Base', u'TIJ': u'General Abelardo L. Rodr\xedguez International Airport', u'TIK': u'Tinker Air Force Base', u'TLH': u'Tallahassee Regional Airport', u'TOL': u'Toledo Express Airport', u'TPA': u'Tampa International Airport', u'TRI': u'Tri Cities Regional Tn Va Airport', u'TUL': u'Tulsa International Airport', u'TUS': u'Tucson International Airport', u'TYS': u'McGhee Tyson Airport', u'VBG': u'Vandenberg Air Force Base', u'VPS': u'Destin-Ft Walton Beach Airport', u'WRB': u'Robins Air Force Base', u'YEG': u'Edmonton International Airport', u'YHZ': u'Halifax / Stanfield International Airport', u'YOW': u'Ottawa Macdonald-Cartier International Airport', u'YUL': u'Montreal / Pierre Elliott Trudeau International Airport', u'YVR': u'Vancouver International Airport', u'YWG': u'Winnipeg / James Armstrong Richardson International Airport', u'YYC': u'Calgary International Airport', u'YYJ': u'Victoria International Airport', u'YYT': u"St. John's International Airport", u'YYZ': u'Lester B. Pearson International Airport' }
def imprimeTabuleiro(p1, p2, p3, p4, p5, p6, p7, p8, p9): """ Recebe os valores das nove posições do tabuleiro e imprime o tabuleiro """ #Complete o código da função print(f"{p7} | {p8} | {p9}") print("---------") print(f"{p4} | {p5} | {p6}") print("---------") print(f"{p1} | {p2} | {p3}") def entradaValida(p1, p2, p3, p4, p5, p6, p7, p8, p9): """ Recebe os valores das nove posições do tabuleiro e verifica se os valores são válidos, ou seja, retorna True se cada variável possui " " ou "x" ou "o" e False, caso contrário. """ #Complete o código da função if p1 == " " or p1 == "x" or p1 == "o": return True if p2 == " " or p2 == "x" or p2 == "o": return True if p3 == " " or p3 == "x" or p3 == "o": return True if p4 == " " or p4 == "x" or p4 == "o": return True if p5 == " " or p5 == "x" or p5 == "o": return True if p6 == " " or p6 == "x" or p6 == "o": return True if p7 == " " or p7 == "x" or p7 == "o": return True if p8 == " " or p8 == "x" or p8 == "o": return True if p9 == " " or p9 == "x" or p9 == "o": return True return False def jogadaValida(p1, p2, p3, p4, p5, p6, p7, p8, p9): """ Recebe os valores das nove posições do tabuleiro e verifica se os valores formam uma jogada válida. Retorna True se a jogada for válida e False, caso contrário """ #Complete o código da função x = 0 o = 0 v = 0 if p1 == "x": x += 1 if p1 == "o": o += 1 if p1 == " ": v += 1 if p2 == "x": x += 1 if p2 == "o": o += 1 if p2 == " ": v += 1 if p3 == "x": x += 1 if p3 == "o": o += 1 if p3 == " ": v += 1 if p4 == "x": x += 1 if p4 == "o": o += 1 if p4 == " ": v += 1 if p5 == "x": x += 1 if p5 == "o": o += 1 if p5 == " ": v += 1 if p6 == "x": x += 1 if p6 == "o": o += 1 if p6 == " ": v += 1 if p7 == "x": x += 1 if p7 == "o": o += 1 if p7 == " ": v += 1 if p8 == "x": x += 1 if p8 == "o": o += 1 if p8 == " ": v += 1 if p9 == "x": x += 1 if p9 == "o": o += 1 if p9 == " ": v += 1 r = verificavito(p1, p2, p3, p4, p5, p6, p7, p8, p9) if r == "x" or r == "o" or r == "e": if x+1 == o or o+1 == x: if v >= 1: if r == 'e': print("O jogo nao terminou ! ! !") return else: return True elif v == 0: return True else: return False elif v == 0 and r == "e": return True def verificavito(p1, p2, p3, p4, p5, p6, p7, p8, p9): """ Recebe os valores das nove posições e retorna se há vitória e quem ganhou """ if p1 == "x" and p2 == "x" and p3 == "x": return "x" if p1 == "x" and p4 == "x" and p7 == "x": return "x" if p1 == "x" and p5 == "x" and p9 == "x": return "x" if p9 == "x" and p8 == "x" and p7 == "x": return "x" if p9 == "x" and p6 == "x" and p3 == "x": return "x" if p2 == "x" and p5 == "x" and p8 == "x": return "x" if p4 == "x" and p5 == "x" and p6 == "x": return "x" if p1 == "o" and p2 == "o" and p3 == "o": return "o" if p1 == "o" and p4 == "o" and p7 == "o": return "o" if p1 == "o" and p5 == "o" and p9 == "o": return "o" if p9 == "o" and p8 == "o" and p7 == "o": return "o" if p9 == "o" and p6 == "o" and p3 == "o": return "o" if p2 == "o" and p5 == "o" and p8 == "o": return "o" if p4 == "o" and p5 == "o" and p6 == "o": return "o" return "e" def verificaJogada(p1, p2, p3, p4, p5, p6, p7, p8, p9): """ Recebe os valores das nove posições do tabuleiro e imprime se um jogador ('x' ou 'o') venceu a jogada. (Cada variável representa uma posição no tabuleiro) """ #Complete o código da função r = verificavito(p1, p2, p3, p4, p5, p6, p7, p8, p9) if r == "x" or r == "o": print(f"O jogador '{r}' ganhou a partida") return print("Empate ! ! !") ## NÃO ALTERE A FUNÇÃO 'main' ## def main(): t1 = input() t2 = input() t3 = input() t4 = input() t5 = input() t6 = input() t7 = input() t8 = input() t9 = input() imprimeTabuleiro(t1, t2, t3, t4, t5, t6, t7, t8, t9) if not entradaValida(t1, t2, t3, t4, t5, t6, t7, t8, t9): print("\nEntrada invalida!") elif not jogadaValida(t1, t2, t3, t4, t5, t6, t7, t8, t9): print("\nJogada invalida!") else: print("\n") verificaJogada(t1, t2, t3, t4, t5, t6, t7, t8, t9) main() #~~phelipes2000
# The [Hu] system # The similar philosophy but different approach of GAN. # A revivable self-supervised Learning system # The theory contains two: # 1. The Hu system consists of two agents: the first agent try to provide a good initial solution for the second # to optimize until the solution meets the specified requirement. Meanwhile, the second agent uses this # optimized solution to train the first agent to help it provide a better initial solution for the next time. # In such an iterative system, Agent A and B helps each other to work better, and together they reach the # overall target as good and faster as possible. # 2. A revivable training manner: each time the model is trained to Nash Equilibrium, fixed those non-sparse connections # (for example, weighted kernels or filters), and reinitialize the sparse connections, and train again with new # iteration between the two agents. Thus the learnt parameters to curve the distribution of samples during each # equilibrium round will forward onto the next generation and keeps the learning process a spiral up, instead of # unordered and easily corrupted training of GANs. class Hu(object): def __init__(self): self.layers = []
def test_valid(cldf_dataset, cldf_logger): assert cldf_dataset.validate(log=cldf_logger) def test_forms(cldf_dataset): # check one specific form to make sure columns, values are correct. # 49995,karoto,120_father,aɸa f = [f for f in cldf_dataset["FormTable"] if f["Local_ID"] == "49995"] assert len(f) == 1 assert f[0]["Parameter_ID"] == "120_father" assert f[0]["Language_ID"] == "karoto" assert f[0]["Form"] == "aɸa" def test_languages(cldf_dataset): # ID,Name,Glottocode,Glottolog_Name,ISO639P3code,Macroarea,Family # abaga,Abaga,abag1245,,abg,, f = [f for f in cldf_dataset["LanguageTable"] if f["ID"] == "abaga"] assert len(f) == 1 assert f[0]["Name"] == "Abaga" assert f[0]["Glottocode"] == "abag1245" assert f[0]["ISO639P3code"] == "abg" def test_parameters(cldf_dataset): # ID,Name,Concepticon_ID,Concepticon_Gloss # 796_tocough,to cough,879,COUGH f = [f for f in cldf_dataset["ParameterTable"] if f["ID"] == "796_tocough"] assert len(f) == 1 assert f[0]["Name"] == "to cough" assert f[0]["Concepticon_ID"] == "879" assert f[0]["Concepticon_Gloss"] == "COUGH" def test_sources(cldf_dataset): f = [f for f in cldf_dataset.sources if f.id == "abbott1985"] assert len(f) == 1
# 15/15 games = [input() for i in range(6)] wins = games.count("W") if wins >= 5: print(1) elif wins >= 3: print(2) elif wins >= 1: print(3) else: print(-1)
N = int(input()) qnt_copos = 0 for i in range(1, N + 1): L, C = map(int, input().split()) if L > C: qnt_copos += C print(qnt_copos)
power = {'BUSES': {'Area': 1.33155, 'Bus/Area': 1.33155, 'Bus/Gate Leakage': 0.00662954, 'Bus/Peak Dynamic': 0.0, 'Bus/Runtime Dynamic': 0.0, 'Bus/Subthreshold Leakage': 0.0691322, 'Bus/Subthreshold Leakage with power gating': 0.0259246, 'Gate Leakage': 0.00662954, 'Peak Dynamic': 0.0, 'Runtime Dynamic': 0.0, 'Subthreshold Leakage': 0.0691322, 'Subthreshold Leakage with power gating': 0.0259246}, 'Core': [{'Area': 32.6082, 'Execution Unit/Area': 8.2042, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.134519, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.308346, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.869042, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.122718, 'Execution Unit/Instruction Scheduler/Area': 2.17927, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.328073, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.00115349, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.20978, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.749687, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.017004, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00962066, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00730101, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 1.00996, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00529112, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 2.07911, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 1.29819, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0800117, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0455351, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 4.84781, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.841232, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.000856399, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.55892, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.744547, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.0178624, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00897339, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 2.79242, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.114878, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.0641291, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.607799, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 7.56664, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.164181, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0271768, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.241086, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.200989, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.405267, 'Execution Unit/Register Files/Runtime Dynamic': 0.228165, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0442632, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00607074, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.619416, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 1.52498, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.0920413, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0345155, 'Execution Unit/Runtime Dynamic': 5.25929, 'Execution Unit/Subthreshold Leakage': 1.83518, 'Execution Unit/Subthreshold Leakage with power gating': 0.709678, 'Gate Leakage': 0.372997, 'Instruction Fetch Unit/Area': 5.86007, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.0037841, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.0037841, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.00327615, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.00125742, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.00288722, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.0137316, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.0369892, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0590479, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.193216, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 6.43323, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.643972, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.656247, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 8.96874, 'Instruction Fetch Unit/Runtime Dynamic': 1.54416, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932587, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.408542, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0607968, 'L2/Runtime Dynamic': 0.0238427, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80969, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 5.70881, 'Load Store Unit/Data Cache/Runtime Dynamic': 2.18696, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0351387, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.14467, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.14467, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 6.39475, 'Load Store Unit/Runtime Dynamic': 3.0451, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.356731, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.713462, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591622, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283406, 'Memory Management Unit/Area': 0.434579, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.126605, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.127515, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00813591, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.399995, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.105578, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.777369, 'Memory Management Unit/Runtime Dynamic': 0.233093, 'Memory Management Unit/Subthreshold Leakage': 0.0769113, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462, 'Peak Dynamic': 28.33, 'Renaming Unit/Area': 0.369768, 'Renaming Unit/FP Front End RAT/Area': 0.168486, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00489731, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 3.33511, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.57279, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0437281, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.024925, 'Renaming Unit/Free List/Area': 0.0414755, 'Renaming Unit/Free List/Gate Leakage': 4.15911e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0401324, 'Renaming Unit/Free List/Runtime Dynamic': 0.0452274, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000670426, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000377987, 'Renaming Unit/Gate Leakage': 0.00863632, 'Renaming Unit/Int Front End RAT/Area': 0.114751, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.00038343, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.86945, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.38194, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00611897, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781, 'Renaming Unit/Peak Dynamic': 4.56169, 'Renaming Unit/Runtime Dynamic': 0.999957, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime Dynamic': 11.1054, 'Subthreshold Leakage': 6.21877, 'Subthreshold Leakage with power gating': 2.58311}, {'Area': 32.0201, 'Execution Unit/Area': 7.68434, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.0622834, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.251609, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.400778, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.120359, 'Execution Unit/Instruction Scheduler/Area': 1.66526, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.288425, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.465219, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.234827, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.988471, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.268429, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 5.0175, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.0757156, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0120978, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.108181, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.089471, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.183896, 'Execution Unit/Register Files/Runtime Dynamic': 0.101569, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.243481, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.598191, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 2.34522, 'Execution Unit/Subthreshold Leakage': 1.79543, 'Execution Unit/Subthreshold Leakage with power gating': 0.688821, 'Gate Leakage': 0.368936, 'Instruction Fetch Unit/Area': 5.85939, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.00180264, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.00180264, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.00159215, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.000628404, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.00128526, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00648269, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.0164959, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0589979, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0860108, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 5.47103, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.285843, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.292131, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 7.95506, 'Instruction Fetch Unit/Runtime Dynamic': 0.686963, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932286, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0261081, 'L2/Runtime Dynamic': 0.0101799, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80901, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 3.21939, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.968564, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0350888, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.0641313, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0641312, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 3.52223, 'Load Store Unit/Runtime Dynamic': 1.34897, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.158137, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.316273, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591321, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283293, 'Memory Management Unit/Area': 0.4339, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0561232, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0565129, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00808595, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.340168, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0468663, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.592687, 'Memory Management Unit/Runtime Dynamic': 0.103379, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 20.7031, 'Renaming Unit/Area': 0.303608, 'Renaming Unit/FP Front End RAT/Area': 0.131045, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.199172, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885, 'Renaming Unit/Free List/Area': 0.0340654, 'Renaming Unit/Free List/Gate Leakage': 2.5481e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0306032, 'Renaming Unit/Free List/Runtime Dynamic': 0.0154368, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064, 'Renaming Unit/Gate Leakage': 0.00708398, 'Renaming Unit/Int Front End RAT/Area': 0.0941223, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.14394, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.358549, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 4.85326, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}, {'Area': 32.0201, 'Execution Unit/Area': 7.68434, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.0516689, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.243272, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.329322, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.120359, 'Execution Unit/Instruction Scheduler/Area': 1.66526, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.247959, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.399949, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.201881, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.849788, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.233105, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 4.83052, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.062216, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0104005, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0925082, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0769182, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.154724, 'Execution Unit/Register Files/Runtime Dynamic': 0.0873187, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.207809, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.511623, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 2.09738, 'Execution Unit/Subthreshold Leakage': 1.79543, 'Execution Unit/Subthreshold Leakage with power gating': 0.688821, 'Gate Leakage': 0.368936, 'Instruction Fetch Unit/Area': 5.85939, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.00159533, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.00159533, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.00140738, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.000554586, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.00110494, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00570297, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.014658, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0589979, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0739434, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 4.70344, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.240721, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.251145, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 7.15022, 'Instruction Fetch Unit/Runtime Dynamic': 0.586171, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932286, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0367448, 'L2/Runtime Dynamic': 0.0148648, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80901, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 2.98404, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.875449, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0350888, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.0565171, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.056517, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 3.25093, 'Load Store Unit/Runtime Dynamic': 1.21069, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.139361, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.278723, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591321, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283293, 'Memory Management Unit/Area': 0.4339, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0494598, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0500101, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00808595, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.292442, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0394669, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.533515, 'Memory Management Unit/Runtime Dynamic': 0.089477, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 19.3914, 'Renaming Unit/Area': 0.303608, 'Renaming Unit/FP Front End RAT/Area': 0.131045, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.163661, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885, 'Renaming Unit/Free List/Area': 0.0340654, 'Renaming Unit/Free List/Gate Leakage': 2.5481e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0306032, 'Renaming Unit/Free List/Runtime Dynamic': 0.013179, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064, 'Renaming Unit/Gate Leakage': 0.00708398, 'Renaming Unit/Int Front End RAT/Area': 0.0941223, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.123901, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.300741, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 4.29932, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}, {'Area': 32.0201, 'Execution Unit/Area': 7.68434, 'Execution Unit/Complex ALUs/Area': 0.235435, 'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646, 'Execution Unit/Complex ALUs/Peak Dynamic': 0.0449672, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.238008, 'Execution Unit/Complex ALUs/Subthreshold Leakage': 0.20111, 'Execution Unit/Complex ALUs/Subthreshold Leakage with power gating': 0.0754163, 'Execution Unit/Floating Point Units/Area': 4.6585, 'Execution Unit/Floating Point Units/Gate Leakage': 0.0656156, 'Execution Unit/Floating Point Units/Peak Dynamic': 0.285601, 'Execution Unit/Floating Point Units/Runtime Dynamic': 0.304033, 'Execution Unit/Floating Point Units/Subthreshold Leakage': 0.994829, 'Execution Unit/Floating Point Units/Subthreshold Leakage with power gating': 0.373061, 'Execution Unit/Gate Leakage': 0.120359, 'Execution Unit/Instruction Scheduler/Area': 1.66526, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Area': 0.275653, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Gate Leakage': 0.000977433, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Peak Dynamic': 1.04181, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Runtime Dynamic': 0.210254, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.0143453, 'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00810519, 'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00568913, 'Execution Unit/Instruction Scheduler/Instruction Window/Area': 0.805223, 'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00414562, 'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 1.6763, 'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.339131, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage': 0.0625755, 'Execution Unit/Instruction Scheduler/Instruction Window/Subthreshold Leakage with power gating': 0.0355964, 'Execution Unit/Instruction Scheduler/Peak Dynamic': 3.82262, 'Execution Unit/Instruction Scheduler/ROB/Area': 0.584388, 'Execution Unit/Instruction Scheduler/ROB/Gate Leakage': 0.00056608, 'Execution Unit/Instruction Scheduler/ROB/Peak Dynamic': 1.10451, 'Execution Unit/Instruction Scheduler/ROB/Runtime Dynamic': 0.171182, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.00906853, 'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00364446, 'Execution Unit/Instruction Scheduler/Runtime Dynamic': 0.720567, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage': 0.0859892, 'Execution Unit/Instruction Scheduler/Subthreshold Leakage with power gating': 0.047346, 'Execution Unit/Integer ALUs/Area': 0.47087, 'Execution Unit/Integer ALUs/Gate Leakage': 0.0265291, 'Execution Unit/Integer ALUs/Peak Dynamic': 0.196682, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 4.68648, 'Execution Unit/Register Files/Area': 0.570804, 'Execution Unit/Register Files/Floating Point RF/Area': 0.208131, 'Execution Unit/Register Files/Floating Point RF/Gate Leakage': 0.000232788, 'Execution Unit/Register Files/Floating Point RF/Peak Dynamic': 0.0539561, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00881898, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage': 0.00399698, 'Execution Unit/Register Files/Floating Point RF/Subthreshold Leakage with power gating': 0.00176968, 'Execution Unit/Register Files/Gate Leakage': 0.000622708, 'Execution Unit/Register Files/Integer RF/Area': 0.362673, 'Execution Unit/Register Files/Integer RF/Gate Leakage': 0.00038992, 'Execution Unit/Register Files/Integer RF/Peak Dynamic': 0.0788684, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0652217, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage': 0.00614175, 'Execution Unit/Register Files/Integer RF/Subthreshold Leakage with power gating': 0.00246675, 'Execution Unit/Register Files/Peak Dynamic': 0.132824, 'Execution Unit/Register Files/Runtime Dynamic': 0.0740407, 'Execution Unit/Register Files/Subthreshold Leakage': 0.0101387, 'Execution Unit/Register Files/Subthreshold Leakage with power gating': 0.00423643, 'Execution Unit/Results Broadcast Bus/Area Overhead': 0.0390912, 'Execution Unit/Results Broadcast Bus/Gate Leakage': 0.00537402, 'Execution Unit/Results Broadcast Bus/Peak Dynamic': 0.177398, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.43356, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 1.87155, 'Execution Unit/Subthreshold Leakage': 1.79543, 'Execution Unit/Subthreshold Leakage with power gating': 0.688821, 'Gate Leakage': 0.368936, 'Instruction Fetch Unit/Area': 5.85939, 'Instruction Fetch Unit/Branch Predictor/Area': 0.138516, 'Instruction Fetch Unit/Branch Predictor/Chooser/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Chooser/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Chooser/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Chooser/Runtime Dynamic': 0.00134912, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Chooser/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/Gate Leakage': 0.000757657, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Area': 0.0435221, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Gate Leakage': 0.000278362, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Peak Dynamic': 0.0168831, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Runtime Dynamic': 0.00134912, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage': 0.00759719, 'Instruction Fetch Unit/Branch Predictor/Global Predictor/Subthreshold Leakage with power gating': 0.0039236, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Area': 0.0257064, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Gate Leakage': 0.000154548, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Peak Dynamic': 0.0142575, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Runtime Dynamic': 0.00119071, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage': 0.00384344, 'Instruction Fetch Unit/Branch Predictor/L1_Local Predictor/Subthreshold Leakage with power gating': 0.00198631, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Area': 0.0151917, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Gate Leakage': 8.00196e-05, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Peak Dynamic': 0.00527447, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Runtime Dynamic': 0.000469492, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage': 0.00181347, 'Instruction Fetch Unit/Branch Predictor/L2_Local Predictor/Subthreshold Leakage with power gating': 0.000957045, 'Instruction Fetch Unit/Branch Predictor/Peak Dynamic': 0.0597838, 'Instruction Fetch Unit/Branch Predictor/RAS/Area': 0.0105732, 'Instruction Fetch Unit/Branch Predictor/RAS/Gate Leakage': 4.63858e-05, 'Instruction Fetch Unit/Branch Predictor/RAS/Peak Dynamic': 0.0117602, 'Instruction Fetch Unit/Branch Predictor/RAS/Runtime Dynamic': 0.000936915, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage': 0.000932505, 'Instruction Fetch Unit/Branch Predictor/RAS/Subthreshold Leakage with power gating': 0.000494733, 'Instruction Fetch Unit/Branch Predictor/Runtime Dynamic': 0.00482587, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage': 0.0199703, 'Instruction Fetch Unit/Branch Predictor/Subthreshold Leakage with power gating': 0.0103282, 'Instruction Fetch Unit/Branch Target Buffer/Area': 0.64954, 'Instruction Fetch Unit/Branch Target Buffer/Gate Leakage': 0.00272758, 'Instruction Fetch Unit/Branch Target Buffer/Peak Dynamic': 0.177867, 'Instruction Fetch Unit/Branch Target Buffer/Runtime Dynamic': 0.0123768, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage': 0.0811682, 'Instruction Fetch Unit/Branch Target Buffer/Subthreshold Leakage with power gating': 0.0435357, 'Instruction Fetch Unit/Gate Leakage': 0.0589979, 'Instruction Fetch Unit/Instruction Buffer/Area': 0.0226323, 'Instruction Fetch Unit/Instruction Buffer/Gate Leakage': 6.83558e-05, 'Instruction Fetch Unit/Instruction Buffer/Peak Dynamic': 0.606827, 'Instruction Fetch Unit/Instruction Buffer/Runtime Dynamic': 0.0626993, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 3.98822, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.194691, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage': 0.367022, 'Instruction Fetch Unit/Instruction Cache/Subthreshold Leakage with power gating': 0.180386, 'Instruction Fetch Unit/Instruction Decoder/Area': 1.85799, 'Instruction Fetch Unit/Instruction Decoder/Gate Leakage': 0.0222493, 'Instruction Fetch Unit/Instruction Decoder/Peak Dynamic': 1.37404, 'Instruction Fetch Unit/Instruction Decoder/Runtime Dynamic': 0.212955, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 6.40029, 'Instruction Fetch Unit/Runtime Dynamic': 0.487548, 'Instruction Fetch Unit/Subthreshold Leakage': 0.932286, 'Instruction Fetch Unit/Subthreshold Leakage with power gating': 0.40843, 'L2/Area': 4.53318, 'L2/Gate Leakage': 0.015464, 'L2/Peak Dynamic': 0.0482008, 'L2/Runtime Dynamic': 0.0193441, 'L2/Subthreshold Leakage': 0.834142, 'L2/Subthreshold Leakage with power gating': 0.401066, 'Load Store Unit/Area': 8.80901, 'Load Store Unit/Data Cache/Area': 6.84535, 'Load Store Unit/Data Cache/Gate Leakage': 0.0279261, 'Load Store Unit/Data Cache/Peak Dynamic': 2.73966, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.777181, 'Load Store Unit/Data Cache/Subthreshold Leakage': 0.527675, 'Load Store Unit/Data Cache/Subthreshold Leakage with power gating': 0.25085, 'Load Store Unit/Gate Leakage': 0.0350888, 'Load Store Unit/LoadQ/Area': 0.0836782, 'Load Store Unit/LoadQ/Gate Leakage': 0.00059896, 'Load Store Unit/LoadQ/Peak Dynamic': 0.0486109, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0486109, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 2.96921, 'Load Store Unit/Runtime Dynamic': 1.06552, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.119866, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.239732, 'Load Store Unit/StoreQ/Subthreshold Leakage': 0.0345621, 'Load Store Unit/StoreQ/Subthreshold Leakage with power gating': 0.0197004, 'Load Store Unit/Subthreshold Leakage': 0.591321, 'Load Store Unit/Subthreshold Leakage with power gating': 0.283293, 'Memory Management Unit/Area': 0.4339, 'Memory Management Unit/Dtlb/Area': 0.0879726, 'Memory Management Unit/Dtlb/Gate Leakage': 0.00088729, 'Memory Management Unit/Dtlb/Peak Dynamic': 0.0425409, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0432634, 'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699, 'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485, 'Memory Management Unit/Gate Leakage': 0.00808595, 'Memory Management Unit/Itlb/Area': 0.301552, 'Memory Management Unit/Itlb/Gate Leakage': 0.00393464, 'Memory Management Unit/Itlb/Peak Dynamic': 0.247973, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0319208, 'Memory Management Unit/Itlb/Subthreshold Leakage': 0.0413758, 'Memory Management Unit/Itlb/Subthreshold Leakage with power gating': 0.0235842, 'Memory Management Unit/Peak Dynamic': 0.477159, 'Memory Management Unit/Runtime Dynamic': 0.0751842, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 18.1708, 'Renaming Unit/Area': 0.303608, 'Renaming Unit/FP Front End RAT/Area': 0.131045, 'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00351123, 'Renaming Unit/FP Front End RAT/Peak Dynamic': 2.51468, 'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.141934, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage': 0.0308571, 'Renaming Unit/FP Front End RAT/Subthreshold Leakage with power gating': 0.0175885, 'Renaming Unit/Free List/Area': 0.0340654, 'Renaming Unit/Free List/Gate Leakage': 2.5481e-05, 'Renaming Unit/Free List/Peak Dynamic': 0.0306032, 'Renaming Unit/Free List/Runtime Dynamic': 0.0112134, 'Renaming Unit/Free List/Subthreshold Leakage': 0.000370144, 'Renaming Unit/Free List/Subthreshold Leakage with power gating': 0.000201064, 'Renaming Unit/Gate Leakage': 0.00708398, 'Renaming Unit/Int Front End RAT/Area': 0.0941223, 'Renaming Unit/Int Front End RAT/Gate Leakage': 0.000283242, 'Renaming Unit/Int Front End RAT/Peak Dynamic': 0.731965, 'Renaming Unit/Int Front End RAT/Runtime Dynamic': 0.104957, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00435488, 'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00248228, 'Renaming Unit/Peak Dynamic': 3.58947, 'Renaming Unit/Runtime Dynamic': 0.258104, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 3.77726, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}], 'DRAM': {'Area': 0, 'Gate Leakage': 0, 'Peak Dynamic': 4.565347451194352, 'Runtime Dynamic': 4.565347451194352, 'Subthreshold Leakage': 4.252, 'Subthreshold Leakage with power gating': 4.252}, 'L3': [{'Area': 61.9075, 'Gate Leakage': 0.0484137, 'Peak Dynamic': 0.158312, 'Runtime Dynamic': 0.101947, 'Subthreshold Leakage': 6.80085, 'Subthreshold Leakage with power gating': 3.32364}], 'Processor': {'Area': 191.908, 'Gate Leakage': 1.53485, 'Peak Dynamic': 86.7536, 'Peak Power': 119.866, 'Runtime Dynamic': 24.1372, 'Subthreshold Leakage': 31.5774, 'Subthreshold Leakage with power gating': 13.9484, 'Total Cores/Area': 128.669, 'Total Cores/Gate Leakage': 1.4798, 'Total Cores/Peak Dynamic': 86.5953, 'Total Cores/Runtime Dynamic': 24.0353, 'Total Cores/Subthreshold Leakage': 24.7074, 'Total Cores/Subthreshold Leakage with power gating': 10.2429, 'Total L3s/Area': 61.9075, 'Total L3s/Gate Leakage': 0.0484137, 'Total L3s/Peak Dynamic': 0.158312, 'Total L3s/Runtime Dynamic': 0.101947, 'Total L3s/Subthreshold Leakage': 6.80085, 'Total L3s/Subthreshold Leakage with power gating': 3.32364, 'Total Leakage': 33.1122, 'Total NoCs/Area': 1.33155, 'Total NoCs/Gate Leakage': 0.00662954, 'Total NoCs/Peak Dynamic': 0.0, 'Total NoCs/Runtime Dynamic': 0.0, 'Total NoCs/Subthreshold Leakage': 0.0691322, 'Total NoCs/Subthreshold Leakage with power gating': 0.0259246}}
# coding=UTF-8 #------------------------------------------------------------------------------ # Copyright (c) 2007-2021, Acoular Development Team. #------------------------------------------------------------------------------ # separate file to find out about version without importing the acoular lib __author__ = "Acoular Development Team" __date__ = "5 May 2021" __version__ = "21.05"
# CHeck if running from inside jupyter # From https://stackoverflow.com/questions/47211324/check-if-module-is-running-in-jupyter-or-not def type_of_script(): try: ipy_str = str(type(get_ipython())) if 'zmqshell' in ipy_str: return 'jupyter' if 'terminal' in ipy_str: return 'ipython' except: return 'terminal'
def test_status(client): resp = client.get('/status') assert resp.status_code == 200 def test_get_eval(client): resp = client.get('/evaluate') assert resp.status_code == 405 def test_eval_post(client, eval_dict): resp = client.post('/evaluate', data=eval_dict) assert resp.status_code == 200 def test_post_eval_dict(client, eval_dict): """Tests that the response manifest is the expected length and all requirements are 0,1, or 2 """ resp = client.post('/evaluate', data=eval_dict) file_list = resp.json['manifest'] assert len(file_list) == 5 for file in file_list: assert file['requirement'] in range(3) def test_run_get(client, run_dict): # can't test run endpoint further without knowing what # kinds of sbol files it can handle # so just test that the run endpoint exists resp = client.get('/run') assert resp.status_code == 405
# A Tuple is a collection which is ordered and unchangeable. Allows duplicate members. # Create tuple fruits = ('Apples', 'Oranges', 'Grapes') # Using a constructor # fruits2 = tuple(('Apples', 'Oranges', 'Grapes')) # Single value needs trailing comma fruits2 = ('Apples',) # Get value print(fruits[1]) # Can't change value fruits[0] = 'Pears' # Delete tuple del fruits2 # Get length print(len(fruits)) # A Set is a collection which is unordered and unindexed. No duplicate members. # Create set fruits_set = {'Apples', 'Oranges', 'Mango'} # Check if in set print('Apples' in fruits_set) # Add to set fruits_set.add('Grape') # Remove from set fruits_set.remove('Grape') # Add duplicate fruits_set.add('Apples') # Clear set fruits_set.clear() # Delete del fruits_set print(fruits_set)
n = int(__import__('sys').stdin.readline()) a = [int(_) for _ in __import__('sys').stdin.readline().split()] res = [-1] * n for i in range(n): for j in range(n): if a[j] > i: continue c = 0 for front in range(i): if res[front] > j: c += 1 if c == a[j]: res[i] = j+1 break print(' '.join(map(str, res)))
# demonstrates how to get data out of a closure # on way is to use nonlocal keyword # nonlocal Py3 only, makes it clear when data is being assigned out of a # closure into another scope. CAUTION def sort_priority(numbers, group): """ Python scope is determined by LEGB - local - enclosing - global - built-in scope """ found = False def helper(x): nonlocal found # assert that we want to refer to the enclosing scope if x in group: found = True return (0, x) return (1, x) numbers.sort(key=helper) return found # it is better to wrap your state in a helper class class Sorter(object): def __init__(self, group): self.group = group self.found = False def __call__(self, x): """ this is triggered when the instance of Sorter is called https://stackoverflow.com/a/9663601/1010338 """ if x in self.group: self.found = True return (0, x) return (1, x) if __name__ == '__main__': numbers = [8, 3, 1, 2, 5, 4, 7, 6] group = {2, 3, 5, 7} # nonlocal style # found = sort_priority(numbers, group) # print('Found: ', found) # print(numbers) # helper class style sorter = Sorter(group) numbers.sort(key=sorter) assert sorter.found is True
def ficha(nome, gols): if nome == '': nome = '<desconhecido>' if gols == '': gols = 0 print(f'O jogador {nome} fez {gols} gol(s) no campeonato.') nomeJogador = str(input('Nome do jogador: ')).title() golsJogador = input('Número de gols: ') ficha(nomeJogador, golsJogador)
"""Result - Data structure for a team.""" class Team: """Result - Data structure for a team.""" def __init__(self, team_name, goals_for=0, goals_against=0, home_games=0, away_games=0, points=0): """Construct a Team object.""" self._team_name = team_name self._goals_for = goals_for self._goals_against = goals_against self._home_games = home_games self._away_games = away_games self._points = points self._historic_briers_scores = [] self._historic_attack_strength = [] self._historic_defence_factor = [] def __eq__(self, other): """ Override the __eq__ method for the Team class to allow for object value comparison. Parameters ---------- other : footy.domain.Team.Team The team object to compare to. Returns ------- bool True/False if the values in the two objects are equal. """ return ( self.__class__ == other.__class__ and self._team_name == other._team_name and self._goals_for == other._goals_for and self._goals_against == other._goals_against and self._home_games == other._home_games and self._away_games == other._away_games and self._points == other._points ) def team_name(self): """ Getter method for property team_name. Returns ------- str The value of property team_name. """ return self._team_name def goals_for(self, goals_for=None): """ Getter/setter for property goals_for. Parameters ---------- goals_for : int, optional Set the value of property goals_for. Returns ------- int The value of property goals_for. """ if goals_for is not None: self._goals_for = goals_for return self._goals_for def goals_against(self, goals_against=None): """ Getter/setter method for property goals_against. Parameters ---------- goals_against : int, optional The value to set the property to. Returns ------- int The value of property goals_against. """ if goals_against is not None: self._goals_against = goals_against return self._goals_against def historic_attack_strength(self, attack_strength=None): """ Append attack strength (if provided) if not, return the list. Parameters ---------- attack_strength : float, optional The attack strength to be appended to the historic attack strengths. Returns ------- list of floats A list of the historic attack strengths. """ if attack_strength is not None: self._historic_attack_strength.append(attack_strength) return self._historic_attack_strength def historic_briers_score(self, briers_score=None): """ Append to the Briers Score list for outcomes. Parameters ---------- briers_score : float Returns ------- list of float List of the historic outcome Briers scores. """ if briers_score is not None: self._historic_briers_scores.append(briers_score) return self._historic_briers_scores def historic_defence_factor(self, defence_factor=None): """ Append defence factor (if provided) and provide historic figures. Parameters ---------- defence_factor : float, optional The defence factor to be appended to the list. Returns ------- list of float The historic defence factors for this team. """ if defence_factor is not None: self._historic_defence_factor.append(defence_factor) return self._historic_defence_factor def home_games(self, home_games=None): """ Setter/getter method for property home_games. Parameters ---------- home_games : int, optional The value you wish to set the home_games property to. Returns ------- int The value of property home_games. """ if home_games is not None: self._home_games = home_games return self._home_games def away_games(self, away_games=None): """ Getter/setter method for property away_games. Parameters ---------- away_games : int, optional The value you wish to set the away_games property to. Returns ------- int The value of property away_games. """ if away_games is not None: self._away_games = away_games return self._away_games def points(self, points=None): """ Getter/setter method for property points. Parameters ---------- points : int, optional The value you wish to set the points property to. Returns ------- int The value of property points. """ if points is not None: self._points = points return self._points def goal_difference(self): """ Calculate and return the goal difference for the team. Returns ------- int goals_for - goals_against """ return self._goals_for - self._goals_against
"""Set Union You are given two sets of student roll numbers. One set has subscribed to the English newspaper, and the other set is subscribed to the French newspaper. The same student could be in both sets. Your task is to find the total number of students who have subscribed to at least one newspaper. The first line contains an integer, nn, the number of students who have subscribed to the English newspaper. The second line contains nn space separated roll numbers of those students. The third line contains bb, the number of students who have subscribed to the French newspaper. The fourth line contains bb space separated roll numbers of those students. Output the total number of students who are subscribed to the English or French newspaper. """ english, french = ( set(map(int, input().strip().split())) if int(input().strip()) > 0 else set() for _ in range(2) ) print(len(english | french))
# coding=utf-8 region_name = "" access_key = "" access_secret = "" endpoint = None app_id = "" acl_ak = "" acl_access_secret = ""
{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "## Script to calculate Basic Statistics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Equation for the mean: $\\mu_x = \\sum_{i=1}^{N}\\frac{x_i}{N}$\n", "\n", "### Equation for the standard deviation: $\\sigma_x = \\sqrt{\\sum_{i=1}^{N}\\left(x_i - \\mu \\right)^2}\\frac{1}{N-1}$\n", "\n", "\n", "**Instructions:**\n", "\n", "**(1) Before you write code, write an algorithm that describes the sequence of steps you will take to compute the mean and standard deviation for your samples. The algorithm can be written in pseudocode or as an itemized list.***\n", "\n", "**(2) Use 'for' loops to help yourself compute the average and standard deviation.**\n", "\n", "**(3) Use for loops and conditional operators to count the number of samples within $1\\sigma$ of the mean.**\n", "\n", "**Note:** It is not acceptable to use the pre-programmed routines for mean and st. dev., e.g. numpy.mean()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Edit this box to write an algorithm for computing the mean and std. deviation.\n", "\n", "~~~\n", "\n", "\n", "\n", "\n", "\n", "\n", "~~~" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Write your code using instructions in the cells below." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "# Put your Header information here. Name, creation date, version, etc.\n" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "# Import the matplotlib module here. No other modules should be used.\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Create a list variable that contains at least 25 elements. You can create this list any number of ways. \n", "# This will be your sample.\n" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "# Pretend you do not know how long x is; compute it's length, N, without using functions or modules.\n" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "# Compute the mean of the elements in list x.\n", "\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "# Compute the std deviation, using the mean and the elements in list x.\n", "\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "# Use the 'print' command to report the values of average (mu) and std. dev. (sigma).\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "# Count the number of values that are within +/- 1 std. deviation of the mean. \n", "# A normal distribution will have approx. 68% of the values within this range. \n", "# Based on this criteria is the list normally distributed?\n", "\n", "\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "# Use print() and if statements to report a message about whether the data is normally distributed.\n", "\n" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [], "source": [ "### Use Matplotlb.pyplot to make a histogram of x.\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "### OCG 593 students, look up an equation for Skewness and write code to compute the skewness. \n", "#### Compute the skewness and report whether the sample is normally distributed." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" } }, "nbformat": 4, "nbformat_minor": 1 }
# # PySNMP MIB module ALVARION-TOOLS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALVARION-TOOLS-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:22:25 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) # alvarionMgmtV2, = mibBuilder.importSymbols("ALVARION-SMI", "alvarionMgmtV2") AlvarionNotificationEnable, = mibBuilder.importSymbols("ALVARION-TC", "AlvarionNotificationEnable") OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, ValueSizeConstraint, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "ValueSizeConstraint", "SingleValueConstraint") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") NotificationGroup, ModuleCompliance, ObjectGroup = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance", "ObjectGroup") TimeTicks, Counter32, MibIdentifier, ModuleIdentity, IpAddress, Integer32, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Gauge32, Counter64, Bits, ObjectIdentity, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "Counter32", "MibIdentifier", "ModuleIdentity", "IpAddress", "Integer32", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Gauge32", "Counter64", "Bits", "ObjectIdentity", "Unsigned32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") alvarionToolsMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12)) if mibBuilder.loadTexts: alvarionToolsMIB.setLastUpdated('200710310000Z') if mibBuilder.loadTexts: alvarionToolsMIB.setOrganization('Alvarion Ltd.') if mibBuilder.loadTexts: alvarionToolsMIB.setContactInfo('Alvarion Ltd. Postal: 21a HaBarzel St. P.O. Box 13139 Tel-Aviv 69710 Israel Phone: +972 3 645 6262') if mibBuilder.loadTexts: alvarionToolsMIB.setDescription('Alvarion Tools MIB module.') alvarionToolsMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1)) traceToolConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1)) traceInterface = MibScalar((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1, 1), InterfaceIndex()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceInterface.setStatus('current') if mibBuilder.loadTexts: traceInterface.setDescription('Specifies the interface to apply the trace to.') traceCaptureDestination = MibScalar((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("local", 1), ("remote", 2)))).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCaptureDestination.setStatus('current') if mibBuilder.loadTexts: traceCaptureDestination.setDescription("Specifies if the traces shall be stored locally on the device or remotely on a distant system. 'local': Stores the traces locally on the device. 'remote': Stores the traces in a remote file specified by traceCaptureDestinationURL.") traceCaptureDestinationURL = MibScalar((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1, 3), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCaptureDestinationURL.setStatus('current') if mibBuilder.loadTexts: traceCaptureDestinationURL.setDescription('Specifies the URL of the file that trace data will be sent to. If a valid URL is not defined, the trace data cannot be sent and will be discarded.') traceTimeout = MibScalar((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 99999)).clone(600)).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: traceTimeout.setStatus('current') if mibBuilder.loadTexts: traceTimeout.setDescription('Specifies the amount of time the trace will capture data. Once this limit is reached, the trace automatically stops.') traceNumberOfPackets = MibScalar((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1, 5), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 99999)).clone(100)).setUnits('packets').setMaxAccess("readwrite") if mibBuilder.loadTexts: traceNumberOfPackets.setStatus('current') if mibBuilder.loadTexts: traceNumberOfPackets.setDescription('Specifies the maximum number of packets (IP datagrams) the trace should capture. Once this limit is reached, the trace automatically stops.') tracePacketSize = MibScalar((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(68, 4096)).clone(128)).setUnits('bytes').setMaxAccess("readwrite") if mibBuilder.loadTexts: tracePacketSize.setStatus('current') if mibBuilder.loadTexts: tracePacketSize.setDescription('Specifies the maximum number of bytes to capture for each packet. The remaining data is discarded.') traceCaptureFilter = MibScalar((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1, 7), DisplayString()).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCaptureFilter.setStatus('current') if mibBuilder.loadTexts: traceCaptureFilter.setDescription('Specifies the packet filter to use to capture data. The filter expression has the same format and behavior as the expression parameter used by the well-known TCPDUMP command.') traceCaptureStatus = MibScalar((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1, 8), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("stop", 1), ("start", 2))).clone('stop')).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceCaptureStatus.setStatus('current') if mibBuilder.loadTexts: traceCaptureStatus.setDescription("IP Trace tool action trigger. 'stop': Stops the trace tool from functioning. If any capture was previously started it will end up. if no capture was started, 'stop' has no effect. 'start': Starts to capture the packets following the critera specified in the management tool and in this MIB.") traceNotificationEnabled = MibScalar((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 1, 1, 9), AlvarionNotificationEnable().clone('disable')).setMaxAccess("readwrite") if mibBuilder.loadTexts: traceNotificationEnabled.setStatus('current') if mibBuilder.loadTexts: traceNotificationEnabled.setDescription('Specifies if IP trace notifications are generated.') alvarionToolsMIBNotificationPrefix = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 2)) alvarionToolsMIBNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 2, 0)) traceStatusNotification = NotificationType((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 2, 0, 1)).setObjects(("ALVARION-TOOLS-MIB", "traceCaptureStatus")) if mibBuilder.loadTexts: traceStatusNotification.setStatus('current') if mibBuilder.loadTexts: traceStatusNotification.setDescription('Sent when the user triggers the IP Trace tool either by starting a new trace or stopping an existing session.') alvarionToolsMIBConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 3)) alvarionToolsMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 3, 1)) alvarionToolsMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 3, 2)) alvarionToolsMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 3, 1, 1)).setObjects(("ALVARION-TOOLS-MIB", "alvarionToolsMIBGroup"), ("ALVARION-TOOLS-MIB", "alvarionToolsNotificationGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alvarionToolsMIBCompliance = alvarionToolsMIBCompliance.setStatus('current') if mibBuilder.loadTexts: alvarionToolsMIBCompliance.setDescription('The compliance statement for entities which implement the Alvarion Tools MIB.') alvarionToolsMIBGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 3, 2, 1)).setObjects(("ALVARION-TOOLS-MIB", "traceInterface"), ("ALVARION-TOOLS-MIB", "traceCaptureDestination"), ("ALVARION-TOOLS-MIB", "traceCaptureDestinationURL"), ("ALVARION-TOOLS-MIB", "traceTimeout"), ("ALVARION-TOOLS-MIB", "traceNumberOfPackets"), ("ALVARION-TOOLS-MIB", "tracePacketSize"), ("ALVARION-TOOLS-MIB", "traceCaptureFilter"), ("ALVARION-TOOLS-MIB", "traceCaptureStatus"), ("ALVARION-TOOLS-MIB", "traceNotificationEnabled")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alvarionToolsMIBGroup = alvarionToolsMIBGroup.setStatus('current') if mibBuilder.loadTexts: alvarionToolsMIBGroup.setDescription('A collection of objects providing the Tools MIB capability.') alvarionToolsNotificationGroup = NotificationGroup((1, 3, 6, 1, 4, 1, 12394, 1, 10, 5, 12, 3, 2, 2)).setObjects(("ALVARION-TOOLS-MIB", "traceStatusNotification")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): alvarionToolsNotificationGroup = alvarionToolsNotificationGroup.setStatus('current') if mibBuilder.loadTexts: alvarionToolsNotificationGroup.setDescription('A collection of supported notifications.') mibBuilder.exportSymbols("ALVARION-TOOLS-MIB", traceInterface=traceInterface, alvarionToolsMIBNotifications=alvarionToolsMIBNotifications, traceCaptureStatus=traceCaptureStatus, alvarionToolsMIB=alvarionToolsMIB, traceCaptureFilter=traceCaptureFilter, alvarionToolsMIBObjects=alvarionToolsMIBObjects, traceNotificationEnabled=traceNotificationEnabled, alvarionToolsMIBCompliance=alvarionToolsMIBCompliance, alvarionToolsMIBNotificationPrefix=alvarionToolsMIBNotificationPrefix, alvarionToolsMIBCompliances=alvarionToolsMIBCompliances, tracePacketSize=tracePacketSize, traceStatusNotification=traceStatusNotification, alvarionToolsNotificationGroup=alvarionToolsNotificationGroup, traceNumberOfPackets=traceNumberOfPackets, PYSNMP_MODULE_ID=alvarionToolsMIB, alvarionToolsMIBConformance=alvarionToolsMIBConformance, traceCaptureDestinationURL=traceCaptureDestinationURL, alvarionToolsMIBGroup=alvarionToolsMIBGroup, alvarionToolsMIBGroups=alvarionToolsMIBGroups, traceCaptureDestination=traceCaptureDestination, traceToolConfig=traceToolConfig, traceTimeout=traceTimeout)
# Copyright 2021 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. INSTALL_PACKAGE_CMD = 'Add-WindowsPackage' INSTALL_PACKAGE_SCRIPT = 'Add-WindowsPackage.ps1' INSTALL_PACKAGE_PATH = '-PackagePath {}' INSTALL_PACKAGE_ROOT = '-Path {}' INSTALL_PACKAGE_LOG_PATH = '-LogPath "{}"' INSTALL_PACKAGE_LOG_LEVEL = '-LogLevel {}' def install_package(powershell, scripts, awp, package, mnt_dir, logs, log_level='WarningsInfo'): """Install a package to the mounted image""" # Args for the install command args = [ INSTALL_PACKAGE_PATH.format(package), INSTALL_PACKAGE_ROOT.format(mnt_dir), INSTALL_PACKAGE_LOG_PATH.format( logs.join(INSTALL_PACKAGE_CMD, 'ins_pkg.log')), INSTALL_PACKAGE_LOG_LEVEL.format(log_level) ] for a in awp.args: args.append(a) return powershell( 'Install package {}'.format(awp.name), scripts.join(INSTALL_PACKAGE_SCRIPT), logs=[logs.join(INSTALL_PACKAGE_CMD)], args=args)
# TODO - Update THINGS value with your things. These are the SNAP MACs for your devices, ex: "abc123" # Addresses should not have any separators (no "." Or ":", etc.). The hexadecimal digits a-f must be entered in lower case. THINGS = ["XXXXXX"] PROFILE_NAME = "default" CERTIFICATE_CERT = "certs/certificate_cert.pem" CERTIFICATE_KEY = "certs/certificate_key.pem" CAFILE = "certs/demo.pem"
RUN_TEST = False TEST_SOLUTION = 739785 TEST_INPUT_FILE = "test_input_day_21.txt" INPUT_FILE = "input_day_21.txt" ARGS = [] def game_over(scores): return scores[0] >= 1000 or scores[1] >= 1000 def losing_player_score(scores): return scores[0] if scores[0] < scores[1] else scores[1] def main_part1( input_file, ): with open(input_file) as file: lines = list(map(lambda line: line.rstrip(), file.readlines())) # Day 21 Part 1 - Dirac Dice. The submarine computer challenges you to a # nice game of Dirac Dice. This game consists of a single die, two pawns, # and a game board with a circular track containing ten spaces marked 1 # through 10 clockwise. Each player's starting space is chosen randomly # (your puzzle input). Player 1 goes first. # # Players take turns moving. On each player's turn, the player rolls the # die three times and adds up the results. Then, the player moves their # pawn that many times forward around the track (that is, moving clockwise # on spaces in order of increasing value, wrapping back around to 1 after # 10). So, if a player is on space 7 and they roll 2, 2, and 1, they would # move forward 5 times, to spaces 8, 9, 10, 1, and finally stopping on 2. # # After each player moves, they increase their score by the value of the # space their pawn stopped on. Players' scores start at 0. So, if the first # player starts on space 7 and rolls a total of 5, they would stop on space # 2 and add 2 to their score (for a total score of 2). The game immediately # ends as a win for any player whose score reaches at least 1000. # # Since the first game is a practice game, the submarine opens a # compartment labeled deterministic dice and a 100-sided die falls out. # This die always rolls 1 first, then 2, then 3, and so on up to 100, after # which it starts over at 1 again. Play using this die. # # Play a practice game using the deterministic 100-sided die. The moment # either player wins, what do you get if you multiply the score of the # losing player by the number of times the die was rolled during the game? # Read starting positions. player1_start = int(lines[0][-1]) player2_start = int(lines[1][-1]) scores = [0, 0] position = [player1_start, player2_start] dice_side = 0 # 1-100 dice_rolls = 0 # Play game. player = 0 # 0 = player1, 1 = player2 while not game_over(scores): sum_rolls = 0 for _ in range(3): # new_roll = (i - 1) % n + 1, i-1 would then be the previous roll. dice_side = (dice_side) % 100 + 1 sum_rolls += dice_side dice_rolls += 3 # Same logic as for rolls. position[player] = ((position[player] + sum_rolls) - 1) % 10 + 1 scores[player] += position[player] player = (player + 1) % 2 solution = losing_player_score(scores) * dice_rolls return solution if __name__ == "__main__": if RUN_TEST: solution = main_part1(TEST_INPUT_FILE, *ARGS) print(solution) assert TEST_SOLUTION == solution else: solution = main_part1(INPUT_FILE, *ARGS) print(solution)