content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
class Solution: def findDuplicate(self, nums: List[int]) -> int: p1, p2 = nums[0], nums[nums[0]] while nums[p1] != nums[p2]: p1 = nums[p1] p2 = nums[nums[p2]] p2 = 0 while nums[p1] != nums[p2]: p1 = nums[p1] p2 = nums[p2] return nums[p1]
class Solution: def find_duplicate(self, nums: List[int]) -> int: (p1, p2) = (nums[0], nums[nums[0]]) while nums[p1] != nums[p2]: p1 = nums[p1] p2 = nums[nums[p2]] p2 = 0 while nums[p1] != nums[p2]: p1 = nums[p1] p2 = nums[p2] return nums[p1]
class A: def a(self): return 'a' class B(A, object): def b(self): return 'b' class Inherit(A): def a(self): return 'c'
class A: def a(self): return 'a' class B(A, object): def b(self): return 'b' class Inherit(A): def a(self): return 'c'
""" A / | B C 'B, C' """ class CategoryTree: def __init__(self): self.root = {} self.all_categories = [] def add_category(self, category, parent): if category in self.all_categories: raise KeyError(f"{category} exists") if parent is None: self.root[category] = set() if parent: if parent not in self.root: raise KeyError(f"{parent} invalid") self.root[category] = set() self.root[parent].add(category) self.all_categories.append(category) def get_children(self, parent): if parent and parent not in self.root: raise KeyError(f"{parent} invalid") return list(self.root[parent]) if __name__ == "__main__": c = CategoryTree() c.add_category('A', None) c.add_category('B', 'A') c.add_category('C', 'A') print(','.join(c.get_children('A') or [])) print(','.join(c.get_children('E') or []))
""" A / | B C 'B, C' """ class Categorytree: def __init__(self): self.root = {} self.all_categories = [] def add_category(self, category, parent): if category in self.all_categories: raise key_error(f'{category} exists') if parent is None: self.root[category] = set() if parent: if parent not in self.root: raise key_error(f'{parent} invalid') self.root[category] = set() self.root[parent].add(category) self.all_categories.append(category) def get_children(self, parent): if parent and parent not in self.root: raise key_error(f'{parent} invalid') return list(self.root[parent]) if __name__ == '__main__': c = category_tree() c.add_category('A', None) c.add_category('B', 'A') c.add_category('C', 'A') print(','.join(c.get_children('A') or [])) print(','.join(c.get_children('E') or []))
def sum_of_squares(n): return sum(i ** 2 for i in range(1, n+1)) def square_of_sum(n): return sum(range(1, n+1)) ** 2
def sum_of_squares(n): return sum((i ** 2 for i in range(1, n + 1))) def square_of_sum(n): return sum(range(1, n + 1)) ** 2
Credits = [ ('Bootstrap', 'https://getbootstrap.com', 'The Bootstrap team', 'MIT'), ('Bottle', 'http://bottlepy.org', 'Marcel Hellkamp', 'MIT'), ('Cheroot', 'https://github.com/cherrypy/cheroot', 'CherryPy Team', 'BSD 3-Clause "New" or "Revised" License'), ('Click', 'https://github.com/pallets/click', 'Pallets', 'BSD 3-Clause "New" or "Revised" License'), ('ConfigUpdater', 'https://github.com/pyscaffold/configupdater', 'Florian Wilhelm', 'MIT'), ('Glide', 'https://github.com/glidejs/glide', '@jedrzejchalubek', 'MIT'), ('JQuery', 'https://jquery.com', 'The jQuery Foundation', 'MIT'), ('jquery.pep.js', 'http://pep.briangonzalez.org', '@briangonzalez', 'MIT'), ('js-md5', 'https://github.com/emn178/js-md5', '@emn178', 'MIT'), ('PySocks', 'https://github.com/Anorov/PySocks', '@Anorov', 'Custom DAN HAIM'), ('RapydScript-NG', 'https://github.com/kovidgoyal/rapydscript-ng', '@kovidgoyal', 'BSD 2-Clause "Simplified" License'), ('Requests', 'https://requests.kennethreitz.org', 'Kenneth Reitz', 'Apache License, Version 2.0'), ('scrollMonitor', 'https://github.com/stutrek/scrollmonitor', '@stutrek', 'MIT'), ('Smoothie Charts', 'https://github.com/joewalnes/smoothie', '@drewnoakes', 'MIT'), ('stem', 'https://stem.torproject.org', 'Damian Johnson and The Tor Project', 'GNU LESSER GENERAL PUBLIC LICENSE') ]
credits = [('Bootstrap', 'https://getbootstrap.com', 'The Bootstrap team', 'MIT'), ('Bottle', 'http://bottlepy.org', 'Marcel Hellkamp', 'MIT'), ('Cheroot', 'https://github.com/cherrypy/cheroot', 'CherryPy Team', 'BSD 3-Clause "New" or "Revised" License'), ('Click', 'https://github.com/pallets/click', 'Pallets', 'BSD 3-Clause "New" or "Revised" License'), ('ConfigUpdater', 'https://github.com/pyscaffold/configupdater', 'Florian Wilhelm', 'MIT'), ('Glide', 'https://github.com/glidejs/glide', '@jedrzejchalubek', 'MIT'), ('JQuery', 'https://jquery.com', 'The jQuery Foundation', 'MIT'), ('jquery.pep.js', 'http://pep.briangonzalez.org', '@briangonzalez', 'MIT'), ('js-md5', 'https://github.com/emn178/js-md5', '@emn178', 'MIT'), ('PySocks', 'https://github.com/Anorov/PySocks', '@Anorov', 'Custom DAN HAIM'), ('RapydScript-NG', 'https://github.com/kovidgoyal/rapydscript-ng', '@kovidgoyal', 'BSD 2-Clause "Simplified" License'), ('Requests', 'https://requests.kennethreitz.org', 'Kenneth Reitz', 'Apache License, Version 2.0'), ('scrollMonitor', 'https://github.com/stutrek/scrollmonitor', '@stutrek', 'MIT'), ('Smoothie Charts', 'https://github.com/joewalnes/smoothie', '@drewnoakes', 'MIT'), ('stem', 'https://stem.torproject.org', 'Damian Johnson and The Tor Project', 'GNU LESSER GENERAL PUBLIC LICENSE')]
def repleace_pattern(t,s,r): assert len(t) > 0 assert len(s) > 0 assert len(r) > 0 assert len(t) >= len(s) n = len(t) m = len(s) k = len(r) idx = -1 for i in range(0, n): if t[i] == s[0]: pattern = True for j in range(1,m): if t[i+j] != s[j]: pattern = False break if(pattern): idx=i break result = t print(idx) if(idx!=-1): result = [*t[0:idx],*r,*t[idx+m:n]] return result print (repleace_pattern([1,2,3,1,2,3,4],[1,2,3,4],[9,0]))
def repleace_pattern(t, s, r): assert len(t) > 0 assert len(s) > 0 assert len(r) > 0 assert len(t) >= len(s) n = len(t) m = len(s) k = len(r) idx = -1 for i in range(0, n): if t[i] == s[0]: pattern = True for j in range(1, m): if t[i + j] != s[j]: pattern = False break if pattern: idx = i break result = t print(idx) if idx != -1: result = [*t[0:idx], *r, *t[idx + m:n]] return result print(repleace_pattern([1, 2, 3, 1, 2, 3, 4], [1, 2, 3, 4], [9, 0]))
# Copyright 2017 Mycroft AI Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class EnclosureWeather: """ Listens for Enclosure API commands to display indicators of the weather. Performs the associated command on Arduino by writing on the Serial port. """ def __init__(self, bus, writer): self.bus = bus self.writer = writer self.__init_events() def __init_events(self): self.bus.on('enclosure.weather.display', self.display) def display(self, event=None): if event and event.data: # Convert img_code to icon img_code = event.data.get("img_code", None) icon = None if img_code == 0: # sunny icon = "IICEIBMDNLMDIBCEAA" elif img_code == 1: # partly cloudy icon = "IIEEGBGDHLHDHBGEEA" elif img_code == 2: # cloudy icon = "IIIBMDMDODODODMDIB" elif img_code == 3: # light rain icon = "IIMAOJOFPBPJPFOBMA" elif img_code == 4: # raining icon = "IIMIOFOBPFPDPJOFMA" elif img_code == 5: # storming icon = "IIAAIIMEODLBJAAAAA" elif img_code == 6: # snowing icon = "IIJEKCMBPHMBKCJEAA" elif img_code == 7: # wind/mist icon = "IIABIBIBIJIJJGJAGA" temp = event.data.get("temp", None) if icon is not None and temp is not None: icon = "x=2," + icon msg = "weather.display=" + str(temp) + "," + str(icon) self.writer.write(msg)
class Enclosureweather: """ Listens for Enclosure API commands to display indicators of the weather. Performs the associated command on Arduino by writing on the Serial port. """ def __init__(self, bus, writer): self.bus = bus self.writer = writer self.__init_events() def __init_events(self): self.bus.on('enclosure.weather.display', self.display) def display(self, event=None): if event and event.data: img_code = event.data.get('img_code', None) icon = None if img_code == 0: icon = 'IICEIBMDNLMDIBCEAA' elif img_code == 1: icon = 'IIEEGBGDHLHDHBGEEA' elif img_code == 2: icon = 'IIIBMDMDODODODMDIB' elif img_code == 3: icon = 'IIMAOJOFPBPJPFOBMA' elif img_code == 4: icon = 'IIMIOFOBPFPDPJOFMA' elif img_code == 5: icon = 'IIAAIIMEODLBJAAAAA' elif img_code == 6: icon = 'IIJEKCMBPHMBKCJEAA' elif img_code == 7: icon = 'IIABIBIBIJIJJGJAGA' temp = event.data.get('temp', None) if icon is not None and temp is not None: icon = 'x=2,' + icon msg = 'weather.display=' + str(temp) + ',' + str(icon) self.writer.write(msg)
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def isCousins(self, root: TreeNode, x: int, y: int) -> bool: x_depth = None x_parent = None x_found = 0 y_depth = None y_parent = None y_found = 0 def dfs(node, parent, depth): nonlocal x_depth, x_parent, x_found, y_depth, y_found, y_parent if not node: return if node.val == x: x_depth = depth x_parent = parent x_found = 1 elif node.val == y: y_depth = depth y_parent = parent y_found = 1 if x_found and y_found: return dfs(node.left, node, depth+1) if x_found and y_found: return dfs(node.right, node, depth+1) dfs(root, None, 0) return x_depth == y_depth and x_parent != y_parent
class Solution: def is_cousins(self, root: TreeNode, x: int, y: int) -> bool: x_depth = None x_parent = None x_found = 0 y_depth = None y_parent = None y_found = 0 def dfs(node, parent, depth): nonlocal x_depth, x_parent, x_found, y_depth, y_found, y_parent if not node: return if node.val == x: x_depth = depth x_parent = parent x_found = 1 elif node.val == y: y_depth = depth y_parent = parent y_found = 1 if x_found and y_found: return dfs(node.left, node, depth + 1) if x_found and y_found: return dfs(node.right, node, depth + 1) dfs(root, None, 0) return x_depth == y_depth and x_parent != y_parent
# # Copyright (C) 2009 Mendix. All rights reserved. # SUCCESS = 0 # Starting the Mendix Runtime can fail in both a temporary or permanent way. # Some of the errors can be fixed with some help of the user. # # The default m2ee cli program will only handle a few of these cases, by # providing additional hints or interactive choices to fix the situation and # will default to echoing back the error message received from the runtime. # Database to be used does not exist start_NO_EXISTING_DB = 2 # Database structure is out of sync with the application domain model, DDL # commands need to be run to synchronize the database. start_INVALID_DB_STRUCTURE = 3 # Constant definitions used in the application model are missing from the # configuration. start_MISSING_MF_CONSTANT = 4 # In the application database, a user account was detected which has the # administrative role (as specified in the modeler) and has password '1'. start_ADMIN_1 = 5 # ... start_INVALID_STATE = 6 start_MISSING_DTAP = 7 start_MISSING_BASEPATH = 8 start_MISSING_RUNTIMEPATH = 9 start_INVALID_LICENSE = 10 start_SECURITY_DISABLED = 11 start_STARTUP_ACTION_FAILED = 12 start_NO_MOBILE_IN_LICENSE = 13 check_health_INVALID_STATE = 2
success = 0 start_no_existing_db = 2 start_invalid_db_structure = 3 start_missing_mf_constant = 4 start_admin_1 = 5 start_invalid_state = 6 start_missing_dtap = 7 start_missing_basepath = 8 start_missing_runtimepath = 9 start_invalid_license = 10 start_security_disabled = 11 start_startup_action_failed = 12 start_no_mobile_in_license = 13 check_health_invalid_state = 2
def count_words(sentence): sentence = sentence.lower() words = {} shit = ',\n:!&@$%^&._' for s in shit: sentence = sentence.replace(s, ' ') for w in sentence.split(): if w.endswith('\''): w = w[:-1] if w.startswith('\''): w = w[1:] words[w] = words.get(w, 0) + 1 return words
def count_words(sentence): sentence = sentence.lower() words = {} shit = ',\n:!&@$%^&._' for s in shit: sentence = sentence.replace(s, ' ') for w in sentence.split(): if w.endswith("'"): w = w[:-1] if w.startswith("'"): w = w[1:] words[w] = words.get(w, 0) + 1 return words
ID = {"Worldwide":0, "AF": 1, "AL": 2, "DZ": 3, "AD": 5, "AO": 6, "AI": 7, "AG": 9, "AR": 10, "AM": 11, "AW": 12, "AT": 14, "AZ": 15, "BS": 16, "BH": 17, "BD": 18, "BB": 19, "BY": 20, "BZ": 22, "BJ": 23, "BM": 24, "BO": 26, "BA": 27, "BW": 28, "BV": 29, "BR": 30, "BN": 31, "BG": 32, "BF": 33, "BI": 34, "KH": 35, "CM": 36, "CV": 38, "KY": 39, "TD": 41, "CL": 42, "CN": 43, "CC": 45, "CO": 46, "KM": 47, "CG": 48, "CK": 49, "CR": 50, "CI": 51, "HR": 52, "CU": 53, "CY": 54, "CZ": 55, "DK": 56, "DJ": 57, "DM": 58, "DO": 59, "TL": 60, "EC": 61, "EG": 62, "SV": 63, "EE": 66, "ET": 67, "FO": 69, "FJ": 70, "FI": 71, "FR": 72, "GF": 73, "PF": 74, "GA": 75, "GM": 76, "GE": 77, "DE": 78, "GH": 79, "GR": 81, "GD": 83, "GP": 84, "GT": 86, "GN": 87, "GY": 88, "HT": 89, "HN": 90, "HK": 91, "HU": 92, "IS": 93, "ID": 94, "IQ": 95, "IE": 96, "IT": 97, "JM": 98, "JO": 100, "KZ": 101, "KE": 102, "KI": 103, "KW": 104, "KG": 105, "LA": 106, "LV": 107, "LB": 108, "LS": 109, "LR": 110, "LY": 111, "LT": 113, "LU": 114, "MO": 115, "MK": 116, "MG": 117, "MW": 118, "MY": 119, "MV": 120, "ML": 121, "MT": 122, "MQ": 124, "MR": 125, "MU": 126, "MX": 128, "FM": 129, "MD": 130, "MC": 131, "MN": 132, "MA": 134, "MZ": 135, "MM": 136, "NA": 137, "NP": 139, "NL": 140, "AN": 141, "NC": 142, "NZ": 143, "NI": 144, "NE": 145, "NG": 146, "NO": 149, "OM": 150, "PK": 151, "PW": 152, "PA": 153, "PG": 154, "PY": 155, "PE": 156, "PH": 157, "PL": 159, "PT": 160, "QA": 162, "RE": 163, "RO": 164, "RW": 166, "KN": 167, "LC": 168, "SA": 171, "SN": 172, "SC": 173, "SG": 175, "SK": 176, "SI": 177, "SO": 179, "ZA": 180, "KR": 181, "ES": 182, "LK": 183, "SH": 184, "SR": 186, "SZ": 187, "SE": 188, "CH": 189, "TW": 191, "TJ": 192, "TZ": 193, "TH": 194, "TG": 195, "TT": 198, "TN": 199, "TR": 200, "TM": 201, "UG": 203, "UA": 204, "AE": 205, "GB": 206, "UY": 207, "UZ": 208, "VE": 211, "VN": 212, "VG": 213, "YE": 216, "ZM": 218, "ZW": 219, "RS": 220, "ME": 221, "IN": 225, "TC": 234, "CD": 235, "GG": 236, "IM": 237, "JE": 239, "CW": 246, }
id = {'Worldwide': 0, 'AF': 1, 'AL': 2, 'DZ': 3, 'AD': 5, 'AO': 6, 'AI': 7, 'AG': 9, 'AR': 10, 'AM': 11, 'AW': 12, 'AT': 14, 'AZ': 15, 'BS': 16, 'BH': 17, 'BD': 18, 'BB': 19, 'BY': 20, 'BZ': 22, 'BJ': 23, 'BM': 24, 'BO': 26, 'BA': 27, 'BW': 28, 'BV': 29, 'BR': 30, 'BN': 31, 'BG': 32, 'BF': 33, 'BI': 34, 'KH': 35, 'CM': 36, 'CV': 38, 'KY': 39, 'TD': 41, 'CL': 42, 'CN': 43, 'CC': 45, 'CO': 46, 'KM': 47, 'CG': 48, 'CK': 49, 'CR': 50, 'CI': 51, 'HR': 52, 'CU': 53, 'CY': 54, 'CZ': 55, 'DK': 56, 'DJ': 57, 'DM': 58, 'DO': 59, 'TL': 60, 'EC': 61, 'EG': 62, 'SV': 63, 'EE': 66, 'ET': 67, 'FO': 69, 'FJ': 70, 'FI': 71, 'FR': 72, 'GF': 73, 'PF': 74, 'GA': 75, 'GM': 76, 'GE': 77, 'DE': 78, 'GH': 79, 'GR': 81, 'GD': 83, 'GP': 84, 'GT': 86, 'GN': 87, 'GY': 88, 'HT': 89, 'HN': 90, 'HK': 91, 'HU': 92, 'IS': 93, 'ID': 94, 'IQ': 95, 'IE': 96, 'IT': 97, 'JM': 98, 'JO': 100, 'KZ': 101, 'KE': 102, 'KI': 103, 'KW': 104, 'KG': 105, 'LA': 106, 'LV': 107, 'LB': 108, 'LS': 109, 'LR': 110, 'LY': 111, 'LT': 113, 'LU': 114, 'MO': 115, 'MK': 116, 'MG': 117, 'MW': 118, 'MY': 119, 'MV': 120, 'ML': 121, 'MT': 122, 'MQ': 124, 'MR': 125, 'MU': 126, 'MX': 128, 'FM': 129, 'MD': 130, 'MC': 131, 'MN': 132, 'MA': 134, 'MZ': 135, 'MM': 136, 'NA': 137, 'NP': 139, 'NL': 140, 'AN': 141, 'NC': 142, 'NZ': 143, 'NI': 144, 'NE': 145, 'NG': 146, 'NO': 149, 'OM': 150, 'PK': 151, 'PW': 152, 'PA': 153, 'PG': 154, 'PY': 155, 'PE': 156, 'PH': 157, 'PL': 159, 'PT': 160, 'QA': 162, 'RE': 163, 'RO': 164, 'RW': 166, 'KN': 167, 'LC': 168, 'SA': 171, 'SN': 172, 'SC': 173, 'SG': 175, 'SK': 176, 'SI': 177, 'SO': 179, 'ZA': 180, 'KR': 181, 'ES': 182, 'LK': 183, 'SH': 184, 'SR': 186, 'SZ': 187, 'SE': 188, 'CH': 189, 'TW': 191, 'TJ': 192, 'TZ': 193, 'TH': 194, 'TG': 195, 'TT': 198, 'TN': 199, 'TR': 200, 'TM': 201, 'UG': 203, 'UA': 204, 'AE': 205, 'GB': 206, 'UY': 207, 'UZ': 208, 'VE': 211, 'VN': 212, 'VG': 213, 'YE': 216, 'ZM': 218, 'ZW': 219, 'RS': 220, 'ME': 221, 'IN': 225, 'TC': 234, 'CD': 235, 'GG': 236, 'IM': 237, 'JE': 239, 'CW': 246}
# RiveScript-Python # # This code is released under the MIT License. # See the "LICENSE" file for more information. # # https://www.rivescript.com/ def get_topic_triggers(rs, topic, thats, depth=0, inheritance=0, inherited=False): """Recursively scan a topic and return a list of all triggers. Arguments: rs (RiveScript): A reference to the parent RiveScript instance. topic (str): The original topic name. thats (bool): Are we getting triggers for 'previous' replies? depth (int): Recursion step counter. inheritance (int): The inheritance level counter, for topics that inherit other topics. inherited (bool): Whether the current topic is inherited by others. Returns: []str: List of all triggers found. """ # Break if we're in too deep. if depth > rs._depth: rs._warn("Deep recursion while scanning topic inheritance") # Keep in mind here that there is a difference between 'includes' and # 'inherits' -- topics that inherit other topics are able to OVERRIDE # triggers that appear in the inherited topic. This means that if the top # topic has a trigger of simply '*', then NO triggers are capable of # matching in ANY inherited topic, because even though * has the lowest # priority, it has an automatic priority over all inherited topics. # # The getTopicTriggers method takes this into account. All topics that # inherit other topics will have their triggers prefixed with a fictional # {inherits} tag, which would start at {inherits=0} and increment if this # topic has other inheriting topics. So we can use this tag to make sure # topics that inherit things will have their triggers always be on top of # the stack, from inherits=0 to inherits=n. # Important info about the depth vs inheritance params to this function: # depth increments by 1 each time this function recursively calls itrs. # inheritance increments by 1 only when this topic inherits another # topic. # # This way, '> topic alpha includes beta inherits gamma' will have this # effect: # alpha and beta's triggers are combined together into one matching # pool, and then those triggers have higher matching priority than # gamma's. # # The inherited option is True if this is a recursive call, from a topic # that inherits other topics. This forces the {inherits} tag to be added # to the triggers. This only applies when the top topic 'includes' # another topic. rs._say("\tCollecting trigger list for topic " + topic + "(depth=" + str(depth) + "; inheritance=" + str(inheritance) + "; " + "inherited=" + str(inherited) + ")") # topic: the name of the topic # depth: starts at 0 and ++'s with each recursion # Topic doesn't exist? if not topic in rs._topics: rs._warn("Inherited or included topic {} doesn't exist or has no triggers".format( topic )) return [] # Collect an array of triggers to return. triggers = [] # Get those that exist in this topic directly. inThisTopic = [] if not thats: # The non-that structure is {topic}->[array of triggers] if topic in rs._topics: for trigger in rs._topics[topic]: inThisTopic.append([ trigger["trigger"], trigger ]) else: # The 'that' structure is: {topic}->{cur trig}->{prev trig}->{trig info} if topic in rs._thats.keys(): for curtrig in rs._thats[topic].keys(): for previous, pointer in rs._thats[topic][curtrig].items(): inThisTopic.append([ pointer["trigger"], pointer ]) # Does this topic include others? if topic in rs._includes: # Check every included topic. for includes in rs._includes[topic]: rs._say("\t\tTopic " + topic + " includes " + includes) triggers.extend(get_topic_triggers(rs, includes, thats, (depth + 1), inheritance, True)) # Does this topic inherit others? if topic in rs._lineage: # Check every inherited topic. for inherits in rs._lineage[topic]: rs._say("\t\tTopic " + topic + " inherits " + inherits) triggers.extend(get_topic_triggers(rs, inherits, thats, (depth + 1), (inheritance + 1), False)) # Collect the triggers for *this* topic. If this topic inherits any # other topics, it means that this topic's triggers have higher # priority than those in any inherited topics. Enforce this with an # {inherits} tag. if topic in rs._lineage or inherited: for trigger in inThisTopic: rs._say("\t\tPrefixing trigger with {inherits=" + str(inheritance) + "}" + trigger[0]) triggers.append(["{inherits=" + str(inheritance) + "}" + trigger[0], trigger[1]]) else: triggers.extend(inThisTopic) return triggers def get_topic_tree(rs, topic, depth=0): """Given one topic, get the list of all included/inherited topics. :param str topic: The topic to start the search at. :param int depth: The recursion depth counter. :return []str: Array of topics. """ # Break if we're in too deep. if depth > rs._depth: rs._warn("Deep recursion while scanning topic trees!") return [] # Collect an array of all topics. topics = [topic] # Does this topic include others? if topic in rs._includes: # Try each of these. for includes in sorted(rs._includes[topic]): topics.extend(get_topic_tree(rs, includes, depth + 1)) # Does this topic inherit others? if topic in rs._lineage: # Try each of these. for inherits in sorted(rs._lineage[topic]): topics.extend(get_topic_tree(rs, inherits, depth + 1)) return topics
def get_topic_triggers(rs, topic, thats, depth=0, inheritance=0, inherited=False): """Recursively scan a topic and return a list of all triggers. Arguments: rs (RiveScript): A reference to the parent RiveScript instance. topic (str): The original topic name. thats (bool): Are we getting triggers for 'previous' replies? depth (int): Recursion step counter. inheritance (int): The inheritance level counter, for topics that inherit other topics. inherited (bool): Whether the current topic is inherited by others. Returns: []str: List of all triggers found. """ if depth > rs._depth: rs._warn('Deep recursion while scanning topic inheritance') rs._say('\tCollecting trigger list for topic ' + topic + '(depth=' + str(depth) + '; inheritance=' + str(inheritance) + '; ' + 'inherited=' + str(inherited) + ')') if not topic in rs._topics: rs._warn("Inherited or included topic {} doesn't exist or has no triggers".format(topic)) return [] triggers = [] in_this_topic = [] if not thats: if topic in rs._topics: for trigger in rs._topics[topic]: inThisTopic.append([trigger['trigger'], trigger]) elif topic in rs._thats.keys(): for curtrig in rs._thats[topic].keys(): for (previous, pointer) in rs._thats[topic][curtrig].items(): inThisTopic.append([pointer['trigger'], pointer]) if topic in rs._includes: for includes in rs._includes[topic]: rs._say('\t\tTopic ' + topic + ' includes ' + includes) triggers.extend(get_topic_triggers(rs, includes, thats, depth + 1, inheritance, True)) if topic in rs._lineage: for inherits in rs._lineage[topic]: rs._say('\t\tTopic ' + topic + ' inherits ' + inherits) triggers.extend(get_topic_triggers(rs, inherits, thats, depth + 1, inheritance + 1, False)) if topic in rs._lineage or inherited: for trigger in inThisTopic: rs._say('\t\tPrefixing trigger with {inherits=' + str(inheritance) + '}' + trigger[0]) triggers.append(['{inherits=' + str(inheritance) + '}' + trigger[0], trigger[1]]) else: triggers.extend(inThisTopic) return triggers def get_topic_tree(rs, topic, depth=0): """Given one topic, get the list of all included/inherited topics. :param str topic: The topic to start the search at. :param int depth: The recursion depth counter. :return []str: Array of topics. """ if depth > rs._depth: rs._warn('Deep recursion while scanning topic trees!') return [] topics = [topic] if topic in rs._includes: for includes in sorted(rs._includes[topic]): topics.extend(get_topic_tree(rs, includes, depth + 1)) if topic in rs._lineage: for inherits in sorted(rs._lineage[topic]): topics.extend(get_topic_tree(rs, inherits, depth + 1)) return topics
# In Search for the Lost Memory [Explorer Thief] (3526) # To be replaced with GMS's exact dialogue. # Following dialogue has been edited from DeepL on JMS's dialogue transcript (no KMS footage anywhere): # https://kaengouraiu2.blog.fc2.com/blog-entry-46.html recoveredMemory = 7081 darkLord = 1052001 sm.setSpeakerID(darkLord) sm.sendNext("The way you moved without a trace...you must have exceptional talent. " "Long time no see, #h #.") sm.sendSay("Since when did you grow up to this point? You're no less inferior to any Dark Lord. " "You were just a greenhorn that couldn't even hide their presence...Hmph, well, it's been a while since then. " "Still, it feels weird to see you become so strong. I guess this is how it feels to be proud.") sm.sendSay("But don't let your guard down. Know that there's still more progress to be made. " "As the one who has made you into a thief, I know you that you can be even stronger...!") sm.startQuest(parentID) sm.completeQuest(parentID) sm.startQuest(recoveredMemory) sm.setQRValue(recoveredMemory, "1", False)
recovered_memory = 7081 dark_lord = 1052001 sm.setSpeakerID(darkLord) sm.sendNext('The way you moved without a trace...you must have exceptional talent. Long time no see, #h #.') sm.sendSay("Since when did you grow up to this point? You're no less inferior to any Dark Lord. You were just a greenhorn that couldn't even hide their presence...Hmph, well, it's been a while since then. Still, it feels weird to see you become so strong. I guess this is how it feels to be proud.") sm.sendSay("But don't let your guard down. Know that there's still more progress to be made. As the one who has made you into a thief, I know you that you can be even stronger...!") sm.startQuest(parentID) sm.completeQuest(parentID) sm.startQuest(recoveredMemory) sm.setQRValue(recoveredMemory, '1', False)
def f(): print('f from module 2') if __name__ == '__main__': print('Module 2')
def f(): print('f from module 2') if __name__ == '__main__': print('Module 2')
def contains_word(first_word, second_word, bibliographic_entry): contains_first_word = first_word in bibliographic_entry contains_second_word = second_word in bibliographic_entry if contains_first_word and contains_second_word: return 2 elif contains_first_word or contains_second_word: return 1 else: return 0 if __name__ == "__main__": bibliographic_entry = "Peroni, S., Osborne, F., Di Iorio, A., Nuzzolese, A. G., Poggi, F., Vitali, F., " \ "Motta, E. (2017). Research Articles in Simplified HTML: a Web-first format for " \ "HTML-based scholarly articles. PeerJ Computer Science 3: e132. e2513. " \ "DOI: https://doi.org/10.7717/peerj-cs.132" print(contains_word("Peroni", "Osborne", bibliographic_entry)) print(contains_word("Peroni", "Asprino", bibliographic_entry)) print(contains_word("Reforgiato", "Osborne", bibliographic_entry)) print(contains_word("Reforgiato", "Asprino", bibliographic_entry))
def contains_word(first_word, second_word, bibliographic_entry): contains_first_word = first_word in bibliographic_entry contains_second_word = second_word in bibliographic_entry if contains_first_word and contains_second_word: return 2 elif contains_first_word or contains_second_word: return 1 else: return 0 if __name__ == '__main__': bibliographic_entry = 'Peroni, S., Osborne, F., Di Iorio, A., Nuzzolese, A. G., Poggi, F., Vitali, F., Motta, E. (2017). Research Articles in Simplified HTML: a Web-first format for HTML-based scholarly articles. PeerJ Computer Science 3: e132. e2513. DOI: https://doi.org/10.7717/peerj-cs.132' print(contains_word('Peroni', 'Osborne', bibliographic_entry)) print(contains_word('Peroni', 'Asprino', bibliographic_entry)) print(contains_word('Reforgiato', 'Osborne', bibliographic_entry)) print(contains_word('Reforgiato', 'Asprino', bibliographic_entry))
#!/usr/bin/env python # -*- coding: utf-8 -*- VALID_HISTORY_FIELDS = [ 'datetime', 'open', 'close', 'high', 'low', 'total_turnover', 'volume', 'acc_net_value', 'discount_rate', 'unit_net_value', 'limit_up', 'limit_down', 'open_interest', 'basis_spread', 'settlement', 'prev_settlement' ] VALID_GET_PRICE_FIELDS = [ 'OpeningPx', 'ClosingPx', 'HighPx', 'LowPx', 'TotalTurnover', 'TotalVolumeTraded', 'AccNetValue', 'UnitNetValue', 'DiscountRate', 'SettlPx', 'PrevSettlPx', 'OpenInterest', 'BasisSpread', 'HighLimitPx', 'LowLimitPx' ] VALID_TENORS = [ '0S', '1M', '2M', '3M', '6M', '9M', '1Y', '2Y', '3Y', '4Y', '5Y', '6Y', '7Y', '8Y', '9Y', '10Y', '15Y', '20Y', '30Y', '40Y', '50Y' ] VALID_INSTRUMENT_TYPES = [ 'CS', 'Future', 'INDX', 'ETF', 'LOF', 'SF', 'FenjiA', 'FenjiB', 'FenjiMu', 'Stock', 'Fund', 'Index' ] VALID_XUEQIU_FIELDS = [ 'new_comments', 'total_comments', 'new_followers', 'total_followers', 'sell_actions', 'buy_actions', ] VALID_MARGIN_FIELDS = [ 'margin_balance', 'buy_on_margin_value', 'short_sell_quantity', 'margin_repayment', 'short_balance_quantity', 'short_repayment_quantity', 'short_balance', 'total_balance' ] VALID_SHARE_FIELDS = [ 'total', 'circulation_a', 'management_circulation', 'non_circulation_a', 'total_a' ] VALID_TURNOVER_FIELDS = ( 'today', 'week', 'month', 'three_month', 'six_month', 'year', 'current_year', 'total', )
valid_history_fields = ['datetime', 'open', 'close', 'high', 'low', 'total_turnover', 'volume', 'acc_net_value', 'discount_rate', 'unit_net_value', 'limit_up', 'limit_down', 'open_interest', 'basis_spread', 'settlement', 'prev_settlement'] valid_get_price_fields = ['OpeningPx', 'ClosingPx', 'HighPx', 'LowPx', 'TotalTurnover', 'TotalVolumeTraded', 'AccNetValue', 'UnitNetValue', 'DiscountRate', 'SettlPx', 'PrevSettlPx', 'OpenInterest', 'BasisSpread', 'HighLimitPx', 'LowLimitPx'] valid_tenors = ['0S', '1M', '2M', '3M', '6M', '9M', '1Y', '2Y', '3Y', '4Y', '5Y', '6Y', '7Y', '8Y', '9Y', '10Y', '15Y', '20Y', '30Y', '40Y', '50Y'] valid_instrument_types = ['CS', 'Future', 'INDX', 'ETF', 'LOF', 'SF', 'FenjiA', 'FenjiB', 'FenjiMu', 'Stock', 'Fund', 'Index'] valid_xueqiu_fields = ['new_comments', 'total_comments', 'new_followers', 'total_followers', 'sell_actions', 'buy_actions'] valid_margin_fields = ['margin_balance', 'buy_on_margin_value', 'short_sell_quantity', 'margin_repayment', 'short_balance_quantity', 'short_repayment_quantity', 'short_balance', 'total_balance'] valid_share_fields = ['total', 'circulation_a', 'management_circulation', 'non_circulation_a', 'total_a'] valid_turnover_fields = ('today', 'week', 'month', 'three_month', 'six_month', 'year', 'current_year', 'total')
"""loads the nasm library, used by TF.""" load("//third_party:repo.bzl", "tf_http_archive") def repo(): tf_http_archive( name = "nasm", urls = [ "https://storage.googleapis.com/mirror.tensorflow.org/www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.bz2", "http://pkgs.fedoraproject.org/repo/pkgs/nasm/nasm-2.13.03.tar.bz2/sha512/d7a6b4cee8dfd603d8d4c976e5287b5cc542fa0b466ff989b743276a6e28114e64289bf02a7819eca63142a5278aa6eed57773007e5f589e15768e6456a8919d/nasm-2.13.03.tar.bz2", "http://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.bz2", ], sha256 = "63ec86477ad3f0f6292325fd89e1d93aea2e2fd490070863f17d48f7cd387011", strip_prefix = "nasm-2.13.03", build_file = "//third_party/nasm:nasm.BUILD", system_build_file = "//third_party/nasm:BUILD.system", )
"""loads the nasm library, used by TF.""" load('//third_party:repo.bzl', 'tf_http_archive') def repo(): tf_http_archive(name='nasm', urls=['https://storage.googleapis.com/mirror.tensorflow.org/www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.bz2', 'http://pkgs.fedoraproject.org/repo/pkgs/nasm/nasm-2.13.03.tar.bz2/sha512/d7a6b4cee8dfd603d8d4c976e5287b5cc542fa0b466ff989b743276a6e28114e64289bf02a7819eca63142a5278aa6eed57773007e5f589e15768e6456a8919d/nasm-2.13.03.tar.bz2', 'http://www.nasm.us/pub/nasm/releasebuilds/2.13.03/nasm-2.13.03.tar.bz2'], sha256='63ec86477ad3f0f6292325fd89e1d93aea2e2fd490070863f17d48f7cd387011', strip_prefix='nasm-2.13.03', build_file='//third_party/nasm:nasm.BUILD', system_build_file='//third_party/nasm:BUILD.system')
# unicode digit emojis # digits from '0' to '9' zero_digit_code = zd = 48 # excluded digits excl_digits = [2, 4, 5, 7] # unicode digit keycap udkc = '\U0000fe0f\U000020e3' hours_0_9 = [chr(i) + udkc for i in range(zd, zd + 10) if i - zd not in excl_digits] # number '10' emoji hours_0_9.append('\U0001f51f') # custom emojis from '11' to '23' hours_11_23 = [str(i) for i in range(11, 24)] vote = ('PLUS', 'MINUS') edit = '\U0001F4DD'
zero_digit_code = zd = 48 excl_digits = [2, 4, 5, 7] udkc = '️⃣' hours_0_9 = [chr(i) + udkc for i in range(zd, zd + 10) if i - zd not in excl_digits] hours_0_9.append('🔟') hours_11_23 = [str(i) for i in range(11, 24)] vote = ('PLUS', 'MINUS') edit = '📝'
class Solution: def __init__(self): self.res = [] self.path = [] def arr_to_num(self, arr): s = "" for x in arr: s += str(x) return int(s) def find_position(self, nums): for i in range(len(self.res)): if self.res[i] == nums: if i == len(self.res) - 1: return 0 # we need the check below for duplicate elements in nums # run nums = [1, 5, 1] and see the case next_num = self.arr_to_num(self.res[i + 1]) if next_num > self.arr_to_num(nums): return i + 1 raise Exception("The permutation function has something wrong, please debug it.") def DFS(self, arr): if not arr: self.res.append(self.path[:]) return for i in range(len(arr)): self.path.append(arr[i]) self.DFS(arr[:i] + arr[i + 1:]) self.path.pop() def nextPermutation(self, nums: [int]) -> None: """ Do not return anything, modify nums in-place instead. """ if not nums: raise Exception("Empty Array") # all permutations # note that we need to SORT the array at first arr = nums[:] arr.sort() self.DFS(arr) # find position position = self.find_position(nums) # in-place replacement for i in range(len(nums)): nums[i] = self.res[position][i] if __name__ == "__main__": sol = Solution() # nums = [2, 1, 3] nums = [1, 5, 1] sol.nextPermutation(nums) print(sol.res)
class Solution: def __init__(self): self.res = [] self.path = [] def arr_to_num(self, arr): s = '' for x in arr: s += str(x) return int(s) def find_position(self, nums): for i in range(len(self.res)): if self.res[i] == nums: if i == len(self.res) - 1: return 0 next_num = self.arr_to_num(self.res[i + 1]) if next_num > self.arr_to_num(nums): return i + 1 raise exception('The permutation function has something wrong, please debug it.') def dfs(self, arr): if not arr: self.res.append(self.path[:]) return for i in range(len(arr)): self.path.append(arr[i]) self.DFS(arr[:i] + arr[i + 1:]) self.path.pop() def next_permutation(self, nums: [int]) -> None: """ Do not return anything, modify nums in-place instead. """ if not nums: raise exception('Empty Array') arr = nums[:] arr.sort() self.DFS(arr) position = self.find_position(nums) for i in range(len(nums)): nums[i] = self.res[position][i] if __name__ == '__main__': sol = solution() nums = [1, 5, 1] sol.nextPermutation(nums) print(sol.res)
class Solution: def maximalSquare(self, matrix: List[List[str]]) -> int: if not matrix: return 0 m, n = len(matrix), len(matrix[0]) dp = [[0]*n for _ in range(m)] res = 0 for i in range(m): dp[i][0] = int(matrix[i][0]) for j in range(n): dp[0][j] = int(matrix[0][j]) for i in range(1, m): for j in range(1, n): if matrix[i][j] == '1': dp[i][j] = min(dp[i-1][j],dp[i-1][j-1],dp[i][j-1])+1 res = max(res, dp[i][j]) return res**2
class Solution: def maximal_square(self, matrix: List[List[str]]) -> int: if not matrix: return 0 (m, n) = (len(matrix), len(matrix[0])) dp = [[0] * n for _ in range(m)] res = 0 for i in range(m): dp[i][0] = int(matrix[i][0]) for j in range(n): dp[0][j] = int(matrix[0][j]) for i in range(1, m): for j in range(1, n): if matrix[i][j] == '1': dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - 1], dp[i][j - 1]) + 1 res = max(res, dp[i][j]) return res ** 2
class term(object): # Dados de cadastro das usinas termeletrica (presentes no TERM.DAT) Codigo = None Nome = None Potencia = None FCMax = None TEIF = None IP = None GTMin = None # Dados Adicionais Especificados no arquivo de configuracao termica (CONFT) Sist = None Status = None Classe = None # Dados Adicionais Especificados no arquivo de classe termica (CLAST) Custo = None NomeClasse = None TipoComb = None def insere(self, custo, gmax): self.custo = custo self.gmax = gmax
class Term(object): codigo = None nome = None potencia = None fc_max = None teif = None ip = None gt_min = None sist = None status = None classe = None custo = None nome_classe = None tipo_comb = None def insere(self, custo, gmax): self.custo = custo self.gmax = gmax
""" GPA Calculator """ # Write a function called "simple_gpa" to find GPA when student enters a letter grade as a string. Assign the result to a variable called "gpa". """ Use these conversions: A+ --> 4.0 A --> 4.0 A- --> 3.7 B+ --> 3.3 B --> 3.0 B- --> 2.7 C+ --> 2.3 C --> 2.0 C- --> 1.7 D+ --> 1.3 D --> 1.0 D- --> 0.7 F --> 0.0 """
""" GPA Calculator """ '\nUse these conversions:\nA+ --> 4.0\nA --> 4.0\nA- --> 3.7\nB+ --> 3.3\nB --> 3.0\nB- --> 2.7\nC+ --> 2.3\nC --> 2.0\nC- --> 1.7\nD+ --> 1.3\nD --> 1.0\nD- --> 0.7\nF --> 0.0\n'
# This is a simple program to find the last three digits of 11 raised to any given number. # The main algorithm that does the work is on line 10 def trim_num(num): if len(str(num)) > 3: # no need to trim if the number is 3 or less digits long return str(num)[(len(str(num)) - 3):] # trims the number return num def main(exp): init_val = str((((exp-1) * (exp))/2) % 10 + (exp % 100) / 10) + str(exp % 10) + "1" # The main algorithm which needs to be cleaned (only the last three digits should be shown) return "{}".format(trim_num(init_val)) # To use it, simply copy the code and run the function
def trim_num(num): if len(str(num)) > 3: return str(num)[len(str(num)) - 3:] return num def main(exp): init_val = str((exp - 1) * exp / 2 % 10 + exp % 100 / 10) + str(exp % 10) + '1' return '{}'.format(trim_num(init_val))
class KunaError(Exception): pass class AuthenticationError(KunaError): """Raised when authentication fails.""" pass class UnauthorizedError(KunaError): """Raised when an API call fails as unauthorized (401).""" pass
class Kunaerror(Exception): pass class Authenticationerror(KunaError): """Raised when authentication fails.""" pass class Unauthorizederror(KunaError): """Raised when an API call fails as unauthorized (401).""" pass
# Copyright (c) Microsoft Corporation. # Licensed under the MIT license. ### CONTROLS (non-tunable) ### # general TYPE_OF_RUN = test_episodes # train, test, test_episodes, render NUM_EPISODES_TO_TEST = 1000 MIN_FINAL_REWARD_FOR_SUCCESS = 1.0 LOAD_MODEL_FROM = models/gru_flat_babyai.pth SAVE_MODELS_TO = None # worker.py ENV = BabyAI_Env ENV_RANDOM_SEED = 1 AGENT_RANDOM_SEED = 1 REPORTING_INTERVAL = 1 TOTAL_STEPS = 1 ANNEAL_LR = False # A3cAgent AGENT_NET = GRU_Network # BabyAI_Env BABYAI_ENV_LEVEL = BabyAI-GoToLocal-v0 USE_SUCCESS_RATE = True SUCCESS_RATE_THRESHOLD = 0.99 HELDOUT_TESTING = False NUM_TEST_EPISODES = 10000 OBS_ENCODER = Flat BINARY_REWARD = True ### HYPERPARAMETERS (tunable) ### # A3cAgent A3C_T_MAX = 4 LEARNING_RATE = 4e-05 DISCOUNT_FACTOR = 0.9 GRADIENT_CLIP = 512.0 ENTROPY_TERM_STRENGTH = 0.02 ADAM_EPS = 1e-12 REWARD_SCALE = 2.0 WEIGHT_DECAY = 0. # RNNs NUM_RNN_UNITS = 96 OBS_EMBED_SIZE = 512 AC_HIDDEN_LAYER_SIZE = 4096
type_of_run = test_episodes num_episodes_to_test = 1000 min_final_reward_for_success = 1.0 load_model_from = models / gru_flat_babyai.pth save_models_to = None env = BabyAI_Env env_random_seed = 1 agent_random_seed = 1 reporting_interval = 1 total_steps = 1 anneal_lr = False agent_net = GRU_Network babyai_env_level = BabyAI - GoToLocal - v0 use_success_rate = True success_rate_threshold = 0.99 heldout_testing = False num_test_episodes = 10000 obs_encoder = Flat binary_reward = True a3_c_t_max = 4 learning_rate = 4e-05 discount_factor = 0.9 gradient_clip = 512.0 entropy_term_strength = 0.02 adam_eps = 1e-12 reward_scale = 2.0 weight_decay = 0.0 num_rnn_units = 96 obs_embed_size = 512 ac_hidden_layer_size = 4096
"""runghc support""" load(":private/context.bzl", "render_env") load(":private/packages.bzl", "expose_packages", "pkg_info_to_compile_flags") load( ":private/path_utils.bzl", "link_libraries", "ln", "target_unique_name", ) load( ":private/set.bzl", "set", ) load(":providers.bzl", "get_ghci_extra_libs") load("@bazel_skylib//lib:shell.bzl", "shell") def build_haskell_runghc( hs, runghc_wrapper, user_compile_flags, extra_args, hs_info, cc_info, output, package_databases, version, lib_info = None): """Build runghc script. Args: hs: Haskell context. hs_info: HaskellInfo. package_databases: package caches excluding the cache file of the package we're creating a runghc for. lib_info: If we're building runghc for a library target, pass HaskellLibraryInfo here, otherwise it should be None. Returns: None. """ (pkg_info_inputs, args) = pkg_info_to_compile_flags( hs, pkg_info = expose_packages( package_ids = hs.package_ids, package_databases = package_databases, version = version, ), prefix = "runghc-", ) if lib_info != None: for idir in set.to_list(hs_info.import_dirs): args += ["-i{0}".format(idir)] (ghci_extra_libs, ghc_env) = get_ghci_extra_libs( hs, cc_info, path_prefix = "$RULES_HASKELL_EXEC_ROOT", ) link_libraries(ghci_extra_libs, args) runghc_file = hs.actions.declare_file(target_unique_name(hs, "runghc")) # Extra arguments. # `compiler flags` is the default set of arguments for runghc, # augmented by `extra_args`. # The ordering is important, first compiler flags (from toolchain # and local rule), then from `extra_args`. This way the more # specific arguments are listed last, and then have more priority in # GHC. # Note that most flags for GHCI do have their negative value, so a # negative flag in `extra_args` can disable a positive flag set # in `user_compile_flags`, such as `-XNoOverloadedStrings` will disable # `-XOverloadedStrings`. args += hs.toolchain.compiler_flags + user_compile_flags + hs.toolchain.repl_ghci_args # ghc args need to be wrapped up in "--ghc-arg=" when passing to runghc runcompile_flags = ["--ghc-arg=%s" % a for a in args] runcompile_flags += extra_args hs.actions.expand_template( template = runghc_wrapper, output = runghc_file, substitutions = { "{ENV}": render_env(ghc_env), "{TOOL}": hs.tools.runghc.path, "{CC}": hs.toolchain.cc_wrapper.executable.path, "{ARGS}": " ".join([shell.quote(a) for a in runcompile_flags]), }, is_executable = True, ) # XXX We create a symlink here because we need to force # hs.tools.runghc and the best way to do that is # to use hs.actions.run. That action, in turn must produce # a result, so using ln seems to be the only sane choice. extra_inputs = depset(transitive = [ depset([ hs.tools.runghc, runghc_file, ]), package_databases, pkg_info_inputs, ghci_extra_libs, hs_info.source_files, hs.toolchain.cc_wrapper.runfiles.files, ]) ln(hs, runghc_file, output, extra_inputs)
"""runghc support""" load(':private/context.bzl', 'render_env') load(':private/packages.bzl', 'expose_packages', 'pkg_info_to_compile_flags') load(':private/path_utils.bzl', 'link_libraries', 'ln', 'target_unique_name') load(':private/set.bzl', 'set') load(':providers.bzl', 'get_ghci_extra_libs') load('@bazel_skylib//lib:shell.bzl', 'shell') def build_haskell_runghc(hs, runghc_wrapper, user_compile_flags, extra_args, hs_info, cc_info, output, package_databases, version, lib_info=None): """Build runghc script. Args: hs: Haskell context. hs_info: HaskellInfo. package_databases: package caches excluding the cache file of the package we're creating a runghc for. lib_info: If we're building runghc for a library target, pass HaskellLibraryInfo here, otherwise it should be None. Returns: None. """ (pkg_info_inputs, args) = pkg_info_to_compile_flags(hs, pkg_info=expose_packages(package_ids=hs.package_ids, package_databases=package_databases, version=version), prefix='runghc-') if lib_info != None: for idir in set.to_list(hs_info.import_dirs): args += ['-i{0}'.format(idir)] (ghci_extra_libs, ghc_env) = get_ghci_extra_libs(hs, cc_info, path_prefix='$RULES_HASKELL_EXEC_ROOT') link_libraries(ghci_extra_libs, args) runghc_file = hs.actions.declare_file(target_unique_name(hs, 'runghc')) args += hs.toolchain.compiler_flags + user_compile_flags + hs.toolchain.repl_ghci_args runcompile_flags = ['--ghc-arg=%s' % a for a in args] runcompile_flags += extra_args hs.actions.expand_template(template=runghc_wrapper, output=runghc_file, substitutions={'{ENV}': render_env(ghc_env), '{TOOL}': hs.tools.runghc.path, '{CC}': hs.toolchain.cc_wrapper.executable.path, '{ARGS}': ' '.join([shell.quote(a) for a in runcompile_flags])}, is_executable=True) extra_inputs = depset(transitive=[depset([hs.tools.runghc, runghc_file]), package_databases, pkg_info_inputs, ghci_extra_libs, hs_info.source_files, hs.toolchain.cc_wrapper.runfiles.files]) ln(hs, runghc_file, output, extra_inputs)
# -*- coding: utf-8 -*- """ Created on Thu Dec 19 20:00:00 2019 @author: Emilia Chojak @e-mail: emilia.chojak@gmail.com """ tax_dict = { 'Pan troglodytes' : 'Hominoidea', 'Pongo abelii' : 'Hominoidea', 'Hominoidea' : 'Simiiformes', 'Simiiformes' : 'Haplorrhini', 'Tarsius tarsier' : 'Tarsiiformes', 'Haplorrhini' : 'Primates', 'Tarsiiformes' : 'Haplorrhini', 'Loris tardigradus' : 'Lorisidae', 'Lorisidae' : 'Strepsirrhini', 'Strepsirrhini' : 'Primates', 'Allocebus trichotis' : 'Lemuriformes', 'Lemuriformes' : 'Strepsirrhini', 'Galago alleni' : 'Lorisiformes', 'Lorisiformes' : 'Strepsirrhini', 'Galago moholi' : 'Lorisiformes' } def find_ancestors(taxon): if taxon == 'Primates': return [taxon] parent = tax_dict[taxon] parent_ancestors = find_ancestors(parent) return [taxon] + parent_ancestors def find_ancestors_for_many(taxon_list): many_parents = [] for taxon in taxon_list: many_parents.append(find_ancestors(taxon)) return many_parents def last_common_ancestor(many_parents): for parent in many_parents[0]: is_ok = True for parent_list in many_parents: if parent not in parent_list: is_ok = False if is_ok == True: return parent print(last_common_ancestor(find_ancestors_for_many(["Galago alleni", "Galago moholi"])))
""" Created on Thu Dec 19 20:00:00 2019 @author: Emilia Chojak @e-mail: emilia.chojak@gmail.com """ tax_dict = {'Pan troglodytes': 'Hominoidea', 'Pongo abelii': 'Hominoidea', 'Hominoidea': 'Simiiformes', 'Simiiformes': 'Haplorrhini', 'Tarsius tarsier': 'Tarsiiformes', 'Haplorrhini': 'Primates', 'Tarsiiformes': 'Haplorrhini', 'Loris tardigradus': 'Lorisidae', 'Lorisidae': 'Strepsirrhini', 'Strepsirrhini': 'Primates', 'Allocebus trichotis': 'Lemuriformes', 'Lemuriformes': 'Strepsirrhini', 'Galago alleni': 'Lorisiformes', 'Lorisiformes': 'Strepsirrhini', 'Galago moholi': 'Lorisiformes'} def find_ancestors(taxon): if taxon == 'Primates': return [taxon] parent = tax_dict[taxon] parent_ancestors = find_ancestors(parent) return [taxon] + parent_ancestors def find_ancestors_for_many(taxon_list): many_parents = [] for taxon in taxon_list: many_parents.append(find_ancestors(taxon)) return many_parents def last_common_ancestor(many_parents): for parent in many_parents[0]: is_ok = True for parent_list in many_parents: if parent not in parent_list: is_ok = False if is_ok == True: return parent print(last_common_ancestor(find_ancestors_for_many(['Galago alleni', 'Galago moholi'])))
ezan = { 'name': 'ezan', 'age': 18, 'hair': 'brown', 'cool': True , } print(ezan) class Person(object): #use class to make object def __init__( self, name, age ,hair, color, hungry) : #initialize #first object inside of a class is self self.name = 'ezan' self.age = 18 self.hair = 'brown' self.cool = True def eat(self,food): print("EAT {f}".format(f = food)) self.hungry = food def play(self, game): print("Play {p}".format(p = game)) self.play = game def birth(self,person): kids = Person(name = " lail", age = 18, hair = 'black', color = 'blue', hungry = True) ezan = Person( name = "ezan", age = 18, hair = "black", cool = True, hungry = False) print(ezan.name) print('I am hungry') Austin = Person(name = 'austin', age = 18, hair = "Shrek", cool = False, hungry = True)
ezan = {'name': 'ezan', 'age': 18, 'hair': 'brown', 'cool': True} print(ezan) class Person(object): def __init__(self, name, age, hair, color, hungry): self.name = 'ezan' self.age = 18 self.hair = 'brown' self.cool = True def eat(self, food): print('EAT {f}'.format(f=food)) self.hungry = food def play(self, game): print('Play {p}'.format(p=game)) self.play = game def birth(self, person): kids = person(name=' lail', age=18, hair='black', color='blue', hungry=True) ezan = person(name='ezan', age=18, hair='black', cool=True, hungry=False) print(ezan.name) print('I am hungry') austin = person(name='austin', age=18, hair='Shrek', cool=False, hungry=True)
# # Simple Tuple # fruits = ('Apple', 'Orange', 'Mango') # # Using Constructor # fruits = tuple(('Apple', 'Orange', 'Mango')) # # Getting a Single Value # print(fruits[1]) # Trying to change based on position # fruits[1] = 'Grape' # Tuples with one value should have trailing comma # fruits = ('Apple') # fruits = ('Apple',) # # Getting length of a tupel # print(len(fruits)) # ## Set fruits = {'Apple', 'Orange', 'Mango', 'Apple'} # Checking if in Set print('Apple' in fruits) # Add to Set fruits.add('Grape') # Removing from Set fruits.remove('Grape') # Clearing Set fruits.clear() # Delete set del fruits print(fruits)
fruits = {'Apple', 'Orange', 'Mango', 'Apple'} print('Apple' in fruits) fruits.add('Grape') fruits.remove('Grape') fruits.clear() del fruits print(fruits)
"""Collections of library function names. """ class Library: """Base class for a collection of library function names. """ @staticmethod def get(libname, _cache={}): if libname in _cache: return _cache[libname] if libname == 'stdlib': r = Stdlib() elif libname == 'stdio': r = Stdio() elif libname == 'm': r = Mlib() elif libname == 'libdevice': r = Libdevice() elif libname == 'nvvm': r = NVVMIntrinsics() elif libname == 'llvm': r = LLVMIntrinsics() elif libname == 'heavydb': r = HeavyDB() else: raise ValueError(f'Unknown library {libname}') _cache[libname] = r return r def __contains__(self, fname): return self.check(fname) def check(self, fname): """ Return True if library contains a function with given name. """ if fname in self._function_names: return True for func in self._function_names: if func.endswith('.*') and fname.startswith(func[:-2]): return True return False class HeavyDB(Library): name = 'heavydb' _function_names = list(''' allocate_varlen_buffer set_output_row_size TableFunctionManager_error_message TableFunctionManager_set_output_row_size table_function_error '''.strip().split()) class Stdlib(Library): """ Reference: http://www.cplusplus.com/reference/cstdlib/ """ name = 'stdlib' _function_names = list(''' atof atoi atol atoll strtod strtof strtol strtold strtoll strtoul strtoull rand srand calloc free malloc realloc abort atexit at_quick_exit exit getenv quick_exit system bsearch qsort abs div labs ldiv llabs lldiv mblen mbtowc wctomb mbstowcs wcstombs '''.strip().split()) class Stdio(Library): """ Reference: http://www.cplusplus.com/reference/cstdio/ """ name = 'stdio' _function_names = list(''' remove rename tmpfile tmpnam fclose fflush fopen freopen setbuf setvbuf fprintf fscanf printf scanf snprintf sprintf sscanf vfprintf vfscanf vprintf vscanf vsnprintf vsprintf vsscanf fgetc fgets fputc fputs getc getchar gets putc putchar puts ungetc fread fwrite fgetpos fseek fsetpos ftell rewind clearerr feof ferror perror '''.strip().split()) class Mlib(Library): """ References: https://www.gnu.org/software/libc/manual/html_node/Mathematics.html https://en.cppreference.com/w/cpp/header/cmath """ name = 'm' _function_names = list('''sin sinf sinl cos cosf cosl tan tanf tanl sincos sincosf sincosl csin csinf csinl ccos ccosf ccosl ctan ctanf ctanl asin asinf asinl acos acosf acosl atan atanf atanl atan2 atan2f atan2l casin casinf casinl cacos cacosf cacosl catan catanf catanl exp expf expl exp2 exp2f exp2l exp10 exp10f exp10l log logf logl log2 log2f log2l log10 log10f log10l logb logbf logbl ilogb ilogbf ilogbl pow powf powl sqrt sqrtf sqrtl cbrt cbrtf cbrtl hypot hypotf hypotl expm1 expm1f expm1l log1p log1pf log1pl clog clogf clogl clog10 clog10f clog10l csqrt csqrtf csqrtl cpow cpowf cpowl sinh sinhf sinhl cosh coshf coshl tanh tanhf tanhl csinh csinhf csinhl ccosh ccoshf ccoshl ctanh ctanhf ctanhl asinh asinhf asinhl acosh acoshf acoshl atanh atanhf atanhl casinh casinhf casinhl cacosh cacoshf cacoshl catanh catanhf catanhl erf erff erfl erfc erfcf erfcl lgamma lgammaf lgammal tgamma tgammaf tgammal lgamma_r lgammaf_r lgammal_r gamma gammaf gammal j0 j0f j0l j1 j1f j1l jn jnf jnl y0 y0f y0l y1 y1f y1l yn ynf ynl rand srand rand_r random srandom initstate setstate random_r srandom_r initstate_r setstate_r drand48 erand48 lrand48 nrand48 mrand48 jrand48 srand48 seed48 lcong48 drand48_r erand48_r lrand48_r nrand48_r mrand48_r jrand48_r srand48_r seed48_r lcong48_r abs labs llabs fabs fabsf fabsl cabs cabsf cabsl frexp frexpf frexpl ldexp ldexpf ldexpl scalb scalbf scalbl scalbn scalbnf scalbnl significand significandf significandl ceil ceilf ceill floor floorf floorl trunc truncf truncl rint rintf rintl nearbyint nearbyintf nearbyintl round roundf roundl roundeven roundevenf roundevenl lrint lrintf lrintl lround lroundf lroundl llround llroundf llroundl fromfp fromfpf fromfpl ufromfp ufromfpf ufromfpl fromfpx fromfpxf fromfpxl ufromfpx ufromfpxf ufromfpxl modf modff modfl fmod fmodf fmodl remainder remainderf remainderl drem dremf dreml copysign copysignf copysignl signbit signbitf signbitl nextafter nextafterf nextafterl nexttoward nexttowardf nexttowardl nextup nextupf nextupl nextdown nextdownf nextdownl nan nanf nanl canonicalize canonicalizef canonicalizel getpayload getpayloadf getpayloadl setpayload setpayloadf setpayloadl setpayloadsig setpayloadsigf setpayloadsigl isgreater isgreaterequal isless islessequal islessgreater isunordered iseqsig totalorder totalorderf totalorderl totalordermag totalorderf totalorderl fmin fminf fminl fmax fmaxf fmaxl fminmag fminmagf fminmagl fmaxmag fmaxmagf fmaxmagl fdim fdimf fdiml fma fmaf fmal fadd faddf faddl fsub fsubf fsubl fmul fmulf fmull fdiv fdivf fdivl llrint llrintf llrintl'''.strip().split()) def drop_suffix(f): s = f.rsplit('.', 1)[-1] if s in ['p0i8', 'f64', 'f32', 'i1', 'i8', 'i16', 'i32', 'i64', 'i128']: f = f[:-len(s)-1] return drop_suffix(f) return f def get_llvm_name(f, prefix='llvm.'): """Return normalized name of a llvm intrinsic name. """ if f.startswith(prefix): return drop_suffix(f[len(prefix):]) return f class LLVMIntrinsics(Library): """LLVM intrinsic function names with prefix `llvm.` removed. Reference: https://llvm.org/docs/LangRef.html#intrinsic-functions """ name = 'llvm' def check(self, fname): if fname.startswith('llvm.'): return Library.check(self, get_llvm_name(fname)) return False _function_names = list(''' va_start va_end va_copy gcroot gcread gcwrite returnaddress addressofreturnaddress sponentry frameaddress stacksave stackrestore get.dynamic.area.offset prefetch pcmarker readcyclecounter clear_cache instrprof.increment instrprof.increment.step instrprof.value.profile thread.pointer call.preallocated.setup call.preallocated.arg call.preallocated.teardown abs smax smin umax umin memcpy memcpy.inline memmove sqrt powi sin cos pow exp exp2 log log10 log2 fma fabs minnum maxnum minimum maximum copysign floor ceil trunc rint nearbyint round roundeven lround llround lrint llrint ctpop ctlz cttz fshl fshr sadd.with.overflow uadd.with.overflow ssub.with.overflow usub.with.overflow smul.with.overflow umul.with.overflow sadd.sat uadd.sat ssub.sat usub.sat sshl.sat ushl.sat smul.fix umul.fix smul.fix.sat umul.fix.sat sdiv.fix udiv.fix sdiv.fix.sat udiv.fix.sat canonicalize fmuladd set.loop.iterations test.set.loop.iterations loop.decrement.reg loop.decrement vector.reduce.add vector.reduce.fadd vector.reduce.mul vector.reduce.fmul vector.reduce.and vector.reduce.or vector.reduce.xor vector.reduce.smax vector.reduce.smin vector.reduce.umax vector.reduce.umin vector.reduce.fmax vector.reduce.fmin matrix.transpose matrix.multiply matrix.column.major.load matrix.column.major.store convert.to.fp16 convert.from.fp16 init.trampoline adjust.trampoline lifetime.start lifetime.end invariant.start invariant.end launder.invariant.group strip.invariant.group experimental.constrained.fadd experimental.constrained.fsub experimental.constrained.fmul experimental.constrained.fdiv experimental.constrained.frem experimental.constrained.fma experimental.constrained.fptoui experimental.constrained.fptosi experimental.constrained.uitofp experimental.constrained.sitofp experimental.constrained.fptrunc experimental.constrained.fpext experimental.constrained.fmuladd experimental.constrained.sqrt experimental.constrained.pow experimental.constrained.powi experimental.constrained.sin experimental.constrained.cos experimental.constrained.exp experimental.constrained.exp2 experimental.constrained.log experimental.constrained.log10 experimental.constrained.log2 experimental.constrained.rint experimental.constrained.lrint experimental.constrained.llrint experimental.constrained.nearbyint experimental.constrained.maxnum experimental.constrained.minnum experimental.constrained.maximum experimental.constrained.minimum experimental.constrained.ceil experimental.constrained.floor experimental.constrained.round experimental.constrained.roundeven experimental.constrained.lround experimental.constrained.llround experimental.constrained.trunc experimental.gc.statepoint experimental.gc.result experimental.gc.relocate experimental.gc.get.pointer.base experimental.gc.get.pointer.offset experimental.vector.reduce.add.* experimental.vector.reduce.fadd.* experimental.vector.reduce.mul.* experimental.vector.reduce.fmul.* experimental.vector.reduce.and.* experimental.vector.reduce.or.* experimental.vector.reduce.xor.* experimental.vector.reduce.smax.* experimental.vector.reduce.smin.* experimental.vector.reduce.umax.* experimental.vector.reduce.umin.* experimental.vector.reduce.fmax.* experimental.vector.reduce.fmin.* flt.rounds var.annotation ptr.annotation annotation codeview.annotation trap debugtrap stackprotector stackguard objectsize expect expect.with.probability assume ssa_copy type.test type.checked.load donothing experimental.deoptimize experimental.guard experimental.widenable.condition load.relative sideeffect is.constant ptrmask vscale memcpy.element.unordered.atomic memmove.element.unordered.atomic memset.element.unordered.atomic objc.autorelease objc.autoreleasePoolPop objc.autoreleasePoolPush objc.autoreleaseReturnValue objc.copyWeak objc.destroyWeak objc.initWeak objc.loadWeak objc.loadWeakRetained objc.moveWeak objc.release objc.retain objc.retainAutorelease objc.retainAutoreleaseReturnValue objc.retainAutoreleasedReturnValue objc.retainBlock objc.storeStrong objc.storeWeak preserve.array.access.index preserve.union.access.index preserve.struct.access.index masked.store.* memset'''.strip().split()) class NVVMIntrinsics(Library): """NVVM intrinsic function names with prefix `llvm.` removed. Reference: https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#intrinsic-functions """ name = 'nvvm' def check(self, fname): if fname.startswith('llvm.'): return Library.check(self, get_llvm_name(fname)) return False _function_names = list(''' memcpy memmove memset sqrt fma bswap ctpop ctlz cttz fmuladd convert.to.fp16.f32 convert.from.fp16.f32 convert.to.fp16 convert.from.fp16 lifetime.start lifetime.end invariant.start invariant.end var.annotation ptr.annotation annotation expect donothing '''.strip().split()) class Libdevice(Library): """NVIDIA libdevice function names with prefix `__nv_` removed. Reference: https://docs.nvidia.com/cuda/libdevice-users-guide/function-desc.html#function-desc """ name = 'libdevice' def check(self, fname): if fname.startswith('__nv_'): return Library.check(self, get_llvm_name(fname, prefix='__nv_')) return False _function_names = list(''' abs acos acosf acosh acoshf asin asinf asinh asinhf atan atan2 atan2f atanf atanh atanhf brev brevll byte_perm cbrt cbrtf ceil ceilf clz clzll copysign copysignf cos cosf cosh coshf cospi cospif dadd_rd dadd_rn dadd_ru dadd_rz ddiv_rd ddiv_rn ddiv_ru ddiv_rz dmul_rd dmul_rn dmul_ru dmul_rz double2float_rd double2float_rn double2float_ru double2float_rz double2hiint double2int_rd double2int_rn double2int_ru double2int_rz double2ll_rd double2ll_rn double2ll_ru double2ll_rz double2loint double2uint_rd double2uint_rn double2uint_ru double2uint_rz double2ull_rd double2ull_rn double2ull_ru double2ull_rz double_as_longlong drcp_rd drcp_rn drcp_ru drcp_rz dsqrt_rd dsqrt_rn dsqrt_ru dsqrt_rz erf erfc erfcf erfcinv erfcinvf erfcx erfcxf erff erfinv erfinvf exp exp10 exp10f exp2 exp2f expf expm1 expm1f fabs fabsf fadd_rd fadd_rn fadd_ru fadd_rz fast_cosf fast_exp10f fast_expf fast_fdividef fast_log10f fast_log2f fast_logf fast_powf fast_sincosf fast_sinf fast_tanf fdim fdimf fdiv_rd fdiv_rn fdiv_ru fdiv_rz ffs ffsll finitef float2half_rn float2int_rd float2int_rn float2int_ru float2int_rz float2ll_rd float2ll_rn float2ll_ru float2ll_rz float2uint_rd float2uint_rn float2uint_ru float2uint_rz float2ull_rd float2ull_rn float2ull_ru float2ull_rz float_as_int floor floorf fma fma_rd fma_rn fma_ru fma_rz fmaf fmaf_rd fmaf_rn fmaf_ru fmaf_rz fmax fmaxf fmin fminf fmod fmodf fmul_rd fmul_rn fmul_ru fmul_rz frcp_rd frcp_rn frcp_ru frcp_rz frexp frexpf frsqrt_rn fsqrt_rd fsqrt_rn fsqrt_ru fsqrt_rz fsub_rd fsub_rn fsub_ru fsub_rz hadd half2float hiloint2double hypot hypotf ilogb ilogbf int2double_rn int2float_rd int2float_rn int2float_ru int2float_rz int_as_float isfinited isinfd isinff isnand isnanf j0 j0f j1 j1f jn jnf ldexp ldexpf lgamma lgammaf ll2double_rd ll2double_rn ll2double_ru ll2double_rz ll2float_rd ll2float_rn ll2float_ru ll2float_rz llabs llmax llmin llrint llrintf llround llroundf log log10 log10f log1p log1pf log2 log2f logb logbf logf longlong_as_double max min modf modff mul24 mul64hi mulhi nan nanf nearbyint nearbyintf nextafter nextafterf normcdf normcdff normcdfinv normcdfinvf popc popcll pow powf powi powif rcbrt rcbrtf remainder remainderf remquo remquof rhadd rint rintf round roundf rsqrt rsqrtf sad saturatef scalbn scalbnf signbitd signbitf sin sincos sincosf sincospi sincospif sinf sinh sinhf sinpi sinpif sqrt sqrtf tan tanf tanh tanhf tgamma tgammaf trunc truncf uhadd uint2double_rn uint2float_rd uint2float_rn uint2float_ru uint2float_rz ull2double_rd ull2double_rn ull2double_ru ull2double_rz ull2float_rd ull2float_rn ull2float_ru ull2float_rz ullmax ullmin umax umin umul24 umul64hi umulhi urhadd usad y0 y0f y1 y1f yn ynf '''.strip().split())
"""Collections of library function names. """ class Library: """Base class for a collection of library function names. """ @staticmethod def get(libname, _cache={}): if libname in _cache: return _cache[libname] if libname == 'stdlib': r = stdlib() elif libname == 'stdio': r = stdio() elif libname == 'm': r = mlib() elif libname == 'libdevice': r = libdevice() elif libname == 'nvvm': r = nvvm_intrinsics() elif libname == 'llvm': r = llvm_intrinsics() elif libname == 'heavydb': r = heavy_db() else: raise value_error(f'Unknown library {libname}') _cache[libname] = r return r def __contains__(self, fname): return self.check(fname) def check(self, fname): """ Return True if library contains a function with given name. """ if fname in self._function_names: return True for func in self._function_names: if func.endswith('.*') and fname.startswith(func[:-2]): return True return False class Heavydb(Library): name = 'heavydb' _function_names = list('\n allocate_varlen_buffer set_output_row_size\n TableFunctionManager_error_message TableFunctionManager_set_output_row_size\n table_function_error\n '.strip().split()) class Stdlib(Library): """ Reference: http://www.cplusplus.com/reference/cstdlib/ """ name = 'stdlib' _function_names = list(' atof atoi atol atoll strtod strtof strtol strtold strtoll strtoul\n strtoull rand srand calloc free malloc realloc abort atexit\n at_quick_exit exit getenv quick_exit system bsearch qsort abs div\n labs ldiv llabs lldiv mblen mbtowc wctomb mbstowcs wcstombs '.strip().split()) class Stdio(Library): """ Reference: http://www.cplusplus.com/reference/cstdio/ """ name = 'stdio' _function_names = list(' remove rename tmpfile tmpnam fclose fflush fopen freopen setbuf\n setvbuf fprintf fscanf printf scanf snprintf sprintf sscanf\n vfprintf vfscanf vprintf vscanf vsnprintf vsprintf vsscanf fgetc\n fgets fputc fputs getc getchar gets putc putchar puts ungetc fread\n fwrite fgetpos fseek fsetpos ftell rewind clearerr feof ferror\n perror '.strip().split()) class Mlib(Library): """ References: https://www.gnu.org/software/libc/manual/html_node/Mathematics.html https://en.cppreference.com/w/cpp/header/cmath """ name = 'm' _function_names = list('sin sinf sinl cos cosf cosl tan tanf tanl sincos sincosf sincosl\n csin csinf csinl ccos ccosf ccosl ctan ctanf ctanl asin asinf\n asinl acos acosf acosl atan atanf atanl atan2 atan2f atan2l casin\n casinf casinl cacos cacosf cacosl catan catanf catanl exp expf\n expl exp2 exp2f exp2l exp10 exp10f exp10l log logf logl log2 log2f\n log2l log10 log10f log10l logb logbf logbl ilogb ilogbf ilogbl pow\n powf powl sqrt sqrtf sqrtl cbrt cbrtf cbrtl hypot hypotf hypotl\n expm1 expm1f expm1l log1p log1pf log1pl clog clogf clogl clog10\n clog10f clog10l csqrt csqrtf csqrtl cpow cpowf cpowl sinh sinhf\n sinhl cosh coshf coshl tanh tanhf tanhl csinh csinhf csinhl ccosh\n ccoshf ccoshl ctanh ctanhf ctanhl asinh asinhf asinhl acosh acoshf\n acoshl atanh atanhf atanhl casinh casinhf casinhl cacosh cacoshf\n cacoshl catanh catanhf catanhl erf erff erfl erfc erfcf erfcl\n lgamma lgammaf lgammal tgamma tgammaf tgammal lgamma_r lgammaf_r\n lgammal_r gamma gammaf gammal j0 j0f j0l j1 j1f j1l jn jnf jnl y0\n y0f y0l y1 y1f y1l yn ynf ynl rand srand rand_r random srandom\n initstate setstate random_r srandom_r initstate_r setstate_r\n drand48 erand48 lrand48 nrand48 mrand48 jrand48 srand48 seed48\n lcong48 drand48_r erand48_r lrand48_r nrand48_r mrand48_r\n jrand48_r srand48_r seed48_r lcong48_r abs labs llabs fabs fabsf\n fabsl cabs cabsf cabsl frexp frexpf frexpl ldexp ldexpf ldexpl\n scalb scalbf scalbl scalbn scalbnf scalbnl significand\n significandf significandl ceil ceilf ceill floor floorf floorl\n trunc truncf truncl rint rintf rintl nearbyint nearbyintf\n nearbyintl round roundf roundl roundeven roundevenf roundevenl\n lrint lrintf lrintl lround lroundf lroundl llround llroundf\n llroundl fromfp fromfpf fromfpl ufromfp ufromfpf ufromfpl fromfpx\n fromfpxf fromfpxl ufromfpx ufromfpxf ufromfpxl modf modff modfl\n fmod fmodf fmodl remainder remainderf remainderl drem dremf dreml\n copysign copysignf copysignl signbit signbitf signbitl nextafter\n nextafterf nextafterl nexttoward nexttowardf nexttowardl nextup\n nextupf nextupl nextdown nextdownf nextdownl nan nanf nanl\n canonicalize canonicalizef canonicalizel getpayload getpayloadf\n getpayloadl setpayload setpayloadf setpayloadl setpayloadsig\n setpayloadsigf setpayloadsigl isgreater isgreaterequal isless\n islessequal islessgreater isunordered iseqsig totalorder\n totalorderf totalorderl totalordermag totalorderf totalorderl fmin\n fminf fminl fmax fmaxf fmaxl fminmag fminmagf fminmagl fmaxmag\n fmaxmagf fmaxmagl fdim fdimf fdiml fma fmaf fmal fadd faddf faddl\n fsub fsubf fsubl fmul fmulf fmull fdiv fdivf fdivl llrint llrintf\n llrintl'.strip().split()) def drop_suffix(f): s = f.rsplit('.', 1)[-1] if s in ['p0i8', 'f64', 'f32', 'i1', 'i8', 'i16', 'i32', 'i64', 'i128']: f = f[:-len(s) - 1] return drop_suffix(f) return f def get_llvm_name(f, prefix='llvm.'): """Return normalized name of a llvm intrinsic name. """ if f.startswith(prefix): return drop_suffix(f[len(prefix):]) return f class Llvmintrinsics(Library): """LLVM intrinsic function names with prefix `llvm.` removed. Reference: https://llvm.org/docs/LangRef.html#intrinsic-functions """ name = 'llvm' def check(self, fname): if fname.startswith('llvm.'): return Library.check(self, get_llvm_name(fname)) return False _function_names = list(' va_start va_end va_copy gcroot gcread gcwrite returnaddress\n addressofreturnaddress sponentry frameaddress stacksave\n stackrestore get.dynamic.area.offset prefetch pcmarker\n readcyclecounter clear_cache instrprof.increment\n instrprof.increment.step instrprof.value.profile thread.pointer\n call.preallocated.setup call.preallocated.arg\n call.preallocated.teardown abs smax smin umax umin memcpy\n memcpy.inline memmove sqrt powi sin cos pow exp exp2 log log10\n log2 fma fabs minnum maxnum minimum maximum copysign floor ceil\n trunc rint nearbyint round roundeven lround llround lrint llrint\n ctpop ctlz cttz fshl fshr sadd.with.overflow uadd.with.overflow\n ssub.with.overflow usub.with.overflow smul.with.overflow\n umul.with.overflow sadd.sat uadd.sat ssub.sat usub.sat sshl.sat\n ushl.sat smul.fix umul.fix smul.fix.sat umul.fix.sat sdiv.fix\n udiv.fix sdiv.fix.sat udiv.fix.sat canonicalize fmuladd\n set.loop.iterations test.set.loop.iterations loop.decrement.reg\n loop.decrement vector.reduce.add vector.reduce.fadd\n vector.reduce.mul vector.reduce.fmul vector.reduce.and\n vector.reduce.or vector.reduce.xor vector.reduce.smax\n vector.reduce.smin vector.reduce.umax vector.reduce.umin\n vector.reduce.fmax vector.reduce.fmin matrix.transpose\n matrix.multiply matrix.column.major.load matrix.column.major.store\n convert.to.fp16 convert.from.fp16 init.trampoline\n adjust.trampoline lifetime.start lifetime.end invariant.start\n invariant.end launder.invariant.group strip.invariant.group\n experimental.constrained.fadd experimental.constrained.fsub\n experimental.constrained.fmul experimental.constrained.fdiv\n experimental.constrained.frem experimental.constrained.fma\n experimental.constrained.fptoui experimental.constrained.fptosi\n experimental.constrained.uitofp experimental.constrained.sitofp\n experimental.constrained.fptrunc experimental.constrained.fpext\n experimental.constrained.fmuladd experimental.constrained.sqrt\n experimental.constrained.pow experimental.constrained.powi\n experimental.constrained.sin experimental.constrained.cos\n experimental.constrained.exp experimental.constrained.exp2\n experimental.constrained.log experimental.constrained.log10\n experimental.constrained.log2 experimental.constrained.rint\n experimental.constrained.lrint experimental.constrained.llrint\n experimental.constrained.nearbyint experimental.constrained.maxnum\n experimental.constrained.minnum experimental.constrained.maximum\n experimental.constrained.minimum experimental.constrained.ceil\n experimental.constrained.floor experimental.constrained.round\n experimental.constrained.roundeven experimental.constrained.lround\n experimental.constrained.llround experimental.constrained.trunc\n experimental.gc.statepoint experimental.gc.result experimental.gc.relocate\n experimental.gc.get.pointer.base experimental.gc.get.pointer.offset\n experimental.vector.reduce.add.* experimental.vector.reduce.fadd.*\n experimental.vector.reduce.mul.* experimental.vector.reduce.fmul.*\n experimental.vector.reduce.and.* experimental.vector.reduce.or.*\n experimental.vector.reduce.xor.* experimental.vector.reduce.smax.*\n experimental.vector.reduce.smin.* experimental.vector.reduce.umax.*\n experimental.vector.reduce.umin.* experimental.vector.reduce.fmax.*\n experimental.vector.reduce.fmin.*\n flt.rounds var.annotation ptr.annotation annotation\n codeview.annotation trap debugtrap stackprotector stackguard\n objectsize expect expect.with.probability assume ssa_copy\n type.test type.checked.load donothing experimental.deoptimize\n experimental.guard experimental.widenable.condition load.relative\n sideeffect is.constant ptrmask vscale\n memcpy.element.unordered.atomic memmove.element.unordered.atomic\n memset.element.unordered.atomic objc.autorelease\n objc.autoreleasePoolPop objc.autoreleasePoolPush\n objc.autoreleaseReturnValue objc.copyWeak objc.destroyWeak\n objc.initWeak objc.loadWeak objc.loadWeakRetained objc.moveWeak\n objc.release objc.retain objc.retainAutorelease\n objc.retainAutoreleaseReturnValue\n objc.retainAutoreleasedReturnValue objc.retainBlock\n objc.storeStrong objc.storeWeak preserve.array.access.index\n preserve.union.access.index preserve.struct.access.index\n masked.store.* memset'.strip().split()) class Nvvmintrinsics(Library): """NVVM intrinsic function names with prefix `llvm.` removed. Reference: https://docs.nvidia.com/cuda/nvvm-ir-spec/index.html#intrinsic-functions """ name = 'nvvm' def check(self, fname): if fname.startswith('llvm.'): return Library.check(self, get_llvm_name(fname)) return False _function_names = list(' memcpy memmove memset sqrt fma bswap ctpop ctlz cttz fmuladd\n convert.to.fp16.f32 convert.from.fp16.f32 convert.to.fp16\n convert.from.fp16 lifetime.start lifetime.end invariant.start\n invariant.end var.annotation ptr.annotation annotation expect\n donothing '.strip().split()) class Libdevice(Library): """NVIDIA libdevice function names with prefix `__nv_` removed. Reference: https://docs.nvidia.com/cuda/libdevice-users-guide/function-desc.html#function-desc """ name = 'libdevice' def check(self, fname): if fname.startswith('__nv_'): return Library.check(self, get_llvm_name(fname, prefix='__nv_')) return False _function_names = list(' abs acos acosf acosh acoshf asin asinf asinh asinhf atan atan2\n atan2f atanf atanh atanhf brev brevll byte_perm cbrt cbrtf ceil\n ceilf clz clzll copysign copysignf cos cosf cosh coshf cospi\n cospif dadd_rd dadd_rn dadd_ru dadd_rz ddiv_rd ddiv_rn ddiv_ru\n ddiv_rz dmul_rd dmul_rn dmul_ru dmul_rz double2float_rd\n double2float_rn double2float_ru double2float_rz double2hiint\n double2int_rd double2int_rn double2int_ru double2int_rz\n double2ll_rd double2ll_rn double2ll_ru double2ll_rz double2loint\n double2uint_rd double2uint_rn double2uint_ru double2uint_rz\n double2ull_rd double2ull_rn double2ull_ru double2ull_rz\n double_as_longlong drcp_rd drcp_rn drcp_ru drcp_rz dsqrt_rd\n dsqrt_rn dsqrt_ru dsqrt_rz erf erfc erfcf erfcinv erfcinvf erfcx\n erfcxf erff erfinv erfinvf exp exp10 exp10f exp2 exp2f expf expm1\n expm1f fabs fabsf fadd_rd fadd_rn fadd_ru fadd_rz fast_cosf\n fast_exp10f fast_expf fast_fdividef fast_log10f fast_log2f\n fast_logf fast_powf fast_sincosf fast_sinf fast_tanf fdim fdimf\n fdiv_rd fdiv_rn fdiv_ru fdiv_rz ffs ffsll finitef float2half_rn\n float2int_rd float2int_rn float2int_ru float2int_rz float2ll_rd\n float2ll_rn float2ll_ru float2ll_rz float2uint_rd float2uint_rn\n float2uint_ru float2uint_rz float2ull_rd float2ull_rn float2ull_ru\n float2ull_rz float_as_int floor floorf fma fma_rd fma_rn fma_ru\n fma_rz fmaf fmaf_rd fmaf_rn fmaf_ru fmaf_rz fmax fmaxf fmin fminf\n fmod fmodf fmul_rd fmul_rn fmul_ru fmul_rz frcp_rd frcp_rn frcp_ru\n frcp_rz frexp frexpf frsqrt_rn fsqrt_rd fsqrt_rn fsqrt_ru fsqrt_rz\n fsub_rd fsub_rn fsub_ru fsub_rz hadd half2float hiloint2double\n hypot hypotf ilogb ilogbf int2double_rn int2float_rd int2float_rn\n int2float_ru int2float_rz int_as_float isfinited isinfd isinff\n isnand isnanf j0 j0f j1 j1f jn jnf ldexp ldexpf lgamma lgammaf\n ll2double_rd ll2double_rn ll2double_ru ll2double_rz ll2float_rd\n ll2float_rn ll2float_ru ll2float_rz llabs llmax llmin llrint\n llrintf llround llroundf log log10 log10f log1p log1pf log2 log2f\n logb logbf logf longlong_as_double max min modf modff mul24\n mul64hi mulhi nan nanf nearbyint nearbyintf nextafter nextafterf\n normcdf normcdff normcdfinv normcdfinvf popc popcll pow powf powi\n powif rcbrt rcbrtf remainder remainderf remquo remquof rhadd rint\n rintf round roundf rsqrt rsqrtf sad saturatef scalbn scalbnf\n signbitd signbitf sin sincos sincosf sincospi sincospif sinf sinh\n sinhf sinpi sinpif sqrt sqrtf tan tanf tanh tanhf tgamma tgammaf\n trunc truncf uhadd uint2double_rn uint2float_rd uint2float_rn\n uint2float_ru uint2float_rz ull2double_rd ull2double_rn\n ull2double_ru ull2double_rz ull2float_rd ull2float_rn ull2float_ru\n ull2float_rz ullmax ullmin umax umin umul24 umul64hi umulhi urhadd\n usad y0 y0f y1 y1f yn ynf '.strip().split())
"""HERE are the base Points for all valid Tonnetze Systems. A period of all 12 notes divided by mod 3, mod 4 (always stable) """ # x = 4, y = 3 NotePointsT345 = { 0: (0, 0), 1: (1, 3), 2: (2, 2), 3: (0, 1), 4: (1, 0), 5: (2, 3), 6: (0, 2), 7: (1, 1), 8: (2, 0), 9: (0, 3), 10: (1, 2), 11: (2, 1) } # x = 8, y = 3 NotePointsT138 = { 0: (0, 0), 1: (2, 3), 2: (1, 2), 3: (0, 1), 4: (2, 0), 5: (1, 3), 6: (0, 2), 7: (2, 1), 8: (1, 0), 9: (0, 3), 10: (2, 2), 11: (1, 1) } # x = 2, y = 9 NotePointsT129 = { 0: (0, 0), 1: (2, 1), 2: (1, 0), 3: (0, 3), 4: (2, 0), 5: (1, 3), 6: (0, 2), 7: (2, 3), 8: (1, 2), 9: (0, 1), 10: (2, 2), 11: (1, 1) } # x = 4, y = 1 NotePointsT147 = { 0: (0, 0), 1: (0, 1), 2: (0, 2), 3: (0, 3), 4: (1, 0), 5: (1, 1), 6: (1, 2), 7: (1, 3), 8: (2, 0), 9: (2, 1), 10: (2, 2), 11: (2, 3) } # x = 2, y = 3 NotePointsT237 = { 0: (0, 0), 1: (2, 3), 2: (1, 0), 3: (0, 1), 4: (2, 0), 5: (1, 1), 6: (0, 2), 7: (2, 1), 8: (1, 2), 9: (0, 3), 10: (2, 2), 11: (1, 3) } dictOfTonnetz = { 'T345': NotePointsT345, 'T147': NotePointsT147, 'T138': NotePointsT138, 'T237': NotePointsT237, 'T129': NotePointsT129 } dictOfTonnetze = { 'T129': [1, 2, 9], 'T138': [1, 3, 8], 'T147': [1, 4, 7], 'T156': [1, 5, 6], 'T237': [2, 3, 7], 'T345': [3, 4, 5] }
"""HERE are the base Points for all valid Tonnetze Systems. A period of all 12 notes divided by mod 3, mod 4 (always stable) """ note_points_t345 = {0: (0, 0), 1: (1, 3), 2: (2, 2), 3: (0, 1), 4: (1, 0), 5: (2, 3), 6: (0, 2), 7: (1, 1), 8: (2, 0), 9: (0, 3), 10: (1, 2), 11: (2, 1)} note_points_t138 = {0: (0, 0), 1: (2, 3), 2: (1, 2), 3: (0, 1), 4: (2, 0), 5: (1, 3), 6: (0, 2), 7: (2, 1), 8: (1, 0), 9: (0, 3), 10: (2, 2), 11: (1, 1)} note_points_t129 = {0: (0, 0), 1: (2, 1), 2: (1, 0), 3: (0, 3), 4: (2, 0), 5: (1, 3), 6: (0, 2), 7: (2, 3), 8: (1, 2), 9: (0, 1), 10: (2, 2), 11: (1, 1)} note_points_t147 = {0: (0, 0), 1: (0, 1), 2: (0, 2), 3: (0, 3), 4: (1, 0), 5: (1, 1), 6: (1, 2), 7: (1, 3), 8: (2, 0), 9: (2, 1), 10: (2, 2), 11: (2, 3)} note_points_t237 = {0: (0, 0), 1: (2, 3), 2: (1, 0), 3: (0, 1), 4: (2, 0), 5: (1, 1), 6: (0, 2), 7: (2, 1), 8: (1, 2), 9: (0, 3), 10: (2, 2), 11: (1, 3)} dict_of_tonnetz = {'T345': NotePointsT345, 'T147': NotePointsT147, 'T138': NotePointsT138, 'T237': NotePointsT237, 'T129': NotePointsT129} dict_of_tonnetze = {'T129': [1, 2, 9], 'T138': [1, 3, 8], 'T147': [1, 4, 7], 'T156': [1, 5, 6], 'T237': [2, 3, 7], 'T345': [3, 4, 5]}
class RequirementsNotMetError(Exception): """For SQL INSERT, missing table attributes.""" def __init__(self, message): super().__init__(message) class AuthenticationError(Exception): """Generic authentication error.""" def __init__(self, message): super().__init__(message)
class Requirementsnotmeterror(Exception): """For SQL INSERT, missing table attributes.""" def __init__(self, message): super().__init__(message) class Authenticationerror(Exception): """Generic authentication error.""" def __init__(self, message): super().__init__(message)
## -*- encoding: utf-8 -*- """ This file (./domaines_doctest.sage) was *autogenerated* from ./domaines.tex, with sagetex.sty version 2011/05/27 v2.3.1. It contains the contents of all the sageexample environments from this file. You should be able to doctest this file with: sage -t ./domaines_doctest.sage It is always safe to delete this file; it is not used in typesetting your document. Sage example in ./domaines.tex, line 10:: sage: x = var('x') Sage example in ./domaines.tex, line 69:: sage: o = 12/35 sage: type(o) <... 'sage.rings.rational.Rational'> Sage example in ./domaines.tex, line 82:: sage: type(12/35) <... 'sage.rings.rational.Rational'> Sage example in ./domaines.tex, line 131:: sage: o = 720 sage: o.factor() 2^4 * 3^2 * 5 Sage example in ./domaines.tex, line 142:: sage: type(o).factor(o) 2^4 * 3^2 * 5 Sage example in ./domaines.tex, line 157:: sage: 720.factor() 2^4 * 3^2 * 5 Sage example in ./domaines.tex, line 166:: sage: o = 720 / 133 sage: o.numerator().factor() 2^4 * 3^2 * 5 Sage example in ./domaines.tex, line 253:: sage: 3 * 7 21 Sage example in ./domaines.tex, line 261:: sage: (2/3) * (6/5) 4/5 Sage example in ./domaines.tex, line 267:: sage: (1 + I) * (1 - I) 2 Sage example in ./domaines.tex, line 274:: sage: (x + 2) * (x + 1) (x + 2)*(x + 1) sage: (x + 1) * (x + 2) (x + 2)*(x + 1) Sage example in ./domaines.tex, line 308:: sage: def fourth_power(a): ....: a = a * a ....: a = a * a ....: return a Sage example in ./domaines.tex, line 330:: sage: fourth_power(2) 16 sage: fourth_power(3/2) 81/16 sage: fourth_power(I) 1 sage: fourth_power(x+1) (x + 1)^4 sage: M = matrix([[0,-1],[1,0]]); M [ 0 -1] [ 1 0] sage: fourth_power(M) [1 0] [0 1] Sage example in ./domaines.tex, line 375:: sage: t = type(5/1); t <... 'sage.rings.rational.Rational'> sage: t == type(5) False Sage example in ./domaines.tex, line 476:: sage: a = 5; a 5 sage: a.is_unit() False Sage example in ./domaines.tex, line 484:: sage: a = 5/1; a 5 sage: a.is_unit() True Sage example in ./domaines.tex, line 507:: sage: parent(5) Integer Ring sage: parent(5/1) Rational Field Sage example in ./domaines.tex, line 515:: sage: ZZ Integer Ring sage: QQ Rational Field Sage example in ./domaines.tex, line 525:: sage: QQ(5).parent() Rational Field sage: ZZ(5/1).parent() Integer Ring sage: ZZ(1/5) Traceback (most recent call last): ... TypeError: no conversion of this rational to integer Sage example in ./domaines.tex, line 543:: sage: ZZ(1), QQ(1), RR(1), CC(1) (1, 1, 1.00000000000000, 1.00000000000000) Sage example in ./domaines.tex, line 568:: sage: cartesian_product([QQ, QQ]) The Cartesian product of (Rational Field, Rational Field) Sage example in ./domaines.tex, line 574:: sage: ZZ.fraction_field() Rational Field Sage example in ./domaines.tex, line 580:: sage: ZZ['x'] Univariate Polynomial Ring in x over Integer Ring Sage example in ./domaines.tex, line 591:: sage: Z5 = GF(5); Z5 Finite Field of size 5 sage: P = Z5['x']; P Univariate Polynomial Ring in x over Finite Field of size 5 sage: M = MatrixSpace(P, 3, 3); M Full MatrixSpace of 3 by 3 dense matrices over Univariate Polynomial Ring in x over Finite Field of size 5 Sage example in ./domaines.tex, line 602:: sage: M.random_element() # random [2*x^2 + 3*x + 4 4*x^2 + 2*x + 2 4*x^2 + 2*x] [ 3*x 2*x^2 + x + 3 3*x^2 + 4*x] [ 4*x^2 + 3 3*x^2 + 2*x + 4 2*x + 4] Sage example in ./domaines.tex, line 697:: sage: QQ.category() Join of Category of number fields and Category of quotient fields and Category of metric spaces Sage example in ./domaines.tex, line 704:: sage: QQ in Fields() True Sage example in ./domaines.tex, line 712:: sage: QQ in CommutativeAdditiveGroups() True Sage example in ./domaines.tex, line 718:: sage: QQ['x'] in EuclideanDomains() True Sage example in ./domaines.tex, line 859:: sage: 5.parent() Integer Ring Sage example in ./domaines.tex, line 872:: sage: type(factor(4)) <class 'sage.structure.factorization_integer.IntegerFactorization'> Sage example in ./domaines.tex, line 895:: sage: int(5) 5 sage: type(int(5)) <... 'int'> Sage example in ./domaines.tex, line 909:: sage: Integer(5) 5 sage: type(Integer(5)) <... 'sage.rings.integer.Integer'> Sage example in ./domaines.tex, line 926:: sage: factorial(99) / factorial(100) - 1 / 50 -1/100 Sage example in ./domaines.tex, line 974:: sage: 72/53 - 5/3 * 2.7 -3.14150943396227 Sage example in ./domaines.tex, line 982:: sage: cos(1), cos(1.) (cos(1), 0.540302305868140) Sage example in ./domaines.tex, line 1000:: sage: pi.n(digits=50) # variant: n(pi,digits=50) 3.1415926535897932384626433832795028841971693993751 Sage example in ./domaines.tex, line 1020:: sage: z = CC(1,2); z.arg() 1.10714871779409 Sage example in ./domaines.tex, line 1036:: sage: I.parent() Number Field in I with defining polynomial x^2 + 1 with I = 1*I Sage example in ./domaines.tex, line 1043:: sage: (1.+2.*I).parent() Complex Field with 53 bits of precision sage: (1.+2.*SR(I)).parent() Symbolic Ring Sage example in ./domaines.tex, line 1064:: sage: z = 3 * exp(I*pi/4) sage: z.real(), z.imag(), z.abs().canonicalize_radical() (3/2*sqrt(2), 3/2*sqrt(2), 3) Sage example in ./domaines.tex, line 1094:: sage: a, b, c = 0, 2, 3 sage: a == 1 or (b == 2 and c == 3) True Sage example in ./domaines.tex, line 1147:: sage: x, y = var('x, y') sage: bool( (x-y)*(x+y) == x^2-y^2 ) True Sage example in ./domaines.tex, line 1171:: sage: Z4 = IntegerModRing(4); Z4 Ring of integers modulo 4 sage: m = Z4(7); m 3 Sage example in ./domaines.tex, line 1184:: sage: 3 * m + 1 2 Sage example in ./domaines.tex, line 1191:: sage: Z3 = GF(3); Z3 Finite Field of size 3 Sage example in ./domaines.tex, line 1243:: sage: a = matrix(QQ, [[1,2,3],[2,4,8],[3,9,27]]) sage: (a^2 + 1) * a^(-1) [ -5 13/2 7/3] [ 7 1 25/3] [ 2 19/2 27] Sage example in ./domaines.tex, line 1259:: sage: M = MatrixSpace(QQ,3,3); M Full MatrixSpace of 3 by 3 dense matrices over Rational Field sage: a = M([[1,2,3],[2,4,8],[3,9,27]]) sage: (a^2 + 1) * a^(-1) [ -5 13/2 7/3] [ 7 1 25/3] [ 2 19/2 27] Sage example in ./domaines.tex, line 1283:: sage: P = ZZ['x']; P Univariate Polynomial Ring in x over Integer Ring sage: F = P.fraction_field(); F Fraction Field of Univariate Polynomial Ring in x over Integer Ring sage: p = P(x+1) * P(x); p x^2 + x sage: p + 1/p (x^4 + 2*x^3 + x^2 + 1)/(x^2 + x) sage: parent(p + 1/p) Fraction Field of Univariate Polynomial Ring in x over Integer Ring Sage example in ./domaines.tex, line 1382:: sage: k.<a> = NumberField(x^3 + x + 1); a^3; a^4+3*a -a - 1 -a^2 + 2*a Sage example in ./domaines.tex, line 1416:: sage: parent(sin(x)) Symbolic Ring Sage example in ./domaines.tex, line 1422:: sage: SR Symbolic Ring Sage example in ./domaines.tex, line 1428:: sage: SR.category() Category of fields Sage example in ./domaines.tex, line 1482:: sage: R = QQ['x1,x2,x3,x4']; R Multivariate Polynomial Ring in x1, x2, x3, x4 over Rational Field sage: x1, x2, x3, x4 = R.gens() Sage example in ./domaines.tex, line 1489:: sage: x1 * (x2 - x3) x1*x2 - x1*x3 Sage example in ./domaines.tex, line 1496:: sage: (x1+x2)*(x1-x2) - (x1^2 - x2^2) 0 Sage example in ./domaines.tex, line 1509:: sage: P = prod( (a-b) for (a,b) in Subsets([x1,x2,x3,x4],2) ); P * P.lc() x1^3*x2^2*x3 - x1^2*x2^3*x3 - x1^3*x2*x3^2 + x1*x2^3*x3^2 + x1^2*x2*x3^3 - x1*x2^2*x3^3 - x1^3*x2^2*x4 + x1^2*x2^3*x4 + x1^3*x3^2*x4 - x2^3*x3^2*x4 - x1^2*x3^3*x4 + x2^2*x3^3*x4 + x1^3*x2*x4^2 - x1*x2^3*x4^2 - x1^3*x3*x4^2 + x2^3*x3*x4^2 + x1*x3^3*x4^2 - x2*x3^3*x4^2 - x1^2*x2*x4^3 + x1*x2^2*x4^3 + x1^2*x3*x4^3 - x2^2*x3*x4^3 - x1*x3^2*x4^3 + x2*x3^2*x4^3 Sage example in ./domaines.tex, line 1531:: sage: x1, x2, x3, x4 = SR.var('x1, x2, x3, x4') sage: got = prod( (a-b) for (a,b) in Subsets([x1,x2,x3,x4],2) ) sage: expected1 = -(x1 - x2)*(x1 - x3)*(x1 - x4)*(x2 - x3)*(x2 - x4)*(x3 - x4) sage: expected2 = (x1 - x2)*(x1 - x3)*(x1 - x4)*(x2 - x3)*(x2 - x4)*(x3 - x4) sage: bool(got == expected1 or got == expected2) True Sage example in ./domaines.tex, line 1581:: sage: x = var('x') sage: p = 54*x^4+36*x^3-102*x^2-72*x-12 sage: factor(p) 6*(x^2 - 2)*(3*x + 1)^2 Sage example in ./domaines.tex, line 1616:: sage: R = ZZ['x']; R Univariate Polynomial Ring in x over Integer Ring Sage example in ./domaines.tex, line 1622:: sage: q = R(p); q 54*x^4 + 36*x^3 - 102*x^2 - 72*x - 12 Sage example in ./domaines.tex, line 1629:: sage: parent(q) Univariate Polynomial Ring in x over Integer Ring Sage example in ./domaines.tex, line 1635:: sage: factor(q) 2 * 3 * (3*x + 1)^2 * (x^2 - 2) Sage example in ./domaines.tex, line 1642:: sage: R = QQ['x']; R Univariate Polynomial Ring in x over Rational Field sage: q = R(p); q 54*x^4 + 36*x^3 - 102*x^2 - 72*x - 12 sage: factor(q) (54) * (x + 1/3)^2 * (x^2 - 2) Sage example in ./domaines.tex, line 1665:: sage: R = ComplexField(16)['x']; R Univariate Polynomial Ring in x over Complex Field with 16 bits of precision sage: q = R(p); q 54.00*x^4 + 36.00*x^3 - 102.0*x^2 - 72.00*x - 12.00 sage: factor(q) (54.00) * (x - 1.414) * (x + 0.3333)^2 * (x + 1.414) Sage example in ./domaines.tex, line 1685:: sage: R = QQ[sqrt(2)]['x']; R Univariate Polynomial Ring in x over Number Field in sqrt2 with defining polynomial x^2 - 2 with sqrt2 = 1.414213562373095? sage: q = R(p); q 54*x^4 + 36*x^3 - 102*x^2 - 72*x - 12 sage: factor(q) (54) * (x - sqrt2) * (x + sqrt2) * (x + 1/3)^2 Sage example in ./domaines.tex, line 1698:: sage: R = GF(5)['x']; R Univariate Polynomial Ring in x over Finite Field of size 5 sage: q = R(p); q 4*x^4 + x^3 + 3*x^2 + 3*x + 3 sage: factor(q) (4) * (x + 2)^2 * (x^2 + 3) """
""" This file (./domaines_doctest.sage) was *autogenerated* from ./domaines.tex, with sagetex.sty version 2011/05/27 v2.3.1. It contains the contents of all the sageexample environments from this file. You should be able to doctest this file with: sage -t ./domaines_doctest.sage It is always safe to delete this file; it is not used in typesetting your document. Sage example in ./domaines.tex, line 10:: sage: x = var('x') Sage example in ./domaines.tex, line 69:: sage: o = 12/35 sage: type(o) <... 'sage.rings.rational.Rational'> Sage example in ./domaines.tex, line 82:: sage: type(12/35) <... 'sage.rings.rational.Rational'> Sage example in ./domaines.tex, line 131:: sage: o = 720 sage: o.factor() 2^4 * 3^2 * 5 Sage example in ./domaines.tex, line 142:: sage: type(o).factor(o) 2^4 * 3^2 * 5 Sage example in ./domaines.tex, line 157:: sage: 720.factor() 2^4 * 3^2 * 5 Sage example in ./domaines.tex, line 166:: sage: o = 720 / 133 sage: o.numerator().factor() 2^4 * 3^2 * 5 Sage example in ./domaines.tex, line 253:: sage: 3 * 7 21 Sage example in ./domaines.tex, line 261:: sage: (2/3) * (6/5) 4/5 Sage example in ./domaines.tex, line 267:: sage: (1 + I) * (1 - I) 2 Sage example in ./domaines.tex, line 274:: sage: (x + 2) * (x + 1) (x + 2)*(x + 1) sage: (x + 1) * (x + 2) (x + 2)*(x + 1) Sage example in ./domaines.tex, line 308:: sage: def fourth_power(a): ....: a = a * a ....: a = a * a ....: return a Sage example in ./domaines.tex, line 330:: sage: fourth_power(2) 16 sage: fourth_power(3/2) 81/16 sage: fourth_power(I) 1 sage: fourth_power(x+1) (x + 1)^4 sage: M = matrix([[0,-1],[1,0]]); M [ 0 -1] [ 1 0] sage: fourth_power(M) [1 0] [0 1] Sage example in ./domaines.tex, line 375:: sage: t = type(5/1); t <... 'sage.rings.rational.Rational'> sage: t == type(5) False Sage example in ./domaines.tex, line 476:: sage: a = 5; a 5 sage: a.is_unit() False Sage example in ./domaines.tex, line 484:: sage: a = 5/1; a 5 sage: a.is_unit() True Sage example in ./domaines.tex, line 507:: sage: parent(5) Integer Ring sage: parent(5/1) Rational Field Sage example in ./domaines.tex, line 515:: sage: ZZ Integer Ring sage: QQ Rational Field Sage example in ./domaines.tex, line 525:: sage: QQ(5).parent() Rational Field sage: ZZ(5/1).parent() Integer Ring sage: ZZ(1/5) Traceback (most recent call last): ... TypeError: no conversion of this rational to integer Sage example in ./domaines.tex, line 543:: sage: ZZ(1), QQ(1), RR(1), CC(1) (1, 1, 1.00000000000000, 1.00000000000000) Sage example in ./domaines.tex, line 568:: sage: cartesian_product([QQ, QQ]) The Cartesian product of (Rational Field, Rational Field) Sage example in ./domaines.tex, line 574:: sage: ZZ.fraction_field() Rational Field Sage example in ./domaines.tex, line 580:: sage: ZZ['x'] Univariate Polynomial Ring in x over Integer Ring Sage example in ./domaines.tex, line 591:: sage: Z5 = GF(5); Z5 Finite Field of size 5 sage: P = Z5['x']; P Univariate Polynomial Ring in x over Finite Field of size 5 sage: M = MatrixSpace(P, 3, 3); M Full MatrixSpace of 3 by 3 dense matrices over Univariate Polynomial Ring in x over Finite Field of size 5 Sage example in ./domaines.tex, line 602:: sage: M.random_element() # random [2*x^2 + 3*x + 4 4*x^2 + 2*x + 2 4*x^2 + 2*x] [ 3*x 2*x^2 + x + 3 3*x^2 + 4*x] [ 4*x^2 + 3 3*x^2 + 2*x + 4 2*x + 4] Sage example in ./domaines.tex, line 697:: sage: QQ.category() Join of Category of number fields and Category of quotient fields and Category of metric spaces Sage example in ./domaines.tex, line 704:: sage: QQ in Fields() True Sage example in ./domaines.tex, line 712:: sage: QQ in CommutativeAdditiveGroups() True Sage example in ./domaines.tex, line 718:: sage: QQ['x'] in EuclideanDomains() True Sage example in ./domaines.tex, line 859:: sage: 5.parent() Integer Ring Sage example in ./domaines.tex, line 872:: sage: type(factor(4)) <class 'sage.structure.factorization_integer.IntegerFactorization'> Sage example in ./domaines.tex, line 895:: sage: int(5) 5 sage: type(int(5)) <... 'int'> Sage example in ./domaines.tex, line 909:: sage: Integer(5) 5 sage: type(Integer(5)) <... 'sage.rings.integer.Integer'> Sage example in ./domaines.tex, line 926:: sage: factorial(99) / factorial(100) - 1 / 50 -1/100 Sage example in ./domaines.tex, line 974:: sage: 72/53 - 5/3 * 2.7 -3.14150943396227 Sage example in ./domaines.tex, line 982:: sage: cos(1), cos(1.) (cos(1), 0.540302305868140) Sage example in ./domaines.tex, line 1000:: sage: pi.n(digits=50) # variant: n(pi,digits=50) 3.1415926535897932384626433832795028841971693993751 Sage example in ./domaines.tex, line 1020:: sage: z = CC(1,2); z.arg() 1.10714871779409 Sage example in ./domaines.tex, line 1036:: sage: I.parent() Number Field in I with defining polynomial x^2 + 1 with I = 1*I Sage example in ./domaines.tex, line 1043:: sage: (1.+2.*I).parent() Complex Field with 53 bits of precision sage: (1.+2.*SR(I)).parent() Symbolic Ring Sage example in ./domaines.tex, line 1064:: sage: z = 3 * exp(I*pi/4) sage: z.real(), z.imag(), z.abs().canonicalize_radical() (3/2*sqrt(2), 3/2*sqrt(2), 3) Sage example in ./domaines.tex, line 1094:: sage: a, b, c = 0, 2, 3 sage: a == 1 or (b == 2 and c == 3) True Sage example in ./domaines.tex, line 1147:: sage: x, y = var('x, y') sage: bool( (x-y)*(x+y) == x^2-y^2 ) True Sage example in ./domaines.tex, line 1171:: sage: Z4 = IntegerModRing(4); Z4 Ring of integers modulo 4 sage: m = Z4(7); m 3 Sage example in ./domaines.tex, line 1184:: sage: 3 * m + 1 2 Sage example in ./domaines.tex, line 1191:: sage: Z3 = GF(3); Z3 Finite Field of size 3 Sage example in ./domaines.tex, line 1243:: sage: a = matrix(QQ, [[1,2,3],[2,4,8],[3,9,27]]) sage: (a^2 + 1) * a^(-1) [ -5 13/2 7/3] [ 7 1 25/3] [ 2 19/2 27] Sage example in ./domaines.tex, line 1259:: sage: M = MatrixSpace(QQ,3,3); M Full MatrixSpace of 3 by 3 dense matrices over Rational Field sage: a = M([[1,2,3],[2,4,8],[3,9,27]]) sage: (a^2 + 1) * a^(-1) [ -5 13/2 7/3] [ 7 1 25/3] [ 2 19/2 27] Sage example in ./domaines.tex, line 1283:: sage: P = ZZ['x']; P Univariate Polynomial Ring in x over Integer Ring sage: F = P.fraction_field(); F Fraction Field of Univariate Polynomial Ring in x over Integer Ring sage: p = P(x+1) * P(x); p x^2 + x sage: p + 1/p (x^4 + 2*x^3 + x^2 + 1)/(x^2 + x) sage: parent(p + 1/p) Fraction Field of Univariate Polynomial Ring in x over Integer Ring Sage example in ./domaines.tex, line 1382:: sage: k.<a> = NumberField(x^3 + x + 1); a^3; a^4+3*a -a - 1 -a^2 + 2*a Sage example in ./domaines.tex, line 1416:: sage: parent(sin(x)) Symbolic Ring Sage example in ./domaines.tex, line 1422:: sage: SR Symbolic Ring Sage example in ./domaines.tex, line 1428:: sage: SR.category() Category of fields Sage example in ./domaines.tex, line 1482:: sage: R = QQ['x1,x2,x3,x4']; R Multivariate Polynomial Ring in x1, x2, x3, x4 over Rational Field sage: x1, x2, x3, x4 = R.gens() Sage example in ./domaines.tex, line 1489:: sage: x1 * (x2 - x3) x1*x2 - x1*x3 Sage example in ./domaines.tex, line 1496:: sage: (x1+x2)*(x1-x2) - (x1^2 - x2^2) 0 Sage example in ./domaines.tex, line 1509:: sage: P = prod( (a-b) for (a,b) in Subsets([x1,x2,x3,x4],2) ); P * P.lc() x1^3*x2^2*x3 - x1^2*x2^3*x3 - x1^3*x2*x3^2 + x1*x2^3*x3^2 + x1^2*x2*x3^3 - x1*x2^2*x3^3 - x1^3*x2^2*x4 + x1^2*x2^3*x4 + x1^3*x3^2*x4 - x2^3*x3^2*x4 - x1^2*x3^3*x4 + x2^2*x3^3*x4 + x1^3*x2*x4^2 - x1*x2^3*x4^2 - x1^3*x3*x4^2 + x2^3*x3*x4^2 + x1*x3^3*x4^2 - x2*x3^3*x4^2 - x1^2*x2*x4^3 + x1*x2^2*x4^3 + x1^2*x3*x4^3 - x2^2*x3*x4^3 - x1*x3^2*x4^3 + x2*x3^2*x4^3 Sage example in ./domaines.tex, line 1531:: sage: x1, x2, x3, x4 = SR.var('x1, x2, x3, x4') sage: got = prod( (a-b) for (a,b) in Subsets([x1,x2,x3,x4],2) ) sage: expected1 = -(x1 - x2)*(x1 - x3)*(x1 - x4)*(x2 - x3)*(x2 - x4)*(x3 - x4) sage: expected2 = (x1 - x2)*(x1 - x3)*(x1 - x4)*(x2 - x3)*(x2 - x4)*(x3 - x4) sage: bool(got == expected1 or got == expected2) True Sage example in ./domaines.tex, line 1581:: sage: x = var('x') sage: p = 54*x^4+36*x^3-102*x^2-72*x-12 sage: factor(p) 6*(x^2 - 2)*(3*x + 1)^2 Sage example in ./domaines.tex, line 1616:: sage: R = ZZ['x']; R Univariate Polynomial Ring in x over Integer Ring Sage example in ./domaines.tex, line 1622:: sage: q = R(p); q 54*x^4 + 36*x^3 - 102*x^2 - 72*x - 12 Sage example in ./domaines.tex, line 1629:: sage: parent(q) Univariate Polynomial Ring in x over Integer Ring Sage example in ./domaines.tex, line 1635:: sage: factor(q) 2 * 3 * (3*x + 1)^2 * (x^2 - 2) Sage example in ./domaines.tex, line 1642:: sage: R = QQ['x']; R Univariate Polynomial Ring in x over Rational Field sage: q = R(p); q 54*x^4 + 36*x^3 - 102*x^2 - 72*x - 12 sage: factor(q) (54) * (x + 1/3)^2 * (x^2 - 2) Sage example in ./domaines.tex, line 1665:: sage: R = ComplexField(16)['x']; R Univariate Polynomial Ring in x over Complex Field with 16 bits of precision sage: q = R(p); q 54.00*x^4 + 36.00*x^3 - 102.0*x^2 - 72.00*x - 12.00 sage: factor(q) (54.00) * (x - 1.414) * (x + 0.3333)^2 * (x + 1.414) Sage example in ./domaines.tex, line 1685:: sage: R = QQ[sqrt(2)]['x']; R Univariate Polynomial Ring in x over Number Field in sqrt2 with defining polynomial x^2 - 2 with sqrt2 = 1.414213562373095? sage: q = R(p); q 54*x^4 + 36*x^3 - 102*x^2 - 72*x - 12 sage: factor(q) (54) * (x - sqrt2) * (x + sqrt2) * (x + 1/3)^2 Sage example in ./domaines.tex, line 1698:: sage: R = GF(5)['x']; R Univariate Polynomial Ring in x over Finite Field of size 5 sage: q = R(p); q 4*x^4 + x^3 + 3*x^2 + 3*x + 3 sage: factor(q) (4) * (x + 2)^2 * (x^2 + 3) """
description = 'Mezei spin flipper using TTI power supply' group = 'optional' tango_base = 'tango://miractrl.mira.frm2:10000/mira/' devices = dict( dct1 = device('nicos.devices.entangle.PowerSupply', description = 'current in first channel of supply (flipper current)', tangodevice = tango_base + 'tti1/out1', timeout = 1, precision = 0.01, ), dct2 = device('nicos.devices.entangle.PowerSupply', description = 'current in second channel of supply (compensation current)', tangodevice = tango_base + 'tti1/out2', timeout = 1, precision = 0.01, ), flip = device('nicos.devices.polarized.MezeiFlipper', description = 'Mezei flipper before sample (in shielding table)', flip = 'dct1', corr = 'dct2', ), )
description = 'Mezei spin flipper using TTI power supply' group = 'optional' tango_base = 'tango://miractrl.mira.frm2:10000/mira/' devices = dict(dct1=device('nicos.devices.entangle.PowerSupply', description='current in first channel of supply (flipper current)', tangodevice=tango_base + 'tti1/out1', timeout=1, precision=0.01), dct2=device('nicos.devices.entangle.PowerSupply', description='current in second channel of supply (compensation current)', tangodevice=tango_base + 'tti1/out2', timeout=1, precision=0.01), flip=device('nicos.devices.polarized.MezeiFlipper', description='Mezei flipper before sample (in shielding table)', flip='dct1', corr='dct2'))
class Stack: def __init__(self): self.stack = [] self.minMaxStack = [] # O(1) time | O(1) space def peek(self): if (len(self.stack)): return self.stack[-1] return None # O(1) time | O(1) space def pop(self): if (len(self.stack)): self.minMaxStack.pop() return self.stack.pop() return None # Procedure # O(1) time | O(1) space def push(self, value): minNumber = value maxNumber = value if (len(self.minMaxStack)): lastMinMax = self.minMaxStack[-1] minNumber = min(lastMinMax[0], minNumber) maxNumber = max(lastMinMax[1], maxNumber) self.stack.append(value) self.minMaxStack.append((minNumber, maxNumber)) print(self.stack) print(self.minMaxStack) # O(1) time | O(1) space def getMin(self): if (len(self.minMaxStack)): return self.minMaxStack[-1][0] return None # O(1) time | O(1) space def getMax(self): if (len(self.minMaxStack)): return self.minMaxStack[-1][1] return None
class Stack: def __init__(self): self.stack = [] self.minMaxStack = [] def peek(self): if len(self.stack): return self.stack[-1] return None def pop(self): if len(self.stack): self.minMaxStack.pop() return self.stack.pop() return None def push(self, value): min_number = value max_number = value if len(self.minMaxStack): last_min_max = self.minMaxStack[-1] min_number = min(lastMinMax[0], minNumber) max_number = max(lastMinMax[1], maxNumber) self.stack.append(value) self.minMaxStack.append((minNumber, maxNumber)) print(self.stack) print(self.minMaxStack) def get_min(self): if len(self.minMaxStack): return self.minMaxStack[-1][0] return None def get_max(self): if len(self.minMaxStack): return self.minMaxStack[-1][1] return None
BIG_CONSTANT = "YES" def group_by(xs, grouper): groups = {} for x in xs: group = grouper(x) if group not in groups: groups[group] = [] groups[group].append(x) return groups print(group_by([1, 2, 3, 4, 5, 6], lambda x: "even" if x % 2 == 0 else "odd"))
big_constant = 'YES' def group_by(xs, grouper): groups = {} for x in xs: group = grouper(x) if group not in groups: groups[group] = [] groups[group].append(x) return groups print(group_by([1, 2, 3, 4, 5, 6], lambda x: 'even' if x % 2 == 0 else 'odd'))
NOTES = { 'notes': [ {'date': '2014-05-22T00:00:00Z', 'note': 'Second Note'}, {'date': '2014-05-21T14:02:45Z', 'note': 'First Note'} ] } SUBJECT = { "subject": ['HB1-3840', 'H'] } OWNER = { "owner": "Owner" } EDITORIAL = { "editor_group": "editorgroup", "editor": "associate" } SEAL = { "doaj_seal": True, }
notes = {'notes': [{'date': '2014-05-22T00:00:00Z', 'note': 'Second Note'}, {'date': '2014-05-21T14:02:45Z', 'note': 'First Note'}]} subject = {'subject': ['HB1-3840', 'H']} owner = {'owner': 'Owner'} editorial = {'editor_group': 'editorgroup', 'editor': 'associate'} seal = {'doaj_seal': True}
def fatorial(n): f = 1 while n != 0: f *= n n -= 1 return f def dobro(n): n *= 2 return n def triplo(n): n *= 3 return n
def fatorial(n): f = 1 while n != 0: f *= n n -= 1 return f def dobro(n): n *= 2 return n def triplo(n): n *= 3 return n
#!/usr/bin/python3 # If F(a) is any function that can be defined as composition of bitwise XORs, ANDs and left shifts # Then the dynac system x_(n+1) = F(x_n) is Turing complete # Proof by simulation (rule110) a = 1 while a: print(bin(a)) a = a ^ (a << 1) ^ (a & (a << 1)) ^ (a & (a << 1) & (a << 2))
a = 1 while a: print(bin(a)) a = a ^ a << 1 ^ a & a << 1 ^ a & a << 1 & a << 2
__author__ = "Daniel Winklehner" __doc__ = "Find out if a number is a power of two" def power_of_two(number): """ Function that checks if the input value (data) is a power of 2 (i.e. 2, 4, 8, 16, 32, ...) """ res = 0 while res == 0: res = number % 2 number /= 2.0 print("res: {}, data: {}".format(res, number)) if number == 1 and res == 0: return True return False
__author__ = 'Daniel Winklehner' __doc__ = 'Find out if a number is a power of two' def power_of_two(number): """ Function that checks if the input value (data) is a power of 2 (i.e. 2, 4, 8, 16, 32, ...) """ res = 0 while res == 0: res = number % 2 number /= 2.0 print('res: {}, data: {}'.format(res, number)) if number == 1 and res == 0: return True return False
load("//tools/bzl:maven_jar.bzl", "maven_jar") def external_plugin_deps(omit_commons_codec = True): JACKSON_VERS = "2.10.2" maven_jar( name = "scribejava-core", artifact = "com.github.scribejava:scribejava-core:6.9.0", sha1 = "ed761f450d8382f75787e8fee9ae52e7ec768747", ) maven_jar( name = "jackson-annotations", artifact = "com.fasterxml.jackson.core:jackson-annotations:" + JACKSON_VERS, sha1 = "3a13b6105946541b8d4181a0506355b5fae63260", ) maven_jar( name = "jackson-databind", artifact = "com.fasterxml.jackson.core:jackson-databind:" + JACKSON_VERS, sha1 = "0528de95f198afafbcfb0c09d2e43b6e0ea663ec", deps = [ "@jackson-annotations//jar", ], ) if not omit_commons_codec: maven_jar( name = "commons-codec", artifact = "commons-codec:commons-codec:1.4", sha1 = "4216af16d38465bbab0f3dff8efa14204f7a399a", )
load('//tools/bzl:maven_jar.bzl', 'maven_jar') def external_plugin_deps(omit_commons_codec=True): jackson_vers = '2.10.2' maven_jar(name='scribejava-core', artifact='com.github.scribejava:scribejava-core:6.9.0', sha1='ed761f450d8382f75787e8fee9ae52e7ec768747') maven_jar(name='jackson-annotations', artifact='com.fasterxml.jackson.core:jackson-annotations:' + JACKSON_VERS, sha1='3a13b6105946541b8d4181a0506355b5fae63260') maven_jar(name='jackson-databind', artifact='com.fasterxml.jackson.core:jackson-databind:' + JACKSON_VERS, sha1='0528de95f198afafbcfb0c09d2e43b6e0ea663ec', deps=['@jackson-annotations//jar']) if not omit_commons_codec: maven_jar(name='commons-codec', artifact='commons-codec:commons-codec:1.4', sha1='4216af16d38465bbab0f3dff8efa14204f7a399a')
def load(h): return ({'abbr': 0, 'code': 0, 'title': 'There is no appended list'}, {'abbr': 1, 'code': 1, 'title': 'Numbers define number of points corresponding to full coordinate ' 'circles (i.e. parallels), coordinate values on each circle are ' 'multiple of the circle mesh, and extreme coordinate values given ' 'in grid definition (i.e. extreme longitudes) may not be reached in ' 'all rows'}, {'abbr': 2, 'code': 2, 'title': 'Numbers define number of points corresponding to coordinate lines ' 'delimited by extreme coordinate values given in grid definition ' '(i.e. extreme longitudes) which are present in each row'}, {'abbr': 3, 'code': 3, 'title': 'Numbers define the actual latitudes for each row in the grid. The ' 'list of numbers are integer values of the valid latitudes in ' 'microdegrees (scaled by 10-6) or in unit equal to the ratio of the ' 'basic angle and the subdivisions number for each row, in the same ' 'order as specified in the scanning mode flag', 'units': 'bit no. 2'}, {'abbr': None, 'code': 255, 'title': 'Missing'})
def load(h): return ({'abbr': 0, 'code': 0, 'title': 'There is no appended list'}, {'abbr': 1, 'code': 1, 'title': 'Numbers define number of points corresponding to full coordinate circles (i.e. parallels), coordinate values on each circle are multiple of the circle mesh, and extreme coordinate values given in grid definition (i.e. extreme longitudes) may not be reached in all rows'}, {'abbr': 2, 'code': 2, 'title': 'Numbers define number of points corresponding to coordinate lines delimited by extreme coordinate values given in grid definition (i.e. extreme longitudes) which are present in each row'}, {'abbr': 3, 'code': 3, 'title': 'Numbers define the actual latitudes for each row in the grid. The list of numbers are integer values of the valid latitudes in microdegrees (scaled by 10-6) or in unit equal to the ratio of the basic angle and the subdivisions number for each row, in the same order as specified in the scanning mode flag', 'units': 'bit no. 2'}, {'abbr': None, 'code': 255, 'title': 'Missing'})
class InvalidSideException(Exception): """Invalid side""" class NotSupportedException(Exception): """Not supported by dummy wallet""" class InvalidProductException(Exception): """Invalid product type""" class OutOfBoundsException(Exception): """Attempt to access memory outside buffer bounds"""
class Invalidsideexception(Exception): """Invalid side""" class Notsupportedexception(Exception): """Not supported by dummy wallet""" class Invalidproductexception(Exception): """Invalid product type""" class Outofboundsexception(Exception): """Attempt to access memory outside buffer bounds"""
# 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: seen = set() curr = headA while curr: seen.add(curr) curr = curr.next curr = headB while curr: if curr in seen: return curr curr = curr.next return None
class Listnode: def __init__(self, x): self.val = x self.next = None class Solution: def get_intersection_node(self, headA: ListNode, headB: ListNode) -> ListNode: seen = set() curr = headA while curr: seen.add(curr) curr = curr.next curr = headB while curr: if curr in seen: return curr curr = curr.next return None
""" Insertion Sort Approach: Loop Complexity: O(n2) """ def sort_insertion(input_arr): print("""""""""""""""""""""""""") print("input " + str(input_arr)) print("""""""""""""""""""""""""") ln = len(input_arr) i = 1 # Assuming first element is sorted while i < ln: # n times c = input_arr[i] p = i while p > 0 and input_arr[p - 1] > c: # n times input_arr[p] = input_arr[p - 1] p -= 1 input_arr[p] = c i += 1 print("pass " + str(i) + " " + str(input_arr)) print("""""""""""""""""""""""""") print("result " + str(input_arr)) print("""""""""""""""""""""""""") if __name__ == '__main__': arr = [21, 4, 1, 3, 9, 20, 25, 6, 21, 14] sort_insertion(arr)
""" Insertion Sort Approach: Loop Complexity: O(n2) """ def sort_insertion(input_arr): print('') print('input ' + str(input_arr)) print('') ln = len(input_arr) i = 1 while i < ln: c = input_arr[i] p = i while p > 0 and input_arr[p - 1] > c: input_arr[p] = input_arr[p - 1] p -= 1 input_arr[p] = c i += 1 print('pass ' + str(i) + ' ' + str(input_arr)) print('') print('result ' + str(input_arr)) print('') if __name__ == '__main__': arr = [21, 4, 1, 3, 9, 20, 25, 6, 21, 14] sort_insertion(arr)
""" fixtures that return an sql statement with a list of values to be inserted.""" def load_language(): """ return the sql and values of the insert queuery.""" sql = """ INSERT INTO Spanglish_Test.Language ( `name`, `iso-639-1` ) VALUES (%s, %s) """ values = [ ( 'English', 'EN' ), ( 'Spanish', 'ES' ), ( 'Dutch', 'NL' ) ] return { 'sql': sql, 'values': values }
""" fixtures that return an sql statement with a list of values to be inserted.""" def load_language(): """ return the sql and values of the insert queuery.""" sql = '\n INSERT INTO Spanglish_Test.Language \n (\n `name`, `iso-639-1`\n ) \n VALUES (%s, %s)\n ' values = [('English', 'EN'), ('Spanish', 'ES'), ('Dutch', 'NL')] return {'sql': sql, 'values': values}
# Copyright 2020 Plezentek, 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. load( "//sqlc/private:providers.bzl", "SQLCRelease", ) load( "//sqlc/private/rules_go/lib:platforms.bzl", "PLATFORMS", ) def _sqlc_toolchain_impl(ctx): release = ctx.attr.release[SQLCRelease] cross_compile = ctx.attr.goos != release.goos or ctx.attr.goarch != release.goarch return [platform_common.ToolchainInfo( name = ctx.label.name, cross_compile = cross_compile, default_goos = ctx.attr.goos, default_goarch = ctx.attr.goarch, actions = struct(), flags = struct(), release = release, )] sqlc_toolchain = rule( _sqlc_toolchain_impl, attrs = { "goos": attr.string( mandatory = True, doc = "Default target OS", ), "goarch": attr.string( mandatory = True, doc = "Default target architecture", ), "release": attr.label( mandatory = True, providers = [SQLCRelease], cfg = "exec", doc = "The SQLC release this toolchain is based on", ), }, doc = "Defines a SQLC toolchain based on a release", provides = [platform_common.ToolchainInfo], ) def declare_toolchains(host, release): host_goos, _, host_goarch = host.partition("_") for p in PLATFORMS: toolchain_name = "sqlc_" + p.name impl_name = toolchain_name + "-impl" cgo_constraints = ( "@com_plezentek_rules_sqlc//sqlc/toolchain:cgo_off", "@com_plezentek_rules_sqlc//sqlc/toolchain:cgo_on", ) constraints = [c for c in p.constraints if c not in cgo_constraints] sqlc_toolchain( name = impl_name, goos = p.goos, goarch = p.goarch, release = release, tags = ["manual"], visibility = ["//visibility:public"], ) native.toolchain( name = toolchain_name, toolchain_type = "@com_plezentek_rules_sqlc//sqlc:toolchain", exec_compatible_with = [ "@com_plezentek_rules_sqlc//sqlc/toolchain:" + host_goos, "@com_plezentek_rules_sqlc//sqlc/toolchain:" + host_goarch, ], target_compatible_with = constraints, toolchain = ":" + impl_name, )
load('//sqlc/private:providers.bzl', 'SQLCRelease') load('//sqlc/private/rules_go/lib:platforms.bzl', 'PLATFORMS') def _sqlc_toolchain_impl(ctx): release = ctx.attr.release[SQLCRelease] cross_compile = ctx.attr.goos != release.goos or ctx.attr.goarch != release.goarch return [platform_common.ToolchainInfo(name=ctx.label.name, cross_compile=cross_compile, default_goos=ctx.attr.goos, default_goarch=ctx.attr.goarch, actions=struct(), flags=struct(), release=release)] sqlc_toolchain = rule(_sqlc_toolchain_impl, attrs={'goos': attr.string(mandatory=True, doc='Default target OS'), 'goarch': attr.string(mandatory=True, doc='Default target architecture'), 'release': attr.label(mandatory=True, providers=[SQLCRelease], cfg='exec', doc='The SQLC release this toolchain is based on')}, doc='Defines a SQLC toolchain based on a release', provides=[platform_common.ToolchainInfo]) def declare_toolchains(host, release): (host_goos, _, host_goarch) = host.partition('_') for p in PLATFORMS: toolchain_name = 'sqlc_' + p.name impl_name = toolchain_name + '-impl' cgo_constraints = ('@com_plezentek_rules_sqlc//sqlc/toolchain:cgo_off', '@com_plezentek_rules_sqlc//sqlc/toolchain:cgo_on') constraints = [c for c in p.constraints if c not in cgo_constraints] sqlc_toolchain(name=impl_name, goos=p.goos, goarch=p.goarch, release=release, tags=['manual'], visibility=['//visibility:public']) native.toolchain(name=toolchain_name, toolchain_type='@com_plezentek_rules_sqlc//sqlc:toolchain', exec_compatible_with=['@com_plezentek_rules_sqlc//sqlc/toolchain:' + host_goos, '@com_plezentek_rules_sqlc//sqlc/toolchain:' + host_goarch], target_compatible_with=constraints, toolchain=':' + impl_name)
root = { "general" : { "display_viewer" : False, #The visible GPUS will be restricted to the numbers listed here. The pytorch (cuda:0) numeration will start at 0 #This is a trick to get everything onto the wanted gpus because just setting cuda:4 in the function calls will #not work for mmdetection. There will still be things on gpu cuda:0. "cuda_visible_devices" : "1", "save_track_results" : True }, "data" : { # To increase the speed while developing an specific interval of all frames can be set. "selection_interval" : [0,10000], "source" : { "base_folder" : "/u40/zhanr110/MTA_ext_short/test", # "base_folder" : "/Users/nolanzhang/Projects/mtmct/data/MTA_ext_short/test", "cam_ids" : [1] } }, "detector" : { # "mmdetection_config" : "detectors/mmdetection/configs/faster_rcnn_r50_fpn_1x_gta.py", "mmdetection_config" : "detectors/mmdetection/configs/mta/faster_rcnn_r50_mta.py", # "mmdetection_checkpoint_file" : "work_dirs/detector/faster_rcnn_gta22.07_epoch_5.pth", "mmdetection_checkpoint_file" : "detectors/mmdetection/work_dirs/GtaDataset_30e/epoch_20.pth", "device" : "cuda:0", #Remove all detections with a confidence less than min_confidence "min_confidence" : 0.8, }, "feature_extractor" : { "feature_extractor_name" : "abd_net_extractor" ,"reid_strong_extractor": { "reid_strong_baseline_config": "feature_extractors/reid_strong_baseline/configs/softmax_triplet.yml", "checkpoint_file": "work_dirs/feature_extractor/strong_reid_baseline/resnet50_model_reid_GTA_softmax_triplet.pth", "device": "cuda:0,1" ,"visible_device" : "0,1"} ,"abd_net_extractor" : dict(abd_dan=['cam', 'pam'], abd_dan_no_head=False, abd_dim=1024, abd_np=2, adam_beta1=0.9, adam_beta2=0.999, arch='resnet50', branches=['global', 'abd'], compatibility=False, criterion='htri', cuhk03_classic_split=False, cuhk03_labeled=False, dan_dan=[], dan_dan_no_head=False, dan_dim=1024, data_augment=['crop,random-erase'], day_only=False, dropout=0.5, eval_freq=5, evaluate=False, fixbase=False, fixbase_epoch=10, flip_eval=False, gamma=0.1, global_dim=1024, global_max_pooling=False, gpu_devices='1', height=384, htri_only=False, label_smooth=True, lambda_htri=0.1, lambda_xent=1, lr=0.0003, margin=1.2, max_epoch=80, min_height=-1, momentum=0.9, night_only=False, np_dim=1024, np_max_pooling=False, np_np=2, np_with_global=False, num_instances=4, of_beta=1e-06, of_position=['before', 'after', 'cam', 'pam', 'intermediate'], of_start_epoch=23, open_layers=['classifier'], optim='adam', ow_beta=0.001, pool_tracklet_features='avg', print_freq=10, resume='', rmsprop_alpha=0.99 , load_weights='work_dirs/feature_extractor/abd-net/checkpoint_ep30_non_clean.pth.tar' # , load_weights='work_dirs/feature_extractor/abd-net/resnet50-19c8e357.pth' , root='work_dirs/datasets' , sample_method='evenly' , save_dir='work_dirs/feature_extractor/abd-net/log/eval-resnet50' , seed=1, seq_len=15, sgd_dampening=0, sgd_nesterov=False, shallow_cam=True, source_names=['mta_ext'], split_id=0, start_epoch=0, start_eval=0, stepsize=[20, 40], target_names=['market1501'], test_batch_size=100, train_batch_size=64, train_sampler='', use_avai_gpus=False, use_cpu=False, use_metric_cuhk03=False, use_of=True, use_ow=True, visualize_ranks=False, weight_decay=0.0005, width=128, workers=4) }, "tracker" : { "type" : "DeepSort", "nn_budget" : 100 } }
root = {'general': {'display_viewer': False, 'cuda_visible_devices': '1', 'save_track_results': True}, 'data': {'selection_interval': [0, 10000], 'source': {'base_folder': '/u40/zhanr110/MTA_ext_short/test', 'cam_ids': [1]}}, 'detector': {'mmdetection_config': 'detectors/mmdetection/configs/mta/faster_rcnn_r50_mta.py', 'mmdetection_checkpoint_file': 'detectors/mmdetection/work_dirs/GtaDataset_30e/epoch_20.pth', 'device': 'cuda:0', 'min_confidence': 0.8}, 'feature_extractor': {'feature_extractor_name': 'abd_net_extractor', 'reid_strong_extractor': {'reid_strong_baseline_config': 'feature_extractors/reid_strong_baseline/configs/softmax_triplet.yml', 'checkpoint_file': 'work_dirs/feature_extractor/strong_reid_baseline/resnet50_model_reid_GTA_softmax_triplet.pth', 'device': 'cuda:0,1', 'visible_device': '0,1'}, 'abd_net_extractor': dict(abd_dan=['cam', 'pam'], abd_dan_no_head=False, abd_dim=1024, abd_np=2, adam_beta1=0.9, adam_beta2=0.999, arch='resnet50', branches=['global', 'abd'], compatibility=False, criterion='htri', cuhk03_classic_split=False, cuhk03_labeled=False, dan_dan=[], dan_dan_no_head=False, dan_dim=1024, data_augment=['crop,random-erase'], day_only=False, dropout=0.5, eval_freq=5, evaluate=False, fixbase=False, fixbase_epoch=10, flip_eval=False, gamma=0.1, global_dim=1024, global_max_pooling=False, gpu_devices='1', height=384, htri_only=False, label_smooth=True, lambda_htri=0.1, lambda_xent=1, lr=0.0003, margin=1.2, max_epoch=80, min_height=-1, momentum=0.9, night_only=False, np_dim=1024, np_max_pooling=False, np_np=2, np_with_global=False, num_instances=4, of_beta=1e-06, of_position=['before', 'after', 'cam', 'pam', 'intermediate'], of_start_epoch=23, open_layers=['classifier'], optim='adam', ow_beta=0.001, pool_tracklet_features='avg', print_freq=10, resume='', rmsprop_alpha=0.99, load_weights='work_dirs/feature_extractor/abd-net/checkpoint_ep30_non_clean.pth.tar', root='work_dirs/datasets', sample_method='evenly', save_dir='work_dirs/feature_extractor/abd-net/log/eval-resnet50', seed=1, seq_len=15, sgd_dampening=0, sgd_nesterov=False, shallow_cam=True, source_names=['mta_ext'], split_id=0, start_epoch=0, start_eval=0, stepsize=[20, 40], target_names=['market1501'], test_batch_size=100, train_batch_size=64, train_sampler='', use_avai_gpus=False, use_cpu=False, use_metric_cuhk03=False, use_of=True, use_ow=True, visualize_ranks=False, weight_decay=0.0005, width=128, workers=4)}, 'tracker': {'type': 'DeepSort', 'nn_budget': 100}}
i=input("Enter a string: ") list = i.split() list.sort() for i in list: print(i,end=' ')
i = input('Enter a string: ') list = i.split() list.sort() for i in list: print(i, end=' ')
def test_one_plus_one_is_two(): assert 1 + 1 == 2 #o assert espera que algo seja verdadeiro, se for falso o teste quebrou def test_negative_1_plus_1_is_3(): assert 1 + 1 == 3
def test_one_plus_one_is_two(): assert 1 + 1 == 2 def test_negative_1_plus_1_is_3(): assert 1 + 1 == 3
values = [] for i in range(9): values.append(int(input(''))) max_value = 0 location = 0 for i in range(9): if values[i] > max_value: max_value = values[i] location = i+1 print(max_value) print(location)
values = [] for i in range(9): values.append(int(input(''))) max_value = 0 location = 0 for i in range(9): if values[i] > max_value: max_value = values[i] location = i + 1 print(max_value) print(location)
"""Test whether putative triangles, specified as triples of side lengths, in fact are possible.""" def load_triangles(filename): """Load triangles from filename.""" triangles = [] with open(filename) as f: for line in f: if line.strip(): triangles.append(tuple([int(side) for side in line.split()])) return triangles def load_triangles_from_cols(filename): """Instead of loading one triangle per line, load one-third each of three triangles per line.""" xs = [] ys = [] zs = [] with open(filename) as f: for line in f: if line.strip(): x, y, z = [int(side) for side in line.split()] xs.append(x) ys.append(y) zs.append(z) return ([(xs[i], xs[i+1], xs[i+2]) for i in range(0, len(xs), 3)] + [(ys[i], ys[i+1], ys[i+2]) for i in range(0, len(ys), 3)] + [(zs[i], zs[i+1], zs[i+2]) for i in range(0, len(zs), 3)]) def is_possible(*sides): """The sum of the lengths of every pair of sides in a, b, c must be larger than the length of the remaining side, or the putative triangle is impossible.""" for a in [0, 1]: for b in range(a + 1, 3): if a == 0: c = 1 if b == 2 else 2 elif a == 1: c = 0 if sum([sides[a], sides[b]]) <= sides[c]: return False return True
"""Test whether putative triangles, specified as triples of side lengths, in fact are possible.""" def load_triangles(filename): """Load triangles from filename.""" triangles = [] with open(filename) as f: for line in f: if line.strip(): triangles.append(tuple([int(side) for side in line.split()])) return triangles def load_triangles_from_cols(filename): """Instead of loading one triangle per line, load one-third each of three triangles per line.""" xs = [] ys = [] zs = [] with open(filename) as f: for line in f: if line.strip(): (x, y, z) = [int(side) for side in line.split()] xs.append(x) ys.append(y) zs.append(z) return [(xs[i], xs[i + 1], xs[i + 2]) for i in range(0, len(xs), 3)] + [(ys[i], ys[i + 1], ys[i + 2]) for i in range(0, len(ys), 3)] + [(zs[i], zs[i + 1], zs[i + 2]) for i in range(0, len(zs), 3)] def is_possible(*sides): """The sum of the lengths of every pair of sides in a, b, c must be larger than the length of the remaining side, or the putative triangle is impossible.""" for a in [0, 1]: for b in range(a + 1, 3): if a == 0: c = 1 if b == 2 else 2 elif a == 1: c = 0 if sum([sides[a], sides[b]]) <= sides[c]: return False return True
"""{{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }}""" __version__ = "{{ cookiecutter.project_version }}" __author__ = """{{ cookiecutter.author_name }}""" __email__ = "{{ cookiecutter.author_email }}" prog_name = "{{ cookiecutter.project_hyphen }}"
"""{{ cookiecutter.project_name }} - {{ cookiecutter.project_short_description }}""" __version__ = '{{ cookiecutter.project_version }}' __author__ = '{{ cookiecutter.author_name }}' __email__ = '{{ cookiecutter.author_email }}' prog_name = '{{ cookiecutter.project_hyphen }}'
class BitcoinGoldMainNet(object): """Bitcoin Gold MainNet version bytes. """ NAME = "Bitcoin Gold Main Net" COIN = "BTG" SCRIPT_ADDRESS = 0x17 # int(0x17) = 23 PUBKEY_ADDRESS = 0x26 # int(0x26) = 38 # Used to create payment addresses SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF format EXT_PUBLIC_KEY = 0x0488b21E # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x0488ADE4 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/0'/0'/" class BitcoinCashMainNet(object): """Bitcoin Cash MainNet version bytes.""" NAME = "Bitcoin Cash Main Net" COIN = "BCH" SCRIPT_ADDRESS = 0x28 # int(0x28) = 40 PUBKEY_ADDRESS = 0x1C # int(0x00) = 28 # Used to create payment addresses SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF format EXT_PUBLIC_KEY = 0x0488b21E # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x0488ADE4 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/145'/0'/" class DashMainNet(object): """Dash MainNet version bytes.""" NAME = "Dash Main Net" COIN = "DASH" SCRIPT_ADDRESS = 0x10 # int(0x10) = 16 PUBKEY_ADDRESS = 0x4C # int(0x4C) = 76 # Used to create payment addresses SECRET_KEY = 0xCC # int(0xCC) = 204 # Used for WIF format EXT_PUBLIC_KEY = 0X0488B21E # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0X0488ADE4 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/5'/0'/" class DashTestNet(object): """Dash TestNet version bytes.""" NAME = "Dash Test Net" COIN = "DASH" SCRIPT_ADDRESS = 0x13 # int(0x13) = 19 PUBKEY_ADDRESS = 0x8C # int(0x8C) = 140 # Used to create payment addresses SECRET_KEY = 0xEF # int(0xEF) = 239 # Used for WIF format EXT_PUBLIC_KEY = 0x043587CF # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x04358394 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/1'/0'/" class MarteXMainNet(object): """MarteX MainNet version bytes.""" NAME = "MarteX Main Net" COIN = "MXT" SCRIPT_ADDRESS = 0x05 # int(0x05) = 05 PUBKEY_ADDRESS = 0x32 # int(0x32) = 50 # Used to create payment addresses SECRET_KEY = 0xB2 # int(0xB2) = 178 # Used for WIF format EXT_PUBLIC_KEY = 0X0488B21E # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0X0488ADE4 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/180'/0'/" class MarteXTestNet(object): """MarteX TestNet version bytes.""" NAME = "MarteX Test Net" COIN = "MXT" SCRIPT_ADDRESS = 0xC4 # int(0xC4) = 196 PUBKEY_ADDRESS = 0x6C # int(0x6F) = 111 # Used to create payment addresses SECRET_KEY = 0x144 # int(0x144) = 324 # Used for WIF format EXT_PUBLIC_KEY = 0x043587CF # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x04358394 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/1'/0'/" class OmniMainNet(object): """Bitcoin MainNet version bytes. From https://github.com/OmniLayer/omnicore/blob/develop/src/chainparams.cpp """ NAME = "Omni Main Net" COIN = "USDT" SCRIPT_ADDRESS = 0x00 # int(0x00) = 0 PUBKEY_ADDRESS = 0x05 # int(0x05) = 5 # Used to create payment addresses SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF format EXT_PUBLIC_KEY = 0x0488B21E # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x0488ADE4 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/0'/0'/" class OmniTestNet(object): """Bitcoin MainNet version bytes. From https://github.com/OmniLayer/omnicore/blob/develop/src/chainparams.cpp """ NAME = "Omni Test Net" COIN = "USDT" SCRIPT_ADDRESS = 0x6f # int(0x6f) = 111 PUBKEY_ADDRESS = 0xc4 # int(0xc4) = 196 # Used to create payment addresses SECRET_KEY = 0xef # int(0xef) = 239 # Used for WIF format EXT_PUBLIC_KEY = 0x043587CF # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x04358394 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/0'/0'/" class BitcoinMainNet(object): """Bitcoin MainNet version bytes. From https://github.com/bitcoin/bitcoin/blob/v0.9.0rc1/src/chainparams.cpp """ NAME = "Bitcoin Main Net" COIN = "BTC" SCRIPT_ADDRESS = 0x05 # int(0x05) = 5 PUBKEY_ADDRESS = 0x00 # int(0x00) = 0 # Used to create payment addresses SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF format EXT_PUBLIC_KEY = 0x0488B21E # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x0488ADE4 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/0'/0'/" class FeathercoinMainNet(object): """Feathercoin MainNet version bytes. From https://github.com/FeatherCoin/Feathercoin/blob/master-0.13/src/chainparams.cpp """ NAME = "Feathercoin Main Net" COIN = "FTC" SCRIPT_ADDRESS = 0x05 # int(0x05) = 5 PUBKEY_ADDRESS = 0x0E # int(0x0E) = 14 # Used to create payment addresses SECRET_KEY = 0x8E # int(0x8E) = 142 # Used for WIF format EXT_PUBLIC_KEY = 0x0488BC26 # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x0488DAEE # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/4'/0'/" class BitcoinTestNet(object): """Bitcoin TestNet version bytes. From https://github.com/bitcoin/bitcoin/blob/v0.9.0rc1/src/chainparams.cpp """ NAME = "Bitcoin Test Net" COIN = "BTC" SCRIPT_ADDRESS = 0xc4 # int(0xc4) = 196 PUBKEY_ADDRESS = 0x6f # int(0x6f) = 111 SECRET_KEY = 0xEF # int(0xef) = 239 EXT_PUBLIC_KEY = 0x043587CF EXT_SECRET_KEY = 0x04358394 BIP32_PATH = "m/44'/1'/0'/" class LitecoinMainNet(object): """Litecoin MainNet version bytes Primary version bytes from: https://github.com/litecoin-project/litecoin/blob/master-0.8/src/base58.h Unofficial extended version bytes from https://bitcointalk.org/index.php?topic=453395.0 """ NAME = "Litecoin Main Net" COIN = "LTC" SCRIPT_ADDRESS = 0x05 # int(0x05) = 5 PUBKEY_ADDRESS = 0x30 # int(0x30) = 48 SECRET_KEY = PUBKEY_ADDRESS + 128 # = int(0xb0) = 176 # Unofficial extended version bytes taken from # https://bitcointalk.org/index.php?topic=453395.0 # EXT_PUBLIC_KEY = 0x019da462 # EXT_SECRET_KEY = 0x019d9cfe # same as Bitcoin's # https://github.com/ranaroussi/pywallet/issues/6 EXT_PUBLIC_KEY = 0x0488B21E EXT_SECRET_KEY = 0x0488ADE4 BIP32_PATH = "m/44'/2'/0'/" class LitecoinTestNet(object): """Litecoin TestNet version bytes Primary version bytes from: https://github.com/litecoin-project/litecoin/blob/master-0.8/src/base58.h Unofficial extended version bytes from https://bitcointalk.org/index.php?topic=453395.0 """ NAME = "Litecoin Test Net" COIN = "LTC" SCRIPT_ADDRESS = 0xc4 # int(0xc4) = 196 PUBKEY_ADDRESS = 0x6f # int(0x6f) = 111 SECRET_KEY = PUBKEY_ADDRESS + 128 # = int(0xef) = 239 # Unofficial extended version bytes taken from # https://bitcointalk.org/index.php?topic=453395.0 # EXT_PUBLIC_KEY = 0x0436f6e1 # EXT_SECRET_KEY = 0x0436ef7d # same as Bitcoin's # https://github.com/ranaroussi/pywallet/issues/6 EXT_PUBLIC_KEY = 0x043587CF EXT_SECRET_KEY = 0x04358394 BIP32_PATH = "m/44'/1'/0'/" class DogecoinMainNet(object): """Dogecoin MainNet version bytes Primary version bytes from: https://github.com/dogecoin/dogecoin/blob/1.5.2/src/base58.h Unofficial extended version bytes from https://bitcointalk.org/index.php?topic=409731 """ NAME = "Dogecoin Main Net" COIN = "DOGE" SCRIPT_ADDRESS = 0x16 # int(0x16) = 22 PUBKEY_ADDRESS = 0x1e # int(0x1e) = 30 SECRET_KEY = PUBKEY_ADDRESS + 128 # int(0x9e) = 158 # Unofficial extended version bytes taken from # https://bitcointalk.org/index.php?topic=409731 EXT_PUBLIC_KEY = 0x02facafd EXT_SECRET_KEY = 0x02fac398 BIP32_PATH = "m/44'/3'/0'/" class DogecoinTestNet(object): """Dogecoin TestNet version bytes Primary version bytes from: https://github.com/dogecoin/dogecoin/blob/1.5.2/src/base58.h Unofficial extended version bytes from https://bitcointalk.org/index.php?topic=409731 """ NAME = "Dogecoin Test Net" COIN = "DOGE" SCRIPT_ADDRESS = 0xc4 # int(0xc4) = 196 PUBKEY_ADDRESS = 0x71 # int(0x71) = 113 SECRET_KEY = PUBKEY_ADDRESS + 128 # int(0xf1) = 241 # Unofficial extended version bytes taken from # https://bitcointalk.org/index.php?topic=409731 EXT_PUBLIC_KEY = 0x0432a9a8 EXT_SECRET_KEY = 0x0432a243 BIP32_PATH = "m/44'/1'/0'/" class BlockCypherTestNet(object): """BlockCypher TestNet version bytes. From http://dev.blockcypher.com/#testing """ NAME = "BlockCypher Test Net" COIN = "BlockCypher" SCRIPT_ADDRESS = 0x1f # int(0x1f) = 31 PUBKEY_ADDRESS = 0x1b # int(0x1b) = 27 # Used to create payment addresses SECRET_KEY = 0x49 # int(0x49) = 73 # Used for WIF format EXT_PUBLIC_KEY = 0x2d413ff # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x2d40fc3 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/1'/0'/" class QtumMainNet(object): """Qtum MainNet version bytes Primary version bytes from: https://github.com/qtumproject/qtum/blob/master/src/chainparams.cpp """ NAME = "Qtum Main Net" COIN = "QTUM" SCRIPT_ADDRESS = 0x32 # int(0x32) = 50 PUBKEY_ADDRESS = 0x3A # int(0x3A) = 58 # Used to create payment addresses SECRET_KEY = 0x80 # int(0x80) = 128 # Used for WIF format EXT_PUBLIC_KEY = 0x0488B21E # Used to serialize public BIP32 addresses EXT_SECRET_KEY = 0x0488ADE4 # Used to serialize private BIP32 addresses BIP32_PATH = "m/44'/88'/0'/" class QtumTestNet(object): """Qtum TestNet version bytes Primary version bytes from: https://github.com/qtumproject/qtum/blob/master/src/chainparams.cpp """ NAME = "Qtum Test Net" COIN = "QTUM" SCRIPT_ADDRESS = 0x6E # int(0x6e) = 110 PUBKEY_ADDRESS = 0x78 # int(0x78) = 120 SECRET_KEY = 0xEF # int(0xef) = 239 EXT_PUBLIC_KEY = 0x043587CF EXT_SECRET_KEY = 0x04358394 BIP32_PATH = "m/44'/88'/0'/"
class Bitcoingoldmainnet(object): """Bitcoin Gold MainNet version bytes. """ name = 'Bitcoin Gold Main Net' coin = 'BTG' script_address = 23 pubkey_address = 38 secret_key = 128 ext_public_key = 76067358 ext_secret_key = 76066276 bip32_path = "m/44'/0'/0'/" class Bitcoincashmainnet(object): """Bitcoin Cash MainNet version bytes.""" name = 'Bitcoin Cash Main Net' coin = 'BCH' script_address = 40 pubkey_address = 28 secret_key = 128 ext_public_key = 76067358 ext_secret_key = 76066276 bip32_path = "m/44'/145'/0'/" class Dashmainnet(object): """Dash MainNet version bytes.""" name = 'Dash Main Net' coin = 'DASH' script_address = 16 pubkey_address = 76 secret_key = 204 ext_public_key = 76067358 ext_secret_key = 76066276 bip32_path = "m/44'/5'/0'/" class Dashtestnet(object): """Dash TestNet version bytes.""" name = 'Dash Test Net' coin = 'DASH' script_address = 19 pubkey_address = 140 secret_key = 239 ext_public_key = 70617039 ext_secret_key = 70615956 bip32_path = "m/44'/1'/0'/" class Martexmainnet(object): """MarteX MainNet version bytes.""" name = 'MarteX Main Net' coin = 'MXT' script_address = 5 pubkey_address = 50 secret_key = 178 ext_public_key = 76067358 ext_secret_key = 76066276 bip32_path = "m/44'/180'/0'/" class Martextestnet(object): """MarteX TestNet version bytes.""" name = 'MarteX Test Net' coin = 'MXT' script_address = 196 pubkey_address = 108 secret_key = 324 ext_public_key = 70617039 ext_secret_key = 70615956 bip32_path = "m/44'/1'/0'/" class Omnimainnet(object): """Bitcoin MainNet version bytes. From https://github.com/OmniLayer/omnicore/blob/develop/src/chainparams.cpp """ name = 'Omni Main Net' coin = 'USDT' script_address = 0 pubkey_address = 5 secret_key = 128 ext_public_key = 76067358 ext_secret_key = 76066276 bip32_path = "m/44'/0'/0'/" class Omnitestnet(object): """Bitcoin MainNet version bytes. From https://github.com/OmniLayer/omnicore/blob/develop/src/chainparams.cpp """ name = 'Omni Test Net' coin = 'USDT' script_address = 111 pubkey_address = 196 secret_key = 239 ext_public_key = 70617039 ext_secret_key = 70615956 bip32_path = "m/44'/0'/0'/" class Bitcoinmainnet(object): """Bitcoin MainNet version bytes. From https://github.com/bitcoin/bitcoin/blob/v0.9.0rc1/src/chainparams.cpp """ name = 'Bitcoin Main Net' coin = 'BTC' script_address = 5 pubkey_address = 0 secret_key = 128 ext_public_key = 76067358 ext_secret_key = 76066276 bip32_path = "m/44'/0'/0'/" class Feathercoinmainnet(object): """Feathercoin MainNet version bytes. From https://github.com/FeatherCoin/Feathercoin/blob/master-0.13/src/chainparams.cpp """ name = 'Feathercoin Main Net' coin = 'FTC' script_address = 5 pubkey_address = 14 secret_key = 142 ext_public_key = 76069926 ext_secret_key = 76077806 bip32_path = "m/44'/4'/0'/" class Bitcointestnet(object): """Bitcoin TestNet version bytes. From https://github.com/bitcoin/bitcoin/blob/v0.9.0rc1/src/chainparams.cpp """ name = 'Bitcoin Test Net' coin = 'BTC' script_address = 196 pubkey_address = 111 secret_key = 239 ext_public_key = 70617039 ext_secret_key = 70615956 bip32_path = "m/44'/1'/0'/" class Litecoinmainnet(object): """Litecoin MainNet version bytes Primary version bytes from: https://github.com/litecoin-project/litecoin/blob/master-0.8/src/base58.h Unofficial extended version bytes from https://bitcointalk.org/index.php?topic=453395.0 """ name = 'Litecoin Main Net' coin = 'LTC' script_address = 5 pubkey_address = 48 secret_key = PUBKEY_ADDRESS + 128 ext_public_key = 76067358 ext_secret_key = 76066276 bip32_path = "m/44'/2'/0'/" class Litecointestnet(object): """Litecoin TestNet version bytes Primary version bytes from: https://github.com/litecoin-project/litecoin/blob/master-0.8/src/base58.h Unofficial extended version bytes from https://bitcointalk.org/index.php?topic=453395.0 """ name = 'Litecoin Test Net' coin = 'LTC' script_address = 196 pubkey_address = 111 secret_key = PUBKEY_ADDRESS + 128 ext_public_key = 70617039 ext_secret_key = 70615956 bip32_path = "m/44'/1'/0'/" class Dogecoinmainnet(object): """Dogecoin MainNet version bytes Primary version bytes from: https://github.com/dogecoin/dogecoin/blob/1.5.2/src/base58.h Unofficial extended version bytes from https://bitcointalk.org/index.php?topic=409731 """ name = 'Dogecoin Main Net' coin = 'DOGE' script_address = 22 pubkey_address = 30 secret_key = PUBKEY_ADDRESS + 128 ext_public_key = 49990397 ext_secret_key = 49988504 bip32_path = "m/44'/3'/0'/" class Dogecointestnet(object): """Dogecoin TestNet version bytes Primary version bytes from: https://github.com/dogecoin/dogecoin/blob/1.5.2/src/base58.h Unofficial extended version bytes from https://bitcointalk.org/index.php?topic=409731 """ name = 'Dogecoin Test Net' coin = 'DOGE' script_address = 196 pubkey_address = 113 secret_key = PUBKEY_ADDRESS + 128 ext_public_key = 70429096 ext_secret_key = 70427203 bip32_path = "m/44'/1'/0'/" class Blockcyphertestnet(object): """BlockCypher TestNet version bytes. From http://dev.blockcypher.com/#testing """ name = 'BlockCypher Test Net' coin = 'BlockCypher' script_address = 31 pubkey_address = 27 secret_key = 73 ext_public_key = 47453183 ext_secret_key = 47452099 bip32_path = "m/44'/1'/0'/" class Qtummainnet(object): """Qtum MainNet version bytes Primary version bytes from: https://github.com/qtumproject/qtum/blob/master/src/chainparams.cpp """ name = 'Qtum Main Net' coin = 'QTUM' script_address = 50 pubkey_address = 58 secret_key = 128 ext_public_key = 76067358 ext_secret_key = 76066276 bip32_path = "m/44'/88'/0'/" class Qtumtestnet(object): """Qtum TestNet version bytes Primary version bytes from: https://github.com/qtumproject/qtum/blob/master/src/chainparams.cpp """ name = 'Qtum Test Net' coin = 'QTUM' script_address = 110 pubkey_address = 120 secret_key = 239 ext_public_key = 70617039 ext_secret_key = 70615956 bip32_path = "m/44'/88'/0'/"
# OpenWeatherMap API Key weather_api_key = "MyOpenWeatherMapAPIKey" # Google API Key g_key = "MyGoogleKey"
weather_api_key = 'MyOpenWeatherMapAPIKey' g_key = 'MyGoogleKey'
def attack(): pass def defend(): pass def pass_turn(): pass def use_ability_One(kit): pass def use_ability_Two(kit): pass def end_Of_Battle(): pass
def attack(): pass def defend(): pass def pass_turn(): pass def use_ability__one(kit): pass def use_ability__two(kit): pass def end__of__battle(): pass
mail_settings = { "MAIL_SERVER": 'smtp.gmail.com', "MAIL_PORT": 465, "MAIL_USE_TLS": False, "MAIL_USE_SSL": True, "MAIL_USERNAME": 'c003.teste.jp@gmail.com', "MAIL_PASSWORD": 'C003.teste' }
mail_settings = {'MAIL_SERVER': 'smtp.gmail.com', 'MAIL_PORT': 465, 'MAIL_USE_TLS': False, 'MAIL_USE_SSL': True, 'MAIL_USERNAME': 'c003.teste.jp@gmail.com', 'MAIL_PASSWORD': 'C003.teste'}
class Solution: def maxArea(self, height) -> int: left=0 right=len(height)-1 res=min(height[left],height[right])*(right-left) while right>left: res=max(res,(right-left)*min(height[right],height[left])) if height[left]<height[right]: left+=1 else: right-=1 return res if __name__ == '__main__': sol=Solution() # height = [1, 1] height=[1,3,2,5,25,24,5] print(sol.maxArea(height))
class Solution: def max_area(self, height) -> int: left = 0 right = len(height) - 1 res = min(height[left], height[right]) * (right - left) while right > left: res = max(res, (right - left) * min(height[right], height[left])) if height[left] < height[right]: left += 1 else: right -= 1 return res if __name__ == '__main__': sol = solution() height = [1, 3, 2, 5, 25, 24, 5] print(sol.maxArea(height))
# Copyright (c) 2021, Omid Erfanmanesh, All rights reserved. class RuntimeMode: TRAIN = 0 TUNING = 1 CROSS_VAL = 2 FEATURE_IMPORTANCE = 3
class Runtimemode: train = 0 tuning = 1 cross_val = 2 feature_importance = 3
# # Example file for HelloWorld # def main(): print("Hello World") name = input("What is your name? ") print("Nice to meet you,", name) if __name__ == "__main__": main()
def main(): print('Hello World') name = input('What is your name? ') print('Nice to meet you,', name) if __name__ == '__main__': main()
"""Node class module for Binary Tree.""" class Node(object): """The Node class.""" def __init__(self, value): """Initialization of node object.""" self.value = value self.left = None self.right = None def __str__(self): """Return a string representation of the node object.""" return f'{self.value}' def __repr__(self): """Return a representation of the node object.""" return f'<Node | Value: {self.value} | Left: {self.left} | Right: {self.right}>'
"""Node class module for Binary Tree.""" class Node(object): """The Node class.""" def __init__(self, value): """Initialization of node object.""" self.value = value self.left = None self.right = None def __str__(self): """Return a string representation of the node object.""" return f'{self.value}' def __repr__(self): """Return a representation of the node object.""" return f'<Node | Value: {self.value} | Left: {self.left} | Right: {self.right}>'
class DispatchConfig: def __init__(self, raw_config): self.registered_commands = {} for package in raw_config["handlers"]: for command in package["commands"]: self.registered_commands[command] = { "class": package["class"], "fullpath": ".".join([package["package"], package["module"], package["class"]]) } def get_handler_by_command(self, command): if command in self.registered_commands: return self.registered_commands[command] else: return None
class Dispatchconfig: def __init__(self, raw_config): self.registered_commands = {} for package in raw_config['handlers']: for command in package['commands']: self.registered_commands[command] = {'class': package['class'], 'fullpath': '.'.join([package['package'], package['module'], package['class']])} def get_handler_by_command(self, command): if command in self.registered_commands: return self.registered_commands[command] else: return None
""" This program visualizes nested for loops by printing number 0 through 3 and then 0 through 3 for the nested loop. """ for i in range(4): print("Outer for loop: " + str(i)) for j in range(4): print(" Inner for loop: " + str(j))
""" This program visualizes nested for loops by printing number 0 through 3 and then 0 through 3 for the nested loop. """ for i in range(4): print('Outer for loop: ' + str(i)) for j in range(4): print(' Inner for loop: ' + str(j))
"""Queue implementation using circularly linked list for storage.""" class CircularQueue: """Queue implementation using circularly linked list for storage.""" class _Node: """Lightweight, nonpublic class for storing a singly linked node.""" __slots__ = '_element', '_next' def __init__(self, element, next_element): self._element = element self._next = next_element def __init__(self): """Create an empty queue.""" self._tail = None self._size = 0 def __len__(self): """Return the number of elements in the queue.""" return self._size def is_empty(self): """Return True if the queue is empty.""" return self._size == 0 def first(self): """Return (but do not remove) the element at the front of the queue. Raise ValueError exception if the queue is empty. """ if self.is_empty(): raise ValueError('Queue is empty') head = self._tail._next return head._element def dequeue(self): """Remove and return the first element of the queue (i.e., FIFO). Raise ValueError exception if the queue is empty. """ if self.is_empty(): raise ValueError('Queue is empty') oldhead = self._tail._next if self._size == 1: self._tail = None else: self._tail._next = oldhead._next self._size -= 1 return oldhead._element def enqueue(self, element): """Add an element to the back of queue.""" newest = self._Node(element, None) if self.is_empty(): newest._next = newest else: newest._next = self._tail._next self._tail._next = newest self._tail = newest self._size += 1 def rotate(self): """Rotate front element to the back of the queue.""" if self._size > 0: self._tail = self._tail._next
"""Queue implementation using circularly linked list for storage.""" class Circularqueue: """Queue implementation using circularly linked list for storage.""" class _Node: """Lightweight, nonpublic class for storing a singly linked node.""" __slots__ = ('_element', '_next') def __init__(self, element, next_element): self._element = element self._next = next_element def __init__(self): """Create an empty queue.""" self._tail = None self._size = 0 def __len__(self): """Return the number of elements in the queue.""" return self._size def is_empty(self): """Return True if the queue is empty.""" return self._size == 0 def first(self): """Return (but do not remove) the element at the front of the queue. Raise ValueError exception if the queue is empty. """ if self.is_empty(): raise value_error('Queue is empty') head = self._tail._next return head._element def dequeue(self): """Remove and return the first element of the queue (i.e., FIFO). Raise ValueError exception if the queue is empty. """ if self.is_empty(): raise value_error('Queue is empty') oldhead = self._tail._next if self._size == 1: self._tail = None else: self._tail._next = oldhead._next self._size -= 1 return oldhead._element def enqueue(self, element): """Add an element to the back of queue.""" newest = self._Node(element, None) if self.is_empty(): newest._next = newest else: newest._next = self._tail._next self._tail._next = newest self._tail = newest self._size += 1 def rotate(self): """Rotate front element to the back of the queue.""" if self._size > 0: self._tail = self._tail._next
"set operations for multiple sequences" def intersect(*args): res = [] for x in args[0]: # scan the first list for other in args[1:]: # for all other arguments if x not in other: break # this item in each one? else: res.append(x) # add common items to the end return res def union(*args): res = [] for seq in args: # for all sequence-arguments for x in seq: # for all nodes in argument if not x in res: res.append(x) # add new items to result return res
"""set operations for multiple sequences""" def intersect(*args): res = [] for x in args[0]: for other in args[1:]: if x not in other: break else: res.append(x) return res def union(*args): res = [] for seq in args: for x in seq: if not x in res: res.append(x) return res
msg_dict = { 'resource_not_found': 'The resource you specified was not found', 'invalid_gender': "The gender you specified is invalid!!", 'many_invalid_fields': 'Some errors occured while validating some fields. Please check and try again', 'unique': 'The {} you inputted already exists', 'user_not_found': 'The user with that username/email and password combination was not found', 'email_not_found': 'A user with email `{}` does not exist', 'user_already_verified': 'The user with that email has already been verified', 'invalid_flight_type': 'Flight type must be either international or local', 'invalid_flight_schedule': 'Flight schedule must be at least 12 hours before it is created', 'resource_id_not_found': 'The {} with that id was not found', 'user_book_flight_twice': 'You had previously booked for this Flight and thus cannot do it again', 'flight_booking_expired': 'You cannot book for a flight less than 24 hours before the flight', 'flight_schedule_expired': 'The schedule of this flight has already passed and thus you cannot book it', 'missing_field': 'You forgot to include this field', 'value_not_a_file': 'The value you inputted is not a file', 'not_an_image': 'The file you uploaded is not a valid image', 'image_too_large': 'Image must not be more than 2MB', 'payment_link_error': 'An error occurred while creating payment link', 'booking_already_paid': 'You have already paid for this flight', 'booking_expired': 'Your booking has expired, thus you cannot pay for this ticket', 'invalid_url': 'The `{}` field must be a valid URL with protocols `http` or `https`', "invalid_url_field": 'This field must be a valid URL with protocols `http` or `https`', 'paystack_threw_error': "There was an unexpected error while processing request. " "Please raise this as an issue in at " "https://github.com/chidioguejiofor/airtech-api/issues", 'empty_request': 'You did not specify any `{}` data in your request', 'paid_booking_cannot_be_deleted': 'You cannot delete this Booking because you have already paid for it', 'cannot_delete_expired_booking': 'You cannot delete an expired booking', 'cannot_delete_flight_with_bookings': 'You cannot delete this flight because users have started booking it', 'cannot_delete_flight_that_has_flown': 'You cannot delete this flight because the schedule date has been passed', 'cannot_update_flight_field_with_bookings': 'You cannot update the `{}` of this flight because it has already been booked', 'cannot_update_field': 'You cannot update a {} {}', 'regular_user_only': 'This endpoint is for only regular users', 'profile_not_updated': 'You need to update your profile picture before you can do this', 'only_alpha_and_numbers': 'This field can contain only alphabets and numbers' }
msg_dict = {'resource_not_found': 'The resource you specified was not found', 'invalid_gender': 'The gender you specified is invalid!!', 'many_invalid_fields': 'Some errors occured while validating some fields. Please check and try again', 'unique': 'The {} you inputted already exists', 'user_not_found': 'The user with that username/email and password combination was not found', 'email_not_found': 'A user with email `{}` does not exist', 'user_already_verified': 'The user with that email has already been verified', 'invalid_flight_type': 'Flight type must be either international or local', 'invalid_flight_schedule': 'Flight schedule must be at least 12 hours before it is created', 'resource_id_not_found': 'The {} with that id was not found', 'user_book_flight_twice': 'You had previously booked for this Flight and thus cannot do it again', 'flight_booking_expired': 'You cannot book for a flight less than 24 hours before the flight', 'flight_schedule_expired': 'The schedule of this flight has already passed and thus you cannot book it', 'missing_field': 'You forgot to include this field', 'value_not_a_file': 'The value you inputted is not a file', 'not_an_image': 'The file you uploaded is not a valid image', 'image_too_large': 'Image must not be more than 2MB', 'payment_link_error': 'An error occurred while creating payment link', 'booking_already_paid': 'You have already paid for this flight', 'booking_expired': 'Your booking has expired, thus you cannot pay for this ticket', 'invalid_url': 'The `{}` field must be a valid URL with protocols `http` or `https`', 'invalid_url_field': 'This field must be a valid URL with protocols `http` or `https`', 'paystack_threw_error': 'There was an unexpected error while processing request. Please raise this as an issue in at https://github.com/chidioguejiofor/airtech-api/issues', 'empty_request': 'You did not specify any `{}` data in your request', 'paid_booking_cannot_be_deleted': 'You cannot delete this Booking because you have already paid for it', 'cannot_delete_expired_booking': 'You cannot delete an expired booking', 'cannot_delete_flight_with_bookings': 'You cannot delete this flight because users have started booking it', 'cannot_delete_flight_that_has_flown': 'You cannot delete this flight because the schedule date has been passed', 'cannot_update_flight_field_with_bookings': 'You cannot update the `{}` of this flight because it has already been booked', 'cannot_update_field': 'You cannot update a {} {}', 'regular_user_only': 'This endpoint is for only regular users', 'profile_not_updated': 'You need to update your profile picture before you can do this', 'only_alpha_and_numbers': 'This field can contain only alphabets and numbers'}
''' - Leetcode problem: 23 - Difficulty: Hard - Brief problem description: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 - Solution Summary: - Used Resources: --- Bo Zhou ''' # Definition for singly-linked list. # class ListNode: # def __init__(self, val=0, next=None): # self.val = val # self.next = next class Solution: def mergeKLists(self, lists: List[ListNode]) -> ListNode: pq = [] for l in lists: if l: heapq.heappush(pq, (l.val, id(l), l)) newNode = ListNode() result = newNode while pq: minVal, i, minNode = heapq.heappop(pq) newNode.next = minNode nextNode = minNode.next newNode = minNode if nextNode: heapq.heappush(pq, (nextNode.val, id(nextNode), nextNode)) return result.next
""" - Leetcode problem: 23 - Difficulty: Hard - Brief problem description: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: Input: [ 1->4->5, 1->3->4, 2->6 ] Output: 1->1->2->3->4->4->5->6 - Solution Summary: - Used Resources: --- Bo Zhou """ class Solution: def merge_k_lists(self, lists: List[ListNode]) -> ListNode: pq = [] for l in lists: if l: heapq.heappush(pq, (l.val, id(l), l)) new_node = list_node() result = newNode while pq: (min_val, i, min_node) = heapq.heappop(pq) newNode.next = minNode next_node = minNode.next new_node = minNode if nextNode: heapq.heappush(pq, (nextNode.val, id(nextNode), nextNode)) return result.next
# Written by Ivan Sapozhkov and Denis Chagin <denis.chagin@emlid.com> # # Copyright (c) 2016, Emlid Limited # All rights reserved. # # Redistribution and use in source and binary forms, # with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # 3. Neither the name of the copyright holder nor the names of its contributors # may be used to endorse or promote products derived from this software # without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND # FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. # IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, # OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED # AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, # EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. def create_security(proto, key_mgmt, group): if not proto: return 'open' if not key_mgmt: if "wep" in group: return 'wep' else: return None else: if "wpa-psk" in key_mgmt: if proto == "WPA": return "wpapsk" elif proto == "RSN": return "wpa2psk" else: return None elif "wpa-eap" in key_mgmt: return 'wpaeap' else: return None def convert_to_wpas_network(network): return dict(WpasNetworkConverter(network)) def convert_to_wificontrol_network(network, current_network): wifinetwork = dict(WifiControlNetworkConverter(network)) try: if wifinetwork['ssid'] == current_network['ssid']: wifinetwork.update(current_network) wifinetwork["connected"] = True except TypeError: pass finally: return wifinetwork class WpasNetworkConverter(object): def __init__(self, network_dict): def rawUtf8(s): return "{}".format(s.encode('utf-8'))[2:-1] self.security = network_dict.get('security') self.name = rawUtf8(network_dict.get('ssid', '')) self.password = rawUtf8(network_dict.get('password', '')) self.identity = rawUtf8(network_dict.get('identity', '')) def __iter__(self): if (self.security == 'open'): yield "ssid", "{}".format(self.name) yield "key_mgmt", "NONE" elif (self.security == 'wep'): yield "ssid", "{}".format(self.name) yield "key_mgmt", "NONE" yield "group", "WEP104 WEP40" yield "wep_key0", "{}".format(self.password) elif (self.security == 'wpapsk'): yield "ssid", "{}".format(self.name) yield "key_mgmt", "WPA-PSK" yield "pairwise", "CCMP TKIP" yield "group", "CCMP TKIP" yield "eap", "TTLS PEAP TLS" yield "psk", "{}".format(self.password) elif (self.security == 'wpa2psk'): yield "ssid", "{}".format(self.name) yield "proto", "RSN" yield "key_mgmt", "WPA-PSK" yield "pairwise", "CCMP TKIP" yield "group", "CCMP TKIP" yield "eap", "TTLS PEAP TLS" yield "psk", "{}".format(self.password) elif (self.security == 'wpaeap'): yield "ssid", "{}".format(self.name) yield "key_mgmt", "WPA-EAP" yield "pairwise", "CCMP TKIP" yield "group", "CCMP TKIP" yield "eap", "TTLS PEAP TLS" yield "identity", "{}".format(self.identity) yield "password", "{}".format(self.password) yield "phase1", "peaplable=0" else: yield "ssid", "{}".format(self.name) yield "psk", "{}".format(self.password) class WifiControlNetworkConverter(object): def __init__(self, network_dict): self.name = network_dict.get('ssid') self.key_mgmt = network_dict.get('key_mgmt') self.proto = network_dict.get('proto') self.group = network_dict.get('group') def __iter__(self): if (self.key_mgmt == 'NONE'): if not self.group: yield "ssid", self.name yield "security", "Open" else: yield "ssid", self.name yield "security", "WEP" elif (self.key_mgmt == 'WPA-PSK'): if not self.proto: yield "ssid", self.name yield "security", "WPA-PSK" else: yield "ssid", self.name yield "security", "WPA2-PSK" elif (self.key_mgmt == 'WPA-EAP'): yield "ssid", self.name yield "security", "WPA-EAP" else: yield "ssid", self.name yield "security", "NONE" yield "connected", False if __name__ == '__main__': network = {'ssid': "MySSID", 'password': "NewPassword", 'security': "wpaeap", 'identity': "alex@example.com"} conv = convert_to_wpas_network(network) reconv = convert_to_wificontrol_network(conv) print(conv, reconv)
def create_security(proto, key_mgmt, group): if not proto: return 'open' if not key_mgmt: if 'wep' in group: return 'wep' else: return None elif 'wpa-psk' in key_mgmt: if proto == 'WPA': return 'wpapsk' elif proto == 'RSN': return 'wpa2psk' else: return None elif 'wpa-eap' in key_mgmt: return 'wpaeap' else: return None def convert_to_wpas_network(network): return dict(wpas_network_converter(network)) def convert_to_wificontrol_network(network, current_network): wifinetwork = dict(wifi_control_network_converter(network)) try: if wifinetwork['ssid'] == current_network['ssid']: wifinetwork.update(current_network) wifinetwork['connected'] = True except TypeError: pass finally: return wifinetwork class Wpasnetworkconverter(object): def __init__(self, network_dict): def raw_utf8(s): return '{}'.format(s.encode('utf-8'))[2:-1] self.security = network_dict.get('security') self.name = raw_utf8(network_dict.get('ssid', '')) self.password = raw_utf8(network_dict.get('password', '')) self.identity = raw_utf8(network_dict.get('identity', '')) def __iter__(self): if self.security == 'open': yield ('ssid', '{}'.format(self.name)) yield ('key_mgmt', 'NONE') elif self.security == 'wep': yield ('ssid', '{}'.format(self.name)) yield ('key_mgmt', 'NONE') yield ('group', 'WEP104 WEP40') yield ('wep_key0', '{}'.format(self.password)) elif self.security == 'wpapsk': yield ('ssid', '{}'.format(self.name)) yield ('key_mgmt', 'WPA-PSK') yield ('pairwise', 'CCMP TKIP') yield ('group', 'CCMP TKIP') yield ('eap', 'TTLS PEAP TLS') yield ('psk', '{}'.format(self.password)) elif self.security == 'wpa2psk': yield ('ssid', '{}'.format(self.name)) yield ('proto', 'RSN') yield ('key_mgmt', 'WPA-PSK') yield ('pairwise', 'CCMP TKIP') yield ('group', 'CCMP TKIP') yield ('eap', 'TTLS PEAP TLS') yield ('psk', '{}'.format(self.password)) elif self.security == 'wpaeap': yield ('ssid', '{}'.format(self.name)) yield ('key_mgmt', 'WPA-EAP') yield ('pairwise', 'CCMP TKIP') yield ('group', 'CCMP TKIP') yield ('eap', 'TTLS PEAP TLS') yield ('identity', '{}'.format(self.identity)) yield ('password', '{}'.format(self.password)) yield ('phase1', 'peaplable=0') else: yield ('ssid', '{}'.format(self.name)) yield ('psk', '{}'.format(self.password)) class Wificontrolnetworkconverter(object): def __init__(self, network_dict): self.name = network_dict.get('ssid') self.key_mgmt = network_dict.get('key_mgmt') self.proto = network_dict.get('proto') self.group = network_dict.get('group') def __iter__(self): if self.key_mgmt == 'NONE': if not self.group: yield ('ssid', self.name) yield ('security', 'Open') else: yield ('ssid', self.name) yield ('security', 'WEP') elif self.key_mgmt == 'WPA-PSK': if not self.proto: yield ('ssid', self.name) yield ('security', 'WPA-PSK') else: yield ('ssid', self.name) yield ('security', 'WPA2-PSK') elif self.key_mgmt == 'WPA-EAP': yield ('ssid', self.name) yield ('security', 'WPA-EAP') else: yield ('ssid', self.name) yield ('security', 'NONE') yield ('connected', False) if __name__ == '__main__': network = {'ssid': 'MySSID', 'password': 'NewPassword', 'security': 'wpaeap', 'identity': 'alex@example.com'} conv = convert_to_wpas_network(network) reconv = convert_to_wificontrol_network(conv) print(conv, reconv)
""" Check for Office file types ViperMonkey is a specialized engine to parse, analyze and interpret Microsoft VBA macros (Visual Basic for Applications), mainly for malware analysis. Author: Philippe Lagadec - http://www.decalage.info License: BSD, see source code or documentation Project Repository: https://github.com/decalage2/ViperMonkey """ # === LICENSE ================================================================== # ViperMonkey is copyright (c) 2015-2016 Philippe Lagadec (http://www.decalage.info) # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Office magic numbers. magic_nums = { "office97" : "D0 CF 11 E0 A1 B1 1A E1", # Office 97 "office2007" : "50 4B 3 4", # Office 2007+ (PKZip) } # PE magic number. pe_magic_num = "4D 5A" def get_1st_8_bytes(fname, is_data): info = None is_data = (is_data or (len(fname) > 200)) if (not is_data): try: tmp = open(fname, 'rb') tmp.close() except: is_data = True if (not is_data): with open(fname, 'rb') as f: info = f.read(8) else: info = fname[:9] curr_magic = "" for b in info: curr_magic += hex(ord(b)).replace("0x", "").upper() + " " return curr_magic def is_pe_file(fname, is_data): """ Check to see if the given file is a PE executable. return - True if it is a PE file, False if not. """ # Read the 1st 8 bytes of the file. curr_magic = get_1st_8_bytes(fname, is_data) # See if we the known magic #. return (curr_magic.startswith(pe_magic_num)) def is_office_file(fname, is_data): """ Check to see if the given file is a MS Office file format. return - True if it is an Office file, False if not. """ # Read the 1st 8 bytes of the file. curr_magic = get_1st_8_bytes(fname, is_data) # See if we have 1 of the known magic #s. for typ in magic_nums.keys(): magic = magic_nums[typ] if (curr_magic.startswith(magic)): return True return False def is_office97_file(fname, is_data): # Read the 1st 8 bytes of the file. curr_magic = get_1st_8_bytes(fname, is_data) # See if we have the Office97 magic #. return (curr_magic.startswith(magic_nums["office97"])) def is_office2007_file(fname, is_data): # Read the 1st 8 bytes of the file. curr_magic = get_1st_8_bytes(fname, is_data) # See if we have the Office 2007 magic #. return (curr_magic.startswith(magic_nums["office2007"]))
""" Check for Office file types ViperMonkey is a specialized engine to parse, analyze and interpret Microsoft VBA macros (Visual Basic for Applications), mainly for malware analysis. Author: Philippe Lagadec - http://www.decalage.info License: BSD, see source code or documentation Project Repository: https://github.com/decalage2/ViperMonkey """ magic_nums = {'office97': 'D0 CF 11 E0 A1 B1 1A E1', 'office2007': '50 4B 3 4'} pe_magic_num = '4D 5A' def get_1st_8_bytes(fname, is_data): info = None is_data = is_data or len(fname) > 200 if not is_data: try: tmp = open(fname, 'rb') tmp.close() except: is_data = True if not is_data: with open(fname, 'rb') as f: info = f.read(8) else: info = fname[:9] curr_magic = '' for b in info: curr_magic += hex(ord(b)).replace('0x', '').upper() + ' ' return curr_magic def is_pe_file(fname, is_data): """ Check to see if the given file is a PE executable. return - True if it is a PE file, False if not. """ curr_magic = get_1st_8_bytes(fname, is_data) return curr_magic.startswith(pe_magic_num) def is_office_file(fname, is_data): """ Check to see if the given file is a MS Office file format. return - True if it is an Office file, False if not. """ curr_magic = get_1st_8_bytes(fname, is_data) for typ in magic_nums.keys(): magic = magic_nums[typ] if curr_magic.startswith(magic): return True return False def is_office97_file(fname, is_data): curr_magic = get_1st_8_bytes(fname, is_data) return curr_magic.startswith(magic_nums['office97']) def is_office2007_file(fname, is_data): curr_magic = get_1st_8_bytes(fname, is_data) return curr_magic.startswith(magic_nums['office2007'])
# Given a singly linked list, determine if it is a palindrome. # Definition for singly-linked list. class ListNode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def isPalindrome(self, head: ListNode) -> bool: fast = slow = head # find the mid node while fast and fast.next: slow = slow.next fast = fast.next.next # reverse the second half node = None while slow: nxt = slow.next slow.next = node node = slow slow = nxt # compare first and second half of nodes while node: if node.val != head.val: return False node = node.next head = head.next return True
class Listnode: def __init__(self, val=0, next=None): self.val = val self.next = next class Solution: def is_palindrome(self, head: ListNode) -> bool: fast = slow = head while fast and fast.next: slow = slow.next fast = fast.next.next node = None while slow: nxt = slow.next slow.next = node node = slow slow = nxt while node: if node.val != head.val: return False node = node.next head = head.next return True
""" Rocky is a CLI based provisioning and management tool for CloudCIX Cloud software. Rocky is designed to operate in an out of band (OOB) network, serarated from other CloudCIX networks. Rocky's purpose is to facilitate monitoring, testing, debug and recovery """ __version__ = '0.3.5'
""" Rocky is a CLI based provisioning and management tool for CloudCIX Cloud software. Rocky is designed to operate in an out of band (OOB) network, serarated from other CloudCIX networks. Rocky's purpose is to facilitate monitoring, testing, debug and recovery """ __version__ = '0.3.5'
with open("inputday3.txt") as f: data = [x for x in f.read().split()] gamma = "" epsilon = "" for b in range(0, len(data[0])): one = 0 zero = 0 for c in range(0, len(data)): if data[c][b] == '0': zero += 1 else: one += 1 if zero > one: gamma += '0' epsilon += '1' else: gamma += '1' epsilon += '0' g = int(gamma, 2) e = int(epsilon, 2) print("PART 1", g * e) gamma = "" epsilon = "" data2 = data.copy() index = 0 while len(data) > 1: one = 0 zero = 0 ones = [] zeroes = [] for c in range(0, len(data)): if data[c][index] == "0": zero += 1 zeroes.append(data[c]) else: one += 1 ones.append(data[c]) if zero > one: data = zeroes else: data = ones index += 1 oxygen = int(data[0], 2) data = data2 index = 0 while len(data) > 1: one = 0 zero = 0 ones = [] zeroes = [] for c in range(0, len(data)): if data[c][index] == '0': zero += 1 zeroes.append(data[c]) else: one += 1 ones.append(data[c]) if one < zero: data = ones else: data = zeroes index += 1 co2 = int(data[0], 2) print("PART 2", oxygen * co2)
with open('inputday3.txt') as f: data = [x for x in f.read().split()] gamma = '' epsilon = '' for b in range(0, len(data[0])): one = 0 zero = 0 for c in range(0, len(data)): if data[c][b] == '0': zero += 1 else: one += 1 if zero > one: gamma += '0' epsilon += '1' else: gamma += '1' epsilon += '0' g = int(gamma, 2) e = int(epsilon, 2) print('PART 1', g * e) gamma = '' epsilon = '' data2 = data.copy() index = 0 while len(data) > 1: one = 0 zero = 0 ones = [] zeroes = [] for c in range(0, len(data)): if data[c][index] == '0': zero += 1 zeroes.append(data[c]) else: one += 1 ones.append(data[c]) if zero > one: data = zeroes else: data = ones index += 1 oxygen = int(data[0], 2) data = data2 index = 0 while len(data) > 1: one = 0 zero = 0 ones = [] zeroes = [] for c in range(0, len(data)): if data[c][index] == '0': zero += 1 zeroes.append(data[c]) else: one += 1 ones.append(data[c]) if one < zero: data = ones else: data = zeroes index += 1 co2 = int(data[0], 2) print('PART 2', oxygen * co2)
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.181181, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.344996, '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.977935, '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.486054, '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': 0.841669, '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.482721, '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': 1.81044, '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.330514, '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.28395, '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.184753, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0176198, '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.195265, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.130309, '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.380018, 'Execution Unit/Register Files/Runtime Dynamic': 0.147929, '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.521478, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 1.08927, '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': 3.79801, '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.00272158, '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.00272158, '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.0023766, '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.000923356, '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.00187191, '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.00969166, '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.0258763, '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.12527, '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.372767, '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.425473, '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': 0.959077, '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.090727, 'L2/Runtime Dynamic': 0.0127692, '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': 4.08122, 'Load Store Unit/Data Cache/Runtime Dynamic': 1.38167, '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.0920133, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0920133, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 4.51749, 'Load Store Unit/Runtime Dynamic': 1.92746, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.226889, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.453778, '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.0805237, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0817258, '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.061585, '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.697703, 'Memory Management Unit/Runtime Dynamic': 0.143311, 'Memory Management Unit/Subthreshold Leakage': 0.0769113, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462, 'Peak Dynamic': 26.1203, '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.644561, '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.0326103, '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.237087, '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.914258, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime Dynamic': 7.75489, '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.11996, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.29691, '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.64733, '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.234954, '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.378972, '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.191292, '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.805218, '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.169475, '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.2954, '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.122295, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00985502, '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.116195, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0728839, '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.23849, 'Execution Unit/Register Files/Runtime Dynamic': 0.0827389, '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.274787, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.565173, '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.15542, '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.00133282, '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.00133282, '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.00118494, '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.000471861, '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.00104698, '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.00489756, '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.0119197, '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.0700652, '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.45674, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.197355, '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.237973, '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.89155, 'Instruction Fetch Unit/Runtime Dynamic': 0.522211, '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.0504299, 'L2/Runtime Dynamic': 0.0069462, '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.70196, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.713329, '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.0473909, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0473909, '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.92575, 'Load Store Unit/Runtime Dynamic': 0.994436, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.116858, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.233716, '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.0414733, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0421754, '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.277104, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0325171, '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.504457, 'Memory Management Unit/Runtime Dynamic': 0.0746925, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 19.2571, '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.321701, '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.0145155, '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.111753, '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.44797, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 4.20167, '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.0065108, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.207803, '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.0335685, '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.102536, '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.165386, '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.0834813, '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.351403, '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.112125, '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.10223, '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.00634181, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0043008, '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.0336025, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0318071, '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.0399443, 'Execution Unit/Register Files/Runtime Dynamic': 0.0361079, '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.0724192, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.179703, '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.18039, '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.00112696, '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.00112696, '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.000995662, '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.000393137, '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.000456911, '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.0037065, '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.0103022, '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.0305769, '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': 1.94496, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0958958, '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.103853, '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': 4.25787, 'Instruction Fetch Unit/Runtime Dynamic': 0.244335, '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.0538499, 'L2/Runtime Dynamic': 0.0148173, '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.02873, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.40237, '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.0256105, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0256104, '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.14967, 'Load Store Unit/Runtime Dynamic': 0.554282, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.063151, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.126302, '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.0224125, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0232096, '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.12093, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0157552, '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.31554, 'Memory Management Unit/Runtime Dynamic': 0.0389648, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.4686, '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.0166828, '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.00482915, '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.0520126, '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.0735245, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.10632, '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.00682822, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.208052, '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.0364806, '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.106185, '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.171272, '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.0864526, '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.36391, '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.115853, '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.11398, '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.00689197, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00445387, '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.0347798, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0329391, '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.0416718, 'Execution Unit/Register Files/Runtime Dynamic': 0.037393, '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.0749788, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.202833, '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.21756, '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.000625326, '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.000625326, '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.000550159, '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.000215984, '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.000473173, '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.00227399, '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.00579905, '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.0316652, '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': 2.01418, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0689457, '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.107549, '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': 4.33045, 'Instruction Fetch Unit/Runtime Dynamic': 0.216233, '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.0418086, 'L2/Runtime Dynamic': 0.00989266, '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.36015, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.554162, '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.0363327, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0363327, '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.53172, 'Load Store Unit/Runtime Dynamic': 0.769675, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.0895903, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.17918, '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.0317959, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0324228, '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.125234, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0113054, '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.335963, 'Memory Management Unit/Runtime Dynamic': 0.0437282, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.9434, '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.0181291, '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.0050114, '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.0551057, '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.0782462, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.33534, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}], 'DRAM': {'Area': 0, 'Gate Leakage': 0, 'Peak Dynamic': 3.868411224021876, 'Runtime Dynamic': 3.868411224021876, 'Subthreshold Leakage': 4.252, 'Subthreshold Leakage with power gating': 4.252}, 'L3': [{'Area': 61.9075, 'Gate Leakage': 0.0484137, 'Peak Dynamic': 0.371973, 'Runtime Dynamic': 0.183113, 'Subthreshold Leakage': 6.80085, 'Subthreshold Leakage with power gating': 3.32364}], 'Processor': {'Area': 191.908, 'Gate Leakage': 1.53485, 'Peak Dynamic': 75.1614, 'Peak Power': 108.274, 'Runtime Dynamic': 16.5813, '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': 74.7894, 'Total Cores/Runtime Dynamic': 16.3982, '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.371973, 'Total L3s/Runtime Dynamic': 0.183113, '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}}
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.181181, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.344996, '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.977935, '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.486054, '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': 0.841669, '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.482721, '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': 1.81044, '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.330514, '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.28395, '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.184753, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0176198, '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.195265, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.130309, '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.380018, 'Execution Unit/Register Files/Runtime Dynamic': 0.147929, '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.521478, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 1.08927, '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': 3.79801, '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.00272158, '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.00272158, '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.0023766, '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.000923356, '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.00187191, '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.00969166, '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.0258763, '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.12527, '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.372767, '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.425473, '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': 0.959077, '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.090727, 'L2/Runtime Dynamic': 0.0127692, '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': 4.08122, 'Load Store Unit/Data Cache/Runtime Dynamic': 1.38167, '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.0920133, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0920133, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 4.51749, 'Load Store Unit/Runtime Dynamic': 1.92746, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.226889, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.453778, '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.0805237, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0817258, '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.061585, '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.697703, 'Memory Management Unit/Runtime Dynamic': 0.143311, 'Memory Management Unit/Subthreshold Leakage': 0.0769113, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462, 'Peak Dynamic': 26.1203, '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.644561, '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.0326103, '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.237087, '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.914258, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime Dynamic': 7.75489, '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.11996, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.29691, '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.64733, '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.234954, '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.378972, '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.191292, '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.805218, '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.169475, '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.2954, '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.122295, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00985502, '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.116195, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0728839, '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.23849, 'Execution Unit/Register Files/Runtime Dynamic': 0.0827389, '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.274787, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.565173, '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.15542, '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.00133282, '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.00133282, '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.00118494, '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.000471861, '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.00104698, '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.00489756, '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.0119197, '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.0700652, '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.45674, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.197355, '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.237973, '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.89155, 'Instruction Fetch Unit/Runtime Dynamic': 0.522211, '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.0504299, 'L2/Runtime Dynamic': 0.0069462, '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.70196, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.713329, '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.0473909, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0473909, '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.92575, 'Load Store Unit/Runtime Dynamic': 0.994436, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.116858, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.233716, '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.0414733, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0421754, '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.277104, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0325171, '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.504457, 'Memory Management Unit/Runtime Dynamic': 0.0746925, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 19.2571, '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.321701, '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.0145155, '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.111753, '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.44797, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 4.20167, '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.0065108, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.207803, '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.0335685, '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.102536, '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.165386, '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.0834813, '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.351403, '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.112125, '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.10223, '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.00634181, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0043008, '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.0336025, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0318071, '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.0399443, 'Execution Unit/Register Files/Runtime Dynamic': 0.0361079, '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.0724192, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.179703, '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.18039, '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.00112696, '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.00112696, '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.000995662, '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.000393137, '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.000456911, '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.0037065, '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.0103022, '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.0305769, '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': 1.94496, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0958958, '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.103853, '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': 4.25787, 'Instruction Fetch Unit/Runtime Dynamic': 0.244335, '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.0538499, 'L2/Runtime Dynamic': 0.0148173, '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.02873, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.40237, '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.0256105, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0256104, '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.14967, 'Load Store Unit/Runtime Dynamic': 0.554282, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.063151, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.126302, '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.0224125, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0232096, '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.12093, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0157552, '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.31554, 'Memory Management Unit/Runtime Dynamic': 0.0389648, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.4686, '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.0166828, '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.00482915, '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.0520126, '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.0735245, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.10632, '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.00682822, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.208052, '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.0364806, '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.106185, '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.171272, '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.0864526, '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.36391, '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.115853, '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.11398, '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.00689197, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00445387, '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.0347798, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0329391, '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.0416718, 'Execution Unit/Register Files/Runtime Dynamic': 0.037393, '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.0749788, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.202833, '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.21756, '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.000625326, '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.000625326, '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.000550159, '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.000215984, '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.000473173, '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.00227399, '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.00579905, '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.0316652, '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': 2.01418, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0689457, '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.107549, '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': 4.33045, 'Instruction Fetch Unit/Runtime Dynamic': 0.216233, '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.0418086, 'L2/Runtime Dynamic': 0.00989266, '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.36015, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.554162, '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.0363327, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0363327, '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.53172, 'Load Store Unit/Runtime Dynamic': 0.769675, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.0895903, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.17918, '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.0317959, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0324228, '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.125234, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0113054, '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.335963, 'Memory Management Unit/Runtime Dynamic': 0.0437282, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.9434, '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.0181291, '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.0050114, '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.0551057, '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.0782462, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.33534, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}], 'DRAM': {'Area': 0, 'Gate Leakage': 0, 'Peak Dynamic': 3.868411224021876, 'Runtime Dynamic': 3.868411224021876, 'Subthreshold Leakage': 4.252, 'Subthreshold Leakage with power gating': 4.252}, 'L3': [{'Area': 61.9075, 'Gate Leakage': 0.0484137, 'Peak Dynamic': 0.371973, 'Runtime Dynamic': 0.183113, 'Subthreshold Leakage': 6.80085, 'Subthreshold Leakage with power gating': 3.32364}], 'Processor': {'Area': 191.908, 'Gate Leakage': 1.53485, 'Peak Dynamic': 75.1614, 'Peak Power': 108.274, 'Runtime Dynamic': 16.5813, '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': 74.7894, 'Total Cores/Runtime Dynamic': 16.3982, '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.371973, 'Total L3s/Runtime Dynamic': 0.183113, '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}}
"""Fizzbuzz for loop variant 3""" for x in range(1, 101): OUTPUT = "" if x % 3 == 0: OUTPUT += "Fizz" if x % 5 == 0: OUTPUT += "Buzz" print(OUTPUT or x)
"""Fizzbuzz for loop variant 3""" for x in range(1, 101): output = '' if x % 3 == 0: output += 'Fizz' if x % 5 == 0: output += 'Buzz' print(OUTPUT or x)
# type: ignore __all__ = [ "readDatastoreImage", "datastore", ] def readDatastoreImage(*args): raise NotImplementedError("readDatastoreImage") def datastore(*args): raise NotImplementedError("datastore")
__all__ = ['readDatastoreImage', 'datastore'] def read_datastore_image(*args): raise not_implemented_error('readDatastoreImage') def datastore(*args): raise not_implemented_error('datastore')
""" Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal". Example 1: Input: [5, 4, 3, 2, 1] Output: ["Gold Medal", "Silver Medal", "Bronze Medal", "4", "5"] Explanation: The first three athletes got the top three highest scores, so they got "Gold Medal", "Silver Medal" and "Bronze Medal". For the left two athletes, you just need to output their relative ranks according to their scores. Note: N is a positive integer and won't exceed 10,000. All the scores of athletes are guaranteed to be unique. """ class Solution: def findRelativeRanks(self, nums): scores_rank = sorted(nums, reverse=True) d = {} for i, score in enumerate(scores_rank): if i == 0: d[score] = 'Gold Medal' elif i == 1: d[score] = 'Silver Medal' elif i == 2: d[score] = 'Bronze Medal' else: d[score] = str(i + 1) return [d[x] for x in nums]
""" Given scores of N athletes, find their relative ranks and the people with the top three highest scores, who will be awarded medals: "Gold Medal", "Silver Medal" and "Bronze Medal". Example 1: Input: [5, 4, 3, 2, 1] Output: ["Gold Medal", "Silver Medal", "Bronze Medal", "4", "5"] Explanation: The first three athletes got the top three highest scores, so they got "Gold Medal", "Silver Medal" and "Bronze Medal". For the left two athletes, you just need to output their relative ranks according to their scores. Note: N is a positive integer and won't exceed 10,000. All the scores of athletes are guaranteed to be unique. """ class Solution: def find_relative_ranks(self, nums): scores_rank = sorted(nums, reverse=True) d = {} for (i, score) in enumerate(scores_rank): if i == 0: d[score] = 'Gold Medal' elif i == 1: d[score] = 'Silver Medal' elif i == 2: d[score] = 'Bronze Medal' else: d[score] = str(i + 1) return [d[x] for x in nums]
"""! @brief Collection of examples devoted to containers. @authors Andrei Novikov (pyclustering@yandex.ru) @date 2014-2020 @copyright BSD-3-Clause """
"""! @brief Collection of examples devoted to containers. @authors Andrei Novikov (pyclustering@yandex.ru) @date 2014-2020 @copyright BSD-3-Clause """
# THIS FILE IS GENERATED FROM SCIPY SETUP.PY short_version = '1.5.4' version = '1.5.4' full_version = '1.5.4' git_revision = '19acfed431060aafaa963f7e530c95e70cd4b85c' release = True if not release: version = full_version
short_version = '1.5.4' version = '1.5.4' full_version = '1.5.4' git_revision = '19acfed431060aafaa963f7e530c95e70cd4b85c' release = True if not release: version = full_version
# # PySNMP MIB module ZYXEL-AclV2-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ZYXEL-AclV2-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:43:03 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, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueRangeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueRangeConstraint") InetAddress, = mibBuilder.importSymbols("INET-ADDRESS-MIB", "InetAddress") EnabledStatus, = mibBuilder.importSymbols("P-BRIDGE-MIB", "EnabledStatus") PortList, = mibBuilder.importSymbols("Q-BRIDGE-MIB", "PortList") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Counter32, Integer32, Counter64, NotificationType, Bits, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, MibIdentifier, TimeTicks, iso, Gauge32, Unsigned32, IpAddress, ObjectIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Integer32", "Counter64", "NotificationType", "Bits", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "MibIdentifier", "TimeTicks", "iso", "Gauge32", "Unsigned32", "IpAddress", "ObjectIdentity") RowStatus, MacAddress, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "RowStatus", "MacAddress", "DisplayString", "TextualConvention") esMgmt, = mibBuilder.importSymbols("ZYXEL-ES-SMI", "esMgmt") zyxelAclV2 = ModuleIdentity((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105)) if mibBuilder.loadTexts: zyxelAclV2.setLastUpdated('201207010000Z') if mibBuilder.loadTexts: zyxelAclV2.setOrganization('Enterprise Solution ZyXEL') zyxelAclV2ClassifierStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1)) zyxelAclV2PolicyStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2)) zyxelAclV2TrapInfoObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 3)) zyxelAclV2Notifications = MibIdentifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 4)) zyxelAclV2ClassifierTable = MibTable((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1), ) if mibBuilder.loadTexts: zyxelAclV2ClassifierTable.setStatus('current') zyxelAclV2ClassifierEntry = MibTableRow((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1), ).setIndexNames((0, "ZYXEL-AclV2-MIB", "zyAclV2ClassifierName")) if mibBuilder.loadTexts: zyxelAclV2ClassifierEntry.setStatus('current') zyAclV2ClassifierName = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 1), DisplayString()) if mibBuilder.loadTexts: zyAclV2ClassifierName.setStatus('current') zyAclV2ClassifierState = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 2), EnabledStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierState.setStatus('current') zyAclV2ClassifierWeight = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierWeight.setStatus('current') zyAclV2ClassifierCountState = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 4), EnabledStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierCountState.setStatus('current') zyAclV2ClassifierLogState = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 5), EnabledStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierLogState.setStatus('current') zyAclV2ClassifierTimeRange = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 6), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierTimeRange.setStatus('current') zyAclV2ClassifierMatchCount = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 7), Counter64()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierMatchCount.setStatus('current') zyxelAclV2ClassifierEthernetTable = MibTable((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2), ) if mibBuilder.loadTexts: zyxelAclV2ClassifierEthernetTable.setStatus('current') zyxelAclV2ClassifierEthernetEntry = MibTableRow((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1), ).setIndexNames((0, "ZYXEL-AclV2-MIB", "zyAclV2ClassifierName")) if mibBuilder.loadTexts: zyxelAclV2ClassifierEthernetEntry.setStatus('current') zyAclV2ClassifierEthernetSourcePorts = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 1), PortList()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernetSourcePorts.setStatus('current') zyAclV2ClassifierEthernetSourceTrunks = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 2), PortList()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernetSourceTrunks.setStatus('current') zyAclV2ClassifierEthernetPacketFormat = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("all", 1), ("ethernetIIUntagged", 2), ("ethernetIITagged", 3), ("ethernet802dot3Untagged", 4), ("ethernet802dot3Tagged", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernetPacketFormat.setStatus('current') zyAclV2ClassifierEthernet8021pPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernet8021pPriority.setStatus('current') zyAclV2ClassifierEthernetInner8021pPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernetInner8021pPriority.setStatus('current') zyAclV2ClassifierEthernetType = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernetType.setStatus('current') zyAclV2ClassifierEthernetSourceMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 7), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernetSourceMacAddress.setStatus('current') zyAclV2ClassifierEthernetSourceMACMask = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 8), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernetSourceMACMask.setStatus('current') zyAclV2ClassifierEthernetDestinationMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 9), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernetDestinationMacAddress.setStatus('current') zyAclV2ClassifierEthernetDestinationMACMask = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 10), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierEthernetDestinationMACMask.setStatus('current') zyxelAclV2ClassifierVlanTable = MibTable((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3), ) if mibBuilder.loadTexts: zyxelAclV2ClassifierVlanTable.setStatus('current') zyxelAclV2ClassifierVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1), ).setIndexNames((0, "ZYXEL-AclV2-MIB", "zyAclV2ClassifierName")) if mibBuilder.loadTexts: zyxelAclV2ClassifierVlanEntry.setStatus('current') zyAclV2ClassifierVlanMap1k = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierVlanMap1k.setStatus('current') zyAclV2ClassifierVlanMap2k = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierVlanMap2k.setStatus('current') zyAclV2ClassifierVlanMap3k = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierVlanMap3k.setStatus('current') zyAclV2ClassifierVlanMap4k = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierVlanMap4k.setStatus('current') zyxelAclV2ClassifierInnerVlanTable = MibTable((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4), ) if mibBuilder.loadTexts: zyxelAclV2ClassifierInnerVlanTable.setStatus('current') zyxelAclV2ClassifierInnerVlanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1), ).setIndexNames((0, "ZYXEL-AclV2-MIB", "zyAclV2ClassifierName")) if mibBuilder.loadTexts: zyxelAclV2ClassifierInnerVlanEntry.setStatus('current') zyAclV2ClassifierInnerVlanMap1k = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierInnerVlanMap1k.setStatus('current') zyAclV2ClassifierInnerVlanMap2k = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1, 2), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierInnerVlanMap2k.setStatus('current') zyAclV2ClassifierInnerVlanMap3k = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierInnerVlanMap3k.setStatus('current') zyAclV2ClassifierInnerVlanMap4k = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierInnerVlanMap4k.setStatus('current') zyxelAclV2ClassifierIpTable = MibTable((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5), ) if mibBuilder.loadTexts: zyxelAclV2ClassifierIpTable.setStatus('current') zyxelAclV2ClassifierIpEntry = MibTableRow((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1), ).setIndexNames((0, "ZYXEL-AclV2-MIB", "zyAclV2ClassifierName")) if mibBuilder.loadTexts: zyxelAclV2ClassifierIpEntry.setStatus('current') zyAclV2ClassifierIpPacketLenRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpPacketLenRangeStart.setStatus('current') zyAclV2ClassifierIpPacketLenRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpPacketLenRangeEnd.setStatus('current') zyAclV2ClassifierIpDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 3), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpDSCP.setStatus('current') zyAclV2ClassifierIpPrecedence = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpPrecedence.setStatus('current') zyAclV2ClassifierIpToS = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpToS.setStatus('current') zyAclV2ClassifierIpProtocol = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpProtocol.setStatus('current') zyAclV2ClassifierIpEstablishOnly = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 7), EnabledStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpEstablishOnly.setStatus('current') zyAclV2ClassifierIpSourceIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 8), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpSourceIpAddress.setStatus('current') zyAclV2ClassifierIpSourceIpMaskBits = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpSourceIpMaskBits.setStatus('current') zyAclV2ClassifierIpDestinationIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 10), IpAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpDestinationIpAddress.setStatus('current') zyAclV2ClassifierIpDestinationIpMaskBits = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 11), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpDestinationIpMaskBits.setStatus('current') zyAclV2ClassifierIpSourceSocketRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 12), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpSourceSocketRangeStart.setStatus('current') zyAclV2ClassifierIpSourceSocketRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 13), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpSourceSocketRangeEnd.setStatus('current') zyAclV2ClassifierIpDestinationSocketRangeStart = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 14), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpDestinationSocketRangeStart.setStatus('current') zyAclV2ClassifierIpDestinationSocketRangeEnd = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIpDestinationSocketRangeEnd.setStatus('current') zyxelAclV2ClassifierIpv6Table = MibTable((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6), ) if mibBuilder.loadTexts: zyxelAclV2ClassifierIpv6Table.setStatus('current') zyxelAclV2ClassifierIpv6Entry = MibTableRow((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1), ).setIndexNames((0, "ZYXEL-AclV2-MIB", "zyAclV2ClassifierName")) if mibBuilder.loadTexts: zyxelAclV2ClassifierIpv6Entry.setStatus('current') zyAclV2ClassifierIPv6DSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 1), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIPv6DSCP.setStatus('current') zyAclV2ClassifierIPv6NextHeader = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIPv6NextHeader.setStatus('current') zyAclV2ClassifierIPv6EstablishOnly = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 3), EnabledStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIPv6EstablishOnly.setStatus('current') zyAclV2ClassifierIPv6SourceIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 4), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIPv6SourceIpAddress.setStatus('current') zyAclV2ClassifierIPv6SourceIpPrefixLength = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIPv6SourceIpPrefixLength.setStatus('current') zyAclV2ClassifierIPv6DestinationIpAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 6), InetAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIPv6DestinationIpAddress.setStatus('current') zyAclV2ClassifierIPv6DestinationIpPrefixLength = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2ClassifierIPv6DestinationIpPrefixLength.setStatus('current') zyxelAclV2ClassifierMatchOrder = MibScalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("auto", 1), ("manual", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyxelAclV2ClassifierMatchOrder.setStatus('current') zyxelAclV2ClassifierLoggingState = MibScalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 8), EnabledStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyxelAclV2ClassifierLoggingState.setStatus('current') zyxelAclV2ClassifierLoggingInterval = MibScalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyxelAclV2ClassifierLoggingInterval.setStatus('current') zyxelAclV2PolicyTable = MibTable((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1), ) if mibBuilder.loadTexts: zyxelAclV2PolicyTable.setStatus('current') zyxelAclV2PolicyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1), ).setIndexNames((0, "ZYXEL-AclV2-MIB", "zyAclV2PolicyName")) if mibBuilder.loadTexts: zyxelAclV2PolicyEntry.setStatus('current') zyAclV2PolicyName = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 1), DisplayString()) if mibBuilder.loadTexts: zyAclV2PolicyName.setStatus('current') zyAclV2PolicyState = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 2), EnabledStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyState.setStatus('current') zyAclV2PolicyClassifier = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyClassifier.setStatus('current') zyAclV2PolicyVid = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 4), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyVid.setStatus('current') zyAclV2PolicyEgressPort = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 5), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyEgressPort.setStatus('current') zyAclV2Policy8021pPriority = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 6), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2Policy8021pPriority.setStatus('current') zyAclV2PolicyDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyDSCP.setStatus('current') zyAclV2PolicyTOS = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyTOS.setStatus('current') zyAclV2PolicyBandwidth = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyBandwidth.setStatus('current') zyAclV2PolicyOutOfProfileDSCP = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 10), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyOutOfProfileDSCP.setStatus('current') zyAclV2PolicyForwardingAction = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 11), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("noChange", 1), ("discardThePacket", 2), ("doNotDropTheMatchingFramePreviouslyMarkedForDropping", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyForwardingAction.setStatus('current') zyAclV2PolicyPriorityAction = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 12), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5))).clone(namedValues=NamedValues(("noChange", 1), ("setThePackets802dot1Priority", 2), ("sendThePacketToPriorityQueue", 3), ("replaceThe802dot1PriorityFieldWithTheIpTosValue", 4), ("replaceThe802dot1PriorityByInner802dot1Priority", 5)))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyPriorityAction.setStatus('current') zyAclV2PolicyDiffServAction = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 13), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("noChange", 1), ("setThePacketsTosField", 2), ("replaceTheIpTosFieldWithThe802dot1PriorityValue", 3), ("setTheDiffservCodepointFieldInTheFrame", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyDiffServAction.setStatus('current') zyAclV2PolicyOutgoingAction = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 14), Bits().clone(namedValues=NamedValues(("sendThePacketToTheMirrorPort", 0), ("sendThePacketToTheEgressPort", 1), ("sendTheMatchingFramesToTheEgressPort", 2), ("setThePacketVlanId", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyOutgoingAction.setStatus('current') zyAclV2PolicyMeteringState = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 15), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyMeteringState.setStatus('current') zyAclV2PolicyOutOfProfileAction = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 16), Bits().clone(namedValues=NamedValues(("dropThePacket", 0), ("changeTheDscpValue", 1), ("setOutDropPrecedence", 2), ("doNotDropTheMatchingFramePreviouslyMarkedForDropping", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyOutOfProfileAction.setStatus('current') zyAclV2PolicyRowstatus = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 17), RowStatus()).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyRowstatus.setStatus('current') zyAclV2PolicyQueueAction = MibTableColumn((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 18), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("noChange", 1), ("sendThePacketToPriorityQueue", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: zyAclV2PolicyQueueAction.setStatus('current') zyAclV2TrapClassifierLogMatchCount = MibScalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 3, 1), Integer32()) if mibBuilder.loadTexts: zyAclV2TrapClassifierLogMatchCount.setStatus('current') zyAclV2ClassifierLogNotification = NotificationType((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 4, 1)).setObjects(("ZYXEL-AclV2-MIB", "zyAclV2ClassifierName"), ("ZYXEL-AclV2-MIB", "zyAclV2TrapClassifierLogMatchCount")) if mibBuilder.loadTexts: zyAclV2ClassifierLogNotification.setStatus('current') mibBuilder.exportSymbols("ZYXEL-AclV2-MIB", zyAclV2ClassifierInnerVlanMap1k=zyAclV2ClassifierInnerVlanMap1k, zyAclV2ClassifierIPv6DSCP=zyAclV2ClassifierIPv6DSCP, zyAclV2ClassifierEthernetInner8021pPriority=zyAclV2ClassifierEthernetInner8021pPriority, zyAclV2ClassifierInnerVlanMap4k=zyAclV2ClassifierInnerVlanMap4k, zyAclV2ClassifierEthernetPacketFormat=zyAclV2ClassifierEthernetPacketFormat, zyAclV2ClassifierVlanMap2k=zyAclV2ClassifierVlanMap2k, zyxelAclV2PolicyStatus=zyxelAclV2PolicyStatus, zyAclV2PolicyClassifier=zyAclV2PolicyClassifier, zyxelAclV2ClassifierInnerVlanTable=zyxelAclV2ClassifierInnerVlanTable, zyAclV2ClassifierIpEstablishOnly=zyAclV2ClassifierIpEstablishOnly, zyAclV2ClassifierEthernetType=zyAclV2ClassifierEthernetType, zyAclV2ClassifierEthernetSourceMacAddress=zyAclV2ClassifierEthernetSourceMacAddress, zyAclV2ClassifierIpSourceIpMaskBits=zyAclV2ClassifierIpSourceIpMaskBits, zyAclV2ClassifierEthernetDestinationMacAddress=zyAclV2ClassifierEthernetDestinationMacAddress, zyAclV2PolicyOutOfProfileDSCP=zyAclV2PolicyOutOfProfileDSCP, zyAclV2ClassifierIpDestinationSocketRangeEnd=zyAclV2ClassifierIpDestinationSocketRangeEnd, zyAclV2PolicyEgressPort=zyAclV2PolicyEgressPort, zyAclV2PolicyRowstatus=zyAclV2PolicyRowstatus, zyAclV2ClassifierEthernetSourceTrunks=zyAclV2ClassifierEthernetSourceTrunks, zyxelAclV2ClassifierInnerVlanEntry=zyxelAclV2ClassifierInnerVlanEntry, zyAclV2ClassifierLogNotification=zyAclV2ClassifierLogNotification, zyAclV2PolicyOutgoingAction=zyAclV2PolicyOutgoingAction, zyAclV2ClassifierIpDestinationIpAddress=zyAclV2ClassifierIpDestinationIpAddress, zyAclV2PolicyMeteringState=zyAclV2PolicyMeteringState, zyAclV2ClassifierInnerVlanMap2k=zyAclV2ClassifierInnerVlanMap2k, zyAclV2ClassifierIpPrecedence=zyAclV2ClassifierIpPrecedence, zyAclV2PolicyVid=zyAclV2PolicyVid, zyxelAclV2ClassifierEntry=zyxelAclV2ClassifierEntry, zyAclV2ClassifierIpDestinationIpMaskBits=zyAclV2ClassifierIpDestinationIpMaskBits, zyxelAclV2Notifications=zyxelAclV2Notifications, zyxelAclV2PolicyTable=zyxelAclV2PolicyTable, zyxelAclV2ClassifierMatchOrder=zyxelAclV2ClassifierMatchOrder, zyAclV2ClassifierIpDSCP=zyAclV2ClassifierIpDSCP, zyAclV2ClassifierWeight=zyAclV2ClassifierWeight, zyAclV2ClassifierMatchCount=zyAclV2ClassifierMatchCount, zyAclV2PolicyPriorityAction=zyAclV2PolicyPriorityAction, zyAclV2TrapClassifierLogMatchCount=zyAclV2TrapClassifierLogMatchCount, zyxelAclV2ClassifierEthernetEntry=zyxelAclV2ClassifierEthernetEntry, zyAclV2ClassifierIpPacketLenRangeStart=zyAclV2ClassifierIpPacketLenRangeStart, zyAclV2ClassifierEthernetSourceMACMask=zyAclV2ClassifierEthernetSourceMACMask, zyAclV2ClassifierEthernetDestinationMACMask=zyAclV2ClassifierEthernetDestinationMACMask, zyAclV2ClassifierVlanMap3k=zyAclV2ClassifierVlanMap3k, zyAclV2ClassifierTimeRange=zyAclV2ClassifierTimeRange, zyxelAclV2ClassifierIpv6Entry=zyxelAclV2ClassifierIpv6Entry, zyAclV2ClassifierIPv6EstablishOnly=zyAclV2ClassifierIPv6EstablishOnly, zyAclV2ClassifierIPv6DestinationIpPrefixLength=zyAclV2ClassifierIPv6DestinationIpPrefixLength, zyxelAclV2ClassifierIpEntry=zyxelAclV2ClassifierIpEntry, zyAclV2ClassifierIpToS=zyAclV2ClassifierIpToS, zyAclV2ClassifierEthernetSourcePorts=zyAclV2ClassifierEthernetSourcePorts, zyAclV2PolicyQueueAction=zyAclV2PolicyQueueAction, zyAclV2ClassifierIPv6NextHeader=zyAclV2ClassifierIPv6NextHeader, zyAclV2ClassifierVlanMap4k=zyAclV2ClassifierVlanMap4k, zyAclV2ClassifierEthernet8021pPriority=zyAclV2ClassifierEthernet8021pPriority, zyxelAclV2TrapInfoObjects=zyxelAclV2TrapInfoObjects, zyxelAclV2ClassifierIpTable=zyxelAclV2ClassifierIpTable, zyAclV2ClassifierIPv6SourceIpAddress=zyAclV2ClassifierIPv6SourceIpAddress, zyxelAclV2ClassifierLoggingState=zyxelAclV2ClassifierLoggingState, zyxelAclV2=zyxelAclV2, zyxelAclV2ClassifierIpv6Table=zyxelAclV2ClassifierIpv6Table, zyAclV2PolicyDiffServAction=zyAclV2PolicyDiffServAction, zyAclV2ClassifierIpDestinationSocketRangeStart=zyAclV2ClassifierIpDestinationSocketRangeStart, zyAclV2ClassifierVlanMap1k=zyAclV2ClassifierVlanMap1k, zyAclV2PolicyDSCP=zyAclV2PolicyDSCP, zyxelAclV2ClassifierEthernetTable=zyxelAclV2ClassifierEthernetTable, zyAclV2ClassifierLogState=zyAclV2ClassifierLogState, zyAclV2ClassifierInnerVlanMap3k=zyAclV2ClassifierInnerVlanMap3k, zyAclV2ClassifierIPv6SourceIpPrefixLength=zyAclV2ClassifierIPv6SourceIpPrefixLength, zyAclV2PolicyBandwidth=zyAclV2PolicyBandwidth, zyxelAclV2ClassifierLoggingInterval=zyxelAclV2ClassifierLoggingInterval, zyAclV2Policy8021pPriority=zyAclV2Policy8021pPriority, zyAclV2PolicyForwardingAction=zyAclV2PolicyForwardingAction, zyAclV2PolicyName=zyAclV2PolicyName, PYSNMP_MODULE_ID=zyxelAclV2, zyAclV2ClassifierName=zyAclV2ClassifierName, zyAclV2ClassifierIPv6DestinationIpAddress=zyAclV2ClassifierIPv6DestinationIpAddress, zyAclV2ClassifierState=zyAclV2ClassifierState, zyxelAclV2ClassifierVlanEntry=zyxelAclV2ClassifierVlanEntry, zyAclV2PolicyState=zyAclV2PolicyState, zyAclV2ClassifierIpSourceIpAddress=zyAclV2ClassifierIpSourceIpAddress, zyxelAclV2ClassifierTable=zyxelAclV2ClassifierTable, zyxelAclV2ClassifierStatus=zyxelAclV2ClassifierStatus, zyAclV2ClassifierIpSourceSocketRangeEnd=zyAclV2ClassifierIpSourceSocketRangeEnd, zyAclV2PolicyTOS=zyAclV2PolicyTOS, zyAclV2ClassifierIpPacketLenRangeEnd=zyAclV2ClassifierIpPacketLenRangeEnd, zyxelAclV2PolicyEntry=zyxelAclV2PolicyEntry, zyAclV2ClassifierIpProtocol=zyAclV2ClassifierIpProtocol, zyxelAclV2ClassifierVlanTable=zyxelAclV2ClassifierVlanTable, zyAclV2PolicyOutOfProfileAction=zyAclV2PolicyOutOfProfileAction, zyAclV2ClassifierIpSourceSocketRangeStart=zyAclV2ClassifierIpSourceSocketRangeStart, zyAclV2ClassifierCountState=zyAclV2ClassifierCountState)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, constraints_union, single_value_constraint, constraints_intersection, value_range_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ConstraintsUnion', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueRangeConstraint') (inet_address,) = mibBuilder.importSymbols('INET-ADDRESS-MIB', 'InetAddress') (enabled_status,) = mibBuilder.importSymbols('P-BRIDGE-MIB', 'EnabledStatus') (port_list,) = mibBuilder.importSymbols('Q-BRIDGE-MIB', 'PortList') (module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup') (counter32, integer32, counter64, notification_type, bits, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, mib_identifier, time_ticks, iso, gauge32, unsigned32, ip_address, object_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'Counter32', 'Integer32', 'Counter64', 'NotificationType', 'Bits', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'MibIdentifier', 'TimeTicks', 'iso', 'Gauge32', 'Unsigned32', 'IpAddress', 'ObjectIdentity') (row_status, mac_address, display_string, textual_convention) = mibBuilder.importSymbols('SNMPv2-TC', 'RowStatus', 'MacAddress', 'DisplayString', 'TextualConvention') (es_mgmt,) = mibBuilder.importSymbols('ZYXEL-ES-SMI', 'esMgmt') zyxel_acl_v2 = module_identity((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105)) if mibBuilder.loadTexts: zyxelAclV2.setLastUpdated('201207010000Z') if mibBuilder.loadTexts: zyxelAclV2.setOrganization('Enterprise Solution ZyXEL') zyxel_acl_v2_classifier_status = mib_identifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1)) zyxel_acl_v2_policy_status = mib_identifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2)) zyxel_acl_v2_trap_info_objects = mib_identifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 3)) zyxel_acl_v2_notifications = mib_identifier((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 4)) zyxel_acl_v2_classifier_table = mib_table((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1)) if mibBuilder.loadTexts: zyxelAclV2ClassifierTable.setStatus('current') zyxel_acl_v2_classifier_entry = mib_table_row((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1)).setIndexNames((0, 'ZYXEL-AclV2-MIB', 'zyAclV2ClassifierName')) if mibBuilder.loadTexts: zyxelAclV2ClassifierEntry.setStatus('current') zy_acl_v2_classifier_name = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 1), display_string()) if mibBuilder.loadTexts: zyAclV2ClassifierName.setStatus('current') zy_acl_v2_classifier_state = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 2), enabled_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierState.setStatus('current') zy_acl_v2_classifier_weight = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierWeight.setStatus('current') zy_acl_v2_classifier_count_state = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 4), enabled_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierCountState.setStatus('current') zy_acl_v2_classifier_log_state = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 5), enabled_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierLogState.setStatus('current') zy_acl_v2_classifier_time_range = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 6), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierTimeRange.setStatus('current') zy_acl_v2_classifier_match_count = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 1, 1, 7), counter64()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierMatchCount.setStatus('current') zyxel_acl_v2_classifier_ethernet_table = mib_table((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2)) if mibBuilder.loadTexts: zyxelAclV2ClassifierEthernetTable.setStatus('current') zyxel_acl_v2_classifier_ethernet_entry = mib_table_row((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1)).setIndexNames((0, 'ZYXEL-AclV2-MIB', 'zyAclV2ClassifierName')) if mibBuilder.loadTexts: zyxelAclV2ClassifierEthernetEntry.setStatus('current') zy_acl_v2_classifier_ethernet_source_ports = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 1), port_list()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernetSourcePorts.setStatus('current') zy_acl_v2_classifier_ethernet_source_trunks = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 2), port_list()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernetSourceTrunks.setStatus('current') zy_acl_v2_classifier_ethernet_packet_format = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('all', 1), ('ethernetIIUntagged', 2), ('ethernetIITagged', 3), ('ethernet802dot3Untagged', 4), ('ethernet802dot3Tagged', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernetPacketFormat.setStatus('current') zy_acl_v2_classifier_ethernet8021p_priority = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernet8021pPriority.setStatus('current') zy_acl_v2_classifier_ethernet_inner8021p_priority = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernetInner8021pPriority.setStatus('current') zy_acl_v2_classifier_ethernet_type = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernetType.setStatus('current') zy_acl_v2_classifier_ethernet_source_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 7), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernetSourceMacAddress.setStatus('current') zy_acl_v2_classifier_ethernet_source_mac_mask = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 8), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernetSourceMACMask.setStatus('current') zy_acl_v2_classifier_ethernet_destination_mac_address = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 9), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernetDestinationMacAddress.setStatus('current') zy_acl_v2_classifier_ethernet_destination_mac_mask = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 2, 1, 10), mac_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierEthernetDestinationMACMask.setStatus('current') zyxel_acl_v2_classifier_vlan_table = mib_table((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3)) if mibBuilder.loadTexts: zyxelAclV2ClassifierVlanTable.setStatus('current') zyxel_acl_v2_classifier_vlan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1)).setIndexNames((0, 'ZYXEL-AclV2-MIB', 'zyAclV2ClassifierName')) if mibBuilder.loadTexts: zyxelAclV2ClassifierVlanEntry.setStatus('current') zy_acl_v2_classifier_vlan_map1k = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierVlanMap1k.setStatus('current') zy_acl_v2_classifier_vlan_map2k = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierVlanMap2k.setStatus('current') zy_acl_v2_classifier_vlan_map3k = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierVlanMap3k.setStatus('current') zy_acl_v2_classifier_vlan_map4k = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 3, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierVlanMap4k.setStatus('current') zyxel_acl_v2_classifier_inner_vlan_table = mib_table((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4)) if mibBuilder.loadTexts: zyxelAclV2ClassifierInnerVlanTable.setStatus('current') zyxel_acl_v2_classifier_inner_vlan_entry = mib_table_row((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1)).setIndexNames((0, 'ZYXEL-AclV2-MIB', 'zyAclV2ClassifierName')) if mibBuilder.loadTexts: zyxelAclV2ClassifierInnerVlanEntry.setStatus('current') zy_acl_v2_classifier_inner_vlan_map1k = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1, 1), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierInnerVlanMap1k.setStatus('current') zy_acl_v2_classifier_inner_vlan_map2k = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1, 2), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierInnerVlanMap2k.setStatus('current') zy_acl_v2_classifier_inner_vlan_map3k = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierInnerVlanMap3k.setStatus('current') zy_acl_v2_classifier_inner_vlan_map4k = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 4, 1, 4), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierInnerVlanMap4k.setStatus('current') zyxel_acl_v2_classifier_ip_table = mib_table((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5)) if mibBuilder.loadTexts: zyxelAclV2ClassifierIpTable.setStatus('current') zyxel_acl_v2_classifier_ip_entry = mib_table_row((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1)).setIndexNames((0, 'ZYXEL-AclV2-MIB', 'zyAclV2ClassifierName')) if mibBuilder.loadTexts: zyxelAclV2ClassifierIpEntry.setStatus('current') zy_acl_v2_classifier_ip_packet_len_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpPacketLenRangeStart.setStatus('current') zy_acl_v2_classifier_ip_packet_len_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpPacketLenRangeEnd.setStatus('current') zy_acl_v2_classifier_ip_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 3), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpDSCP.setStatus('current') zy_acl_v2_classifier_ip_precedence = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpPrecedence.setStatus('current') zy_acl_v2_classifier_ip_to_s = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpToS.setStatus('current') zy_acl_v2_classifier_ip_protocol = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpProtocol.setStatus('current') zy_acl_v2_classifier_ip_establish_only = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 7), enabled_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpEstablishOnly.setStatus('current') zy_acl_v2_classifier_ip_source_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 8), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpSourceIpAddress.setStatus('current') zy_acl_v2_classifier_ip_source_ip_mask_bits = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpSourceIpMaskBits.setStatus('current') zy_acl_v2_classifier_ip_destination_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 10), ip_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpDestinationIpAddress.setStatus('current') zy_acl_v2_classifier_ip_destination_ip_mask_bits = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 11), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpDestinationIpMaskBits.setStatus('current') zy_acl_v2_classifier_ip_source_socket_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 12), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpSourceSocketRangeStart.setStatus('current') zy_acl_v2_classifier_ip_source_socket_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 13), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpSourceSocketRangeEnd.setStatus('current') zy_acl_v2_classifier_ip_destination_socket_range_start = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 14), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpDestinationSocketRangeStart.setStatus('current') zy_acl_v2_classifier_ip_destination_socket_range_end = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 5, 1, 15), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIpDestinationSocketRangeEnd.setStatus('current') zyxel_acl_v2_classifier_ipv6_table = mib_table((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6)) if mibBuilder.loadTexts: zyxelAclV2ClassifierIpv6Table.setStatus('current') zyxel_acl_v2_classifier_ipv6_entry = mib_table_row((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1)).setIndexNames((0, 'ZYXEL-AclV2-MIB', 'zyAclV2ClassifierName')) if mibBuilder.loadTexts: zyxelAclV2ClassifierIpv6Entry.setStatus('current') zy_acl_v2_classifier_i_pv6_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 1), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIPv6DSCP.setStatus('current') zy_acl_v2_classifier_i_pv6_next_header = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 2), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIPv6NextHeader.setStatus('current') zy_acl_v2_classifier_i_pv6_establish_only = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 3), enabled_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIPv6EstablishOnly.setStatus('current') zy_acl_v2_classifier_i_pv6_source_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 4), inet_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIPv6SourceIpAddress.setStatus('current') zy_acl_v2_classifier_i_pv6_source_ip_prefix_length = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIPv6SourceIpPrefixLength.setStatus('current') zy_acl_v2_classifier_i_pv6_destination_ip_address = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 6), inet_address()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIPv6DestinationIpAddress.setStatus('current') zy_acl_v2_classifier_i_pv6_destination_ip_prefix_length = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 6, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2ClassifierIPv6DestinationIpPrefixLength.setStatus('current') zyxel_acl_v2_classifier_match_order = mib_scalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 7), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('auto', 1), ('manual', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyxelAclV2ClassifierMatchOrder.setStatus('current') zyxel_acl_v2_classifier_logging_state = mib_scalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 8), enabled_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyxelAclV2ClassifierLoggingState.setStatus('current') zyxel_acl_v2_classifier_logging_interval = mib_scalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyxelAclV2ClassifierLoggingInterval.setStatus('current') zyxel_acl_v2_policy_table = mib_table((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1)) if mibBuilder.loadTexts: zyxelAclV2PolicyTable.setStatus('current') zyxel_acl_v2_policy_entry = mib_table_row((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1)).setIndexNames((0, 'ZYXEL-AclV2-MIB', 'zyAclV2PolicyName')) if mibBuilder.loadTexts: zyxelAclV2PolicyEntry.setStatus('current') zy_acl_v2_policy_name = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 1), display_string()) if mibBuilder.loadTexts: zyAclV2PolicyName.setStatus('current') zy_acl_v2_policy_state = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 2), enabled_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyState.setStatus('current') zy_acl_v2_policy_classifier = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 3), display_string()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyClassifier.setStatus('current') zy_acl_v2_policy_vid = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 4), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyVid.setStatus('current') zy_acl_v2_policy_egress_port = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 5), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyEgressPort.setStatus('current') zy_acl_v2_policy8021p_priority = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 6), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2Policy8021pPriority.setStatus('current') zy_acl_v2_policy_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 7), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyDSCP.setStatus('current') zy_acl_v2_policy_tos = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 8), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyTOS.setStatus('current') zy_acl_v2_policy_bandwidth = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 9), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyBandwidth.setStatus('current') zy_acl_v2_policy_out_of_profile_dscp = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 10), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyOutOfProfileDSCP.setStatus('current') zy_acl_v2_policy_forwarding_action = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 11), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3))).clone(namedValues=named_values(('noChange', 1), ('discardThePacket', 2), ('doNotDropTheMatchingFramePreviouslyMarkedForDropping', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyForwardingAction.setStatus('current') zy_acl_v2_policy_priority_action = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 12), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4, 5))).clone(namedValues=named_values(('noChange', 1), ('setThePackets802dot1Priority', 2), ('sendThePacketToPriorityQueue', 3), ('replaceThe802dot1PriorityFieldWithTheIpTosValue', 4), ('replaceThe802dot1PriorityByInner802dot1Priority', 5)))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyPriorityAction.setStatus('current') zy_acl_v2_policy_diff_serv_action = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 13), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2, 3, 4))).clone(namedValues=named_values(('noChange', 1), ('setThePacketsTosField', 2), ('replaceTheIpTosFieldWithThe802dot1PriorityValue', 3), ('setTheDiffservCodepointFieldInTheFrame', 4)))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyDiffServAction.setStatus('current') zy_acl_v2_policy_outgoing_action = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 14), bits().clone(namedValues=named_values(('sendThePacketToTheMirrorPort', 0), ('sendThePacketToTheEgressPort', 1), ('sendTheMatchingFramesToTheEgressPort', 2), ('setThePacketVlanId', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyOutgoingAction.setStatus('current') zy_acl_v2_policy_metering_state = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 15), integer32()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyMeteringState.setStatus('current') zy_acl_v2_policy_out_of_profile_action = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 16), bits().clone(namedValues=named_values(('dropThePacket', 0), ('changeTheDscpValue', 1), ('setOutDropPrecedence', 2), ('doNotDropTheMatchingFramePreviouslyMarkedForDropping', 3)))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyOutOfProfileAction.setStatus('current') zy_acl_v2_policy_rowstatus = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 17), row_status()).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyRowstatus.setStatus('current') zy_acl_v2_policy_queue_action = mib_table_column((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 2, 1, 1, 18), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('noChange', 1), ('sendThePacketToPriorityQueue', 2)))).setMaxAccess('readonly') if mibBuilder.loadTexts: zyAclV2PolicyQueueAction.setStatus('current') zy_acl_v2_trap_classifier_log_match_count = mib_scalar((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 3, 1), integer32()) if mibBuilder.loadTexts: zyAclV2TrapClassifierLogMatchCount.setStatus('current') zy_acl_v2_classifier_log_notification = notification_type((1, 3, 6, 1, 4, 1, 890, 1, 15, 3, 105, 4, 1)).setObjects(('ZYXEL-AclV2-MIB', 'zyAclV2ClassifierName'), ('ZYXEL-AclV2-MIB', 'zyAclV2TrapClassifierLogMatchCount')) if mibBuilder.loadTexts: zyAclV2ClassifierLogNotification.setStatus('current') mibBuilder.exportSymbols('ZYXEL-AclV2-MIB', zyAclV2ClassifierInnerVlanMap1k=zyAclV2ClassifierInnerVlanMap1k, zyAclV2ClassifierIPv6DSCP=zyAclV2ClassifierIPv6DSCP, zyAclV2ClassifierEthernetInner8021pPriority=zyAclV2ClassifierEthernetInner8021pPriority, zyAclV2ClassifierInnerVlanMap4k=zyAclV2ClassifierInnerVlanMap4k, zyAclV2ClassifierEthernetPacketFormat=zyAclV2ClassifierEthernetPacketFormat, zyAclV2ClassifierVlanMap2k=zyAclV2ClassifierVlanMap2k, zyxelAclV2PolicyStatus=zyxelAclV2PolicyStatus, zyAclV2PolicyClassifier=zyAclV2PolicyClassifier, zyxelAclV2ClassifierInnerVlanTable=zyxelAclV2ClassifierInnerVlanTable, zyAclV2ClassifierIpEstablishOnly=zyAclV2ClassifierIpEstablishOnly, zyAclV2ClassifierEthernetType=zyAclV2ClassifierEthernetType, zyAclV2ClassifierEthernetSourceMacAddress=zyAclV2ClassifierEthernetSourceMacAddress, zyAclV2ClassifierIpSourceIpMaskBits=zyAclV2ClassifierIpSourceIpMaskBits, zyAclV2ClassifierEthernetDestinationMacAddress=zyAclV2ClassifierEthernetDestinationMacAddress, zyAclV2PolicyOutOfProfileDSCP=zyAclV2PolicyOutOfProfileDSCP, zyAclV2ClassifierIpDestinationSocketRangeEnd=zyAclV2ClassifierIpDestinationSocketRangeEnd, zyAclV2PolicyEgressPort=zyAclV2PolicyEgressPort, zyAclV2PolicyRowstatus=zyAclV2PolicyRowstatus, zyAclV2ClassifierEthernetSourceTrunks=zyAclV2ClassifierEthernetSourceTrunks, zyxelAclV2ClassifierInnerVlanEntry=zyxelAclV2ClassifierInnerVlanEntry, zyAclV2ClassifierLogNotification=zyAclV2ClassifierLogNotification, zyAclV2PolicyOutgoingAction=zyAclV2PolicyOutgoingAction, zyAclV2ClassifierIpDestinationIpAddress=zyAclV2ClassifierIpDestinationIpAddress, zyAclV2PolicyMeteringState=zyAclV2PolicyMeteringState, zyAclV2ClassifierInnerVlanMap2k=zyAclV2ClassifierInnerVlanMap2k, zyAclV2ClassifierIpPrecedence=zyAclV2ClassifierIpPrecedence, zyAclV2PolicyVid=zyAclV2PolicyVid, zyxelAclV2ClassifierEntry=zyxelAclV2ClassifierEntry, zyAclV2ClassifierIpDestinationIpMaskBits=zyAclV2ClassifierIpDestinationIpMaskBits, zyxelAclV2Notifications=zyxelAclV2Notifications, zyxelAclV2PolicyTable=zyxelAclV2PolicyTable, zyxelAclV2ClassifierMatchOrder=zyxelAclV2ClassifierMatchOrder, zyAclV2ClassifierIpDSCP=zyAclV2ClassifierIpDSCP, zyAclV2ClassifierWeight=zyAclV2ClassifierWeight, zyAclV2ClassifierMatchCount=zyAclV2ClassifierMatchCount, zyAclV2PolicyPriorityAction=zyAclV2PolicyPriorityAction, zyAclV2TrapClassifierLogMatchCount=zyAclV2TrapClassifierLogMatchCount, zyxelAclV2ClassifierEthernetEntry=zyxelAclV2ClassifierEthernetEntry, zyAclV2ClassifierIpPacketLenRangeStart=zyAclV2ClassifierIpPacketLenRangeStart, zyAclV2ClassifierEthernetSourceMACMask=zyAclV2ClassifierEthernetSourceMACMask, zyAclV2ClassifierEthernetDestinationMACMask=zyAclV2ClassifierEthernetDestinationMACMask, zyAclV2ClassifierVlanMap3k=zyAclV2ClassifierVlanMap3k, zyAclV2ClassifierTimeRange=zyAclV2ClassifierTimeRange, zyxelAclV2ClassifierIpv6Entry=zyxelAclV2ClassifierIpv6Entry, zyAclV2ClassifierIPv6EstablishOnly=zyAclV2ClassifierIPv6EstablishOnly, zyAclV2ClassifierIPv6DestinationIpPrefixLength=zyAclV2ClassifierIPv6DestinationIpPrefixLength, zyxelAclV2ClassifierIpEntry=zyxelAclV2ClassifierIpEntry, zyAclV2ClassifierIpToS=zyAclV2ClassifierIpToS, zyAclV2ClassifierEthernetSourcePorts=zyAclV2ClassifierEthernetSourcePorts, zyAclV2PolicyQueueAction=zyAclV2PolicyQueueAction, zyAclV2ClassifierIPv6NextHeader=zyAclV2ClassifierIPv6NextHeader, zyAclV2ClassifierVlanMap4k=zyAclV2ClassifierVlanMap4k, zyAclV2ClassifierEthernet8021pPriority=zyAclV2ClassifierEthernet8021pPriority, zyxelAclV2TrapInfoObjects=zyxelAclV2TrapInfoObjects, zyxelAclV2ClassifierIpTable=zyxelAclV2ClassifierIpTable, zyAclV2ClassifierIPv6SourceIpAddress=zyAclV2ClassifierIPv6SourceIpAddress, zyxelAclV2ClassifierLoggingState=zyxelAclV2ClassifierLoggingState, zyxelAclV2=zyxelAclV2, zyxelAclV2ClassifierIpv6Table=zyxelAclV2ClassifierIpv6Table, zyAclV2PolicyDiffServAction=zyAclV2PolicyDiffServAction, zyAclV2ClassifierIpDestinationSocketRangeStart=zyAclV2ClassifierIpDestinationSocketRangeStart, zyAclV2ClassifierVlanMap1k=zyAclV2ClassifierVlanMap1k, zyAclV2PolicyDSCP=zyAclV2PolicyDSCP, zyxelAclV2ClassifierEthernetTable=zyxelAclV2ClassifierEthernetTable, zyAclV2ClassifierLogState=zyAclV2ClassifierLogState, zyAclV2ClassifierInnerVlanMap3k=zyAclV2ClassifierInnerVlanMap3k, zyAclV2ClassifierIPv6SourceIpPrefixLength=zyAclV2ClassifierIPv6SourceIpPrefixLength, zyAclV2PolicyBandwidth=zyAclV2PolicyBandwidth, zyxelAclV2ClassifierLoggingInterval=zyxelAclV2ClassifierLoggingInterval, zyAclV2Policy8021pPriority=zyAclV2Policy8021pPriority, zyAclV2PolicyForwardingAction=zyAclV2PolicyForwardingAction, zyAclV2PolicyName=zyAclV2PolicyName, PYSNMP_MODULE_ID=zyxelAclV2, zyAclV2ClassifierName=zyAclV2ClassifierName, zyAclV2ClassifierIPv6DestinationIpAddress=zyAclV2ClassifierIPv6DestinationIpAddress, zyAclV2ClassifierState=zyAclV2ClassifierState, zyxelAclV2ClassifierVlanEntry=zyxelAclV2ClassifierVlanEntry, zyAclV2PolicyState=zyAclV2PolicyState, zyAclV2ClassifierIpSourceIpAddress=zyAclV2ClassifierIpSourceIpAddress, zyxelAclV2ClassifierTable=zyxelAclV2ClassifierTable, zyxelAclV2ClassifierStatus=zyxelAclV2ClassifierStatus, zyAclV2ClassifierIpSourceSocketRangeEnd=zyAclV2ClassifierIpSourceSocketRangeEnd, zyAclV2PolicyTOS=zyAclV2PolicyTOS, zyAclV2ClassifierIpPacketLenRangeEnd=zyAclV2ClassifierIpPacketLenRangeEnd, zyxelAclV2PolicyEntry=zyxelAclV2PolicyEntry, zyAclV2ClassifierIpProtocol=zyAclV2ClassifierIpProtocol, zyxelAclV2ClassifierVlanTable=zyxelAclV2ClassifierVlanTable, zyAclV2PolicyOutOfProfileAction=zyAclV2PolicyOutOfProfileAction, zyAclV2ClassifierIpSourceSocketRangeStart=zyAclV2ClassifierIpSourceSocketRangeStart, zyAclV2ClassifierCountState=zyAclV2ClassifierCountState)
class Temperature: def __init__(self, kelvin=None, celsius=None, fahrenheit=None): values = [x for x in [kelvin, celsius, fahrenheit] if x] if len(values) < 1: raise ValueError('Need argument') if len(values) > 1: raise ValueError('Only one argument') if celsius is not None: self.kelvin = celsius + 273.15 elif fahrenheit is not None: self.kelvin = (fahrenheit - 32) * 5 / 9 + 273.15 else: self.kelvin = kelvin if self.kelvin < 0: raise ValueError('Temperature in Kelvin cannot be negative') def __str__(self): return f'Temperature = {self.kelvin} Kelvins'
class Temperature: def __init__(self, kelvin=None, celsius=None, fahrenheit=None): values = [x for x in [kelvin, celsius, fahrenheit] if x] if len(values) < 1: raise value_error('Need argument') if len(values) > 1: raise value_error('Only one argument') if celsius is not None: self.kelvin = celsius + 273.15 elif fahrenheit is not None: self.kelvin = (fahrenheit - 32) * 5 / 9 + 273.15 else: self.kelvin = kelvin if self.kelvin < 0: raise value_error('Temperature in Kelvin cannot be negative') def __str__(self): return f'Temperature = {self.kelvin} Kelvins'
class Solution: def coinChange(self, coins: List[int], amount: int) -> int: M = float('inf') # dynamic programming dp = [0] + [M] * amount for i in range(1, amount+1): dp[i] = 1 + min([dp[i-c] for c in coins if i >= c] or [M]) return dp[-1] if dp[-1] < M else -1
class Solution: def coin_change(self, coins: List[int], amount: int) -> int: m = float('inf') dp = [0] + [M] * amount for i in range(1, amount + 1): dp[i] = 1 + min([dp[i - c] for c in coins if i >= c] or [M]) return dp[-1] if dp[-1] < M else -1
def removeLoop(head): ptr = head ptr2 = head while True : if ptr is None or ptr2 is None or ptr2.next is None : return ptr = ptr.next ptr2 = ptr2.next.next if ptr is ptr2 : loopNode = ptr break ptr = loopNode.next count = 1 while ptr is not loopNode : ptr = ptr.next count += 1 ptr = head ptr1 = head ptr2 = head.next while count > 1 : ptr2 = ptr2.next ptr1 = ptr1.next count -= 1 while ptr is not ptr2 : ptr = ptr.next ptr2 = ptr2.next ptr1 = ptr1.next ptr1.next = None
def remove_loop(head): ptr = head ptr2 = head while True: if ptr is None or ptr2 is None or ptr2.next is None: return ptr = ptr.next ptr2 = ptr2.next.next if ptr is ptr2: loop_node = ptr break ptr = loopNode.next count = 1 while ptr is not loopNode: ptr = ptr.next count += 1 ptr = head ptr1 = head ptr2 = head.next while count > 1: ptr2 = ptr2.next ptr1 = ptr1.next count -= 1 while ptr is not ptr2: ptr = ptr.next ptr2 = ptr2.next ptr1 = ptr1.next ptr1.next = None
students = [] def read_file(): try: f = open("students.txt", "r") for student in read_students(f): students.append(student) f.close() except Exception: print("Could not read file") def read_students(f): for line in f: yield line read_file() print(students)
students = [] def read_file(): try: f = open('students.txt', 'r') for student in read_students(f): students.append(student) f.close() except Exception: print('Could not read file') def read_students(f): for line in f: yield line read_file() print(students)
def extended_euclidean_algorithm(a, b): # Initial s = 1 s = 1 list_s = [] list_t = [] # Algorithm while b > 0: # Find the remainder of a, b r = a % b if r > 0: # The t expression t = (r - (a * s)) // b list_t.append(t) list_s.append(s) # Use b to be the new a a = b if r > 0: # Use the remainder to be the new b b = r else: break # Find the coefficients s and t for i in range(len(list_t)): if i+1 < len(list_t): # Find the coefficient t t = list_t[0] + (list_t[(len(list_t)-1)] * s) # Find the coefficient s s = list_s[i] + list_t[i] * list_t[i+1] return t
def extended_euclidean_algorithm(a, b): s = 1 list_s = [] list_t = [] while b > 0: r = a % b if r > 0: t = (r - a * s) // b list_t.append(t) list_s.append(s) a = b if r > 0: b = r else: break for i in range(len(list_t)): if i + 1 < len(list_t): t = list_t[0] + list_t[len(list_t) - 1] * s s = list_s[i] + list_t[i] * list_t[i + 1] return t
WIDTH = 20 HEIGHT = 14 TITLE = 'Click Ninja' BACKGROUND = 'board' def destroy(s): sound('swoosh') if s.name == 'taco': score(50) else: score(5) # draw a splatting image at the center position of the image image('redsplat', center=s.event_pos, size=2).fade(1.0) s.fade(0.25) def failure(s): score(-20) if s.name == 'bomb': s.destroy() image('explode', center=s.center, size=10).pulse(0.05) if s.name == 'bomb' or score() < 0: sound('scream') text('You Survived %s seconds' % time(), MAROON) callback(gameover, 0.01) def spawn(): speed = randint(2, 10) size = randint(1,4) target = choice(['bananas', 'cherries', 'olives', 'ham', 'hotdog', 'fries','icee', 'pizza']) if randint(1, 4) == 2: target = 'bomb' if randint(1, 10) == 5: target = 'taco' sound('launch') arc = rand_arc() s = image(target, arc[0], size=size) if target == 'bomb': s.speed(speed).spin(1).clicked(failure) s.move_to(arc[1], arc[2], callback = s.destroy) elif target == 'taco': s.speed(5).spin().clicked(destroy) s.move_to((-10, -2), (-5, HEIGHT/2), (WIDTH+1, HEIGHT/2), callback = s.destroy) else: s.speed(speed).clicked(destroy) s.move_to(arc[1], arc[2], callback = lambda: failure(s)) callback(spawn, rand(0.1, 3)) score(color = PURPLE) callback(spawn, 1) keydown('r', reset)
width = 20 height = 14 title = 'Click Ninja' background = 'board' def destroy(s): sound('swoosh') if s.name == 'taco': score(50) else: score(5) image('redsplat', center=s.event_pos, size=2).fade(1.0) s.fade(0.25) def failure(s): score(-20) if s.name == 'bomb': s.destroy() image('explode', center=s.center, size=10).pulse(0.05) if s.name == 'bomb' or score() < 0: sound('scream') text('You Survived %s seconds' % time(), MAROON) callback(gameover, 0.01) def spawn(): speed = randint(2, 10) size = randint(1, 4) target = choice(['bananas', 'cherries', 'olives', 'ham', 'hotdog', 'fries', 'icee', 'pizza']) if randint(1, 4) == 2: target = 'bomb' if randint(1, 10) == 5: target = 'taco' sound('launch') arc = rand_arc() s = image(target, arc[0], size=size) if target == 'bomb': s.speed(speed).spin(1).clicked(failure) s.move_to(arc[1], arc[2], callback=s.destroy) elif target == 'taco': s.speed(5).spin().clicked(destroy) s.move_to((-10, -2), (-5, HEIGHT / 2), (WIDTH + 1, HEIGHT / 2), callback=s.destroy) else: s.speed(speed).clicked(destroy) s.move_to(arc[1], arc[2], callback=lambda : failure(s)) callback(spawn, rand(0.1, 3)) score(color=PURPLE) callback(spawn, 1) keydown('r', reset)
DEPTH = 3 # Action class Action: top = [1, 0, 0, 0] bottom = [0, 1, 0, 0] left = [0, 0, 1, 0] right = [0, 0, 0, 1] actlist = [(-1, 0), (1, 0), (0, -1), (0, 1)] mapAct = { actlist[0]: top, actlist[1]: bottom, actlist[2]: left, actlist[3]: right } def go(state, action, board_height, board_width): if action == (-1, 0): return ((state[0]+board_height-1) % board_height, state[1]) elif action == (1, 0): return ((state[0]+1) % board_height, state[1]) elif action == (0, 1): return (state[0], (state[1]+1) % board_width) elif action == (0, -1): return (state[0], (state[1]+board_width-1) % board_width) class GameState: obs = {} is_end = False def __init__(self, observation): self.obs = { 1: observation[1].copy(), 2: observation[2].copy(), 3: observation[3].copy(), 4: observation[4].copy(), 5: observation[5].copy(), 6: observation[6].copy(), 7: observation[7].copy(), 'board_width': observation['board_width'], 'board_height': observation['board_height'], } def generateSuccessor(self, index, action): successor = GameState(self.obs) index += 2 head = tuple(successor.obs[index][0]) tar = list(Action.go(head, action, self.obs['board_height'], self.obs['board_width'])) for i in range(1, 8): for cor in successor.obs[i]: if cor == tar: successor.is_end = True if i == 1: successor.obs[index].append(successor.obs[index][-1]) else: successor.obs[index].clear() successor.obs[index].insert(0, tar) successor.obs[index].pop() return successor def evaluationFunction(self): ans = 0 for i in range(2, 8): if i < 5: ans += len(self.obs[i]) else: ans -= len(self.obs[i]) return ans class MinimaxAgent: def __init__(self, obs): self.obs = obs def value(self, gameState, index, depth, a, b): index %= 6 if index == 0: return self.maxValue(gameState, index, depth + 1, a, b)[0] elif index < 3: return self.maxValue(gameState, index, depth, a, b)[0] else: return self.minValue(gameState, index, depth, a, b)[0] def maxValue(self, gameState, index, depth, a, b): if gameState.is_end or depth >= DEPTH: return [gameState.evaluationFunction(), None] v = -10000 ac = Action.actlist[0] for action in Action.actlist: next = gameState.generateSuccessor(index, action) value = self.value(next, index+1, depth, a, b) if value > v: v = value ac = action if v >= b: return [v, ac] a = max(a, v) return [v, ac] def minValue(self, gameState, index, depth, a, b): if gameState.is_end: return [gameState.evaluationFunction(), None] v = 10000 ac = Action.actlist[0] for action in Action.actlist: next = gameState.generateSuccessor(index, action) value = self.value(next, index+1, depth, a, b) if value < v: v = value ac = action if v <= a: return [v, ac] b = min(b, v) return [v, ac] def get_action(self, index): return self.maxValue(GameState(self.obs), index-2, 0, -10000, 10000)[1] def my_controller(observation, action_space, is_act_continuous=False): ac = Action.mapAct[MinimaxAgent(observation).get_action(observation['controlled_snake_index'])] return [ac]
depth = 3 class Action: top = [1, 0, 0, 0] bottom = [0, 1, 0, 0] left = [0, 0, 1, 0] right = [0, 0, 0, 1] actlist = [(-1, 0), (1, 0), (0, -1), (0, 1)] map_act = {actlist[0]: top, actlist[1]: bottom, actlist[2]: left, actlist[3]: right} def go(state, action, board_height, board_width): if action == (-1, 0): return ((state[0] + board_height - 1) % board_height, state[1]) elif action == (1, 0): return ((state[0] + 1) % board_height, state[1]) elif action == (0, 1): return (state[0], (state[1] + 1) % board_width) elif action == (0, -1): return (state[0], (state[1] + board_width - 1) % board_width) class Gamestate: obs = {} is_end = False def __init__(self, observation): self.obs = {1: observation[1].copy(), 2: observation[2].copy(), 3: observation[3].copy(), 4: observation[4].copy(), 5: observation[5].copy(), 6: observation[6].copy(), 7: observation[7].copy(), 'board_width': observation['board_width'], 'board_height': observation['board_height']} def generate_successor(self, index, action): successor = game_state(self.obs) index += 2 head = tuple(successor.obs[index][0]) tar = list(Action.go(head, action, self.obs['board_height'], self.obs['board_width'])) for i in range(1, 8): for cor in successor.obs[i]: if cor == tar: successor.is_end = True if i == 1: successor.obs[index].append(successor.obs[index][-1]) else: successor.obs[index].clear() successor.obs[index].insert(0, tar) successor.obs[index].pop() return successor def evaluation_function(self): ans = 0 for i in range(2, 8): if i < 5: ans += len(self.obs[i]) else: ans -= len(self.obs[i]) return ans class Minimaxagent: def __init__(self, obs): self.obs = obs def value(self, gameState, index, depth, a, b): index %= 6 if index == 0: return self.maxValue(gameState, index, depth + 1, a, b)[0] elif index < 3: return self.maxValue(gameState, index, depth, a, b)[0] else: return self.minValue(gameState, index, depth, a, b)[0] def max_value(self, gameState, index, depth, a, b): if gameState.is_end or depth >= DEPTH: return [gameState.evaluationFunction(), None] v = -10000 ac = Action.actlist[0] for action in Action.actlist: next = gameState.generateSuccessor(index, action) value = self.value(next, index + 1, depth, a, b) if value > v: v = value ac = action if v >= b: return [v, ac] a = max(a, v) return [v, ac] def min_value(self, gameState, index, depth, a, b): if gameState.is_end: return [gameState.evaluationFunction(), None] v = 10000 ac = Action.actlist[0] for action in Action.actlist: next = gameState.generateSuccessor(index, action) value = self.value(next, index + 1, depth, a, b) if value < v: v = value ac = action if v <= a: return [v, ac] b = min(b, v) return [v, ac] def get_action(self, index): return self.maxValue(game_state(self.obs), index - 2, 0, -10000, 10000)[1] def my_controller(observation, action_space, is_act_continuous=False): ac = Action.mapAct[minimax_agent(observation).get_action(observation['controlled_snake_index'])] return [ac]
def read_csv(root, file_name, keys): with open('{root}private_static/csv/{file_name}.csv'.format(root=root, file_name=file_name)) as file: data = file.read() lines = data.split("\n") return [dict(zip(keys, line.split(','))) for i, line in enumerate(lines) if i != 0]
def read_csv(root, file_name, keys): with open('{root}private_static/csv/{file_name}.csv'.format(root=root, file_name=file_name)) as file: data = file.read() lines = data.split('\n') return [dict(zip(keys, line.split(','))) for (i, line) in enumerate(lines) if i != 0]
# -*- coding: utf-8 -*- ''' Copyright 2012 Rodrigo Pinheiro Matias <rodrigopmatias@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ''' templates = { 'static_link': ''' \t@$(AR) rcs %(lib)s %(obj)s \t@echo " [\033[33m\033[1mAR\033[0m] - \033[37m\033[1m%(obj)s\033[0m to \033[37m\033[1m%(lib)s\033[0m"''', 'c_obj_ruler': '''%(obj)s: %(source)s \t@$(CC) $(CFLAGS) $(INCLUDE) -c %(source)s -o %(obj)s 1>> compile.log 2>> compile.err \t@echo " [\033[33m\033[1mCC\033[0m] - \033[37m\033[1m%(source)s\033[0m"''', 'asm_obj_ruler': '''%(obj)s: %(source)s \t@$(AS) $(ASFLAGS) -o %(obj)s %(source)s 1>> compile.log 2>> compile.err \t@echo " [\033[33m\033[1mAS\033[0m] - \033[37m\033[1m%(source)s\033[0m"''', 'c_asm_ruler': '''%(obj)s: %(source)s \t@$(CC) $(CFLAGS) $(INCLUDE) -c %(source)s -S -o %(obj)s 1>> compile.log 2>> compile.err \t@echo " [\033[33m\033[1mCC\033[0m] - \033[37m\033[1m%(source)s\033[0m"''', 'cxx_obj_ruler': '''%(obj)s: %(source)s \t@$(CXX) $(CXXFLAGS) $(INCLUDE) -c %(source)s -o %(obj)s 1>> compile.log 2>> compile.err \t@echo " [\033[33m\033[1mCXX\033[0m] - \033[37m\033[1m%(source)s\033[0m"''', 'cxx_asm_ruler': '''%(obj)s: %(source)s \t@$(CXX) $(CXXFLAGS) $(INCLUDE) -c %(source)s -S -o %(obj)s 1>> compile.log 2>> compile.err \t@echo " [\033[33m\033[1mCXX\033[0m] - \033[37m\033[1m%(source)s\033[0m"''', 'avr-main.cc': '''/** * Generated with sketch %(version)s **/ #include <avr/sleep.h> int main(void) { for(;;) sleep_mode(); return 0; }''', 'main.cc': '''/** * Generated with sketch %(version)s **/ #include <Arduino.h> /** * Setup of the firmware **/ void setup() { } /** * Schedule events for firmware program **/ void loop() { delay(250); }''', 'Makefile': '''########################################## # Makefile generated with sketch %(version)s ########################################## # Defines of Arduino ARDUINO_HOME=%(sdk_home)s ARDUINO_CORE=$(ARDUINO_HOME)/hardware/arduino/cores ARDUINO_VARIANT=$(ARDUINO_HOME)/hardware/arduino/variants/%(variant)s # Define toolchain CC=%(cc)s CXX=%(cxx)s AS=%(asm)s LD=%(ld)s AR=%(ar)s OBJCOPY=%(objcopy)s SIZE=%(size)s AVRDUDE=%(avrdude)s PROGRAMER=%(programer)s LIB= INCLUDE=-I$(ARDUINO_CORE)/arduino -I$(ARDUINO_VARIANT) -I$(ARDUINO_CORE) -I lib/ #Define of MCU MCU=%(mcu)s CLOCK=%(clock_hz)sUL ARDUINO=%(sdk_version)s # Define compiler flags _CFLAGS=-Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=$(MCU) \\ -DF_CPU=$(CLOCK) -MMD -DARDUINO=$(ARDUINO) \\ -fpermissive -lm -Wl,-u,vfprintf -lprintf_min CFLAGS=$(_CFLAGS) -std=c99 CXXFLAGS=$(_CFLAGS) -std=c++98 ASFLAGS=-mmcu $(MCU) # Define compiler rulers OBJ=%(obj_dep)s CORE_OBJ=%(core_obj_dep)s AOUT=binary/%(project_name)s-%(mcu)s.elf HEX=binary/%(project_name)s-%(mcu)s.hex EPP=binary/%(project_name)s-%(mcu)s.epp CORE_LIB=binary/core.a LIB_DEPS=%(lib_deps)s LD_FLAGS=-Os -Wl,--gc-sections -mmcu=$(MCU) -lm AVRDUDE_OPTIONS = -p$(MCU) -c$(PROGRAMER) %(pgrextra)s -Uflash:w:$(HEX):i SIZE_OPTS=-C --mcu=$(MCU) CONFIG_EXISTS=$(shell [ -e "Makefile.config" ] && echo 1 || echo 0) ifeq ($(CONFIG_EXISTS), 1) include Makefile.config endif all: $(HEX) $(EPP) rebuild: clean all deploy: $(HEX) \t$(AVRDUDE) $(AVRDUDE_OPTIONS) $(HEX): $(EPP) \t@echo " [\033[33m\033[1mOBJCOPY\033[0m] - \033[37m\033[1mFirmware\033[0m" \t@$(OBJCOPY) -O ihex -R .eeprom $(AOUT) $(HEX) $(EPP): $(AOUT) \t@echo " [\033[33m\033[1mOBJCOPY\033[0m] - \033[37m\033[1mMemory of EEPROM\033[0m" \t@$(OBJCOPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $(AOUT) $(EPP) size: $(AOUT) \t@$(SIZE) $(SIZE_OPTS) $(AOUT) $(AOUT): clear-compiler $(OBJ) $(CORE_LIB) $(LIB_DEPS) \t@echo " [\033[33m\033[1mLD\033[0m] - \033[37m\033[1m$(AOUT)\033[0m" \t@$(CXX) $(LD_FLAGS) $(LIB) $(OBJ) $(CORE_LIB) $(LIB_DEPS) -o $(AOUT) $(CORE_LIB): $(CORE_OBJ)%(core_ruler)s %(asm_rulers)s %(obj_rulers)s %(libs_rulers)s %(core_asm_rulers)s %(core_obj_rulers)s clear-compiler: \t@echo " [\033[33m\033[1mRM\033[0m] - Clear compiler logs" \trm -f compile.* clean-tmp: \t@echo " [\033[33m\033[1mRM\033[0m] - Clear temporary files" \t@rm -f tmp/* clean-bin: \t@echo " [\033[33m\033[1mRM\033[0m] - Clear binary files" \t@rm -f binary/* clean: \t@echo " [\033[33m\033[1mRM\033[0m] - Clear temporary files" \t@rm -f tmp/* \t@echo " [\033[33m\033[1mRM\033[0m] - Clear binary files" \t@rm -f binary/* ''', 'avr-Makefile': '''########################################## # Makefile generated with sketch %(version)s ########################################## # Define toolchain CC=%(cc)s CXX=%(cxx)s AS=%(asm)s LD=%(ld)s AR=%(ar)s OBJCOPY=%(objcopy)s SIZE=%(size)s AVRDUDE=%(avrdude)s PROGRAMER=%(programer)s LIB= INCLUDE=-I lib/ #Define of MCU MCU=%(mcu)s CLOCK=%(clock_hz)sUL # Define compiler flags _CFLAGS=-Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=$(MCU) \\ -DF_CPU=$(CLOCK) -fpermissive -lm -Wl,-u,vfprintf -lprintf_min CFLAGS=$(_CFLAGS) -std=c99 CXXFLAGS=$(_CFLAGS) -std=c++98 ASFLAGS=-mmcu $(MCU) # Define compiler rulers ASM=%(asm_dep)s OBJ=%(obj_dep)s LIB_DEPS=%(lib_deps)s AOUT=binary/%(project_name)s-%(mcu)s.elf HEX=binary/%(project_name)s-%(mcu)s.hex EPP=binary/%(project_name)s-%(mcu)s.epp LD_FLAGS=-Os -Wl,--gc-sections -mmcu=$(MCU) -lm AVRDUDE_OPTIONS = -p$(MCU) -c$(PROGRAMER) %(pgrextra)s -Uflash:w:$(HEX):i SIZE_OPTS=-A CONFIG_EXISTS=$(shell [ -e "Makefile.config" ] && echo 1 || echo 0) ifeq ($(CONFIG_EXISTS), 1) include Makefile.config endif all: $(HEX) $(EPP) rebuild: clean all deploy: $(HEX) \t$(AVRDUDE) $(AVRDUDE_OPTIONS) $(HEX): $(EPP) \t@echo " [\033[33m\033[1mOBJCOPY\033[0m] - \033[37m\033[1mFirmware\033[0m" \t@$(OBJCOPY) -O ihex -R .eeprom $(AOUT) $(HEX) $(EPP): $(AOUT) \t@echo " [\033[33m\033[1mOBJCOPY\033[0m] - \033[37m\033[1mMemory of EEPROM\033[0m" \t@$(OBJCOPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $(AOUT) $(EPP) size: $(AOUT) \t@$(SIZE) $(SIZE_OPTS) $(AOUT) $(AOUT): clear-compiler $(OBJ) $(LIB_DEPS) \t@echo " [\033[33m\033[1mLD\033[0m] - \033[37m\033[1m$(AOUT)\033[0m" \t@$(CXX) $(LD_FLAGS) $(LIB) $(OBJ) $(LIB_DEPS) -o $(AOUT) %(asm_rulers)s %(obj_rulers)s %(libs_rulers)s clear-compiler: \t@echo " [\033[33m\033[1mRM\033[0m] - Clear compiler logs" \t@rm -f compile.* clean-tmp: \t@echo " [\033[33m\033[1mRM\033[0m] - Clear temporary files" \t@rm -f tmp/* clean-bin: \t@echo " [\033[33m\033[1mRM\033[0m] - Clear binary files" \t@rm -f binary/* clean: \t@echo " [\033[33m\033[1mRM\033[0m] - Clear temporary files" \t@rm -f tmp/* \t@echo " [\033[33m\033[1mRM\033[0m] - Clear binary files" \t@rm -f binary/* ''' }
""" Copyright 2012 Rodrigo Pinheiro Matias <rodrigopmatias@gmail.com> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ templates = {'static_link': '\n\t@$(AR) rcs %(lib)s %(obj)s\n\t@echo " [\x1b[33m\x1b[1mAR\x1b[0m] - \x1b[37m\x1b[1m%(obj)s\x1b[0m to \x1b[37m\x1b[1m%(lib)s\x1b[0m"', 'c_obj_ruler': '%(obj)s: %(source)s\n\t@$(CC) $(CFLAGS) $(INCLUDE) -c %(source)s -o %(obj)s 1>> compile.log 2>> compile.err\n\t@echo " [\x1b[33m\x1b[1mCC\x1b[0m] - \x1b[37m\x1b[1m%(source)s\x1b[0m"', 'asm_obj_ruler': '%(obj)s: %(source)s\n\t@$(AS) $(ASFLAGS) -o %(obj)s %(source)s 1>> compile.log 2>> compile.err\n\t@echo " [\x1b[33m\x1b[1mAS\x1b[0m] - \x1b[37m\x1b[1m%(source)s\x1b[0m"', 'c_asm_ruler': '%(obj)s: %(source)s\n\t@$(CC) $(CFLAGS) $(INCLUDE) -c %(source)s -S -o %(obj)s 1>> compile.log 2>> compile.err\n\t@echo " [\x1b[33m\x1b[1mCC\x1b[0m] - \x1b[37m\x1b[1m%(source)s\x1b[0m"', 'cxx_obj_ruler': '%(obj)s: %(source)s\n\t@$(CXX) $(CXXFLAGS) $(INCLUDE) -c %(source)s -o %(obj)s 1>> compile.log 2>> compile.err\n\t@echo " [\x1b[33m\x1b[1mCXX\x1b[0m] - \x1b[37m\x1b[1m%(source)s\x1b[0m"', 'cxx_asm_ruler': '%(obj)s: %(source)s\n\t@$(CXX) $(CXXFLAGS) $(INCLUDE) -c %(source)s -S -o %(obj)s 1>> compile.log 2>> compile.err\n\t@echo " [\x1b[33m\x1b[1mCXX\x1b[0m] - \x1b[37m\x1b[1m%(source)s\x1b[0m"', 'avr-main.cc': '/**\n * Generated with sketch %(version)s\n **/\n#include <avr/sleep.h>\n\nint main(void) {\n for(;;)\n sleep_mode();\n\n return 0;\n}', 'main.cc': '/**\n * Generated with sketch %(version)s\n **/\n#include <Arduino.h>\n\n/**\n * Setup of the firmware\n **/\nvoid setup() {\n}\n\n/**\n * Schedule events for firmware program\n **/\nvoid loop() {\n delay(250);\n}', 'Makefile': '##########################################\n# Makefile generated with sketch %(version)s\n##########################################\n\n# Defines of Arduino\nARDUINO_HOME=%(sdk_home)s\nARDUINO_CORE=$(ARDUINO_HOME)/hardware/arduino/cores\nARDUINO_VARIANT=$(ARDUINO_HOME)/hardware/arduino/variants/%(variant)s\n\n# Define toolchain\nCC=%(cc)s\nCXX=%(cxx)s\nAS=%(asm)s\nLD=%(ld)s\nAR=%(ar)s\nOBJCOPY=%(objcopy)s\nSIZE=%(size)s\nAVRDUDE=%(avrdude)s\nPROGRAMER=%(programer)s\nLIB=\nINCLUDE=-I$(ARDUINO_CORE)/arduino -I$(ARDUINO_VARIANT) -I$(ARDUINO_CORE) -I lib/\n\n#Define of MCU\nMCU=%(mcu)s\nCLOCK=%(clock_hz)sUL\nARDUINO=%(sdk_version)s\n\n# Define compiler flags\n_CFLAGS=-Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=$(MCU) \\\n -DF_CPU=$(CLOCK) -MMD -DARDUINO=$(ARDUINO) \\\n -fpermissive -lm -Wl,-u,vfprintf -lprintf_min\nCFLAGS=$(_CFLAGS) -std=c99\nCXXFLAGS=$(_CFLAGS) -std=c++98\nASFLAGS=-mmcu $(MCU)\n\n# Define compiler rulers\nOBJ=%(obj_dep)s\nCORE_OBJ=%(core_obj_dep)s\nAOUT=binary/%(project_name)s-%(mcu)s.elf\nHEX=binary/%(project_name)s-%(mcu)s.hex\nEPP=binary/%(project_name)s-%(mcu)s.epp\nCORE_LIB=binary/core.a\nLIB_DEPS=%(lib_deps)s\nLD_FLAGS=-Os -Wl,--gc-sections -mmcu=$(MCU) -lm\n\nAVRDUDE_OPTIONS = -p$(MCU) -c$(PROGRAMER) %(pgrextra)s -Uflash:w:$(HEX):i\n\nSIZE_OPTS=-C --mcu=$(MCU)\n\nCONFIG_EXISTS=$(shell [ -e "Makefile.config" ] && echo 1 || echo 0)\n\nifeq ($(CONFIG_EXISTS), 1)\n include Makefile.config\nendif\n\nall: $(HEX) $(EPP)\n\nrebuild: clean all\n\ndeploy: $(HEX)\n\t$(AVRDUDE) $(AVRDUDE_OPTIONS)\n\n$(HEX): $(EPP)\n\t@echo " [\x1b[33m\x1b[1mOBJCOPY\x1b[0m] - \x1b[37m\x1b[1mFirmware\x1b[0m"\n\t@$(OBJCOPY) -O ihex -R .eeprom $(AOUT) $(HEX)\n\n$(EPP): $(AOUT)\n\t@echo " [\x1b[33m\x1b[1mOBJCOPY\x1b[0m] - \x1b[37m\x1b[1mMemory of EEPROM\x1b[0m"\n\t@$(OBJCOPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $(AOUT) $(EPP)\n\nsize: $(AOUT)\n\t@$(SIZE) $(SIZE_OPTS) $(AOUT)\n\n$(AOUT): clear-compiler $(OBJ) $(CORE_LIB) $(LIB_DEPS)\n\t@echo " [\x1b[33m\x1b[1mLD\x1b[0m] - \x1b[37m\x1b[1m$(AOUT)\x1b[0m"\n\t@$(CXX) $(LD_FLAGS) $(LIB) $(OBJ) $(CORE_LIB) $(LIB_DEPS) -o $(AOUT)\n\n$(CORE_LIB): $(CORE_OBJ)%(core_ruler)s\n\n%(asm_rulers)s\n\n%(obj_rulers)s\n\n%(libs_rulers)s\n\n%(core_asm_rulers)s\n\n%(core_obj_rulers)s\n\nclear-compiler:\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear compiler logs"\n\trm -f compile.*\n\nclean-tmp:\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear temporary files"\n\t@rm -f tmp/*\n\nclean-bin:\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear binary files"\n\t@rm -f binary/*\n\nclean:\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear temporary files"\n\t@rm -f tmp/*\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear binary files"\n\t@rm -f binary/*\n', 'avr-Makefile': '##########################################\n# Makefile generated with sketch %(version)s\n##########################################\n\n# Define toolchain\nCC=%(cc)s\nCXX=%(cxx)s\nAS=%(asm)s\nLD=%(ld)s\nAR=%(ar)s\nOBJCOPY=%(objcopy)s\nSIZE=%(size)s\nAVRDUDE=%(avrdude)s\nPROGRAMER=%(programer)s\nLIB=\nINCLUDE=-I lib/\n\n#Define of MCU\nMCU=%(mcu)s\nCLOCK=%(clock_hz)sUL\n\n# Define compiler flags\n_CFLAGS=-Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=$(MCU) \\\n -DF_CPU=$(CLOCK) -fpermissive -lm -Wl,-u,vfprintf -lprintf_min\nCFLAGS=$(_CFLAGS) -std=c99\nCXXFLAGS=$(_CFLAGS) -std=c++98\nASFLAGS=-mmcu $(MCU)\n\n# Define compiler rulers\nASM=%(asm_dep)s\nOBJ=%(obj_dep)s\nLIB_DEPS=%(lib_deps)s\nAOUT=binary/%(project_name)s-%(mcu)s.elf\nHEX=binary/%(project_name)s-%(mcu)s.hex\nEPP=binary/%(project_name)s-%(mcu)s.epp\nLD_FLAGS=-Os -Wl,--gc-sections -mmcu=$(MCU) -lm\n\nAVRDUDE_OPTIONS = -p$(MCU) -c$(PROGRAMER) %(pgrextra)s -Uflash:w:$(HEX):i\n\nSIZE_OPTS=-A\n\nCONFIG_EXISTS=$(shell [ -e "Makefile.config" ] && echo 1 || echo 0)\n\nifeq ($(CONFIG_EXISTS), 1)\n include Makefile.config\nendif\n\nall: $(HEX) $(EPP)\n\nrebuild: clean all\n\ndeploy: $(HEX)\n\t$(AVRDUDE) $(AVRDUDE_OPTIONS)\n\n$(HEX): $(EPP)\n\t@echo " [\x1b[33m\x1b[1mOBJCOPY\x1b[0m] - \x1b[37m\x1b[1mFirmware\x1b[0m"\n\t@$(OBJCOPY) -O ihex -R .eeprom $(AOUT) $(HEX)\n\n$(EPP): $(AOUT)\n\t@echo " [\x1b[33m\x1b[1mOBJCOPY\x1b[0m] - \x1b[37m\x1b[1mMemory of EEPROM\x1b[0m"\n\t@$(OBJCOPY) -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 $(AOUT) $(EPP)\n\nsize: $(AOUT)\n\t@$(SIZE) $(SIZE_OPTS) $(AOUT)\n\n$(AOUT): clear-compiler $(OBJ) $(LIB_DEPS)\n\t@echo " [\x1b[33m\x1b[1mLD\x1b[0m] - \x1b[37m\x1b[1m$(AOUT)\x1b[0m"\n\t@$(CXX) $(LD_FLAGS) $(LIB) $(OBJ) $(LIB_DEPS) -o $(AOUT)\n\n%(asm_rulers)s\n\n%(obj_rulers)s\n\n%(libs_rulers)s\n\nclear-compiler:\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear compiler logs"\n\t@rm -f compile.*\n\nclean-tmp:\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear temporary files"\n\t@rm -f tmp/*\n\nclean-bin:\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear binary files"\n\t@rm -f binary/*\n\nclean:\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear temporary files"\n\t@rm -f tmp/*\n\t@echo " [\x1b[33m\x1b[1mRM\x1b[0m] - Clear binary files"\n\t@rm -f binary/*\n'}
def main(): # input A = input() # compute # output if A == 'a': print(-1) else: print('a') if __name__ == '__main__': main()
def main(): a = input() if A == 'a': print(-1) else: print('a') if __name__ == '__main__': main()
## mv to //:WORKSPACE.bzl ocaml_configure load("//ocaml/_bootstrap:ocaml.bzl", _ocaml_configure = "ocaml_configure") # load("//ocaml/_bootstrap:obazl.bzl", _obazl_configure = "obazl_configure") load("//ocaml/_rules:ocaml_repository.bzl" , _ocaml_repository = "ocaml_repository") # load("//ocaml/_rules:opam_configuration.bzl" , _opam_configuration = "opam_configuration") # load("//ocaml/_toolchains:ocaml_toolchains.bzl", # _ocaml_toolchain = "ocaml_toolchain", # _ocaml_register_toolchains = "ocaml_register_toolchains") # obazl_configure = _obazl_configure ocaml_configure = _ocaml_configure ocaml_repository = _ocaml_repository # ocaml_toolchain = _ocaml_toolchain # ocaml_register_toolchains = _ocaml_register_toolchains
load('//ocaml/_bootstrap:ocaml.bzl', _ocaml_configure='ocaml_configure') load('//ocaml/_rules:ocaml_repository.bzl', _ocaml_repository='ocaml_repository') ocaml_configure = _ocaml_configure ocaml_repository = _ocaml_repository
class AthenaError(Exception): """base class for all athena exceptions""" pass class AthenaMongoError(AthenaError): """Class for all mongo related errors""" pass
class Athenaerror(Exception): """base class for all athena exceptions""" pass class Athenamongoerror(AthenaError): """Class for all mongo related errors""" pass
class MetricsService: def __init__(self, adc_data, metrics_data): self._adc_data = adc_data self._metrics_data = metrics_data @property def metrics_data(self): return self._metrics_data def update(self): self._metrics_data.is_new_data_available = False if self._adc_data.is_new_data_available: self._metrics_data.update(self._adc_data.trace) self._metrics_data.is_new_data_available = True
class Metricsservice: def __init__(self, adc_data, metrics_data): self._adc_data = adc_data self._metrics_data = metrics_data @property def metrics_data(self): return self._metrics_data def update(self): self._metrics_data.is_new_data_available = False if self._adc_data.is_new_data_available: self._metrics_data.update(self._adc_data.trace) self._metrics_data.is_new_data_available = True
#sum(iterable, start=0, /) #Return the sum of a 'start' value (default: 0) plus an iterable of numbers #When the iterable is empty, return the start value. '''This function is intended specifically for use with numeric values and may reject non-numeric types.''' a = [1,3,5,7,9,4,6,2,8] print(sum(a)) print(sum(a,start = 4))
"""This function is intended specifically for use with numeric values and may reject non-numeric types.""" a = [1, 3, 5, 7, 9, 4, 6, 2, 8] print(sum(a)) print(sum(a, start=4))
def find_accounts(search_text): # perform search... if not db_is_available: return None # returns a list of account IDs return db_search(search_text) accounts = find_accounts('python') if accounts is None: print("Error: DB not available") else: print("Accounts found: Would list them here...") def db_search(search_text): return [1, 11] db_is_availble = True
def find_accounts(search_text): if not db_is_available: return None return db_search(search_text) accounts = find_accounts('python') if accounts is None: print('Error: DB not available') else: print('Accounts found: Would list them here...') def db_search(search_text): return [1, 11] db_is_availble = True
fruits = ["orange", "banana", "apple", "avocado", "kiwi", "apricot", "cherry", "grape", "coconut", "lemon", "mango", "peach", "pear", "strawberry", "pineapple", "apple", "orange", "pear", "grape", "banana" ] filters = dict() for key in fruits: filters[key] = 1 result = set(filters.keys()) print(result)
fruits = ['orange', 'banana', 'apple', 'avocado', 'kiwi', 'apricot', 'cherry', 'grape', 'coconut', 'lemon', 'mango', 'peach', 'pear', 'strawberry', 'pineapple', 'apple', 'orange', 'pear', 'grape', 'banana'] filters = dict() for key in fruits: filters[key] = 1 result = set(filters.keys()) print(result)
#module.py def hello(): print("Hello!") #if __name__=="__main__": # print(__name__)
def hello(): print('Hello!')
class IOEngine(object): def __init__(self, node): self.node = node self.inputs = [] self.outputs = [] def release(self): self.inputs = None self.outputs = None self.node = None def updateInputs(self, names): # remove prior outputs for inputNode in self.inputs: if not inputNode in names: if self.node.model.existNode(inputNode): self.node.model.getNode(inputNode).ioEngine.removeOutput( self.node.identifier) newInputs = [] for nodeId in names: if self.node.model.existNode(nodeId): newInputs.append(nodeId) if not nodeId in self.inputs: self.node.model.getNode(nodeId).ioEngine.addOutput( self.node.identifier) self.inputs = newInputs def removeOutput(self, nodeId): if nodeId in self.outputs: self.outputs.remove(nodeId) def removeInput(self, nodeId): if nodeId in self.inputs: self.inputs.remove(nodeId) def addOutput(self, nodeId): self.outputs.append(nodeId) def updateNodeId(self, oldId, newId): for inputNode in self.inputs: if self.node.model.existNode(inputNode): self.node.model.getNode( inputNode).ioEngine.updateOutputId(oldId, newId) for outputNode in self.outputs: if self.node.model.existNode(outputNode): self.node.model.getNode( outputNode).ioEngine.updateInputId(oldId, newId) def updateOnDeleteNode(self): for inputNode in self.inputs: if self.node.model.existNode(inputNode): self.node.model.getNode(inputNode).ioEngine.removeOutput( self.node.identifier) for outputNode in self.outputs: if self.node.model.existNode(outputNode): self.node.model.getNode(outputNode).ioEngine.removeInput( self.node.identifier) def updateOutputId(self, oldId, newId): if oldId in self.outputs: self.outputs.remove(oldId) self.outputs.append(newId) def updateInputId(self, oldId, newId): if oldId in self.inputs: self.inputs.remove(oldId) self.inputs.append(newId) self.node.updateDefinitionForChangeId(oldId, newId)
class Ioengine(object): def __init__(self, node): self.node = node self.inputs = [] self.outputs = [] def release(self): self.inputs = None self.outputs = None self.node = None def update_inputs(self, names): for input_node in self.inputs: if not inputNode in names: if self.node.model.existNode(inputNode): self.node.model.getNode(inputNode).ioEngine.removeOutput(self.node.identifier) new_inputs = [] for node_id in names: if self.node.model.existNode(nodeId): newInputs.append(nodeId) if not nodeId in self.inputs: self.node.model.getNode(nodeId).ioEngine.addOutput(self.node.identifier) self.inputs = newInputs def remove_output(self, nodeId): if nodeId in self.outputs: self.outputs.remove(nodeId) def remove_input(self, nodeId): if nodeId in self.inputs: self.inputs.remove(nodeId) def add_output(self, nodeId): self.outputs.append(nodeId) def update_node_id(self, oldId, newId): for input_node in self.inputs: if self.node.model.existNode(inputNode): self.node.model.getNode(inputNode).ioEngine.updateOutputId(oldId, newId) for output_node in self.outputs: if self.node.model.existNode(outputNode): self.node.model.getNode(outputNode).ioEngine.updateInputId(oldId, newId) def update_on_delete_node(self): for input_node in self.inputs: if self.node.model.existNode(inputNode): self.node.model.getNode(inputNode).ioEngine.removeOutput(self.node.identifier) for output_node in self.outputs: if self.node.model.existNode(outputNode): self.node.model.getNode(outputNode).ioEngine.removeInput(self.node.identifier) def update_output_id(self, oldId, newId): if oldId in self.outputs: self.outputs.remove(oldId) self.outputs.append(newId) def update_input_id(self, oldId, newId): if oldId in self.inputs: self.inputs.remove(oldId) self.inputs.append(newId) self.node.updateDefinitionForChangeId(oldId, newId)
class Node: def __init__(self,value): self.value=value self.left=None self.right=None class Binary_Tree: def __init__(self): self.root = None def pre_order(self): """ root-left-right """ try: self.values=[] if self.root == None: return "Tree is Empty" def tree(node): self.values+=[node.value] if node.left: tree(node.left) if node.right: tree(node.right) return self.values return tree(self.root) except: return "Error" def in_order(self): """ left-node-right""" try: self.values=[] if not self.root: return "Tree is Empty" def tree(node): if node.left: tree(node.left) self.values+=[node.value] if node.right: tree(node.right) return self.values return tree(self.root) except: return "Error" def post_order(self): """ left-right-node""" try: self.values=[] if not self.root: return "Tree is Empty" def tree(node): if node.left: tree(node.left) if node.right: tree(node.right) self.values+=[node.value] return self.values return tree(self.root) except: return "Error" def max(self): if not self.root: return "Tree is Empty" self.max=self.root.value def tree(node): if node.value>self.max: self.max=node.value if node.left: tree(node.left) if node.right: tree(node.right) return self.max return tree(self.root) class Binary_Search_Tree(Binary_Tree): def add(self,value): '''add value to binery tree ''' if self.root == None: self.root = Node(value) else: current=self.root while current: if value < current.value : if current.left == None: current.left = Node(value) break current = current.left else: if current.right == None: current.right = Node(value) break current = current.right def Contains(self,value): if self.root==None: return 'Tree is Empty' else: current=self.root while current: if current.value==value: return True elif value < current.value : if current.left == None: return False current = current.left else: if current.right == None: return False current = current.right
class Node: def __init__(self, value): self.value = value self.left = None self.right = None class Binary_Tree: def __init__(self): self.root = None def pre_order(self): """ root-left-right """ try: self.values = [] if self.root == None: return 'Tree is Empty' def tree(node): self.values += [node.value] if node.left: tree(node.left) if node.right: tree(node.right) return self.values return tree(self.root) except: return 'Error' def in_order(self): """ left-node-right""" try: self.values = [] if not self.root: return 'Tree is Empty' def tree(node): if node.left: tree(node.left) self.values += [node.value] if node.right: tree(node.right) return self.values return tree(self.root) except: return 'Error' def post_order(self): """ left-right-node""" try: self.values = [] if not self.root: return 'Tree is Empty' def tree(node): if node.left: tree(node.left) if node.right: tree(node.right) self.values += [node.value] return self.values return tree(self.root) except: return 'Error' def max(self): if not self.root: return 'Tree is Empty' self.max = self.root.value def tree(node): if node.value > self.max: self.max = node.value if node.left: tree(node.left) if node.right: tree(node.right) return self.max return tree(self.root) class Binary_Search_Tree(Binary_Tree): def add(self, value): """add value to binery tree """ if self.root == None: self.root = node(value) else: current = self.root while current: if value < current.value: if current.left == None: current.left = node(value) break current = current.left else: if current.right == None: current.right = node(value) break current = current.right def contains(self, value): if self.root == None: return 'Tree is Empty' else: current = self.root while current: if current.value == value: return True elif value < current.value: if current.left == None: return False current = current.left else: if current.right == None: return False current = current.right
# # Copyright (C) 2018 The Android Open Source Project # # 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. # model = Model() i1 = Input("op1", "TENSOR_FLOAT32", "{1, 3, 3, 2}") f1 = Input("op2", "TENSOR_FLOAT32", "{1, 2, 2, 4}") b1 = Input("op3", "TENSOR_FLOAT32", "{4}") pad0 = Int32Scalar("pad0", 0) act = Int32Scalar("act", 0) stride = Int32Scalar("stride", 1) cm = Int32Scalar("channelMultiplier", 2) output = Output("op4", "TENSOR_FLOAT32", "{1, 2, 2, 4}") model = model.Operation("DEPTHWISE_CONV_2D", i1, f1, b1, pad0, pad0, pad0, pad0, stride, stride, cm, act).To(output) model = model.RelaxedExecution(True) # Example 1. Input in operand 0, input0 = {i1: # input 0 [10, 21, 10, 22, 10, 23, 10, 24, 10, 25, 10, 26, 10, 27, 10, 28, 10, 29], f1: [.25, 0, .2, 0, .25, 0, 0, .3, .25, 0, 0, 0, .25, .1, 0, 0], b1: [1, 2, 3, 4]} # (i1 (conv) f1) + b1 # filter usage: # in_ch1 * f_1 --> output_d1 # in_ch1 * f_2 --> output_d2 # in_ch2 * f_3 --> output_d3 # in_ch3 * f_4 --> output_d4 output0 = {output: # output 0 [11, 3, 7.2, 10.6, 11, 3, 7.4, 10.9, 11, 3, 7.8, 11.5, 11, 3, 8.0, 11.8]} # Instantiate an example Example((input0, output0))
model = model() i1 = input('op1', 'TENSOR_FLOAT32', '{1, 3, 3, 2}') f1 = input('op2', 'TENSOR_FLOAT32', '{1, 2, 2, 4}') b1 = input('op3', 'TENSOR_FLOAT32', '{4}') pad0 = int32_scalar('pad0', 0) act = int32_scalar('act', 0) stride = int32_scalar('stride', 1) cm = int32_scalar('channelMultiplier', 2) output = output('op4', 'TENSOR_FLOAT32', '{1, 2, 2, 4}') model = model.Operation('DEPTHWISE_CONV_2D', i1, f1, b1, pad0, pad0, pad0, pad0, stride, stride, cm, act).To(output) model = model.RelaxedExecution(True) input0 = {i1: [10, 21, 10, 22, 10, 23, 10, 24, 10, 25, 10, 26, 10, 27, 10, 28, 10, 29], f1: [0.25, 0, 0.2, 0, 0.25, 0, 0, 0.3, 0.25, 0, 0, 0, 0.25, 0.1, 0, 0], b1: [1, 2, 3, 4]} output0 = {output: [11, 3, 7.2, 10.6, 11, 3, 7.4, 10.9, 11, 3, 7.8, 11.5, 11, 3, 8.0, 11.8]} example((input0, output0))
class Check_Excessive_Current(object): def __init__(self,chain_name,cf,handlers,irrigation_io,irrigation_hash_control,get_json_object): self.get_json_object = get_json_object cf.define_chain(chain_name, False ) #cf.insert.log("check_excessive_current") cf.insert.assert_function_reset(self.check_excessive_current) cf.insert.log("excessive_current_found") cf.insert.send_event("IRI_CLOSE_MASTER_VALVE",False) cf.insert.send_event( "RELEASE_IRRIGATION_CONTROL") cf.insert.one_step(irrigation_io.disable_all_sprinklers ) cf.insert.wait_event_count( count = 15 ) cf.insert.reset() self.handlers = handlers self.irrigation_hash_control = irrigation_hash_control def check_excessive_current(self,cf_handle, chainObj, parameters, event): #print("check excessive current") return False #TBD
class Check_Excessive_Current(object): def __init__(self, chain_name, cf, handlers, irrigation_io, irrigation_hash_control, get_json_object): self.get_json_object = get_json_object cf.define_chain(chain_name, False) cf.insert.assert_function_reset(self.check_excessive_current) cf.insert.log('excessive_current_found') cf.insert.send_event('IRI_CLOSE_MASTER_VALVE', False) cf.insert.send_event('RELEASE_IRRIGATION_CONTROL') cf.insert.one_step(irrigation_io.disable_all_sprinklers) cf.insert.wait_event_count(count=15) cf.insert.reset() self.handlers = handlers self.irrigation_hash_control = irrigation_hash_control def check_excessive_current(self, cf_handle, chainObj, parameters, event): return False