content stringlengths 7 1.05M | fixed_cases stringlengths 1 1.28M |
|---|---|
class Zoo:
def __init__(self, name, budget, animal_capacity, workers_capacity):
self.__budget = budget
self.__animal_capacity = animal_capacity
self.__workers_capacity = workers_capacity
self.name = name
self.animals = []
self.workers = []
def add_animal(self, animal, price):
if len(self.animals) == self.__animal_capacity:
return "Not enough space for animal"
if self.__budget < price:
return "Not enough budget"
self.animals.append(animal)
self.__budget -= price
return f"{animal.name} the {animal.__class__.__name__} added to the zoo"
def hire_worker(self, worker):
if len(self.workers) == self.__workers_capacity:
return "Not enough space for worker"
self.workers.append(worker)
return f"{worker.name} the {worker.__class__.__name__} hired successfully"
def fire_worker(self, worker):
worker_object = [w for w in self.workers if w.name == worker]
if not worker_object:
return f"There is no {worker} in the zoo"
self.workers.remove(worker_object[0])
return f"{worker} fired successfully"
def pay_workers(self):
total_salaries = sum([w.salary for w in self.workers])
if not self.__budget >= total_salaries:
return "You have no budget to pay your workers. They are unhappy"
self.__budget -= total_salaries
return f"You payed your workers. They are happy. Budget left: {self.__budget}"
def tend_animals(self):
total_tend_expenses = sum(a.get_needs() for a in self.animals)
if not self.__budget >= total_tend_expenses:
return "You have no budget to tend the animals. They are unhappy."
self.__budget -= total_tend_expenses
return f"You tended all the animals. They are happy. Budget left: {self.__budget}"
def profit(self, amount):
self.__budget += amount
def __for_filtering(self, array, class_name):
filtered_arr = [x for x in array if x.__class__.__name__ == class_name]
return filtered_arr
def animals_status(self):
lions_list = self.__for_filtering(self.animals, "Lion")
cheetahs_list = self.__for_filtering(self.animals, "Cheetah")
tigers_list = self.__for_filtering(self.animals, "Tiger")
result = f"You have {len(self.animals)} animals"
result += f"\n----- {len(lions_list)} Lions:\n"
result += '\n'.join(repr(lion) for lion in lions_list)
result += f"\n----- {len(tigers_list)} Tigers:\n"
result += '\n'.join(repr(tiger) for tiger in tigers_list)
result += f"\n----- {len(cheetahs_list)} Cheetahs:\n"
result += '\n'.join(repr(cheetah) for cheetah in cheetahs_list)
return result
def workers_status(self):
keepers_list = self.__for_filtering(self.workers, "Keeper")
caretakers_list = self.__for_filtering(self.workers, "Caretaker")
vets_list = self.__for_filtering(self.workers, "Vet")
result = f"You have {len(self.workers)} workers"
result += f"\n----- {len(keepers_list)} Keepers:\n"
result += '\n'.join(repr(keeper) for keeper in keepers_list)
result += f"\n----- {len(caretakers_list)} Caretakers:\n"
result += '\n'.join(repr(caretaker) for caretaker in caretakers_list)
result += f"\n----- {len(vets_list)} Vets:\n"
result += '\n'.join(repr(vet) for vet in vets_list)
return result | class Zoo:
def __init__(self, name, budget, animal_capacity, workers_capacity):
self.__budget = budget
self.__animal_capacity = animal_capacity
self.__workers_capacity = workers_capacity
self.name = name
self.animals = []
self.workers = []
def add_animal(self, animal, price):
if len(self.animals) == self.__animal_capacity:
return 'Not enough space for animal'
if self.__budget < price:
return 'Not enough budget'
self.animals.append(animal)
self.__budget -= price
return f'{animal.name} the {animal.__class__.__name__} added to the zoo'
def hire_worker(self, worker):
if len(self.workers) == self.__workers_capacity:
return 'Not enough space for worker'
self.workers.append(worker)
return f'{worker.name} the {worker.__class__.__name__} hired successfully'
def fire_worker(self, worker):
worker_object = [w for w in self.workers if w.name == worker]
if not worker_object:
return f'There is no {worker} in the zoo'
self.workers.remove(worker_object[0])
return f'{worker} fired successfully'
def pay_workers(self):
total_salaries = sum([w.salary for w in self.workers])
if not self.__budget >= total_salaries:
return 'You have no budget to pay your workers. They are unhappy'
self.__budget -= total_salaries
return f'You payed your workers. They are happy. Budget left: {self.__budget}'
def tend_animals(self):
total_tend_expenses = sum((a.get_needs() for a in self.animals))
if not self.__budget >= total_tend_expenses:
return 'You have no budget to tend the animals. They are unhappy.'
self.__budget -= total_tend_expenses
return f'You tended all the animals. They are happy. Budget left: {self.__budget}'
def profit(self, amount):
self.__budget += amount
def __for_filtering(self, array, class_name):
filtered_arr = [x for x in array if x.__class__.__name__ == class_name]
return filtered_arr
def animals_status(self):
lions_list = self.__for_filtering(self.animals, 'Lion')
cheetahs_list = self.__for_filtering(self.animals, 'Cheetah')
tigers_list = self.__for_filtering(self.animals, 'Tiger')
result = f'You have {len(self.animals)} animals'
result += f'\n----- {len(lions_list)} Lions:\n'
result += '\n'.join((repr(lion) for lion in lions_list))
result += f'\n----- {len(tigers_list)} Tigers:\n'
result += '\n'.join((repr(tiger) for tiger in tigers_list))
result += f'\n----- {len(cheetahs_list)} Cheetahs:\n'
result += '\n'.join((repr(cheetah) for cheetah in cheetahs_list))
return result
def workers_status(self):
keepers_list = self.__for_filtering(self.workers, 'Keeper')
caretakers_list = self.__for_filtering(self.workers, 'Caretaker')
vets_list = self.__for_filtering(self.workers, 'Vet')
result = f'You have {len(self.workers)} workers'
result += f'\n----- {len(keepers_list)} Keepers:\n'
result += '\n'.join((repr(keeper) for keeper in keepers_list))
result += f'\n----- {len(caretakers_list)} Caretakers:\n'
result += '\n'.join((repr(caretaker) for caretaker in caretakers_list))
result += f'\n----- {len(vets_list)} Vets:\n'
result += '\n'.join((repr(vet) for vet in vets_list))
return result |
def arrMul(lst):
out = [None] * len(lst)
prod = 1
i = 0
while i < len(lst):
out [i] = prod
prod *= lst[i]
i += 1
print ("First Four Pass",out)
prod = 1
i = len(lst) - 1
while i >= 0:
out[i] *= prod
prod *= lst[i]
i -= 1
return out
print(arrMul([1,2,3,4,5]))
| def arr_mul(lst):
out = [None] * len(lst)
prod = 1
i = 0
while i < len(lst):
out[i] = prod
prod *= lst[i]
i += 1
print('First Four Pass', out)
prod = 1
i = len(lst) - 1
while i >= 0:
out[i] *= prod
prod *= lst[i]
i -= 1
return out
print(arr_mul([1, 2, 3, 4, 5])) |
#
# PySNMP MIB module TUBS-IBR-PROC-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TUBS-IBR-PROC-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:27:52 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
SingleValueConstraint, ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "SingleValueConstraint", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsUnion", "ConstraintsIntersection")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
Unsigned32, IpAddress, Counter64, NotificationType, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, MibIdentifier, Gauge32, Counter32, Bits, iso, ObjectIdentity, ModuleIdentity, TimeTicks = mibBuilder.importSymbols("SNMPv2-SMI", "Unsigned32", "IpAddress", "Counter64", "NotificationType", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "MibIdentifier", "Gauge32", "Counter32", "Bits", "iso", "ObjectIdentity", "ModuleIdentity", "TimeTicks")
DisplayString, TextualConvention, DateAndTime = mibBuilder.importSymbols("SNMPv2-TC", "DisplayString", "TextualConvention", "DateAndTime")
ibr, = mibBuilder.importSymbols("TUBS-SMI", "ibr")
procMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 1575, 1, 3))
procMIB.setRevisions(('2000-02-09 00:00', '1997-02-14 10:23', '1994-11-15 20:24',))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts: procMIB.setRevisionsDescriptions(('Updated IMPORTS and minor stylistic fixes.', 'Various cleanups to make the module conforming to SNMPv2 SMI.', 'The initial revision of this module.',))
if mibBuilder.loadTexts: procMIB.setLastUpdated('200002090000Z')
if mibBuilder.loadTexts: procMIB.setOrganization('TU Braunschweig')
if mibBuilder.loadTexts: procMIB.setContactInfo('Juergen Schoenwaelder TU Braunschweig Bueltenweg 74/75 38106 Braunschweig Germany Tel: +49 531 391 3283 Fax: +49 531 391 5936 E-mail: schoenw@ibr.cs.tu-bs.de')
if mibBuilder.loadTexts: procMIB.setDescription('Experimental MIB module for listing processes.')
procReload = MibScalar((1, 3, 6, 1, 4, 1, 1575, 1, 3, 1), DateAndTime()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: procReload.setStatus('current')
if mibBuilder.loadTexts: procReload.setDescription('Any set operation will reload the process table. It contains a time stamp when the proc table was reloaded the last time.')
procTable = MibTable((1, 3, 6, 1, 4, 1, 1575, 1, 3, 2), )
if mibBuilder.loadTexts: procTable.setStatus('current')
if mibBuilder.loadTexts: procTable.setDescription('The process table.')
procEntry = MibTableRow((1, 3, 6, 1, 4, 1, 1575, 1, 3, 2, 1), ).setIndexNames((0, "TUBS-IBR-PROC-MIB", "procID"))
if mibBuilder.loadTexts: procEntry.setStatus('current')
if mibBuilder.loadTexts: procEntry.setDescription('An entry for a process in the processes table.')
procID = MibTableColumn((1, 3, 6, 1, 4, 1, 1575, 1, 3, 2, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 2147483647))).setMaxAccess("readonly")
if mibBuilder.loadTexts: procID.setStatus('current')
if mibBuilder.loadTexts: procID.setDescription('The unique process ID.')
procCmd = MibTableColumn((1, 3, 6, 1, 4, 1, 1575, 1, 3, 2, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: procCmd.setStatus('current')
if mibBuilder.loadTexts: procCmd.setDescription('The command name used to start this process.')
mibBuilder.exportSymbols("TUBS-IBR-PROC-MIB", procTable=procTable, procCmd=procCmd, PYSNMP_MODULE_ID=procMIB, procEntry=procEntry, procMIB=procMIB, procID=procID, procReload=procReload)
| (octet_string, object_identifier, integer) = mibBuilder.importSymbols('ASN1', 'OctetString', 'ObjectIdentifier', 'Integer')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(single_value_constraint, value_range_constraint, value_size_constraint, constraints_union, constraints_intersection) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'SingleValueConstraint', 'ValueRangeConstraint', 'ValueSizeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(unsigned32, ip_address, counter64, notification_type, mib_scalar, mib_table, mib_table_row, mib_table_column, integer32, mib_identifier, gauge32, counter32, bits, iso, object_identity, module_identity, time_ticks) = mibBuilder.importSymbols('SNMPv2-SMI', 'Unsigned32', 'IpAddress', 'Counter64', 'NotificationType', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Integer32', 'MibIdentifier', 'Gauge32', 'Counter32', 'Bits', 'iso', 'ObjectIdentity', 'ModuleIdentity', 'TimeTicks')
(display_string, textual_convention, date_and_time) = mibBuilder.importSymbols('SNMPv2-TC', 'DisplayString', 'TextualConvention', 'DateAndTime')
(ibr,) = mibBuilder.importSymbols('TUBS-SMI', 'ibr')
proc_mib = module_identity((1, 3, 6, 1, 4, 1, 1575, 1, 3))
procMIB.setRevisions(('2000-02-09 00:00', '1997-02-14 10:23', '1994-11-15 20:24'))
if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0):
if mibBuilder.loadTexts:
procMIB.setRevisionsDescriptions(('Updated IMPORTS and minor stylistic fixes.', 'Various cleanups to make the module conforming to SNMPv2 SMI.', 'The initial revision of this module.'))
if mibBuilder.loadTexts:
procMIB.setLastUpdated('200002090000Z')
if mibBuilder.loadTexts:
procMIB.setOrganization('TU Braunschweig')
if mibBuilder.loadTexts:
procMIB.setContactInfo('Juergen Schoenwaelder TU Braunschweig Bueltenweg 74/75 38106 Braunschweig Germany Tel: +49 531 391 3283 Fax: +49 531 391 5936 E-mail: schoenw@ibr.cs.tu-bs.de')
if mibBuilder.loadTexts:
procMIB.setDescription('Experimental MIB module for listing processes.')
proc_reload = mib_scalar((1, 3, 6, 1, 4, 1, 1575, 1, 3, 1), date_and_time()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
procReload.setStatus('current')
if mibBuilder.loadTexts:
procReload.setDescription('Any set operation will reload the process table. It contains a time stamp when the proc table was reloaded the last time.')
proc_table = mib_table((1, 3, 6, 1, 4, 1, 1575, 1, 3, 2))
if mibBuilder.loadTexts:
procTable.setStatus('current')
if mibBuilder.loadTexts:
procTable.setDescription('The process table.')
proc_entry = mib_table_row((1, 3, 6, 1, 4, 1, 1575, 1, 3, 2, 1)).setIndexNames((0, 'TUBS-IBR-PROC-MIB', 'procID'))
if mibBuilder.loadTexts:
procEntry.setStatus('current')
if mibBuilder.loadTexts:
procEntry.setDescription('An entry for a process in the processes table.')
proc_id = mib_table_column((1, 3, 6, 1, 4, 1, 1575, 1, 3, 2, 1, 1), integer32().subtype(subtypeSpec=value_range_constraint(1, 2147483647))).setMaxAccess('readonly')
if mibBuilder.loadTexts:
procID.setStatus('current')
if mibBuilder.loadTexts:
procID.setDescription('The unique process ID.')
proc_cmd = mib_table_column((1, 3, 6, 1, 4, 1, 1575, 1, 3, 2, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
procCmd.setStatus('current')
if mibBuilder.loadTexts:
procCmd.setDescription('The command name used to start this process.')
mibBuilder.exportSymbols('TUBS-IBR-PROC-MIB', procTable=procTable, procCmd=procCmd, PYSNMP_MODULE_ID=procMIB, procEntry=procEntry, procMIB=procMIB, procID=procID, procReload=procReload) |
class GRPCConfiguration:
def __init__(self, client_side: bool, server_string=None, user_agent=None,
message_encoding=None, message_accept_encoding=None,
max_message_length=33554432):
self._client_side = client_side
if client_side and server_string is not None:
raise ValueError("Passed client_side=True and server_string at the same time")
if not client_side and user_agent is not None:
raise ValueError("Passed user_agent put didn't pass client_side=True")
self._server_string = server_string
self._user_agent = user_agent
self._max_message_length = max_message_length
self._message_encoding = message_encoding
# TODO: this does not need to be passed in config, may be just a single global string
# with all encodings supported by grpclib
if message_accept_encoding is not None:
self._message_accept_encoding = ",".join(message_accept_encoding)
else:
self._message_accept_encoding = None
@property
def client_side(self):
return self._client_side
@property
def server_string(self):
return self._server_string
@property
def user_agent(self):
return self._user_agent
@property
def message_encoding(self):
return self._message_encoding
@property
def message_accept_encoding(self):
return self._message_accept_encoding
@property
def max_message_length(self):
return self._max_message_length
| class Grpcconfiguration:
def __init__(self, client_side: bool, server_string=None, user_agent=None, message_encoding=None, message_accept_encoding=None, max_message_length=33554432):
self._client_side = client_side
if client_side and server_string is not None:
raise value_error('Passed client_side=True and server_string at the same time')
if not client_side and user_agent is not None:
raise value_error("Passed user_agent put didn't pass client_side=True")
self._server_string = server_string
self._user_agent = user_agent
self._max_message_length = max_message_length
self._message_encoding = message_encoding
if message_accept_encoding is not None:
self._message_accept_encoding = ','.join(message_accept_encoding)
else:
self._message_accept_encoding = None
@property
def client_side(self):
return self._client_side
@property
def server_string(self):
return self._server_string
@property
def user_agent(self):
return self._user_agent
@property
def message_encoding(self):
return self._message_encoding
@property
def message_accept_encoding(self):
return self._message_accept_encoding
@property
def max_message_length(self):
return self._max_message_length |
#string method
name ="Emanuele Micheletti"
print(len(name))
print(name.find("B")) # -1 if not found, index otherwise
print(name.capitalize())
print(name.upper())
print(name.lower())
print(name.isdigit()) #false if contains alpha char, True only if all chars are numeric
print(name.isalpha()) #space is not alpha
print(name.count("e"))
print(name.replace("e", "a"))
print(name*3) | name = 'Emanuele Micheletti'
print(len(name))
print(name.find('B'))
print(name.capitalize())
print(name.upper())
print(name.lower())
print(name.isdigit())
print(name.isalpha())
print(name.count('e'))
print(name.replace('e', 'a'))
print(name * 3) |
"""
Module: 'websocket' on esp32_LoBo
MCU: (sysname='esp32_LoBo', nodename='esp32_LoBo', release='3.2.24', version='ESP32_LoBo_v3.2.24 on 2018-09-06', machine='ESP32 board with ESP32')
Stubber: 1.0.0
"""
class websocket:
''
def close():
pass
def ioctl():
pass
def read():
pass
def readinto():
pass
def readline():
pass
def write():
pass
| """
Module: 'websocket' on esp32_LoBo
MCU: (sysname='esp32_LoBo', nodename='esp32_LoBo', release='3.2.24', version='ESP32_LoBo_v3.2.24 on 2018-09-06', machine='ESP32 board with ESP32')
Stubber: 1.0.0
"""
class Websocket:
""""""
def close():
pass
def ioctl():
pass
def read():
pass
def readinto():
pass
def readline():
pass
def write():
pass |
# Definition for singly-linked list.
class _ListNode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def removeElements(self, head: _ListNode, val: int) -> _ListNode:
prev = None
curr = head
while curr is not None:
if curr.val == val:
if prev is None:
head = curr.next
curr = head
else:
prev.next = curr.next
curr = curr.next
else:
prev = curr
curr = curr.next
return head
| class _Listnode:
def __init__(self, val=0, next=None):
self.val = val
self.next = next
class Solution:
def remove_elements(self, head: _ListNode, val: int) -> _ListNode:
prev = None
curr = head
while curr is not None:
if curr.val == val:
if prev is None:
head = curr.next
curr = head
else:
prev.next = curr.next
curr = curr.next
else:
prev = curr
curr = curr.next
return head |
class PlayFabBaseObject():
pass
class PlayFabRequestCommon(PlayFabBaseObject):
"""
This is a base-class for all Api-request objects.
It is currently unfinished, but we will add result-specific properties,
and add template where-conditions to make some code easier to follow
"""
pass
class PlayFabResultCommon(PlayFabBaseObject):
"""
This is a base-class for all Api-result objects.
It is currently unfinished, but we will add result-specific properties,
and add template where-conditions to make some code easier to follow
"""
pass
| class Playfabbaseobject:
pass
class Playfabrequestcommon(PlayFabBaseObject):
"""
This is a base-class for all Api-request objects.
It is currently unfinished, but we will add result-specific properties,
and add template where-conditions to make some code easier to follow
"""
pass
class Playfabresultcommon(PlayFabBaseObject):
"""
This is a base-class for all Api-result objects.
It is currently unfinished, but we will add result-specific properties,
and add template where-conditions to make some code easier to follow
"""
pass |
ENVFileTemplate="""
#!/usr/bin/env bash
# https://github.com/toggl/toggl_api_docs
export TOGGL_API_TOKEN=''
# Sometimes you have a billable rate and a non-billable rate.
export BILLABLE_RATE='10.0'
export NON_BILLABLE_RATE='5.0'
export FULFILLMENT_DELAY='30'
# Make sure to iterate the invoice number with each use
export INVOICE_NUMBER=space-needle-0
export OUTPUT_DIR=$PWD
export INVOICE_FILENAME='Invoice.pdf'
export SERVICE_PROVIDER='The Freemont Troll'
export SERVICE_PROVIDER_EMAIL='freemont-troll@jbcurtin.io'
export SERVICE_PROVIDER_PHONE=''
export SERVICE_PROVIDER_ADDRESS='Troll Ave N'
export SERVICE_PROVIDER_ADDRESS_TWO='#office'
export SERVICE_PROVIDER_CITY='Seattle'
export SERVICE_PROVIDER_STATE='WA'
export SERVICE_PROVIDER_POSTAL='98103'
export RECIPIENT='Seattle Space Needle'
export RECIPIENT_EMAIL='space-needle@jbcurtin.io'
export RECIPIENT_PHONE=''
export RECIPIENT_ADDRESS='400 Broad St'
export RECIPIENT_ADDRESS_TWO='#office'
export RECIPIENT_CITY='Seattle'
export RECIPIENT_STATE='WA'
export RECIPIENT_POSTAL='98109'
"""
| env_file_template = "\n#!/usr/bin/env bash\n\n# https://github.com/toggl/toggl_api_docs\nexport TOGGL_API_TOKEN=''\n\n# Sometimes you have a billable rate and a non-billable rate.\nexport BILLABLE_RATE='10.0'\nexport NON_BILLABLE_RATE='5.0'\nexport FULFILLMENT_DELAY='30'\n\n# Make sure to iterate the invoice number with each use\nexport INVOICE_NUMBER=space-needle-0\nexport OUTPUT_DIR=$PWD\nexport INVOICE_FILENAME='Invoice.pdf'\n\nexport SERVICE_PROVIDER='The Freemont Troll'\nexport SERVICE_PROVIDER_EMAIL='freemont-troll@jbcurtin.io'\nexport SERVICE_PROVIDER_PHONE=''\nexport SERVICE_PROVIDER_ADDRESS='Troll Ave N'\nexport SERVICE_PROVIDER_ADDRESS_TWO='#office'\nexport SERVICE_PROVIDER_CITY='Seattle'\nexport SERVICE_PROVIDER_STATE='WA'\nexport SERVICE_PROVIDER_POSTAL='98103'\n\nexport RECIPIENT='Seattle Space Needle'\nexport RECIPIENT_EMAIL='space-needle@jbcurtin.io'\nexport RECIPIENT_PHONE=''\nexport RECIPIENT_ADDRESS='400 Broad St'\nexport RECIPIENT_ADDRESS_TWO='#office'\nexport RECIPIENT_CITY='Seattle'\nexport RECIPIENT_STATE='WA'\nexport RECIPIENT_POSTAL='98109'\n" |
"""Repeating elements: All elements appear exactly once except one element, we have to find that element.
Also all elements from 0 to max of the array are present at least once in the array. Eg: [0, 2, 1, 3, 2, 2] O/P: 2"""
""" Solution: """
def repeating_element(a) -> int:
n = len(a)
for i in range(n):
for j in range(i+1, n):
if a[i] == a[j]:
return a[i]
def repeating_element_2(a) -> int:
n = len(a)
temp_arr = [0]*n
for i in range(n):
temp_arr[a[i]] += 1
for i in range(n):
if temp_arr[i] > 1:
return i
return -1
""" More Efficient idea is to use a approach where we find cycles/loop in the array and we know that the repeating
element would be the first node in this array"""
def repeating_element_eff(a) -> int:
n = len(a)
slow = a[0] + 1
fast = a[0] + 1
slow = a[slow] + 1
fast = a[a[fast] + 1] + 1
while slow != fast:
slow = a[slow] + 1
fast = a[a[fast] + 1] + 1
slow = a[0] + 1
while slow != fast:
slow = a[slow] + 1
fast = a[fast] + 1
return slow - 1
def main():
arr = [1, 2, 3, 3, 0, 4, 5]
a2 = repeating_element_eff(arr)
print(a2)
# Using the special variable
# __name__
if __name__ == "__main__":
main()
| """Repeating elements: All elements appear exactly once except one element, we have to find that element.
Also all elements from 0 to max of the array are present at least once in the array. Eg: [0, 2, 1, 3, 2, 2] O/P: 2"""
' Solution: '
def repeating_element(a) -> int:
n = len(a)
for i in range(n):
for j in range(i + 1, n):
if a[i] == a[j]:
return a[i]
def repeating_element_2(a) -> int:
n = len(a)
temp_arr = [0] * n
for i in range(n):
temp_arr[a[i]] += 1
for i in range(n):
if temp_arr[i] > 1:
return i
return -1
' More Efficient idea is to use a approach where we find cycles/loop in the array and we know that the repeating\n element would be the first node in this array'
def repeating_element_eff(a) -> int:
n = len(a)
slow = a[0] + 1
fast = a[0] + 1
slow = a[slow] + 1
fast = a[a[fast] + 1] + 1
while slow != fast:
slow = a[slow] + 1
fast = a[a[fast] + 1] + 1
slow = a[0] + 1
while slow != fast:
slow = a[slow] + 1
fast = a[fast] + 1
return slow - 1
def main():
arr = [1, 2, 3, 3, 0, 4, 5]
a2 = repeating_element_eff(arr)
print(a2)
if __name__ == '__main__':
main() |
# https://practice.geeksforgeeks.org/problems/distribute-n-candies/1#
# try to distribute as many candies as possible in a complete round
# when a candies required in a turn are more than left, then
# find out the last person to get full turn candy
# give remaining to next and return the array
class Solution:
def apSum(self, a, d, n):
return int(n*(2*a +(n-1)*d)/2)
def distributeCandies(self, N, K):
rem = N
full_rounds = 0
while rem > 0:
this_round = self.apSum(1 + K*full_rounds,1,K)
if this_round > rem:
break
rem -= this_round
full_rounds += 1
result = [0 for i in range(K)]
for i in range(K):
result[i] += self.apSum(i+1,K,full_rounds)
extras = i+1 + full_rounds*K
if extras > rem:
result[i] += rem
rem = 0
continue
result[i] += extras
rem -= extras
return result
if __name__ == '__main__':
t = int (input ())
for _ in range (t):
N,K=map(int,input().split())
ob = Solution()
res = ob.distributeCandies(N,K)
for i in res:
print(i,end=" ")
print() | class Solution:
def ap_sum(self, a, d, n):
return int(n * (2 * a + (n - 1) * d) / 2)
def distribute_candies(self, N, K):
rem = N
full_rounds = 0
while rem > 0:
this_round = self.apSum(1 + K * full_rounds, 1, K)
if this_round > rem:
break
rem -= this_round
full_rounds += 1
result = [0 for i in range(K)]
for i in range(K):
result[i] += self.apSum(i + 1, K, full_rounds)
extras = i + 1 + full_rounds * K
if extras > rem:
result[i] += rem
rem = 0
continue
result[i] += extras
rem -= extras
return result
if __name__ == '__main__':
t = int(input())
for _ in range(t):
(n, k) = map(int, input().split())
ob = solution()
res = ob.distributeCandies(N, K)
for i in res:
print(i, end=' ')
print() |
num = int(input('Digite algum numero: '))
u = num // 1 % 10
d = num // 10 % 10
c = num // 100 % 10
m = num // 1000 % 10
print(f'Analisando numero {num}')
if u > 0:
print(f'Unidade: {u}')
if d > 0:
print(f'Dezena: {d}')
if c > 0:
print(f'Centena: {c}')
if m > 0:
print(f'Milhar: {m}')
| num = int(input('Digite algum numero: '))
u = num // 1 % 10
d = num // 10 % 10
c = num // 100 % 10
m = num // 1000 % 10
print(f'Analisando numero {num}')
if u > 0:
print(f'Unidade: {u}')
if d > 0:
print(f'Dezena: {d}')
if c > 0:
print(f'Centena: {c}')
if m > 0:
print(f'Milhar: {m}') |
"""Defines a repository rule for configuring the helm executable.
"""
def _impl(repository_ctx):
substitutions = {"%{TOOL_ATTRS}": " target_tool = \"%s\"\n" % repository_ctx.attr.target_tool}
repository_ctx.template(
"BUILD",
Label("@ltd_fox_hound_rules_helm//toolchains/helm:BUILD.tpl"),
substitutions,
False,
)
helm_toolchain_configure = repository_rule(
implementation = _impl,
attrs = {
"target_tool": attr.label(
doc = "Target for a downloaded nodejs binary for the target os.",
mandatory = True,
allow_single_file = True,
),
},
doc = """Creates an external repository with a helm_toolchain //:toolchain target properly configured.""",
)
| """Defines a repository rule for configuring the helm executable.
"""
def _impl(repository_ctx):
substitutions = {'%{TOOL_ATTRS}': ' target_tool = "%s"\n' % repository_ctx.attr.target_tool}
repository_ctx.template('BUILD', label('@ltd_fox_hound_rules_helm//toolchains/helm:BUILD.tpl'), substitutions, False)
helm_toolchain_configure = repository_rule(implementation=_impl, attrs={'target_tool': attr.label(doc='Target for a downloaded nodejs binary for the target os.', mandatory=True, allow_single_file=True)}, doc='Creates an external repository with a helm_toolchain //:toolchain target properly configured.') |
class Solution:
def ipToCIDR(self, ip, n):
"""
:type ip: str
:type n: int
:rtype: List[str]
"""
def iptoint(ip):
nums = list(map(int, ip.split('.')))
return sum(num << (32 - (i + 1) * 8) for i, num in enumerate(nums))
def inttoip(num):
s = '{:032b}'.format(num)
iters = [iter(s)] * 8
lst = [int(''.join(sub), 2) for sub in zip(*iters)]
return '.'.join(map(str, lst))
def lowbit(num):
low = 0
while num & (1 << low) == 0:
low += 1
return low
ans = []
count = n
num = iptoint(ip)
while count > 0:
low = lowbit(num)
cnt = 2 ** low # maximum possible cnt
left = (32 - low) if count >= cnt else (32 - int(math.log2(count)))
cnt = 2 ** (32 - left)
ans.append('{}/{}'.format(inttoip(num), left))
count -= cnt
num += cnt
return ans | class Solution:
def ip_to_cidr(self, ip, n):
"""
:type ip: str
:type n: int
:rtype: List[str]
"""
def iptoint(ip):
nums = list(map(int, ip.split('.')))
return sum((num << 32 - (i + 1) * 8 for (i, num) in enumerate(nums)))
def inttoip(num):
s = '{:032b}'.format(num)
iters = [iter(s)] * 8
lst = [int(''.join(sub), 2) for sub in zip(*iters)]
return '.'.join(map(str, lst))
def lowbit(num):
low = 0
while num & 1 << low == 0:
low += 1
return low
ans = []
count = n
num = iptoint(ip)
while count > 0:
low = lowbit(num)
cnt = 2 ** low
left = 32 - low if count >= cnt else 32 - int(math.log2(count))
cnt = 2 ** (32 - left)
ans.append('{}/{}'.format(inttoip(num), left))
count -= cnt
num += cnt
return ans |
"""
Author: shikechen
Function: def FileTool class
Version: 6.0
Date: 2019/2/8
"""
class PasswordTool:
def __init__(self, password):
self.password = password
self.strength_level = 0
def process_password(self):
# Rule 1: length >= 8
if len(self.password) >= 8:
self.strength_level += 1
else:
print('Password length too short, at least 8 digits')
# Rule 2: contain number
if self.check_number_exist():
self.strength_level += 1
else:
print('Password must be contain number')
# Rule 3: contain letter
if self.check_letter_exist():
self.strength_level += 1
else:
print('Password must be contain letter')
def check_number_exist(self):
has_number = False
for n in self.password:
if n.isnumeric():
has_number = True
break
return has_number
def check_letter_exist(self):
has_alpha = False
for l in self.password:
if l.isalpha():
has_alpha = True
break
return has_alpha
class FileTool:
def __init__(self, file_path):
self.file_path = file_path
def write_to_file(self, line):
f = open(self.file_path, 'a')
f.write(line)
f.close()
def read_from_file(self):
f = open(self.file_path, 'r')
lines = f.readlines()
return lines
def main():
try_times = 5
file_path = 'password_6.0.txt'
file_tool = FileTool(file_path)
while try_times > 0:
password = input('Input password: ')
# init class
password_tool = PasswordTool(password)
# invoke class method
password_tool.process_password()
strength_level_str = ''
if password_tool.strength_level == 3:
strength_level_str = 'High'
elif password_tool.strength_level == 2:
strength_level_str = 'Middle'
elif password_tool.strength_level == 1:
strength_level_str = 'Low'
else:
strength_level_str = 'Floor'
line = 'Pwd: {}, strength_level: {}\n'.format(password, strength_level_str)
file_tool.write_to_file(line)
if password_tool.strength_level == 3:
print('Password OK')
break
else:
print('Sorry')
print()
try_times -= 1
if try_times <= 0:
print("Try too many times!!!")
lines = file_tool.read_from_file()
print(lines)
if __name__ == '__main__':
main()
| """
Author: shikechen
Function: def FileTool class
Version: 6.0
Date: 2019/2/8
"""
class Passwordtool:
def __init__(self, password):
self.password = password
self.strength_level = 0
def process_password(self):
if len(self.password) >= 8:
self.strength_level += 1
else:
print('Password length too short, at least 8 digits')
if self.check_number_exist():
self.strength_level += 1
else:
print('Password must be contain number')
if self.check_letter_exist():
self.strength_level += 1
else:
print('Password must be contain letter')
def check_number_exist(self):
has_number = False
for n in self.password:
if n.isnumeric():
has_number = True
break
return has_number
def check_letter_exist(self):
has_alpha = False
for l in self.password:
if l.isalpha():
has_alpha = True
break
return has_alpha
class Filetool:
def __init__(self, file_path):
self.file_path = file_path
def write_to_file(self, line):
f = open(self.file_path, 'a')
f.write(line)
f.close()
def read_from_file(self):
f = open(self.file_path, 'r')
lines = f.readlines()
return lines
def main():
try_times = 5
file_path = 'password_6.0.txt'
file_tool = file_tool(file_path)
while try_times > 0:
password = input('Input password: ')
password_tool = password_tool(password)
password_tool.process_password()
strength_level_str = ''
if password_tool.strength_level == 3:
strength_level_str = 'High'
elif password_tool.strength_level == 2:
strength_level_str = 'Middle'
elif password_tool.strength_level == 1:
strength_level_str = 'Low'
else:
strength_level_str = 'Floor'
line = 'Pwd: {}, strength_level: {}\n'.format(password, strength_level_str)
file_tool.write_to_file(line)
if password_tool.strength_level == 3:
print('Password OK')
break
else:
print('Sorry')
print()
try_times -= 1
if try_times <= 0:
print('Try too many times!!!')
lines = file_tool.read_from_file()
print(lines)
if __name__ == '__main__':
main() |
# Pandigital products
def check_pandigital_product(x, y):
if ''.join(sorted(str(x*y)+str(x)+str(y))) == '123456789':
return True
return False
pandig_products = []
for x in range(int(10), int(1e4)):
for y in range(int(10), int(1e4)):
if len(str(x)+str(y)+str(x*y)) != 9:
continue
if check_pandigital_product(x, y) and x*y not in pandig_products:
pandig_products.append(x*y)
print(pandig_products)
print("Sum of pandigital products: {}".format(sum(pandig_products)))
| def check_pandigital_product(x, y):
if ''.join(sorted(str(x * y) + str(x) + str(y))) == '123456789':
return True
return False
pandig_products = []
for x in range(int(10), int(10000.0)):
for y in range(int(10), int(10000.0)):
if len(str(x) + str(y) + str(x * y)) != 9:
continue
if check_pandigital_product(x, y) and x * y not in pandig_products:
pandig_products.append(x * y)
print(pandig_products)
print('Sum of pandigital products: {}'.format(sum(pandig_products))) |
######################################################################
# Author: Thy H. Nguyen TODO: Change this to your names
# Username: nguyent2 TODO: Change this to your usernames
#
# Assignment: A09: Caesar Cipher
#
# Purpose: The class imports a file, encrypts the file, and exports the cipher to a new file
# You need to implement the decrypt function.
######################################################################
# Acknowledgements:
#
# Acknowledgements: The original code was created by Dr. Scott Heggen
# and modified by Dr. Jan Pearce
#
# licensed under a Creative Commons
# Attribution-Noncommercial-Share Alike 3.0 United States License.
####################################################################################
class CaesarCipher:
"""
A class to encrypt and decrypt
"""
alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" # The alphabet, which will be used to do our shifts
def __init__(self, input_file="message_input.txt", key=0, crypt_type="encrypt"):
"""
A constructor for the CaesarCipher class
:param input_file: The file to be encrypted/decrypted
:param key: The amount each message/cipher needs shifted
:param crypt_type: Either encrypt or decrypt
"""
self.input_file = input_file # The file to be encrypted or decrypted
self.key = key # The amount each message/cipher will be shifted
self.message = "" # A placeholder for the message
self.cipher = "" # A placeholder for the cipher
self.crypt_type = crypt_type # Either "encrypt" or "decrypt"
self.import_file() # Calls the import_file() method below
def import_file(self):
"""
Imports a file stored in the variable self.input_file
:return: a string representing the contents of the file
"""
f = open(self.input_file, "r")
if self.crypt_type == "encrypt":
self.message = f.read() # Set self.message to the file contents
elif self.crypt_type == "decrypt":
self.cipher = f.read() # Set self.cipher to the file contents
f.close()
if __name__ == "__main__":
print("File imported: {0}".format(self.input_file))
def export_file(self, text_to_export, filename):
"""
Exports a file called filename
:param text_to_export: the string to be written to the exported file
:param filename: a string representing the name of the file to be exported to
"""
f = open(filename, "w")
f.write(text_to_export)
f.close()
if __name__ == "__main__":
print("File exported: {0}".format(filename))
def encrypt(self):
"""
Converts an original message into a ciphered message with each letter shifted to the right by the key.
:return: a string representing the ciphertext
"""
output = ""
for i in self.message:
if i.upper() in self.alphabet:
old_letter = self.alphabet.find(i.upper())
# Uses modulus to return the correct index for each letter after the shift
# (for cases where the index is outside the range of self.alphabet,
# it wraps back to the beginning of the alphabet)
output += self.alphabet[(old_letter + self.key+26) % 26]
else:
output += i # Adds non-alphabet characters directly
if __name__ == "__main__":
print("Message Encrypted")
return output
def decrypt(self):
"""
Converts a ciphertext into an original message by shifting each letter to the left by the key
:return: a string representing the original message
"""
# TODO Complete the decrypt method
output = ""
for i in self.cipher:
if i.upper() in self.alphabet:
old_letter = self.alphabet.find(i.upper())
# Uses modulus to return the correct index for each letter after the shift
# (for cases where the index is outside the range of self.alphabet,
# it wraps back to the beginning of the alphabet)
output += self.alphabet[(old_letter-self.key) % 26]
#Move to the left
else:
output += i # Adds non-alphabet characters directly
if __name__ == "__main__":
print("Message Decrypted")
return output
def main():
# A sample encryption
cipher0 = CaesarCipher("message_input.txt", 2, "encrypt") # Constructs a new CaesarCipher object called cipher0
cipher_text0 = cipher0.encrypt() # Encrypts the file specified in the constructor
cipher0.export_file(cipher_text0, "cipher_sample.txt") # Writes the output to a file
# Caesar has some letters to send and receive.
# Letter 1 goes to P. Lentulus Spinther, who has agreed with Caesar to use a key of 3
# TODO Construct a new CaesarCipher object called cipher_lentulus
cipher_lentulus = CaesarCipher("letter_to_friend_1.txt",3,"encrypt")
# TODO Encrypt the file specified in the constructor
cipher_lentulus0=cipher_lentulus.encrypt()
# TODO Write the output to a file
cipher_lentulus.export_file(cipher_lentulus0, "cipher_to_friend_1.txt")
# Letter 2 goes to Marcus Tullius Cicero, who has agreed to use a key of 14
# TODO Construct a new CaesarCipher object called cipher_marcus
cipher_marcus = CaesarCipher("letter_to_friend_2.txt", 14, "encrypt")
# TODO Encrypt the file specified in the constructor
cipher_marcus0=cipher_marcus.encrypt()
# TODO Write the output to a file
cipher_marcus.export_file(cipher_marcus0, "cipher_to_friend_2.txt")
# Letter 3 is coming from Cicero for Caesar to decrypt. Again, they agreed to use key 14
cipher3 = CaesarCipher("cipher_from_friend_3.txt", 14,
"decrypt") # constructs a new CaesarCipher object called cipher3
# TODO Decrypt the file specified in the constructor
cipher3_0=cipher3.decrypt()
# TODO Write the output to a file using the export_file() method
cipher3.export_file(cipher3_0, "message_from_friend_3.txt")
if __name__ == "__main__":
main() | class Caesarcipher:
"""
A class to encrypt and decrypt
"""
alphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def __init__(self, input_file='message_input.txt', key=0, crypt_type='encrypt'):
"""
A constructor for the CaesarCipher class
:param input_file: The file to be encrypted/decrypted
:param key: The amount each message/cipher needs shifted
:param crypt_type: Either encrypt or decrypt
"""
self.input_file = input_file
self.key = key
self.message = ''
self.cipher = ''
self.crypt_type = crypt_type
self.import_file()
def import_file(self):
"""
Imports a file stored in the variable self.input_file
:return: a string representing the contents of the file
"""
f = open(self.input_file, 'r')
if self.crypt_type == 'encrypt':
self.message = f.read()
elif self.crypt_type == 'decrypt':
self.cipher = f.read()
f.close()
if __name__ == '__main__':
print('File imported: {0}'.format(self.input_file))
def export_file(self, text_to_export, filename):
"""
Exports a file called filename
:param text_to_export: the string to be written to the exported file
:param filename: a string representing the name of the file to be exported to
"""
f = open(filename, 'w')
f.write(text_to_export)
f.close()
if __name__ == '__main__':
print('File exported: {0}'.format(filename))
def encrypt(self):
"""
Converts an original message into a ciphered message with each letter shifted to the right by the key.
:return: a string representing the ciphertext
"""
output = ''
for i in self.message:
if i.upper() in self.alphabet:
old_letter = self.alphabet.find(i.upper())
output += self.alphabet[(old_letter + self.key + 26) % 26]
else:
output += i
if __name__ == '__main__':
print('Message Encrypted')
return output
def decrypt(self):
"""
Converts a ciphertext into an original message by shifting each letter to the left by the key
:return: a string representing the original message
"""
output = ''
for i in self.cipher:
if i.upper() in self.alphabet:
old_letter = self.alphabet.find(i.upper())
output += self.alphabet[(old_letter - self.key) % 26]
else:
output += i
if __name__ == '__main__':
print('Message Decrypted')
return output
def main():
cipher0 = caesar_cipher('message_input.txt', 2, 'encrypt')
cipher_text0 = cipher0.encrypt()
cipher0.export_file(cipher_text0, 'cipher_sample.txt')
cipher_lentulus = caesar_cipher('letter_to_friend_1.txt', 3, 'encrypt')
cipher_lentulus0 = cipher_lentulus.encrypt()
cipher_lentulus.export_file(cipher_lentulus0, 'cipher_to_friend_1.txt')
cipher_marcus = caesar_cipher('letter_to_friend_2.txt', 14, 'encrypt')
cipher_marcus0 = cipher_marcus.encrypt()
cipher_marcus.export_file(cipher_marcus0, 'cipher_to_friend_2.txt')
cipher3 = caesar_cipher('cipher_from_friend_3.txt', 14, 'decrypt')
cipher3_0 = cipher3.decrypt()
cipher3.export_file(cipher3_0, 'message_from_friend_3.txt')
if __name__ == '__main__':
main() |
# -*- coding: utf-8 -*-
class Guild:
def __init__(self, data=None):
self.id: str = ""
self.name: str = ""
self.icon: str = ""
self.owner_id: str = ""
self.owner: bool = False
self.member_count: int = 0
self.max_members: int = 0
self.description: str = ""
self.joined_at: str = ""
if data:
self.__dict__ = data
| class Guild:
def __init__(self, data=None):
self.id: str = ''
self.name: str = ''
self.icon: str = ''
self.owner_id: str = ''
self.owner: bool = False
self.member_count: int = 0
self.max_members: int = 0
self.description: str = ''
self.joined_at: str = ''
if data:
self.__dict__ = data |
"""
Given a data stream input of non-negative integers a1, a2, ..., an, ...,
summarize the numbers seen so far as a list of disjoint intervals.
For example, suppose the integers from the data stream are 1, 3, 7, 2, 6, ...,
then the summary will be:
1 [1, 1]
3 [1, 1], [3, 3]
7 [1, 1], [3, 3], [7, 7]
2 [1, 3], [7, 7] // case 1
6 [1, 3], [6, 7] // case 2
IDEA:
"""
class Solution352:
pass
| """
Given a data stream input of non-negative integers a1, a2, ..., an, ...,
summarize the numbers seen so far as a list of disjoint intervals.
For example, suppose the integers from the data stream are 1, 3, 7, 2, 6, ...,
then the summary will be:
1 [1, 1]
3 [1, 1], [3, 3]
7 [1, 1], [3, 3], [7, 7]
2 [1, 3], [7, 7] // case 1
6 [1, 3], [6, 7] // case 2
IDEA:
"""
class Solution352:
pass |
class PiRGBArray:
def __init__(self, *args, **kwargs):
self.array = None
def truncate(self, _):
pass
class PiYUVArray:
def __init__(self, *args, **kwargs):
self.array = None
| class Pirgbarray:
def __init__(self, *args, **kwargs):
self.array = None
def truncate(self, _):
pass
class Piyuvarray:
def __init__(self, *args, **kwargs):
self.array = None |
class Course:
def __init__(self,name,ratings):
self.name=name
self.ratings=ratings
def average(self):
numberOfRatings= len(self.ratings)
average = sum(self.ratings)/numberOfRatings
print("Average Ratings For ",self.name," Is ",average)
c1 = Course("Java Course",[1,2,3,4,5])
print(c1.name)
print(c1.ratings)
c1.average()
c2 = Course("Java Web Services",[5,5,5,5])
print(c2.name)
print(c2.ratings)
c2.average() | class Course:
def __init__(self, name, ratings):
self.name = name
self.ratings = ratings
def average(self):
number_of_ratings = len(self.ratings)
average = sum(self.ratings) / numberOfRatings
print('Average Ratings For ', self.name, ' Is ', average)
c1 = course('Java Course', [1, 2, 3, 4, 5])
print(c1.name)
print(c1.ratings)
c1.average()
c2 = course('Java Web Services', [5, 5, 5, 5])
print(c2.name)
print(c2.ratings)
c2.average() |
class SubClass1:
pass
class SubClass2:
pass
async def async_function() -> None:
return
| class Subclass1:
pass
class Subclass2:
pass
async def async_function() -> None:
return |
GOOGLE_MAP_API_KEY = 'AIzaSyA2b8Zh0rzAJQjwDn0_CZ_tHdPXm6G2Sjs'
FIREBASE_FCM_API_KEY = 'AIzaSyAYd8wWQYEJFBzdLJgSGaa1fpJO0OT4APA'
| google_map_api_key = 'AIzaSyA2b8Zh0rzAJQjwDn0_CZ_tHdPXm6G2Sjs'
firebase_fcm_api_key = 'AIzaSyAYd8wWQYEJFBzdLJgSGaa1fpJO0OT4APA' |
# -*- coding: utf-8 -*-
class Student(object):
def __init__(self, name, score):
self.name = name
self.score = score
def print_score(std):
print('%s: %s' % (std.name, std.score))
#print(std.name,std.score)
def get_grade(self):
if self.score >= 90:
return 'A'
elif self.score >= 60:
return 'B'
else:
return 'C'
#print ('C')
bart = Student('Bart Simpson', 59)
print(bart.name)
#print(bart.score)
bart.print_score()
print(bart.get_grade())
#bart.get_grade()
| class Student(object):
def __init__(self, name, score):
self.name = name
self.score = score
def print_score(std):
print('%s: %s' % (std.name, std.score))
def get_grade(self):
if self.score >= 90:
return 'A'
elif self.score >= 60:
return 'B'
else:
return 'C'
bart = student('Bart Simpson', 59)
print(bart.name)
bart.print_score()
print(bart.get_grade()) |
List1=[]
user=int(input())
for i in range(user):
List1.append(int(input()))
n=len(List1)
for k in range(n-1):
for j in range(n-1-k):
if List1[j]>List1[j+1]:
List1[j],List1[j+1]=List1[j+1],List1[j]
for i in List1:
print(i)
| list1 = []
user = int(input())
for i in range(user):
List1.append(int(input()))
n = len(List1)
for k in range(n - 1):
for j in range(n - 1 - k):
if List1[j] > List1[j + 1]:
(List1[j], List1[j + 1]) = (List1[j + 1], List1[j])
for i in List1:
print(i) |
class Solution(object):
# dp - Bottom up, O(n) space
def climbStairs_On(self, n):
"""
:type n: int
:rtype: int
"""
ls = [0]*(n+1)
if n == 0:
return 1
if n == 1:
return 1
ls[0] = ls[1] = 1
for i in range(2, len(ls)):
ls[i] = ls[i-1] + ls[i-2] # 1-step back + 2-step back
return ls[n]
# dp - Bottom up, O(1) space
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
ls = [0]*(n+1)
if n == 0:
return 1
if n == 1:
return 1
one_step_back = 1
two_steps_back = 1
for i in range(n - 1):
output = one_step_back + two_steps_back
one_step_back, two_steps_back = output, one_step_back
return output | class Solution(object):
def climb_stairs__on(self, n):
"""
:type n: int
:rtype: int
"""
ls = [0] * (n + 1)
if n == 0:
return 1
if n == 1:
return 1
ls[0] = ls[1] = 1
for i in range(2, len(ls)):
ls[i] = ls[i - 1] + ls[i - 2]
return ls[n]
def climb_stairs(self, n):
"""
:type n: int
:rtype: int
"""
ls = [0] * (n + 1)
if n == 0:
return 1
if n == 1:
return 1
one_step_back = 1
two_steps_back = 1
for i in range(n - 1):
output = one_step_back + two_steps_back
(one_step_back, two_steps_back) = (output, one_step_back)
return output |
# Part of the Crubit project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
# Create a loader/trampoline repository that we can call into to load LLVM.
#
# Our real goal is to choose between two different sources for LLVM binaries:
# - if `PREBUILT_LLVM_PATH` is in the environment, we treat it as the root of
# an LLVM tree that's been built with CMake and try to use headers and
# libraries from there
# - otherwise, we build LLVM from source
#
# We *could* implement this choice directly as an if/else between `http_archive`
# or `new_local_repository`. However, all Bazel `load`s are unconditional, so we
# would always end up cloning the (very large) LLVM project repository to load
# its Bazel configuration even if we aren't going to use it.
#
# To avoid that, we add the extra indirection of the "loader" repository. We
# populate the loader repository with one of two templated .bzl files depending
# on whether we want "local" or "remote" LLVM. Then our caller activates that
# .bzl file and gets the desired effect.
def _llvm_loader_repository(repository_ctx):
# The final repository is required to have a `BUILD` file at the root.
repository_ctx.file("BUILD")
# Create `llvm.bzl` from one of `llvm_{remote|local}.bzl.tmpl`.
if "PREBUILT_LLVM_PATH" in repository_ctx.os.environ:
# Use prebuilt LLVM
path = repository_ctx.os.environ["PREBUILT_LLVM_PATH"]
# If needed, resolve relative to root of *calling* repository
if not path.startswith("/"):
root_path = repository_ctx.path(
repository_ctx.attr.file_at_root,
).dirname
path = repository_ctx.path(str(root_path) + "/" + path)
repository_ctx.template(
"llvm.bzl",
Label("//bazel:llvm_local.bzl.tmpl"),
substitutions = {
"${PREBUILT_LLVM_PATH}": str(path),
"${CMAKE_BUILD_DIR}": "build",
},
executable = False,
)
else:
# Use downloaded LLVM built with Bazel
repository_ctx.template(
"llvm.bzl",
Label("//bazel:llvm_remote.bzl.tmpl"),
substitutions = {},
executable = False,
)
def llvm_loader_repository_dependencies():
# This *declares* the dependency, but it won't actually be *downloaded*
# unless it's used.
new_git_repository(
name = "llvm-raw",
build_file_content = "# empty",
commit = "llvmorg-15-init-10717-ge00cbbec",
shallow_since = "2022-05-18",
remote = "https://github.com/llvm/llvm-project.git",
)
llvm_loader_repository = repository_rule(
implementation = _llvm_loader_repository,
attrs = {
# We need a file from the root in order to get the workspace path
"file_at_root": attr.label(default = "//:BUILD"),
},
environ = [
"PREBUILT_LLVM_PATH",
],
)
| load('@bazel_tools//tools/build_defs/repo:git.bzl', 'new_git_repository')
def _llvm_loader_repository(repository_ctx):
repository_ctx.file('BUILD')
if 'PREBUILT_LLVM_PATH' in repository_ctx.os.environ:
path = repository_ctx.os.environ['PREBUILT_LLVM_PATH']
if not path.startswith('/'):
root_path = repository_ctx.path(repository_ctx.attr.file_at_root).dirname
path = repository_ctx.path(str(root_path) + '/' + path)
repository_ctx.template('llvm.bzl', label('//bazel:llvm_local.bzl.tmpl'), substitutions={'${PREBUILT_LLVM_PATH}': str(path), '${CMAKE_BUILD_DIR}': 'build'}, executable=False)
else:
repository_ctx.template('llvm.bzl', label('//bazel:llvm_remote.bzl.tmpl'), substitutions={}, executable=False)
def llvm_loader_repository_dependencies():
new_git_repository(name='llvm-raw', build_file_content='# empty', commit='llvmorg-15-init-10717-ge00cbbec', shallow_since='2022-05-18', remote='https://github.com/llvm/llvm-project.git')
llvm_loader_repository = repository_rule(implementation=_llvm_loader_repository, attrs={'file_at_root': attr.label(default='//:BUILD')}, environ=['PREBUILT_LLVM_PATH']) |
#Fizz Buzz Algorithm
def fizzBuzz(input):
if (input % 3 == 0) and (input % 5 == 0):
return "FizzBuzz"
elif input % 3 == 0:
return "Fizz"
elif input % 5 == 0:
return "Buzz"
return input
data = int(input("Enter any number :"))
print(fizzBuzz(data)) | def fizz_buzz(input):
if input % 3 == 0 and input % 5 == 0:
return 'FizzBuzz'
elif input % 3 == 0:
return 'Fizz'
elif input % 5 == 0:
return 'Buzz'
return input
data = int(input('Enter any number :'))
print(fizz_buzz(data)) |
def power(base , pow):
answer = 1
for index in range(pow):
answer = answer * base
return answer
print(power(2 , 14)) | def power(base, pow):
answer = 1
for index in range(pow):
answer = answer * base
return answer
print(power(2, 14)) |
# Only 4xx errors information will be returned currently
# https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_Client_errors
MSG = "msg"
# 400x
BAD_REQUEST_4000 = 4000
INVALID_INPUT_4001 = 4001
INVALID_INPUT_4001_MSG = "Invalid inputs."
WRONG_CREDENTIALS_4002 = 4002
WRONG_CREDENTIALS_4002_MSG = "Incorrect username(email) or password or both."
# 404x
NOT_FOUND_4040 = 4040
USER_NOT_FOUND_4041 = 4041
USER_INACTIVE_4042 = 4042
USER_INACTIVE_4042_MSG = "The current account is inactive."
# 500x
INTERNAL_SERVER_ERROR_5000 = 5000
| msg = 'msg'
bad_request_4000 = 4000
invalid_input_4001 = 4001
invalid_input_4001_msg = 'Invalid inputs.'
wrong_credentials_4002 = 4002
wrong_credentials_4002_msg = 'Incorrect username(email) or password or both.'
not_found_4040 = 4040
user_not_found_4041 = 4041
user_inactive_4042 = 4042
user_inactive_4042_msg = 'The current account is inactive.'
internal_server_error_5000 = 5000 |
class Solution(object):
def coinChangeIter(self, coins, amount):
sum = 0
dp = [0 for i in range(amount+1)]
for i in range(1, amount+1):
min = -1
for coin in coins:
if i-coin >= 0 and dp[i-coin] != -1:
if min < 0 or dp[i-coin] +1 < min:
min = dp[i-coin] + 1
dp[i] = min
return dp[amount]
def coinChange(self, coins, amount):
dp = [0 for i in range(amount+1)]
a = self.coinChangeRecurse(coins, amount, dp)
return a
def coinChangeRecurse(self, coins, rem, dp):
if rem == 0:
return 0
if rem < 0:
return -1
if dp[rem] != 0:
return dp[rem]
min = 9999999
for coin in coins:
a = self.coinChangeRecurse(coins, rem-coin, dp)
if a >= 0 and a < min:
min = a +1
if min == 9999999:
min = -1
dp[rem] = min
return min
a = Solution()
print(a.coinChange([1, 2, 5], 11))
print(a.coinChange([2], 3))
| class Solution(object):
def coin_change_iter(self, coins, amount):
sum = 0
dp = [0 for i in range(amount + 1)]
for i in range(1, amount + 1):
min = -1
for coin in coins:
if i - coin >= 0 and dp[i - coin] != -1:
if min < 0 or dp[i - coin] + 1 < min:
min = dp[i - coin] + 1
dp[i] = min
return dp[amount]
def coin_change(self, coins, amount):
dp = [0 for i in range(amount + 1)]
a = self.coinChangeRecurse(coins, amount, dp)
return a
def coin_change_recurse(self, coins, rem, dp):
if rem == 0:
return 0
if rem < 0:
return -1
if dp[rem] != 0:
return dp[rem]
min = 9999999
for coin in coins:
a = self.coinChangeRecurse(coins, rem - coin, dp)
if a >= 0 and a < min:
min = a + 1
if min == 9999999:
min = -1
dp[rem] = min
return min
a = solution()
print(a.coinChange([1, 2, 5], 11))
print(a.coinChange([2], 3)) |
# -*- coding: utf-8 -*-
"""
Created on Mon Dec 2 22:43:50 2019
@author: ZWH
"""
| """
Created on Mon Dec 2 22:43:50 2019
@author: ZWH
""" |
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': 4.72345e-06,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.202693,
'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': 2.02403e-05,
'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.347313,
'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.601421,
'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.344932,
'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.29367,
'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.343302,
'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.54895,
'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': 3.82383e-06,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0125904,
'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.0910465,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0931135,
'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.0910503,
'Execution Unit/Register Files/Runtime Dynamic': 0.105704,
'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.220007,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.565341,
'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': 2.57278,
'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.00392745,
'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.00392745,
'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.00343906,
'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.0013413,
'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.00133758,
'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.0126315,
'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.0370038,
'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.0895124,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 5.69376,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.337064,
'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.304024,
'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.19283,
'Instruction Fetch Unit/Runtime Dynamic': 0.780237,
'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.0690669,
'L2/Runtime Dynamic': 0.0155266,
'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': 3.94674,
'Load Store Unit/Data Cache/Runtime Dynamic': 1.32432,
'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.0876627,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0876628,
'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.36239,
'Load Store Unit/Runtime Dynamic': 1.84431,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.216161,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.432323,
'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.0767164,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0774717,
'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.354017,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0560921,
'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.645143,
'Memory Management Unit/Runtime Dynamic': 0.133564,
'Memory Management Unit/Subthreshold Leakage': 0.0769113,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462,
'Peak Dynamic': 23.3801,
'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': 1.30032e-05,
'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.0177598,
'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.179809,
'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.197582,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime Dynamic': 5.54399,
'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.0498229,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.241822,
'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.266868,
'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.114592,
'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.184833,
'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.0932975,
'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.392723,
'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.0901452,
'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.47063,
'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.0504171,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00480652,
'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.053499,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0355471,
'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.103916,
'Execution Unit/Register Files/Runtime Dynamic': 0.0403536,
'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.125166,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.311805,
'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.39208,
'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.000322766,
'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.000322766,
'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.000296288,
'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.000122988,
'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.000510637,
'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.00145246,
'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.00255307,
'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.0341724,
'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.17365,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0780257,
'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.116065,
'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.49766,
'Instruction Fetch Unit/Runtime Dynamic': 0.232268,
'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.0460378,
'L2/Runtime Dynamic': 0.00374756,
'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.60591,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.661816,
'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.0442836,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0442837,
'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.81503,
'Load Store Unit/Runtime Dynamic': 0.924492,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.109196,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.218392,
'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.038754,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0394436,
'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.13515,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0127968,
'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.357831,
'Memory Management Unit/Runtime Dynamic': 0.0522404,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 15.7767,
'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.132625,
'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.0067841,
'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.0562553,
'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.195664,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 2.80049,
'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.0,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.202689,
'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.0,
'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.0910043,
'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.146787,
'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.0740929,
'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.311884,
'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.104084,
'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.02642,
'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.0,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00381713,
'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.027603,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.02823,
'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.027603,
'Execution Unit/Register Files/Runtime Dynamic': 0.0320472,
'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.0581517,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.169518,
'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.12151,
'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.000479496,
'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.000479496,
'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.000421528,
'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.000165306,
'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.000405526,
'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.00178605,
'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.00445847,
'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.0271382,
'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.72622,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0530833,
'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.0921737,
'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.02851,
'Instruction Fetch Unit/Runtime Dynamic': 0.17864,
'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.033737,
'L2/Runtime Dynamic': 0.00795641,
'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.29632,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.520584,
'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.0342676,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0342675,
'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.45814,
'Load Store Unit/Runtime Dynamic': 0.723847,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.0844981,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.168996,
'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.0299887,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0304948,
'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.10733,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.00870376,
'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.314954,
'Memory Management Unit/Runtime Dynamic': 0.0391986,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 14.4512,
'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.0,
'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.00410587,
'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.0479361,
'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.0520419,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 2.1232,
'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.0358538,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.23085,
'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.185183,
'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.090258,
'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.145583,
'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.0734853,
'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.309326,
'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.0748382,
'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.30031,
'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.0349851,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00378582,
'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.0411426,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0279985,
'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.0761277,
'Execution Unit/Register Files/Runtime Dynamic': 0.0317843,
'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.0956413,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.254774,
'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.23211,
'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.000261061,
'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.000261061,
'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.000227814,
'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': 8.84257e-05,
'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.000402201,
'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.00115214,
'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.00248766,
'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.0269157,
'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.71207,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0737253,
'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.0914177,
'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.01367,
'Instruction Fetch Unit/Runtime Dynamic': 0.195698,
'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.0594532,
'L2/Runtime Dynamic': 0.016644,
'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.31416,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.545885,
'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.0348449,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0348448,
'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.47871,
'Load Store Unit/Runtime Dynamic': 0.752572,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.0859216,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.171843,
'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.0304939,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0313747,
'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.10645,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0121218,
'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.314942,
'Memory Management Unit/Runtime Dynamic': 0.0434965,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 14.7566,
'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.0920295,
'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.00519217,
'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.0446444,
'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.141866,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 2.38239,
'Subthreshold Leakage': 6.16288,
'Subthreshold Leakage with power gating': 2.55328}],
'DRAM': {'Area': 0,
'Gate Leakage': 0,
'Peak Dynamic': 5.817101355307589,
'Runtime Dynamic': 5.817101355307589,
'Subthreshold Leakage': 4.252,
'Subthreshold Leakage with power gating': 4.252},
'L3': [{'Area': 61.9075,
'Gate Leakage': 0.0484137,
'Peak Dynamic': 0.298219,
'Runtime Dynamic': 0.0868154,
'Subthreshold Leakage': 6.80085,
'Subthreshold Leakage with power gating': 3.32364}],
'Processor': {'Area': 191.908,
'Gate Leakage': 1.53485,
'Peak Dynamic': 68.6627,
'Peak Power': 101.775,
'Runtime Dynamic': 12.9369,
'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': 68.3645,
'Total Cores/Runtime Dynamic': 12.8501,
'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.298219,
'Total L3s/Runtime Dynamic': 0.0868154,
'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': 4.72345e-06, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.202693, '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': 2.02403e-05, '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.347313, '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.601421, '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.344932, '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.29367, '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.343302, '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.54895, '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': 3.82383e-06, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0125904, '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.0910465, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0931135, '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.0910503, 'Execution Unit/Register Files/Runtime Dynamic': 0.105704, '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.220007, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.565341, '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': 2.57278, '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.00392745, '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.00392745, '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.00343906, '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.0013413, '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.00133758, '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.0126315, '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.0370038, '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.0895124, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 5.69376, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.337064, '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.304024, '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.19283, 'Instruction Fetch Unit/Runtime Dynamic': 0.780237, '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.0690669, 'L2/Runtime Dynamic': 0.0155266, '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': 3.94674, 'Load Store Unit/Data Cache/Runtime Dynamic': 1.32432, '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.0876627, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0876628, '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.36239, 'Load Store Unit/Runtime Dynamic': 1.84431, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.216161, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.432323, '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.0767164, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0774717, '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.354017, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0560921, '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.645143, 'Memory Management Unit/Runtime Dynamic': 0.133564, 'Memory Management Unit/Subthreshold Leakage': 0.0769113, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462, 'Peak Dynamic': 23.3801, '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': 1.30032e-05, '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.0177598, '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.179809, '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.197582, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime Dynamic': 5.54399, '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.0498229, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.241822, '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.266868, '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.114592, '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.184833, '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.0932975, '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.392723, '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.0901452, '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.47063, '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.0504171, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00480652, '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.053499, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0355471, '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.103916, 'Execution Unit/Register Files/Runtime Dynamic': 0.0403536, '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.125166, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.311805, '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.39208, '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.000322766, '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.000322766, '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.000296288, '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.000122988, '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.000510637, '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.00145246, '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.00255307, '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.0341724, '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.17365, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0780257, '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.116065, '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.49766, 'Instruction Fetch Unit/Runtime Dynamic': 0.232268, '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.0460378, 'L2/Runtime Dynamic': 0.00374756, '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.60591, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.661816, '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.0442836, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0442837, '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.81503, 'Load Store Unit/Runtime Dynamic': 0.924492, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.109196, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.218392, '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.038754, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0394436, '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.13515, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0127968, '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.357831, 'Memory Management Unit/Runtime Dynamic': 0.0522404, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 15.7767, '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.132625, '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.0067841, '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.0562553, '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.195664, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.80049, '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.0, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.202689, '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.0, '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.0910043, '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.146787, '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.0740929, '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.311884, '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.104084, '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.02642, '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.0, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00381713, '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.027603, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.02823, '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.027603, 'Execution Unit/Register Files/Runtime Dynamic': 0.0320472, '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.0581517, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.169518, '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.12151, '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.000479496, '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.000479496, '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.000421528, '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.000165306, '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.000405526, '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.00178605, '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.00445847, '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.0271382, '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.72622, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0530833, '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.0921737, '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.02851, 'Instruction Fetch Unit/Runtime Dynamic': 0.17864, '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.033737, 'L2/Runtime Dynamic': 0.00795641, '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.29632, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.520584, '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.0342676, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0342675, '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.45814, 'Load Store Unit/Runtime Dynamic': 0.723847, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.0844981, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.168996, '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.0299887, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0304948, '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.10733, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.00870376, '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.314954, 'Memory Management Unit/Runtime Dynamic': 0.0391986, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.4512, '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.0, '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.00410587, '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.0479361, '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.0520419, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.1232, '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.0358538, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.23085, '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.185183, '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.090258, '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.145583, '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.0734853, '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.309326, '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.0748382, '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.30031, '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.0349851, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00378582, '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.0411426, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0279985, '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.0761277, 'Execution Unit/Register Files/Runtime Dynamic': 0.0317843, '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.0956413, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.254774, '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.23211, '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.000261061, '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.000261061, '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.000227814, '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': 8.84257e-05, '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.000402201, '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.00115214, '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.00248766, '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.0269157, '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.71207, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0737253, '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.0914177, '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.01367, 'Instruction Fetch Unit/Runtime Dynamic': 0.195698, '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.0594532, 'L2/Runtime Dynamic': 0.016644, '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.31416, 'Load Store Unit/Data Cache/Runtime Dynamic': 0.545885, '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.0348449, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0348448, '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.47871, 'Load Store Unit/Runtime Dynamic': 0.752572, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.0859216, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.171843, '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.0304939, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0313747, '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.10645, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0121218, '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.314942, 'Memory Management Unit/Runtime Dynamic': 0.0434965, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 14.7566, '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.0920295, '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.00519217, '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.0446444, '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.141866, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 2.38239, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}], 'DRAM': {'Area': 0, 'Gate Leakage': 0, 'Peak Dynamic': 5.817101355307589, 'Runtime Dynamic': 5.817101355307589, 'Subthreshold Leakage': 4.252, 'Subthreshold Leakage with power gating': 4.252}, 'L3': [{'Area': 61.9075, 'Gate Leakage': 0.0484137, 'Peak Dynamic': 0.298219, 'Runtime Dynamic': 0.0868154, 'Subthreshold Leakage': 6.80085, 'Subthreshold Leakage with power gating': 3.32364}], 'Processor': {'Area': 191.908, 'Gate Leakage': 1.53485, 'Peak Dynamic': 68.6627, 'Peak Power': 101.775, 'Runtime Dynamic': 12.9369, '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': 68.3645, 'Total Cores/Runtime Dynamic': 12.8501, '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.298219, 'Total L3s/Runtime Dynamic': 0.0868154, '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}} |
def func():
print('first')
print('second')
return 3
print('third')
func() | def func():
print('first')
print('second')
return 3
print('third')
func() |
def add_(a,b):
return a+b
def sub_(a,b):
return a-b | def add_(a, b):
return a + b
def sub_(a, b):
return a - b |
class Solution(object):
def validIPAddress(self, IP):
"""
:type IP: str
:rtype: str
"""
try:
if '.' in IP:
# IPv4
strs = IP.split('.')
if len(strs) == 4:
for s in strs:
if not s or len(s) > 1 and s[0] == '0' or not 0 <= int(s) < 256 or s[0] in '+-':
break
else:
return 'IPv4'
elif ':' in IP:
# IPv6
omit = None
strs = IP.split(':')
if len(strs) == 8:
for s in strs:
if not s or len(s) > 4 or not 0 <= int(s, 16) <= 0xffff or s[0] in '+-':
break
else:
return 'IPv6'
except ValueError:
pass
return 'Neither'
| class Solution(object):
def valid_ip_address(self, IP):
"""
:type IP: str
:rtype: str
"""
try:
if '.' in IP:
strs = IP.split('.')
if len(strs) == 4:
for s in strs:
if not s or (len(s) > 1 and s[0] == '0') or (not 0 <= int(s) < 256) or (s[0] in '+-'):
break
else:
return 'IPv4'
elif ':' in IP:
omit = None
strs = IP.split(':')
if len(strs) == 8:
for s in strs:
if not s or len(s) > 4 or (not 0 <= int(s, 16) <= 65535) or (s[0] in '+-'):
break
else:
return 'IPv6'
except ValueError:
pass
return 'Neither' |
"""
Ejercicio 2. Escribir un script que nos muestre por pantalla todos los numeros pares del 1 al 120
"""
contador = 1
for contador in range(1,121):
if contador%2 == 0:
print(f"es par {contador}")
"""
else:
print(f"{contador} es impar")
"""
| """
Ejercicio 2. Escribir un script que nos muestre por pantalla todos los numeros pares del 1 al 120
"""
contador = 1
for contador in range(1, 121):
if contador % 2 == 0:
print(f'es par {contador}')
'\n else:\n print(f"{contador} es impar")\n ' |
'''Initialize biosql db '''
#biodb_conn_string = 'sqlite://biodb.sqlite'
# biodb_conn_string = 'mysql://root:@127.0.0.1/mybiodb'
#biodb_conn_string = 'postgres://mybiodb:mypass@127.0.0.1/mybiodb'
# timestamps_db = 'sqlite://biodb.sqlite'
biodb_handler = BioSQLHandler(settings.biodb_conn_string, compatibility_mode = False, time_stamps = settings.timestamps_db, pool_size = 5)
biodb = biodb_handler.adaptor
if biodb_handler._build_error:
response.flash = 'DB model building error'
'''Initial configuration data '''
biodatabases = [row.name for row in biodb(biodb.biodatabase.id>0).select()]
if 'UniProt' not in biodatabases:
biodb_handler.make_new_db(dbname = 'UniProt',
description = 'Entries loaded from UniProt',)
| """Initialize biosql db """
biodb_handler = bio_sql_handler(settings.biodb_conn_string, compatibility_mode=False, time_stamps=settings.timestamps_db, pool_size=5)
biodb = biodb_handler.adaptor
if biodb_handler._build_error:
response.flash = 'DB model building error'
'Initial configuration data '
biodatabases = [row.name for row in biodb(biodb.biodatabase.id > 0).select()]
if 'UniProt' not in biodatabases:
biodb_handler.make_new_db(dbname='UniProt', description='Entries loaded from UniProt') |
user_range = input("Type a range (star and end): ").split()
for u in range(0, len(user_range)):
user_range[u] = int(user_range[u])
even_sum = 0
for i in range(user_range[0], user_range[1]):
if i % 2 == 0:
even_sum += i
print("The total even add is: {:d}".format(even_sum))
| user_range = input('Type a range (star and end): ').split()
for u in range(0, len(user_range)):
user_range[u] = int(user_range[u])
even_sum = 0
for i in range(user_range[0], user_range[1]):
if i % 2 == 0:
even_sum += i
print('The total even add is: {:d}'.format(even_sum)) |
# Solution
# O(nd) time / O(n) space
# n - target amount
# d - number of denominations
def numberOfWaysToMakeChange(n, denoms):
ways = [0 for amount in range(n + 1)]
ways[0] = 1
for denom in denoms:
for amount in range(1, n + 1):
if denom <= amount:
ways[amount] += ways[amount - denom]
return ways[n]
| def number_of_ways_to_make_change(n, denoms):
ways = [0 for amount in range(n + 1)]
ways[0] = 1
for denom in denoms:
for amount in range(1, n + 1):
if denom <= amount:
ways[amount] += ways[amount - denom]
return ways[n] |
print(" Week 1 - Day-2 ")
print("--------------------")
print(" v = 6" + " AND "+ "c = 5")
print("--------------------")
v = 6
c = 5
if v < c:
print(" c big than v")
else:
print(" c small than v")
input('Press ENTER to continue...')
| print(' Week 1 - Day-2 ')
print('--------------------')
print(' v = 6' + ' AND ' + 'c = 5')
print('--------------------')
v = 6
c = 5
if v < c:
print(' c big than v')
else:
print(' c small than v')
input('Press ENTER to continue...') |
# A simple graph representing a series of cities and the connections between
# them.
map = {
"Seattle": {"San Francisco"},
"San Francisco": {"Seattle", "Los Angeles", "Denver"},
"Los Angeles": {"San Francisco", "Phoenix"},
"Phoenix": {"Los Angeles", "Denver"},
"Denver": {"Phoenix", "San Francisco", "Houston", "Kansas City"},
"Kansas City": {"Denver", "Houston", "Chicago", "Nashville"},
"Houston": {"Kansas City", "Denver"},
"Chicago": {"Kansas City", "New York"},
"Nashville": {"Kansas City", "Houston", "Miami"},
"New York": {"Chicago", "Washington D.C."},
"Washington D.C.": {"Chicago", "Nashville", "Miami"},
"Miami": {"Washington D.C.", "Houston", "Nashville"},
}
DELIVERED = "Delivered"
# Use BFS to find the shortest path
def find_shortest_path(start, end):
# Question: Why is a Python list acceptable to use for this queue?
qq = []
qq.append([start])
visited = set()
while len(qq) > 0:
path = qq.pop()
city = path[-1]
if city == end:
return path
else:
if city not in visited:
visited.add(city)
for connection in map[city]:
new_path = list(path)
new_path.append(connection)
qq.insert(0, new_path)
return "Error: Path not found"
# Determine the next step via BFS. Set location to delivered at end.
def advance_delivery(location, destination):
print("advancing", location, destination)
# shouldn't be called in this case
if location == DELIVERED:
return DELIVERED
if location == destination:
return DELIVERED
path = find_shortest_path(location, destination)
# Safe to say there is a next city if we get here
return path[1]
# Testing
# print(find_shortest_path("Seattle", "Kansas City"))
| map = {'Seattle': {'San Francisco'}, 'San Francisco': {'Seattle', 'Los Angeles', 'Denver'}, 'Los Angeles': {'San Francisco', 'Phoenix'}, 'Phoenix': {'Los Angeles', 'Denver'}, 'Denver': {'Phoenix', 'San Francisco', 'Houston', 'Kansas City'}, 'Kansas City': {'Denver', 'Houston', 'Chicago', 'Nashville'}, 'Houston': {'Kansas City', 'Denver'}, 'Chicago': {'Kansas City', 'New York'}, 'Nashville': {'Kansas City', 'Houston', 'Miami'}, 'New York': {'Chicago', 'Washington D.C.'}, 'Washington D.C.': {'Chicago', 'Nashville', 'Miami'}, 'Miami': {'Washington D.C.', 'Houston', 'Nashville'}}
delivered = 'Delivered'
def find_shortest_path(start, end):
qq = []
qq.append([start])
visited = set()
while len(qq) > 0:
path = qq.pop()
city = path[-1]
if city == end:
return path
elif city not in visited:
visited.add(city)
for connection in map[city]:
new_path = list(path)
new_path.append(connection)
qq.insert(0, new_path)
return 'Error: Path not found'
def advance_delivery(location, destination):
print('advancing', location, destination)
if location == DELIVERED:
return DELIVERED
if location == destination:
return DELIVERED
path = find_shortest_path(location, destination)
return path[1] |
RECEIVED_REQUEST = 'RT'
REQUEST_SUCCESS = 'TS'
REQUEST_FAILED = 'TF'
REQUEST_PROCESSING = 'SP'
NETWORK_ISSUE = 'NC'
CONFIRMING_REQUEST = 'SC'
UNIONBANK_RESPONSE_CODES = {
RECEIVED_REQUEST: {
'message': 'Received Transaction Request',
'apis': 'all',
'description': 'Transaction has reached UnionBank'},
REQUEST_SUCCESS: {
'message': 'Credited Beneficiary Account',
'apis': 'all',
'description': 'Successful transaction'},
REQUEST_FAILED: {
'message': 'Failed to Credit Beneficiary Account',
'apis': 'all',
'description': 'All transactional APIs Transaction has failed'},
REQUEST_PROCESSING: {
'message': 'Sent for Processing',
'apis': 'all',
'description': 'Transaction is sent for processing'},
NETWORK_ISSUE: {
'message': 'Network Issue - Core',
'apis': 'all',
'description': 'Transaction has encountered a network issue'},
CONFIRMING_REQUEST: {
'message': 'Sent for Confirmation',
'apis': 'instapay',
'description': 'Transaction status for confirmation'},
}
PENDING_RESPONSE = [
RECEIVED_REQUEST,
REQUEST_PROCESSING,
CONFIRMING_REQUEST
] | received_request = 'RT'
request_success = 'TS'
request_failed = 'TF'
request_processing = 'SP'
network_issue = 'NC'
confirming_request = 'SC'
unionbank_response_codes = {RECEIVED_REQUEST: {'message': 'Received Transaction Request', 'apis': 'all', 'description': 'Transaction has reached UnionBank'}, REQUEST_SUCCESS: {'message': 'Credited Beneficiary Account', 'apis': 'all', 'description': 'Successful transaction'}, REQUEST_FAILED: {'message': 'Failed to Credit Beneficiary Account', 'apis': 'all', 'description': 'All transactional APIs\tTransaction has failed'}, REQUEST_PROCESSING: {'message': 'Sent for Processing', 'apis': 'all', 'description': 'Transaction is sent for processing'}, NETWORK_ISSUE: {'message': 'Network Issue - Core', 'apis': 'all', 'description': 'Transaction has encountered a network issue'}, CONFIRMING_REQUEST: {'message': 'Sent for Confirmation', 'apis': 'instapay', 'description': 'Transaction status for confirmation'}}
pending_response = [RECEIVED_REQUEST, REQUEST_PROCESSING, CONFIRMING_REQUEST] |
# Write your check_for_name function here:
def check_for_name(sentence, name) -> object:
return name.lower() in sentence.lower()
# Uncomment these function calls to test your function:
print(check_for_name("My name is Jamie", "Jamie"))
# should print True
print(check_for_name("My name is jamie", "Jamie"))
# should print True
print(check_for_name("My name is Samantha", "Jamie"))
# should print False | def check_for_name(sentence, name) -> object:
return name.lower() in sentence.lower()
print(check_for_name('My name is Jamie', 'Jamie'))
print(check_for_name('My name is jamie', 'Jamie'))
print(check_for_name('My name is Samantha', 'Jamie')) |
# loops with range
for x in range(0, 10, 1):
pass # insert what to do in each iteration
# 0 represents the value to start iterating with
# 10 represents the value to stop iterating at
# 1 represents the value in which the iterator changes per iteration
for x in range(0, 10, 1):
pass # start iteration at 0, end when x < 10 and iterator increases by 1 each iteration
for x in range(0, 10): # increment of +1 is implied
pass
for x in range(10): # increment of +1 and start at 0 is implied
pass
for x in range(0, 10, 2):
print(x) # output: 0, 2, 4, 6, 8
for x in range(5, 1, -3):
print(x) # output: 5, 2
# iterate through list
my_list = ["abc", 123, "xyz"]
for i in range(0, len(my_list)):
print(i, my_list[i]) # output: 0 abc, 1 123, 2 xyz
# OR
for v in my_list:
print(v) # output: abc, 123, xyz
# iterating through dictionaries / the iterator are they keys in the dictionary
my_dict = { "name": "Noelle", "language": "Python" }
for k in my_dict:
print(k) # output: name, language
# grab the values of the keys in the dictionary
my_dict = { "name": "Noelle", "language": "Python" }
for k in my_dict:
print(my_dict[k]) # output: Noelle, Python
capitals = {"Washington":"Olympia","California":"Sacramento","Idaho":"Boise","Illinois":"Springfield","Texas":"Austin","Oklahoma":"Oklahoma City","Virginia":"Richmond"}
# another way to iterate through the keys
for key in capitals.keys():
print(key) # output: Washington, California, Idaho, Illinois, Texas, Oklahoma, Virginia
#to iterate through the values
for val in capitals.values():
print(val) # output: Olympia, Sacramento, Boise, Springfield, Austin, Oklahoma City, Richmond
#to iterate through both keys and values
for key, val in capitals.items():
print(key, " = ", val) # output: Washington = Olympia, California = Sacramento, Idaho = Boise, etc
# for loop vs while loop
for count in range(0,5):
print("looping - ", count)
count = 0
# same output
while count < 5:
print("looping - ", count)
count += 1
# else statements will do something when the conditions are not met
y = 3
while y > 0:
print(y)
y = y - 1
else:
print("Final else statement")
# using break
for val in "string":
if val == "i":
break
print(val) # output: s, t, r
# using continue
for val in "string":
if val == "i":
continue
print(val) # output: s, t, r, n, g
# notice, no i in the output, but the loop continued after the i
y = 3
while y > 0:
print(y)
y = y - 1
if y == 0:
break
else: # only executes on a clean exit from the while loop (i.e. not a break)
print("Final else statement") # output: 3, 2, 1
| for x in range(0, 10, 1):
pass
for x in range(0, 10, 1):
pass
for x in range(0, 10):
pass
for x in range(10):
pass
for x in range(0, 10, 2):
print(x)
for x in range(5, 1, -3):
print(x)
my_list = ['abc', 123, 'xyz']
for i in range(0, len(my_list)):
print(i, my_list[i])
for v in my_list:
print(v)
my_dict = {'name': 'Noelle', 'language': 'Python'}
for k in my_dict:
print(k)
my_dict = {'name': 'Noelle', 'language': 'Python'}
for k in my_dict:
print(my_dict[k])
capitals = {'Washington': 'Olympia', 'California': 'Sacramento', 'Idaho': 'Boise', 'Illinois': 'Springfield', 'Texas': 'Austin', 'Oklahoma': 'Oklahoma City', 'Virginia': 'Richmond'}
for key in capitals.keys():
print(key)
for val in capitals.values():
print(val)
for (key, val) in capitals.items():
print(key, ' = ', val)
for count in range(0, 5):
print('looping - ', count)
count = 0
while count < 5:
print('looping - ', count)
count += 1
y = 3
while y > 0:
print(y)
y = y - 1
else:
print('Final else statement')
for val in 'string':
if val == 'i':
break
print(val)
for val in 'string':
if val == 'i':
continue
print(val)
y = 3
while y > 0:
print(y)
y = y - 1
if y == 0:
break
else:
print('Final else statement') |
# sum = sum + 10
# sum += 10
# i = i + 1
# i += 1
# number = number / 10
# number /= 10
# number = number / divisor
# number /= divisor
# product = product * 45
# product *= 45
# factroial = factorial * func(3)
# factorial *= func(3)
"""
var = var [operator] value
var [operator]= value
"""
| """
var = var [operator] value
var [operator]= value
""" |
inputText = "{{{{{{<!>!>,<o!>},<a,\"i!!!>i!!,!>,<<e<i<<>,{{{<!>},<!><!>,<!!!>!!!>!!!>{\"!>},<!!!<!>},<oi!>!,'>}}}},{{<{!!!>},<!!,!!!>!!!>!!e!a!!!!<!>},<!!!>u!>,<!>!!u!!!!!>},<!>!>,<{>}},{<\"a!!!!'!>},<!}\"!>!!<o}i!<>,<<e,<eo!a}!!\"!>,<!>!>!>,<e{\"e\">}},{{<!oi'<!o!>ue>,{<!>},<i!>,<i>,{<'>}}}},{{<\"a,!>},<!!e!>,<e!!}!!o!!!>,<',}>,{{<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!}!!'\"!>,<<\"!>,<!!!>'>},{}},{{{<!,!eu!>'u!!{!!!>e}'o!e!!!!!>o>},{<\"!!!>}!<i!!!>!'!!!uooeo!a!\"!iio!!>}},<o!!!{e\"}!!!>!u!\"{,!>!>!>},<u!'>},{<!>},<a!a}!!!>{!i!!!!auo<i>}},{<\"'!>},<{e!!!>!!uu!>,<!!a>,{<o\"o!>},<!>,<!\"}\"o!{'{,!>},<>}}}},{{{<!!{\"\"\"!!,>},<!i<<>},{{<!!o\"!e>}},{{{<e}!!!}>}},{<<!!!>!>,<!>,<!u!!!!!!,u!!!!!!!!!!!>,<'!>\"!!!>{>}}}},{}}}"
#inputText = "{{{{{{<!>!>,<o!>},<a,\"i!!!>i!!,!>,<<e<i<<>,{{{<!>}"
def value(string):
totalPoints = 0
for i in range(0, len(string)):
if (string[i] == '}'):
specificPoints = 0
for j in range(0, i):
if (string[j] == '{'):
specificPoints += 1
if (string[j] == '}'):
specificPoints -= 1
totalPoints += specificPoints
return totalPoints
cleaned = ""
inTrash = False
trashChars = 0
i = 0
while i<len(inputText):
if inTrash == False:
if (inputText[i] == '<'):
inTrash = True
else:
cleaned += inputText[i]
else:
# Else in trash and keep track of everything.
if (inputText[i] == '!'):
i += 1 # This will effectively skip the next character.
elif (inputText[i] == '>'):
inTrash = False
else:
trashChars += 1
i += 1
print(cleaned)
print("It has", trashChars, "in the trash.")
print("Worth", value(cleaned), "points.")
| input_text = '{{{{{{<!>!>,<o!>},<a,"i!!!>i!!,!>,<<e<i<<>,{{{<!>},<!><!>,<!!!>!!!>!!!>{"!>},<!!!<!>},<oi!>!,\'>}}}},{{<{!!!>},<!!,!!!>!!!>!!e!a!!!!<!>},<!!!>u!>,<!>!!u!!!!!>},<!>!>,<{>}},{<"a!!!!\'!>},<!}"!>!!<o}i!<>,<<e,<eo!a}!!"!>,<!>!>!>,<e{"e">}},{{<!oi\'<!o!>ue>,{<!>},<i!>,<i>,{<\'>}}}},{{<"a,!>},<!!e!>,<e!!}!!o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<"!>,<!!!>\'>},{}},{{{<!,!eu!>\'u!!{!!!>e}\'o!e!!!!!>o>},{<"!!!>}!<i!!!>!\'!!!uooeo!a!"!iio!!>}},<o!!!{e"}!!!>!u!"{,!>!>!>},<u!\'>},{<!>},<a!a}!!!>{!i!!!!auo<i>}},{<"\'!>},<{e!!!>!!uu!>,<!!a>,{<o"o!>},<!>,<!"}"o!{\'{,!>},<>}}}},{{{<!!{"""!!,>},<!i<<>},{{<!!o"!e>}},{{{<e}!!!}>}},{<<!!!>!>,<!>,<!u!!!!!!,u!!!!!!!!!!!>,<\'!>"!!!>{>}}}},{}}}'
def value(string):
total_points = 0
for i in range(0, len(string)):
if string[i] == '}':
specific_points = 0
for j in range(0, i):
if string[j] == '{':
specific_points += 1
if string[j] == '}':
specific_points -= 1
total_points += specificPoints
return totalPoints
cleaned = ''
in_trash = False
trash_chars = 0
i = 0
while i < len(inputText):
if inTrash == False:
if inputText[i] == '<':
in_trash = True
else:
cleaned += inputText[i]
elif inputText[i] == '!':
i += 1
elif inputText[i] == '>':
in_trash = False
else:
trash_chars += 1
i += 1
print(cleaned)
print('It has', trashChars, 'in the trash.')
print('Worth', value(cleaned), 'points.') |
bedroom_choices = {
'1': 1,
'2': 2,
'3': 3,
'4': 4,
'5': 5,
'6': 6,
'7': 7,
'8': 8,
'9': 9,
'10': 10
}
price_choices = {
'100000': 'KES100,000',
'200000': 'KES200,000',
'300000': 'KES300,000',
'400000': 'KES400,000',
'500000': 'KES500,000',
'600000': 'KES600,000',
'700000': 'KES700,000',
'800000': 'KES800,000',
'900000': 'KES900,000',
'1000000': 'KES1M+',
}
state_choices = {
'BAR': 'Baringo',
'BMT': 'Bomet',
'BGM': 'Bungoma',
'BSA': 'Busia',
'EGM': 'Elgeyo Marakwet',
'EBU': 'Embu',
'GSA': 'Garissa',
'HMA': 'Homa Bay',
'ISL': 'Isiolo',
'KAJ': 'Kajiado',
'KAK': 'Kakamega',
'KCO': 'Kericho',
'KBU': 'Kiambu',
'KLF': 'Kilifi',
'KIR': 'Kirinyaga',
'KSI': 'Kisii',
'KSM': 'Kisumu',
'KTU': 'Kitui',
'KLE': 'Kwale',
'LKP': 'Laikipia',
'LAU': 'Lamu',
'MCS': 'Machakos',
'MUE': 'Makueni',
'MDA': 'Mandera',
'MAR': 'Marsabit',
'MRU': 'Meru',
'MIG': 'Migori',
'MSA': 'Mombasa',
'MRA': "Murang'a",
'NBO': 'Nairobi',
'NKU': 'Nakuru',
'NDI': 'Nandi',
'NRK': 'Narok',
'NYI': 'Nyamira',
'NDR': 'Nyandarua',
'NER': 'Nyeri',
'SMB': 'Samburu',
'SYA': 'Siaya',
'TVT': 'Taita Taveta',
'TAN': 'Tana River',
'TNT': 'Tharaka Nithi',
'TRN': 'Trans Nzoia',
'TUR': 'Turkana',
'USG': 'Uasin Gishu',
'VHG': 'Vihiga',
'WJR': 'Wajir',
'PKT': 'West Pokot'
}
| bedroom_choices = {'1': 1, '2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10}
price_choices = {'100000': 'KES100,000', '200000': 'KES200,000', '300000': 'KES300,000', '400000': 'KES400,000', '500000': 'KES500,000', '600000': 'KES600,000', '700000': 'KES700,000', '800000': 'KES800,000', '900000': 'KES900,000', '1000000': 'KES1M+'}
state_choices = {'BAR': 'Baringo', 'BMT': 'Bomet', 'BGM': 'Bungoma', 'BSA': 'Busia', 'EGM': 'Elgeyo Marakwet', 'EBU': 'Embu', 'GSA': 'Garissa', 'HMA': 'Homa Bay', 'ISL': 'Isiolo', 'KAJ': 'Kajiado', 'KAK': 'Kakamega', 'KCO': 'Kericho', 'KBU': 'Kiambu', 'KLF': 'Kilifi', 'KIR': 'Kirinyaga', 'KSI': 'Kisii', 'KSM': 'Kisumu', 'KTU': 'Kitui', 'KLE': 'Kwale', 'LKP': 'Laikipia', 'LAU': 'Lamu', 'MCS': 'Machakos', 'MUE': 'Makueni', 'MDA': 'Mandera', 'MAR': 'Marsabit', 'MRU': 'Meru', 'MIG': 'Migori', 'MSA': 'Mombasa', 'MRA': "Murang'a", 'NBO': 'Nairobi', 'NKU': 'Nakuru', 'NDI': 'Nandi', 'NRK': 'Narok', 'NYI': 'Nyamira', 'NDR': 'Nyandarua', 'NER': 'Nyeri', 'SMB': 'Samburu', 'SYA': 'Siaya', 'TVT': 'Taita Taveta', 'TAN': 'Tana River', 'TNT': 'Tharaka Nithi', 'TRN': 'Trans Nzoia', 'TUR': 'Turkana', 'USG': 'Uasin Gishu', 'VHG': 'Vihiga', 'WJR': 'Wajir', 'PKT': 'West Pokot'} |
with open("./Day_Three/input.txt") as File:
input = File.read().strip().split("\n")
class Main():
def __init__(self, input):
self.input = input
def partOne(input: str) -> int:
finalArr = [ {0:0, 1:0} for _ in range(len(input[0]))]
for row in input:
for i, v in enumerate(row):
v = int(v)
finalArr[i][v] += 1
print(finalArr)
gam = [0] * len(finalArr)
eps = [0]* len(finalArr)
for j, v in enumerate(finalArr):
gam[j] = "0" if v[0]>v[1] else "1"
eps[j] = "1" if v[0]>v[1] else "0"
def binToDec(bin):
print(bin)
dec = 0
for i in range(len(bin)):
digit = bin.pop()
if digit == '1':
dec = dec + pow(2, i)
return(dec)
powerConsumption = binToDec(gam) * binToDec(eps)
print(powerConsumption)
# Part 2
def partTwo(input: str) -> int:
arr = input
def binToDec(bin):
dec = 0
bin = [i for i in bin]
for i in range(len(bin)):
digit = bin.pop()
if digit == '1':
dec = dec + pow(2, i)
return(dec)
searchVal = 0
rowIndex = 0
charIndex = 0
finalVal = []
while rowIndex <= len(input[0])-1:
left = []
right = []
for i, row in enumerate(input):
left.append(row) if row[charIndex] == "0" else right.append(row)
# Generator Logic
if searchVal == 1:
input = right if len(right) >= len(left) else left
# Scrubber Logic
if searchVal == 0:
input = left if len(left) <= len(right) else right
rowIndex += 1
charIndex += 1
left = []
right = []
if len(input) == 1 and searchVal == 0:
print("Generator Result: ", input)
finalVal.append(binToDec(input[0]))
rowIndex = 0
charIndex = 0
searchVal = 1
input = arr
if len(input) == 1 and searchVal == 1:
print("Scrubber Result: ", input)
finalVal.append(binToDec(input[0]))
print(finalVal[0] * finalVal[1])
main = Main
# main.partOne(input)
main.partTwo(input)
| with open('./Day_Three/input.txt') as file:
input = File.read().strip().split('\n')
class Main:
def __init__(self, input):
self.input = input
def part_one(input: str) -> int:
final_arr = [{0: 0, 1: 0} for _ in range(len(input[0]))]
for row in input:
for (i, v) in enumerate(row):
v = int(v)
finalArr[i][v] += 1
print(finalArr)
gam = [0] * len(finalArr)
eps = [0] * len(finalArr)
for (j, v) in enumerate(finalArr):
gam[j] = '0' if v[0] > v[1] else '1'
eps[j] = '1' if v[0] > v[1] else '0'
def bin_to_dec(bin):
print(bin)
dec = 0
for i in range(len(bin)):
digit = bin.pop()
if digit == '1':
dec = dec + pow(2, i)
return dec
power_consumption = bin_to_dec(gam) * bin_to_dec(eps)
print(powerConsumption)
def part_two(input: str) -> int:
arr = input
def bin_to_dec(bin):
dec = 0
bin = [i for i in bin]
for i in range(len(bin)):
digit = bin.pop()
if digit == '1':
dec = dec + pow(2, i)
return dec
search_val = 0
row_index = 0
char_index = 0
final_val = []
while rowIndex <= len(input[0]) - 1:
left = []
right = []
for (i, row) in enumerate(input):
left.append(row) if row[charIndex] == '0' else right.append(row)
if searchVal == 1:
input = right if len(right) >= len(left) else left
if searchVal == 0:
input = left if len(left) <= len(right) else right
row_index += 1
char_index += 1
left = []
right = []
if len(input) == 1 and searchVal == 0:
print('Generator Result: ', input)
finalVal.append(bin_to_dec(input[0]))
row_index = 0
char_index = 0
search_val = 1
input = arr
if len(input) == 1 and searchVal == 1:
print('Scrubber Result: ', input)
finalVal.append(bin_to_dec(input[0]))
print(finalVal[0] * finalVal[1])
main = Main
main.partTwo(input) |
#########################################################
# Author: Zach, Dave and Feroz Farazi (msff2@cam.ac.uk) #
# Date: 24 Nov 2020 #
#########################################################
"""This module defines SPARQL queries"""
def get_lucode_label():
"""Sets the current SPARQL query"""
query = """
Prefix ns1:<http://www.theworldavatar.com/kb/ontocropenergy/>
Prefix ns2: <http://www.theworldavatar.com/ontology/ontocropenergy/OntoCropEnergy.owl#>
Prefix ns3: <http://www.theworldavatar.com/ontology/ontospecies/OntoSpecies.owl#>
Prefix OLU: <http://www.theworldavatar.com/ontology/ontolanduse/OntoLandUse.owl#>
Prefix OCMGML: <http://www.theworldavatar.com/ontology/ontocropmapgml/OntoCropMapGML.owl#>
SELECT ?Crop ?Lucode
WHERE
{
?Crop OCMGML:hasLucode ?Lucode .
Filter(?Crop=ns1:SpringWheat||?Crop=ns1:WinterWheat||?Crop=ns1:SpringOilseed||?Crop=ns1:WinterOilseed||?Crop=ns1:Miscanthus)
}
"""
return query
def get_crop_energy(crop_iri):
"""Sets the current SPARQL query"""
query = """
Prefix ns1:<http://www.theworldavatar.com/kb/ontocropenergy/>
Prefix ns2: <http://www.theworldavatar.com/ontology/ontocropenergy/OntoCropEnergy.owl#>
Prefix ns3: <http://www.theworldavatar.com/ontology/ontospecies/OntoSpecies.owl#>
Prefix OLU: <http://www.theworldavatar.com/ontology/ontolanduse/OntoLandUse.owl#>
Prefix OCMGML: <http://www.theworldavatar.com/ontology/ontocropmapgml/OntoCropMapGML.owl#>
SELECT ?HHV
WHERE
{
<%s> ns2:hasGrossCalorificValue ?HHVRef .
?HHVRef ns3:value ?HHV .
}
""" % crop_iri
return query
def get_crop_yield(crop_iri):
"""Sets the current SPARQL query"""
query = """
Prefix ns1:<http://www.theworldavatar.com/kb/ontocropenergy/>
Prefix ns2: <http://www.theworldavatar.com/ontology/ontocropenergy/OntoCropEnergy.owl#>
Prefix ns3: <http://www.theworldavatar.com/ontology/ontospecies/OntoSpecies.owl#>
Prefix OLU: <http://www.theworldavatar.com/ontology/ontolanduse/OntoLandUse.owl#>
SELECT ?Yield
WHERE
{
<%s> ns2:hasCropYield ?YieldRef .
?YieldRef ns3:value ?Yield .
}
""" % crop_iri
return query
def get_crop():
"""Sets the current SPARQL query"""
query = """
PREFIX geoliteral: <http://www.bigdata.com/rdf/geospatial/literals/v1#>
PREFIX geo: <http://www.bigdata.com/rdf/geospatial#>
PREFIX vocabTerm: <http://vocab.datex.org/terms#>
PREFIX ns2: <http://www.theworldavatar.com/ontology/ontocropmapgml/OntoCropMapGML.owl#>
SELECT ?Lucode (COUNT(?Lucode) AS ?LucodeTotal) WHERE {
SERVICE geo:search {
?cropMap geo:search "inCircle" .
?cropMap geo:predicate vocabTerm:centrePoint .
?cropMap geo:searchDatatype geoliteral:lat-lon .
?cropMap geo:spatialCircleCenter "52.398370#0.131902" .
?cropMap geo:spatialCircleRadius "96.5606" . # default unit: Kilometers
?cropMap geo:locationValue ?locationValue.
?cropMap geo:latValue ?centrePointLatitude .
?cropMap geo:lonValue ?centrePointlongitude .
}
?cropMap ns2:hasLucode ?Lucode
}
GROUP BY ?Lucode
ORDER BY DESC(?LucodeTotal)
"""
return query
def get_use_case_power_plant_iri(power_plant_name):
power_plant = "http://www.theworldavatar.com/kb/UK_Digital_Twin/UK_power_plant/"+power_plant_name+".owl#"+power_plant_name
query = """
PREFIX powerplant:<http://www.theworldavatar.com/ontology/ontoeip/powerplants/PowerPlant.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
SELECT ?powerPlantIRI
WHERE
{
?powerPlantIRI rdf:type powerplant:PowerPlant .
Filter(?powerPlantIRI = <%s>)
}
""" % power_plant
return query
def get_power_plant_coordinates(power_plant_iri):
query = """
PREFIX system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/system.owl#>
PREFIX space_and_time_extended:<http://www.theworldavatar.com/ontology/ontocape/supporting_concepts/space_and_time/space_and_time_extended.owl#>
SELECT ?latitude ?longitude
WHERE
{
<%s> space_and_time_extended:hasGISCoordinateSystem ?CoordinateSystem .
?CoordinateSystem space_and_time_extended:hasProjectedCoordinate_x ?x_coordinate .
?CoordinateSystem space_and_time_extended:hasProjectedCoordinate_y ?y_coordinate .
?x_coordinate system:hasValue ?GPS_x_coordinate .
?y_coordinate system:hasValue ?GPS_y_coordinate .
?GPS_x_coordinate system:numericalValue ?longitude .
?GPS_y_coordinate system:numericalValue ?latitude .
}
""" % power_plant_iri
return query
def get_fuel_type(power_plant_iri):
query = """
PREFIX powerplant: <http://www.theworldavatar.com/ontology/ontoeip/powerplants/PowerPlant.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX technical_system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/technical_system.owl#>
SELECT ?fuel
WHERE
{
<%s> technical_system:realizes ?Generation_Type .
?Generation_Type powerplant:consumesPrimaryFuel ?fuel .
}
""" % power_plant_iri
return query
def get_capacity(power_plant_iri):
query = """
PREFIX system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/system.owl#>
PREFIX system_realization: <http://www.theworldavatar.com/ontology/ontoeip/system_aspects/system_realization.owl#>
SELECT ?capacity ?capacity_units
WHERE
{
<%s> system_realization:designCapacity ?Capacity .
?Capacity system:hasValue ?Capacity_value .
?Capacity_value system:numericalValue ?capacity .
?Capacity_value system:hasUnitOfMeasure ?capacity_units .
}
""" % power_plant_iri
return query
def get_generation(power_plant_iri):
query = """
PREFIX powerplant: <http://www.theworldavatar.com/ontology/ontoeip/powerplants/PowerPlant.owl#>
PREFIX system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/system.owl#>
PREFIX technical_system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/technical_system.owl#>
SELECT DISTINCT ?value_of_AnnualGeneration ?unit_of_AnnualGeneration
WHERE
{
<%s> technical_system:realizes ?Generation_Type .
?Generation_Type powerplant:hasAnnualGeneration ?AnnualGeneration .
?AnnualGeneration system:hasValue ?AnnualGeneration_value .
?AnnualGeneration_value system:numericalValue ?value_of_AnnualGeneration .
?AnnualGeneration_value system:hasUnitOfMeasure ?unit_of_AnnualGeneration .
}
""" % power_plant_iri
return query
# def get_lucode_count(circleCentre, lucode):
# query = """
# PREFIX geoliteral: <http://www.bigdata.com/rdf/geospatial/literals/v1#>
# PREFIX geo: <http://www.bigdata.com/rdf/geospatial#>
# PREFIX vocabTerm: <http://vocab.datex.org/terms#>
# PREFIX ns2: <http://www.theworldavatar.com/ontology/ontocropmapgml/OntoCropMapGML.owl#>
# PREFIX ontolanduse: <http://www.theworldavatar.com/kb/ontolanduse/>
#
# SELECT ?Lucode (COUNT(?Lucode) AS ?LucodeTotal) WHERE {
# SERVICE geo:search {
# ?cropMap geo:search "inCircle" .
# ?cropMap geo:predicate vocabTerm:centrePoint .
# ?cropMap geo:searchDatatype geoliteral:lat-lon .
# ?cropMap geo:spatialCircleCenter %s .
# ?cropMap geo:spatialCircleRadius "96.5606" . # default unit: Kilometers
# ?cropMap geo:locationValue ?locationValue.
# ?cropMap geo:latValue ?centrePointLatitude .
# ?cropMap geo:lonValue ?centrePointlongitude .
# }
# ?cropMap ns2:hasLucode ?Lucode .
# Filter(?Lucode = ontolanduse:%s)
# }
# GROUP BY ?Lucode
# """ % (circleCentre, lucode)
# return query
def get_lucode_count(circleCentre):
query = """
PREFIX geoliteral: <http://www.bigdata.com/rdf/geospatial/literals/v1#>
PREFIX geo: <http://www.bigdata.com/rdf/geospatial#>
PREFIX vocabTerm: <http://vocab.datex.org/terms#>
PREFIX ns2: <http://www.theworldavatar.com/ontology/ontocropmapgml/OntoCropMapGML.owl#>
PREFIX ontolanduse: <http://www.theworldavatar.com/kb/ontolanduse/>
SELECT ?Lucode (COUNT(?Lucode) AS ?LucodeTotal) WHERE {
SERVICE geo:search {
?cropMap geo:search "inCircle" .
?cropMap geo:predicate vocabTerm:centrePoint .
?cropMap geo:searchDatatype geoliteral:lat-lon .
?cropMap geo:spatialCircleCenter %s .
?cropMap geo:spatialCircleRadius "96.5606" . # default unit: Kilometers
?cropMap geo:locationValue ?locationValue.
?cropMap geo:latValue ?centrePointLatitude .
?cropMap geo:lonValue ?centrePointlongitude .
}
?cropMap ns2:hasLucode ?Lucode .
}
GROUP BY ?Lucode
""" % (circleCentre)
return query
if __name__=='__main__':
print(get_generation('http://www.powerplant/iri'))
print(get_lucode_count("52.4356#0.12343")) | """This module defines SPARQL queries"""
def get_lucode_label():
"""Sets the current SPARQL query"""
query = '\n Prefix ns1:<http://www.theworldavatar.com/kb/ontocropenergy/> \n Prefix ns2: <http://www.theworldavatar.com/ontology/ontocropenergy/OntoCropEnergy.owl#> \n Prefix ns3: <http://www.theworldavatar.com/ontology/ontospecies/OntoSpecies.owl#> \n Prefix OLU: <http://www.theworldavatar.com/ontology/ontolanduse/OntoLandUse.owl#> \n Prefix OCMGML: <http://www.theworldavatar.com/ontology/ontocropmapgml/OntoCropMapGML.owl#> \n \n SELECT ?Crop ?Lucode \n WHERE \n { \n ?Crop OCMGML:hasLucode ?Lucode .\n \n Filter(?Crop=ns1:SpringWheat||?Crop=ns1:WinterWheat||?Crop=ns1:SpringOilseed||?Crop=ns1:WinterOilseed||?Crop=ns1:Miscanthus) \n \n } \n\n '
return query
def get_crop_energy(crop_iri):
"""Sets the current SPARQL query"""
query = '\n Prefix ns1:<http://www.theworldavatar.com/kb/ontocropenergy/> \n Prefix ns2: <http://www.theworldavatar.com/ontology/ontocropenergy/OntoCropEnergy.owl#> \n Prefix ns3: <http://www.theworldavatar.com/ontology/ontospecies/OntoSpecies.owl#> \n Prefix OLU: <http://www.theworldavatar.com/ontology/ontolanduse/OntoLandUse.owl#> \n Prefix OCMGML: <http://www.theworldavatar.com/ontology/ontocropmapgml/OntoCropMapGML.owl#> \n \n SELECT ?HHV \n WHERE \n { \n <%s> ns2:hasGrossCalorificValue ?HHVRef .\n \n ?HHVRef ns3:value ?HHV .\n } \n\n ' % crop_iri
return query
def get_crop_yield(crop_iri):
"""Sets the current SPARQL query"""
query = '\n Prefix ns1:<http://www.theworldavatar.com/kb/ontocropenergy/>\n Prefix ns2: <http://www.theworldavatar.com/ontology/ontocropenergy/OntoCropEnergy.owl#>\n Prefix ns3: <http://www.theworldavatar.com/ontology/ontospecies/OntoSpecies.owl#>\n Prefix OLU: <http://www.theworldavatar.com/ontology/ontolanduse/OntoLandUse.owl#>\n\n SELECT ?Yield\n WHERE \n { \n <%s> ns2:hasCropYield ?YieldRef .\n \n ?YieldRef ns3:value ?Yield .\n }\n\n ' % crop_iri
return query
def get_crop():
"""Sets the current SPARQL query"""
query = '\n PREFIX geoliteral: <http://www.bigdata.com/rdf/geospatial/literals/v1#>\n PREFIX geo: <http://www.bigdata.com/rdf/geospatial#>\n PREFIX vocabTerm: <http://vocab.datex.org/terms#>\n PREFIX ns2: <http://www.theworldavatar.com/ontology/ontocropmapgml/OntoCropMapGML.owl#>\n\n SELECT ?Lucode (COUNT(?Lucode) AS ?LucodeTotal) WHERE {\n SERVICE geo:search {\n ?cropMap geo:search "inCircle" .\n ?cropMap geo:predicate vocabTerm:centrePoint .\n ?cropMap geo:searchDatatype geoliteral:lat-lon .\n ?cropMap geo:spatialCircleCenter "52.398370#0.131902" . \n ?cropMap geo:spatialCircleRadius "96.5606" . # default unit: Kilometers\n ?cropMap geo:locationValue ?locationValue. \n ?cropMap geo:latValue ?centrePointLatitude .\n ?cropMap geo:lonValue ?centrePointlongitude .\n }\n ?cropMap ns2:hasLucode ?Lucode\n }\n GROUP BY ?Lucode\n ORDER BY DESC(?LucodeTotal)\n '
return query
def get_use_case_power_plant_iri(power_plant_name):
power_plant = 'http://www.theworldavatar.com/kb/UK_Digital_Twin/UK_power_plant/' + power_plant_name + '.owl#' + power_plant_name
query = '\n PREFIX powerplant:<http://www.theworldavatar.com/ontology/ontoeip/powerplants/PowerPlant.owl#>\n PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n SELECT ?powerPlantIRI\n WHERE\n {\n ?powerPlantIRI rdf:type powerplant:PowerPlant .\n Filter(?powerPlantIRI = <%s>)\n }\n ' % power_plant
return query
def get_power_plant_coordinates(power_plant_iri):
query = '\n PREFIX system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/system.owl#>\n PREFIX space_and_time_extended:<http://www.theworldavatar.com/ontology/ontocape/supporting_concepts/space_and_time/space_and_time_extended.owl#>\n SELECT ?latitude ?longitude\n WHERE\n {\n <%s> space_and_time_extended:hasGISCoordinateSystem ?CoordinateSystem .\n ?CoordinateSystem space_and_time_extended:hasProjectedCoordinate_x ?x_coordinate .\n ?CoordinateSystem space_and_time_extended:hasProjectedCoordinate_y ?y_coordinate .\n ?x_coordinate system:hasValue ?GPS_x_coordinate .\n ?y_coordinate system:hasValue ?GPS_y_coordinate . \n ?GPS_x_coordinate system:numericalValue ?longitude .\n ?GPS_y_coordinate system:numericalValue ?latitude .\n }\n ' % power_plant_iri
return query
def get_fuel_type(power_plant_iri):
query = '\n PREFIX powerplant: \t\t\t<http://www.theworldavatar.com/ontology/ontoeip/powerplants/PowerPlant.owl#>\n PREFIX rdf: \t\t\t\t<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\n PREFIX technical_system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/technical_system.owl#>\n SELECT ?fuel\n WHERE\n {\n <%s> technical_system:realizes ?Generation_Type .\n ?Generation_Type powerplant:consumesPrimaryFuel ?fuel .\n }\n ' % power_plant_iri
return query
def get_capacity(power_plant_iri):
query = '\n PREFIX system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/system.owl#>\n PREFIX system_realization: <http://www.theworldavatar.com/ontology/ontoeip/system_aspects/system_realization.owl#>\n SELECT ?capacity ?capacity_units\n WHERE\n {\n <%s> system_realization:designCapacity ?Capacity .\n ?Capacity system:hasValue ?Capacity_value .\n ?Capacity_value system:numericalValue ?capacity .\n ?Capacity_value system:hasUnitOfMeasure ?capacity_units .\n }\n ' % power_plant_iri
return query
def get_generation(power_plant_iri):
query = '\n PREFIX powerplant: <http://www.theworldavatar.com/ontology/ontoeip/powerplants/PowerPlant.owl#>\n PREFIX system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/system.owl#>\n PREFIX technical_system: <http://www.theworldavatar.com/ontology/ontocape/upper_level/technical_system.owl#>\n SELECT DISTINCT ?value_of_AnnualGeneration ?unit_of_AnnualGeneration\n WHERE\n {\n <%s> technical_system:realizes ?Generation_Type .\n ?Generation_Type powerplant:hasAnnualGeneration ?AnnualGeneration .\n ?AnnualGeneration system:hasValue ?AnnualGeneration_value .\n ?AnnualGeneration_value system:numericalValue ?value_of_AnnualGeneration .\n ?AnnualGeneration_value system:hasUnitOfMeasure ?unit_of_AnnualGeneration .\n }\n ' % power_plant_iri
return query
def get_lucode_count(circleCentre):
query = '\n PREFIX geoliteral: <http://www.bigdata.com/rdf/geospatial/literals/v1#>\n PREFIX geo: <http://www.bigdata.com/rdf/geospatial#>\n PREFIX vocabTerm: <http://vocab.datex.org/terms#>\n PREFIX ns2: <http://www.theworldavatar.com/ontology/ontocropmapgml/OntoCropMapGML.owl#>\n PREFIX ontolanduse: <http://www.theworldavatar.com/kb/ontolanduse/>\n\n SELECT ?Lucode (COUNT(?Lucode) AS ?LucodeTotal) WHERE {\n SERVICE geo:search {\n ?cropMap geo:search "inCircle" .\n ?cropMap geo:predicate vocabTerm:centrePoint .\n ?cropMap geo:searchDatatype geoliteral:lat-lon .\n ?cropMap geo:spatialCircleCenter %s .\n ?cropMap geo:spatialCircleRadius "96.5606" . # default unit: Kilometers\n ?cropMap geo:locationValue ?locationValue. \n ?cropMap geo:latValue ?centrePointLatitude .\n ?cropMap geo:lonValue ?centrePointlongitude .\n }\n ?cropMap ns2:hasLucode ?Lucode .\n }\n GROUP BY ?Lucode\n ' % circleCentre
return query
if __name__ == '__main__':
print(get_generation('http://www.powerplant/iri'))
print(get_lucode_count('52.4356#0.12343')) |
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 14 13:43:05 2020
@author: Tushar Saxena
"""
class Node:
def __init__(self, val):
self.left = None
self.right = None
self.val = val
class Tree:
def __init__(self):
self.root = None
def getRoot(self):
return self.root
def add(self, val):
if self.root is None:
self.root = Node(val)
else:
self._add(val, self.root)
def _add(self, val, node):
if val < node.val:
if node.left is not None:
self._add(val, node.left)
else:
node.left = Node(val)
else:
if node.right is not None:
self._add(val, node.right)
else:
node.right = Node(val)
def find(self, val):
if self.root is not None:
return self._find(val, self.root)
def _find(self, val, node):
if val == node.val:
print("Found")
elif val < node.val and node.left is not None:
self._find(val, node.left)
elif val > node.val and node.right is not None:
self._find(val, node.right)
else:
print("Not Found")
def deleteTree(self):
self.root = None
print("Tree Deleted!")
def printTree(self):
if self.root is not None:
self._printTree(self.root)
def _printTree(self, node):
if node is not None:
self._printTree(node.left)
print('| ', str(node.val), ' |')
self._printTree(node.right)
tree = Tree()
while True:
print('1: Print Tree')
print('2: Add Element')
print('3: Delete Tree')
print('4: Find Element')
print('0: Exit')
choice = int(input("Enter your choice."))
if choice == 1:
tree.printTree()
elif choice == 2:
val = int(input("Enter the value to be added!"))
tree.add(val)
elif choice == 3:
tree.deleteTree()
elif choice == 4:
val = int(input("Enter the value to be found!"))
tree.find(val)
elif choice == 0:
break
else:
print("Enter valid choice!") | """
Created on Tue Jan 14 13:43:05 2020
@author: Tushar Saxena
"""
class Node:
def __init__(self, val):
self.left = None
self.right = None
self.val = val
class Tree:
def __init__(self):
self.root = None
def get_root(self):
return self.root
def add(self, val):
if self.root is None:
self.root = node(val)
else:
self._add(val, self.root)
def _add(self, val, node):
if val < node.val:
if node.left is not None:
self._add(val, node.left)
else:
node.left = node(val)
elif node.right is not None:
self._add(val, node.right)
else:
node.right = node(val)
def find(self, val):
if self.root is not None:
return self._find(val, self.root)
def _find(self, val, node):
if val == node.val:
print('Found')
elif val < node.val and node.left is not None:
self._find(val, node.left)
elif val > node.val and node.right is not None:
self._find(val, node.right)
else:
print('Not Found')
def delete_tree(self):
self.root = None
print('Tree Deleted!')
def print_tree(self):
if self.root is not None:
self._printTree(self.root)
def _print_tree(self, node):
if node is not None:
self._printTree(node.left)
print('| ', str(node.val), ' |')
self._printTree(node.right)
tree = tree()
while True:
print('1: Print Tree')
print('2: Add Element')
print('3: Delete Tree')
print('4: Find Element')
print('0: Exit')
choice = int(input('Enter your choice.'))
if choice == 1:
tree.printTree()
elif choice == 2:
val = int(input('Enter the value to be added!'))
tree.add(val)
elif choice == 3:
tree.deleteTree()
elif choice == 4:
val = int(input('Enter the value to be found!'))
tree.find(val)
elif choice == 0:
break
else:
print('Enter valid choice!') |
# Single Number
# Given a non-empty array of integers, every element appears twice except for one. Find that single one.
# Note:
# Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
# Example 1:
# Input: [2,2,1]
# Output: 1
# Example 2:
# Input: [4,1,2,1,2]
# Output: 4
def singleNumber(nums):
seen = []
for i in nums:
if i in seen:
seen.remove(i)
else:
seen.append(i)
return seen[0]
if __name__ == "__main__":
nums = list(map(int, input().split(',')))
r = singleNumber(nums)
print(r)
| def single_number(nums):
seen = []
for i in nums:
if i in seen:
seen.remove(i)
else:
seen.append(i)
return seen[0]
if __name__ == '__main__':
nums = list(map(int, input().split(',')))
r = single_number(nums)
print(r) |
n = int(input())
cod = []
tmp = False
for i in range(n):
cod.append(input())
for i in range(n):
for j in list(set(cod) - set(cod[i])):
for k in list(set(cod) - set([cod[i],j])):
if k in cod[i] + j or k in j + cod[i]:
print(k)
tmp = True
break
if tmp:
break
if tmp:
break
if not tmp:
print('ok')
| n = int(input())
cod = []
tmp = False
for i in range(n):
cod.append(input())
for i in range(n):
for j in list(set(cod) - set(cod[i])):
for k in list(set(cod) - set([cod[i], j])):
if k in cod[i] + j or k in j + cod[i]:
print(k)
tmp = True
break
if tmp:
break
if tmp:
break
if not tmp:
print('ok') |
# Leo colorizer control file for splus mode.
# This file is in the public domain.
# Properties for splus mode.
properties = {
"doubleBracketIndent": "false",
"indentCloseBrackets": "}",
"indentNextLine": "\\s*(((if|while)\\s*\\(|else\\s*|else\\s+if\\s*\\(|for\\s*\\(.*\\))[^{;]*)",
"indentOpenBrackets": "{",
"lineComment": "#",
"lineUpClosingBracket": "true",
"wordBreakChars": "_,+-=<>/?^&*",
}
# Attributes dict for splus_main ruleset.
splus_main_attributes_dict = {
"default": "null",
"digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)",
"escape": "\\",
"highlight_digits": "true",
"ignore_case": "false",
"no_word_sep": "",
}
# Dictionary of attributes dictionaries for splus mode.
attributesDictDict = {
"splus_main": splus_main_attributes_dict,
}
# Keywords dict for splus_main ruleset.
splus_main_keywords_dict = {
"F": "literal2",
"T": "literal2",
"break": "keyword1",
"case": "keyword1",
"continue": "keyword1",
"default": "keyword1",
"do": "keyword1",
"else": "keyword1",
"for": "keyword1",
"function": "keyword1",
"goto": "keyword1",
"if": "keyword1",
"return": "keyword1",
"sizeof": "keyword1",
"switch": "keyword1",
"while": "keyword1",
}
# Dictionary of keywords dictionaries for splus mode.
keywordsDictDict = {
"splus_main": splus_main_keywords_dict,
}
# Rules for splus_main ruleset.
def splus_rule0(colorer, s, i):
return colorer.match_span(s, i, kind="literal1", begin="\"", end="\"",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="",exclude_match=False,
no_escape=False, no_line_break=True, no_word_break=False)
def splus_rule1(colorer, s, i):
return colorer.match_span(s, i, kind="literal1", begin="'", end="'",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="",exclude_match=False,
no_escape=False, no_line_break=True, no_word_break=False)
def splus_rule2(colorer, s, i):
return colorer.match_eol_span(s, i, kind="comment1", seq="#",
at_line_start=False, at_whitespace_end=False, at_word_start=False,
delegate="", exclude_match=False)
def splus_rule3(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="=",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule4(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="!",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule5(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="_",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule6(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq=">=",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule7(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="<=",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule8(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="<-",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule9(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="+",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule10(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="-",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule11(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="/",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule12(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="*",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule13(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq=">",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule14(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="<",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule15(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="%",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule16(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="&",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule17(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="|",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule18(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="^",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule19(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="~",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule20(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="}",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule21(colorer, s, i):
return colorer.match_seq(s, i, kind="operator", seq="{",
at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="")
def splus_rule22(colorer, s, i):
return colorer.match_mark_previous(s, i, kind="label", pattern=":",
at_line_start=False, at_whitespace_end=True, at_word_start=False, exclude_match=True)
def splus_rule23(colorer, s, i):
return colorer.match_mark_previous(s, i, kind="function", pattern="(",
at_line_start=False, at_whitespace_end=False, at_word_start=False, exclude_match=True)
def splus_rule24(colorer, s, i):
return colorer.match_keywords(s, i)
# Rules dict for splus_main ruleset.
rulesDict1 = {
"!": [splus_rule4,],
"\"": [splus_rule0,],
"#": [splus_rule2,],
"%": [splus_rule15,],
"&": [splus_rule16,],
"'": [splus_rule1,],
"(": [splus_rule23,],
"*": [splus_rule12,],
"+": [splus_rule9,],
"-": [splus_rule10,],
"/": [splus_rule11,],
"0": [splus_rule24,],
"1": [splus_rule24,],
"2": [splus_rule24,],
"3": [splus_rule24,],
"4": [splus_rule24,],
"5": [splus_rule24,],
"6": [splus_rule24,],
"7": [splus_rule24,],
"8": [splus_rule24,],
"9": [splus_rule24,],
":": [splus_rule22,],
"<": [splus_rule7,splus_rule8,splus_rule14,],
"=": [splus_rule3,],
">": [splus_rule6,splus_rule13,],
"@": [splus_rule24,],
"A": [splus_rule24,],
"B": [splus_rule24,],
"C": [splus_rule24,],
"D": [splus_rule24,],
"E": [splus_rule24,],
"F": [splus_rule24,],
"G": [splus_rule24,],
"H": [splus_rule24,],
"I": [splus_rule24,],
"J": [splus_rule24,],
"K": [splus_rule24,],
"L": [splus_rule24,],
"M": [splus_rule24,],
"N": [splus_rule24,],
"O": [splus_rule24,],
"P": [splus_rule24,],
"Q": [splus_rule24,],
"R": [splus_rule24,],
"S": [splus_rule24,],
"T": [splus_rule24,],
"U": [splus_rule24,],
"V": [splus_rule24,],
"W": [splus_rule24,],
"X": [splus_rule24,],
"Y": [splus_rule24,],
"Z": [splus_rule24,],
"^": [splus_rule18,],
"_": [splus_rule5,],
"a": [splus_rule24,],
"b": [splus_rule24,],
"c": [splus_rule24,],
"d": [splus_rule24,],
"e": [splus_rule24,],
"f": [splus_rule24,],
"g": [splus_rule24,],
"h": [splus_rule24,],
"i": [splus_rule24,],
"j": [splus_rule24,],
"k": [splus_rule24,],
"l": [splus_rule24,],
"m": [splus_rule24,],
"n": [splus_rule24,],
"o": [splus_rule24,],
"p": [splus_rule24,],
"q": [splus_rule24,],
"r": [splus_rule24,],
"s": [splus_rule24,],
"t": [splus_rule24,],
"u": [splus_rule24,],
"v": [splus_rule24,],
"w": [splus_rule24,],
"x": [splus_rule24,],
"y": [splus_rule24,],
"z": [splus_rule24,],
"{": [splus_rule21,],
"|": [splus_rule17,],
"}": [splus_rule20,],
"~": [splus_rule19,],
}
# x.rulesDictDict for splus mode.
rulesDictDict = {
"splus_main": rulesDict1,
}
# Import dict for splus mode.
importDict = {}
| properties = {'doubleBracketIndent': 'false', 'indentCloseBrackets': '}', 'indentNextLine': '\\s*(((if|while)\\s*\\(|else\\s*|else\\s+if\\s*\\(|for\\s*\\(.*\\))[^{;]*)', 'indentOpenBrackets': '{', 'lineComment': '#', 'lineUpClosingBracket': 'true', 'wordBreakChars': '_,+-=<>/?^&*'}
splus_main_attributes_dict = {'default': 'null', 'digit_re': '(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)', 'escape': '\\', 'highlight_digits': 'true', 'ignore_case': 'false', 'no_word_sep': ''}
attributes_dict_dict = {'splus_main': splus_main_attributes_dict}
splus_main_keywords_dict = {'F': 'literal2', 'T': 'literal2', 'break': 'keyword1', 'case': 'keyword1', 'continue': 'keyword1', 'default': 'keyword1', 'do': 'keyword1', 'else': 'keyword1', 'for': 'keyword1', 'function': 'keyword1', 'goto': 'keyword1', 'if': 'keyword1', 'return': 'keyword1', 'sizeof': 'keyword1', 'switch': 'keyword1', 'while': 'keyword1'}
keywords_dict_dict = {'splus_main': splus_main_keywords_dict}
def splus_rule0(colorer, s, i):
return colorer.match_span(s, i, kind='literal1', begin='"', end='"', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='', exclude_match=False, no_escape=False, no_line_break=True, no_word_break=False)
def splus_rule1(colorer, s, i):
return colorer.match_span(s, i, kind='literal1', begin="'", end="'", at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='', exclude_match=False, no_escape=False, no_line_break=True, no_word_break=False)
def splus_rule2(colorer, s, i):
return colorer.match_eol_span(s, i, kind='comment1', seq='#', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='', exclude_match=False)
def splus_rule3(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='=', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule4(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='!', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule5(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='_', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule6(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='>=', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule7(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='<=', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule8(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='<-', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule9(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='+', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule10(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='-', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule11(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='/', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule12(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='*', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule13(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='>', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule14(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='<', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule15(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='%', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule16(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='&', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule17(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='|', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule18(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='^', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule19(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='~', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule20(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='}', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule21(colorer, s, i):
return colorer.match_seq(s, i, kind='operator', seq='{', at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate='')
def splus_rule22(colorer, s, i):
return colorer.match_mark_previous(s, i, kind='label', pattern=':', at_line_start=False, at_whitespace_end=True, at_word_start=False, exclude_match=True)
def splus_rule23(colorer, s, i):
return colorer.match_mark_previous(s, i, kind='function', pattern='(', at_line_start=False, at_whitespace_end=False, at_word_start=False, exclude_match=True)
def splus_rule24(colorer, s, i):
return colorer.match_keywords(s, i)
rules_dict1 = {'!': [splus_rule4], '"': [splus_rule0], '#': [splus_rule2], '%': [splus_rule15], '&': [splus_rule16], "'": [splus_rule1], '(': [splus_rule23], '*': [splus_rule12], '+': [splus_rule9], '-': [splus_rule10], '/': [splus_rule11], '0': [splus_rule24], '1': [splus_rule24], '2': [splus_rule24], '3': [splus_rule24], '4': [splus_rule24], '5': [splus_rule24], '6': [splus_rule24], '7': [splus_rule24], '8': [splus_rule24], '9': [splus_rule24], ':': [splus_rule22], '<': [splus_rule7, splus_rule8, splus_rule14], '=': [splus_rule3], '>': [splus_rule6, splus_rule13], '@': [splus_rule24], 'A': [splus_rule24], 'B': [splus_rule24], 'C': [splus_rule24], 'D': [splus_rule24], 'E': [splus_rule24], 'F': [splus_rule24], 'G': [splus_rule24], 'H': [splus_rule24], 'I': [splus_rule24], 'J': [splus_rule24], 'K': [splus_rule24], 'L': [splus_rule24], 'M': [splus_rule24], 'N': [splus_rule24], 'O': [splus_rule24], 'P': [splus_rule24], 'Q': [splus_rule24], 'R': [splus_rule24], 'S': [splus_rule24], 'T': [splus_rule24], 'U': [splus_rule24], 'V': [splus_rule24], 'W': [splus_rule24], 'X': [splus_rule24], 'Y': [splus_rule24], 'Z': [splus_rule24], '^': [splus_rule18], '_': [splus_rule5], 'a': [splus_rule24], 'b': [splus_rule24], 'c': [splus_rule24], 'd': [splus_rule24], 'e': [splus_rule24], 'f': [splus_rule24], 'g': [splus_rule24], 'h': [splus_rule24], 'i': [splus_rule24], 'j': [splus_rule24], 'k': [splus_rule24], 'l': [splus_rule24], 'm': [splus_rule24], 'n': [splus_rule24], 'o': [splus_rule24], 'p': [splus_rule24], 'q': [splus_rule24], 'r': [splus_rule24], 's': [splus_rule24], 't': [splus_rule24], 'u': [splus_rule24], 'v': [splus_rule24], 'w': [splus_rule24], 'x': [splus_rule24], 'y': [splus_rule24], 'z': [splus_rule24], '{': [splus_rule21], '|': [splus_rule17], '}': [splus_rule20], '~': [splus_rule19]}
rules_dict_dict = {'splus_main': rulesDict1}
import_dict = {} |
class Solution(object):
def generateParenthesis(self, N):
if N == 0: return ['']
ans = []
for c in range(N):
for left in self.generateParenthesis(c):
for right in self.generateParenthesis(N-1-c):
ans.append('({}){}'.format(left, right))
return ans | class Solution(object):
def generate_parenthesis(self, N):
if N == 0:
return ['']
ans = []
for c in range(N):
for left in self.generateParenthesis(c):
for right in self.generateParenthesis(N - 1 - c):
ans.append('({}){}'.format(left, right))
return ans |
###########################################################
# Fixed parameters for speech recognition
###########################################################
# Model and feature type
model_type = 'Wav2Letter' # DeepSpeech or Wav2Letter
feature_type = 'mfcc' # rawspeech (Wav2Letter), rawframes (DeepSpeech), spectrogram, mfcc, or logmel
# Audio sampling parameters
sample_rate = 16000 # Sample rate
window_size = 0.02 # Window size for spectrogram in seconds
window_stride = 0.01 # Window stride for spectrogram in seconds
window = 'hamming' # Window type to generate spectrogram
# Audio noise parameters
noise_dir = None # directory to inject noise
noise_prob = 0.4 # probability of noise being added per sample
noise_min = 0.0 # minimum noise level to sample from (1.0 means all noise and no original signal)
noise_max = 0.5 # maximum noise level to sample from (1.0 means all noise and no original signal)
# Dataset and model save location
# Note: for ResNet50 must use pre-aligned transcription (e.g., TIMIT)
labels_path = './labels.json' #Contains all characters for prediction
train_manifest = './manifest_files_cm/libri_train_clean_360_manifest.csv' #relative path to train manifest
val_manifest = './manifest_files_cm/libri_val_clean_manifest.csv' #relative path to val manifest
model_path = 'models/deepspeech_rawspeech.pth' # Location to save best validation model
# Model parameters
hidden_size = 768 # Hidden size of RNNs
hidden_layers = 5 # Number of RNN layers
bias = True # Use biases
rnn_type = 'rnn' #Type of the RNN. rnn|gru|lstm are supported
rnn_act_type = 'relu' #Type of the activation within RNN. tanh | relu are supported
bidirectional = False # Whether or not RNN is uni- or bi-directional
# Training parameters
epochs = 70 # Number of training epochs
learning_anneal = 1.1 # Annealing applied to learning rate every epoch
lr = 0.0003 # Initial learning rate
momentum = 0.9 # Momentum
max_norm = 200 # Norm cutoff to prevent explosion of gradients
l2 = 0 # L2 regularization
batch_size = 20 # Batch size for training
augment = True # Use random tempo and gain perturbations
exit_at_acc = True # Exit at given target accuracy
num_workers = 4 # Number of workers used in data-loading
cuda = True # Use cuda to train model
| model_type = 'Wav2Letter'
feature_type = 'mfcc'
sample_rate = 16000
window_size = 0.02
window_stride = 0.01
window = 'hamming'
noise_dir = None
noise_prob = 0.4
noise_min = 0.0
noise_max = 0.5
labels_path = './labels.json'
train_manifest = './manifest_files_cm/libri_train_clean_360_manifest.csv'
val_manifest = './manifest_files_cm/libri_val_clean_manifest.csv'
model_path = 'models/deepspeech_rawspeech.pth'
hidden_size = 768
hidden_layers = 5
bias = True
rnn_type = 'rnn'
rnn_act_type = 'relu'
bidirectional = False
epochs = 70
learning_anneal = 1.1
lr = 0.0003
momentum = 0.9
max_norm = 200
l2 = 0
batch_size = 20
augment = True
exit_at_acc = True
num_workers = 4
cuda = True |
# --------------
# Code starts here
class_1=[]
class_2=[]
class_1.append('Geoffrey Hinton')
class_1.append('Andrew Ng')
class_1.append('Sebastian Raschka')
class_1.append('Yoshua Bengio')
class_2.append('Hilary Mason')
class_2.append('Carla Gentry')
class_2.append('Corinna Cortes')
new_class=class_1 + class_2
print(new_class)
new_class.append('Peter Warden')
print(new_class)
new_class.remove('Carla Gentry')
print(new_class)
# --------------
# Code starts here
courses={"Math":65,'English':70,'History':80,'French':70, 'Science':60}
total=sum(courses.values())
print(total)
percentage= (total/500) * 100
print(percentage)
# Code ends here
# --------------
# Code starts here
mathematics={'Geoffrey Hinton':78,'Andrew Ng':95,'Sebastian Raschka':65, 'Yoshua Benjio':50,'Hilary Mason':70,'Corinna Cortes':66,'Peter Warden':75}
topper=max(mathematics,key=mathematics.get)
print(topper)
# Code ends here
# --------------
# Given string
topper = 'andrew ng'
# Code starts here
first_name,last_name=list(topper.split())
full_name=last_name + " " + first_name
certificate_name=full_name.upper()
print(certificate_name)
# Code ends here
| class_1 = []
class_2 = []
class_1.append('Geoffrey Hinton')
class_1.append('Andrew Ng')
class_1.append('Sebastian Raschka')
class_1.append('Yoshua Bengio')
class_2.append('Hilary Mason')
class_2.append('Carla Gentry')
class_2.append('Corinna Cortes')
new_class = class_1 + class_2
print(new_class)
new_class.append('Peter Warden')
print(new_class)
new_class.remove('Carla Gentry')
print(new_class)
courses = {'Math': 65, 'English': 70, 'History': 80, 'French': 70, 'Science': 60}
total = sum(courses.values())
print(total)
percentage = total / 500 * 100
print(percentage)
mathematics = {'Geoffrey Hinton': 78, 'Andrew Ng': 95, 'Sebastian Raschka': 65, 'Yoshua Benjio': 50, 'Hilary Mason': 70, 'Corinna Cortes': 66, 'Peter Warden': 75}
topper = max(mathematics, key=mathematics.get)
print(topper)
topper = 'andrew ng'
(first_name, last_name) = list(topper.split())
full_name = last_name + ' ' + first_name
certificate_name = full_name.upper()
print(certificate_name) |
class ChannelBirthday:
def __init__(self, channel_id, server_id):
self.channel_id = channel_id
self.server_id = server_id
def __eq__(self, other):
return self.server_id == other.server_id
| class Channelbirthday:
def __init__(self, channel_id, server_id):
self.channel_id = channel_id
self.server_id = server_id
def __eq__(self, other):
return self.server_id == other.server_id |
# pylint: disable=R0903
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
class WafScenarioMixin(object):
profile = None
def current_subscription(self):
subs = self.cmd("az account show").get_output_in_json()
return subs['id']
| class Wafscenariomixin(object):
profile = None
def current_subscription(self):
subs = self.cmd('az account show').get_output_in_json()
return subs['id'] |
class Trie:
def __init__(self, name, isendofword = False ):
self.name = name
self.isendofword = isendofword
self.elements = dict()
def __repr__(self):
return str(
{
'name' : self.name,
'isendiftheword' : self.isendofword,
'elements' : self.elements.keys()
}
)
def search(trie,name):
new = trie
for i in name:
if i in new.elements:
new = new.elements[i]
else:
return False
return True
def printTrie(trie):
if trie:
print(trie.name)
print(trie.elements)
for node in trie.elements:
printTrie(trie.elements.get(node))
def insert(trie,name):
new = trie
for i in range(len(name)):
if name[i] in new.elements:
new = new.elements[name[i]]
if i == len(name) - 1:
new.isendofword = True
else:
node = Trie(name[i])
new.elements[name[i]] = node
new = node
new.isendofword = True
return trie
def sol(trie,name,flag=False,start=0,word = []):
root = trie
for i in range(start, len(name)):
if name[i] in root.elements:
root = root.elements[name[i]]
word.append(name[i])
if flag:
return False
k = word[:]
for j in root.elements:
k = word[:]
k.append(j)
l = checkdictionary(root.elements[j],name, flag = 1,start = i,word = k)
if l:
return l
if trie.isendofword:
return word
else:
for node in root.elements:
if root.elements[node]:
word.append(node)
break
return word
def checkdictionary(trie,name,flag = False, start = None, word = []):
root = trie
if flag ==1:
for i in range(start,len(name)):
if name[i] in root.elements:
root = root.elements[name[i]]
word.append(name[i])
else:
# if abs(len(name) - len(word)) == 1:
# return word
return False
return word
else:
for i in range(len(name)):
if name[i] in root.elements:
root = root.elements[name[i]]
word.append(name[i])
else:
k = word[:]
for j in root.elements:
k = word[:]
k.append(j)
l = checkdictionary(root.elements[j],name, flag = 1,start = i,word = k)
if l:
return l
return word
def solve():
n, q = map(int, input().split())
dictionary = []
trie = Trie(None)
for i in range(n):
name = input()
trie = insert(trie,name)
for i in range(q):
name = input()
print("".join(sol(trie,name, word = [])))
# printTrie(trie)
if __name__ == '__main__':
for t in range(int(input())):
solve() | class Trie:
def __init__(self, name, isendofword=False):
self.name = name
self.isendofword = isendofword
self.elements = dict()
def __repr__(self):
return str({'name': self.name, 'isendiftheword': self.isendofword, 'elements': self.elements.keys()})
def search(trie, name):
new = trie
for i in name:
if i in new.elements:
new = new.elements[i]
else:
return False
return True
def print_trie(trie):
if trie:
print(trie.name)
print(trie.elements)
for node in trie.elements:
print_trie(trie.elements.get(node))
def insert(trie, name):
new = trie
for i in range(len(name)):
if name[i] in new.elements:
new = new.elements[name[i]]
if i == len(name) - 1:
new.isendofword = True
else:
node = trie(name[i])
new.elements[name[i]] = node
new = node
new.isendofword = True
return trie
def sol(trie, name, flag=False, start=0, word=[]):
root = trie
for i in range(start, len(name)):
if name[i] in root.elements:
root = root.elements[name[i]]
word.append(name[i])
if flag:
return False
k = word[:]
for j in root.elements:
k = word[:]
k.append(j)
l = checkdictionary(root.elements[j], name, flag=1, start=i, word=k)
if l:
return l
if trie.isendofword:
return word
else:
for node in root.elements:
if root.elements[node]:
word.append(node)
break
return word
def checkdictionary(trie, name, flag=False, start=None, word=[]):
root = trie
if flag == 1:
for i in range(start, len(name)):
if name[i] in root.elements:
root = root.elements[name[i]]
word.append(name[i])
else:
return False
return word
else:
for i in range(len(name)):
if name[i] in root.elements:
root = root.elements[name[i]]
word.append(name[i])
else:
k = word[:]
for j in root.elements:
k = word[:]
k.append(j)
l = checkdictionary(root.elements[j], name, flag=1, start=i, word=k)
if l:
return l
return word
def solve():
(n, q) = map(int, input().split())
dictionary = []
trie = trie(None)
for i in range(n):
name = input()
trie = insert(trie, name)
for i in range(q):
name = input()
print(''.join(sol(trie, name, word=[])))
if __name__ == '__main__':
for t in range(int(input())):
solve() |
N = int(input()[-1])
if N in [2, 4, 5, 7, 9]:
print("hon")
elif N in [0, 1, 6, 8]:
print("pon")
else:
print("bon")
| n = int(input()[-1])
if N in [2, 4, 5, 7, 9]:
print('hon')
elif N in [0, 1, 6, 8]:
print('pon')
else:
print('bon') |
""" Messenger class file """
class Messenger:
""" Class that represents a messenger object (interface) """
def send(self, user_id: str, text: str):
""" Sends to the user_id (backend must understand) the text message"""
raise NotImplementedError("Abstract method MUST be implemented")
def mark_writing(self, user_id: str, write_on: bool):
""" Sends the user the writing notification"""
# Does nothing if not supported
def mark_seen(self, user_id: str):
""" Sends the user the writing notification"""
# Does nothing if not supported
| """ Messenger class file """
class Messenger:
""" Class that represents a messenger object (interface) """
def send(self, user_id: str, text: str):
""" Sends to the user_id (backend must understand) the text message"""
raise not_implemented_error('Abstract method MUST be implemented')
def mark_writing(self, user_id: str, write_on: bool):
""" Sends the user the writing notification"""
def mark_seen(self, user_id: str):
""" Sends the user the writing notification""" |
# https://www.hackerrank.com/challenges/python-integers-come-in-all-sizes/problem
if __name__ == '__main__':
a = int(input())
b = int(input())
c = int(input())
d = int(input())
caculation = pow(a,b) + pow(c,d)
print(caculation)
| if __name__ == '__main__':
a = int(input())
b = int(input())
c = int(input())
d = int(input())
caculation = pow(a, b) + pow(c, d)
print(caculation) |
class Movie():
""" This Class provides a way to store movie related information
Such as title, storyline, poster image url, and trailer.
To create and instance of the Movie class, import media into
your python file then create an instance by:
variable = media.Movie(movie_title, movie_storyline,
poster_image, trailer_youtube)
"""
def __init__(self, movie_title, movie_storyline,
poster_image, trailer_youtube):
self.title = movie_title
self.storyline = movie_storyline
self.poster_image_url = poster_image
self.trailer_youtube_url = trailer_youtube
| class Movie:
""" This Class provides a way to store movie related information
Such as title, storyline, poster image url, and trailer.
To create and instance of the Movie class, import media into
your python file then create an instance by:
variable = media.Movie(movie_title, movie_storyline,
poster_image, trailer_youtube)
"""
def __init__(self, movie_title, movie_storyline, poster_image, trailer_youtube):
self.title = movie_title
self.storyline = movie_storyline
self.poster_image_url = poster_image
self.trailer_youtube_url = trailer_youtube |
# Union-Find with path compression and union with rank
class UF:
def __init__(self, n):
self.count = [1] * n
self.parent = [_ for _ in range(n)]
def find(self, i): # find root(i) and compress the path
if self.parent[i] != i:
self.parent[i] = self.find(self.parent[i])
return self.parent[i]
def union(self, i, j): # return True if already connected
pi, pj = self.find(i), self.find(j)
if pi != pj:
if self.count[pi] < self.count[pj]:
pi, pj = pj, pi
self.parent[pj] = pi
self.count[pi] += self.count[pj]
return False
return True
| class Uf:
def __init__(self, n):
self.count = [1] * n
self.parent = [_ for _ in range(n)]
def find(self, i):
if self.parent[i] != i:
self.parent[i] = self.find(self.parent[i])
return self.parent[i]
def union(self, i, j):
(pi, pj) = (self.find(i), self.find(j))
if pi != pj:
if self.count[pi] < self.count[pj]:
(pi, pj) = (pj, pi)
self.parent[pj] = pi
self.count[pi] += self.count[pj]
return False
return True |
# Author: BHARATHI KANNAN N - Github: https://github.com/bharathikannann, linkedin: https://linkedin.com/in/bharathikannann
#
# ## Doubly Linked List
# - A doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. Each node contains three fields: two link fields (references to the previous and to the next node in the sequence of nodes) and one data field.
# - The two node links allow traversal of the list in either direction.
#Structure of the node for our doubly linked list
class Node(object):
#Each node has its data and two pointers which points to the next data and previous data
def __init__(self, data, next = None, prev = None):
self.data = data
self.next = next
self.prev = prev
class DoublyLinkedList(object):
# Head of the doubly linked list
def __init__(self):
self.head = None
# ------------------------------------------------------------------------------------------
# Inserting at first
def insertAtFirst(self, data):
newNode = Node(data)
# If head is none then make new node as head
if(self.head == None):
self.head = newNode
# Insert new node before head and change the head
else:
newNode.next = self.head
self.head.prev = newNode
self.head = newNode
# ------------------------------------------------------------------------------------------
# To print all the elements
def show(self):
if(self.head == None):
return
temp = self.head
# traverse till end and print each data
while(temp):
print(temp.data, end="<->")
temp = temp.next
# Last node is none and printed here for convenience
print("None")
# ------------------------------------------------------------------------------------------
# Insert node at last
def insertAtLast(self, data):
if(self.head == None):
return
temp = self.head
# Traverse till prev of last node and attach at last
while(temp.next):
temp = temp.next
newNode = Node(data)
temp.next = newNode
newNode.prev = temp
# ------------------------------------------------------------------------------------------
# Insert at a certain position
def insertAtPosition(self, data, position):
# If position is 1 then insert at start
if(position == 1):
return self.insertAtFirst(data)
newNode = Node(data)
temp = self.head
# Traverse till before the position (-2 because we already start at position 1)
for i in range(position - 2):
# If next of temp is none then we have reached till end. So we cannot insert after None so return
if(temp.next == None):
return
temp = temp.next
# Insert new node betwwen temp and next of temp
newNode.next = temp.next
newNode.prev = temp
# If next of temp is none we cannot change it prev
if(temp.next is not None):
temp.next.prev = newNode
temp.next = newNode
# ------------------------------------------------------------------------------------------
# Delete an element
def delete(self, data):
# If head is none return
if(self.head == None):
return
# If head is the element to be deleted
temp = self.head
if(temp.data == data):
# change head to next element
self.head = temp.next
temp = None
return
# Traverse till end
while(temp):
if(temp.data == data):
break
temp = temp.next
# If temp is none then we have reached till end and no data is found
if(temp == None):
return
# Connect prev node to next of temp
temp.prev.next = temp.next
# If next of temp is none the we cannot link it's prev to prev of temp
if(temp.next):
temp.next.prev = temp.prev
# Disconnect temp
temp.next = None
temp.prev = None
# ------------------------------------------------------------------------------------------
# Delete the entire doubly linked list
def deleteList(self):
self.head = None
# ------------------------------------------------------------------------------------------
# Count of nodes in our doubly linked list
def length(self):
temp = self.head
count = 0
# Traverse each time and increment the count
while(temp):
count +=1
temp = temp.next
return count
# ------------------------------------------------------------------------------------------
# Print all the elements in reverse
def reversePrint(self):
if(self.head == None):
return
temp = self.head
while(temp.next):
temp = temp.next
while(temp):
print(temp.data,end="<->")
temp = temp.prev
print()
if __name__ == "__main__":
dll = DoublyLinkedList()
dll.insertAtFirst(10)
dll.insertAtFirst(20)
dll.insertAtLast(5)
dll.insertAtLast(2)
dll.insertAtPosition(15, 5)
dll.show()
print("Delete an element")
dll.delete(15)
dll.show()
print("Length:" + str(dll.length()))
print("Print in reverse")
dll.reversePrint()
'''
Output
20<->10<->5<->2<->15<->None
Delete an element
20<->10<->5<->2<->None
Length:4
Print in reverse
2<->5<->10<->20<->
''' | class Node(object):
def __init__(self, data, next=None, prev=None):
self.data = data
self.next = next
self.prev = prev
class Doublylinkedlist(object):
def __init__(self):
self.head = None
def insert_at_first(self, data):
new_node = node(data)
if self.head == None:
self.head = newNode
else:
newNode.next = self.head
self.head.prev = newNode
self.head = newNode
def show(self):
if self.head == None:
return
temp = self.head
while temp:
print(temp.data, end='<->')
temp = temp.next
print('None')
def insert_at_last(self, data):
if self.head == None:
return
temp = self.head
while temp.next:
temp = temp.next
new_node = node(data)
temp.next = newNode
newNode.prev = temp
def insert_at_position(self, data, position):
if position == 1:
return self.insertAtFirst(data)
new_node = node(data)
temp = self.head
for i in range(position - 2):
if temp.next == None:
return
temp = temp.next
newNode.next = temp.next
newNode.prev = temp
if temp.next is not None:
temp.next.prev = newNode
temp.next = newNode
def delete(self, data):
if self.head == None:
return
temp = self.head
if temp.data == data:
self.head = temp.next
temp = None
return
while temp:
if temp.data == data:
break
temp = temp.next
if temp == None:
return
temp.prev.next = temp.next
if temp.next:
temp.next.prev = temp.prev
temp.next = None
temp.prev = None
def delete_list(self):
self.head = None
def length(self):
temp = self.head
count = 0
while temp:
count += 1
temp = temp.next
return count
def reverse_print(self):
if self.head == None:
return
temp = self.head
while temp.next:
temp = temp.next
while temp:
print(temp.data, end='<->')
temp = temp.prev
print()
if __name__ == '__main__':
dll = doubly_linked_list()
dll.insertAtFirst(10)
dll.insertAtFirst(20)
dll.insertAtLast(5)
dll.insertAtLast(2)
dll.insertAtPosition(15, 5)
dll.show()
print('Delete an element')
dll.delete(15)
dll.show()
print('Length:' + str(dll.length()))
print('Print in reverse')
dll.reversePrint()
'\n Output\n 20<->10<->5<->2<->15<->None\n Delete an element\n 20<->10<->5<->2<->None\n Length:4\n Print in reverse\n 2<->5<->10<->20<->\n ' |
class ApplicationException(Exception):
...
class NoteExists(ApplicationException):
...
class InputError(ApplicationException):
...
class ActionAborted(ApplicationException):
...
class PathIsNotDefined(ApplicationException):
def __init__(self):
super().__init__(
"Path to notes is not defined. Please add let g:kb_notes_path to your config file"
)
| class Applicationexception(Exception):
...
class Noteexists(ApplicationException):
...
class Inputerror(ApplicationException):
...
class Actionaborted(ApplicationException):
...
class Pathisnotdefined(ApplicationException):
def __init__(self):
super().__init__('Path to notes is not defined. Please add let g:kb_notes_path to your config file') |
___assertEqual(len('123'), 3)
___assertEqual(len(()), 0)
___assertEqual(len((1, 2, 3, 4)), 4)
___assertEqual(len([1, 2, 3, 4]), 4)
___assertEqual(len({}), 0)
___assertEqual(len({'a':1, 'b': 2}), 2)
| ___assert_equal(len('123'), 3)
___assert_equal(len(()), 0)
___assert_equal(len((1, 2, 3, 4)), 4)
___assert_equal(len([1, 2, 3, 4]), 4)
___assert_equal(len({}), 0)
___assert_equal(len({'a': 1, 'b': 2}), 2) |
#1. Create a greeting for your program.
print('welocme to brand name generator')
#2. Ask the user for the city that they grew up in.
city_name = input('enter your city name')
print('city name is '+city_name)
#3. Ask the user for the name of a pet.
pet_name = input('enter your pet name')
print('pet name is ' + pet_name)
#4. Combine the name of their city and pet and show them their band name.
print('my best recomodate :- '+city_name + pet_name)
#5. Make sure the input cursor shows on a new line, see the example at:
# https://band-name-generator-end.appbrewery.repl.run/ | print('welocme to brand name generator')
city_name = input('enter your city name')
print('city name is ' + city_name)
pet_name = input('enter your pet name')
print('pet name is ' + pet_name)
print('my best recomodate :- ' + city_name + pet_name) |
#Validate credit cards using Luhn's algorithm. Input should be 16 digits.
def luhn():
card_number=input("Enter the card number to be checked: ")
def digits_of(n):
return [int(d) for d in str(n)]
digits = digits_of(card_number)
odd = digits[-1::-2]
even = digits[-2::-2]
checksum = 0
checksum += sum(odd)
for d in even:
checksum += sum(digits_of(d*2))
if (checksum % 10):
print("\nThis card is INVALID.")
else:
print("This card is VALID.")
again = input("\nDo want to input another card?(y/n)")
if (str(again)).lower() == "y":
luhn()
if __name__ == "__main__":
luhn() | def luhn():
card_number = input('Enter the card number to be checked: ')
def digits_of(n):
return [int(d) for d in str(n)]
digits = digits_of(card_number)
odd = digits[-1::-2]
even = digits[-2::-2]
checksum = 0
checksum += sum(odd)
for d in even:
checksum += sum(digits_of(d * 2))
if checksum % 10:
print('\nThis card is INVALID.')
else:
print('This card is VALID.')
again = input('\nDo want to input another card?(y/n)')
if str(again).lower() == 'y':
luhn()
if __name__ == '__main__':
luhn() |
# E[0] = sum(Vi/N)
# E[k] = sum(max(Vi, E[k-1])/N)
def expectation(N, K, V, mean):
# # Recursion form fails
# if K == 0: return mean
# e = expectation(N, K-1, V, mean)
# return sum(max(v, e)/N for v in V)
ek = mean
for k in range(K):
ek = sum(max(v, ek)/N for v in V)
return ek
def solve(N, K, V):
mean = sum(V) / N
# return expectation(N, K, V, mean)
return expectation_faster(N, K, sorted(V), mean)
def expectation_faster(N, K, V, mean):
# # Recursion form fails
# if K == 0: return mean
# e = expectation_faster(N, K-1, V, mean)
# x = binary_search(V, e)
# if isinstance(x, tuple): x = x[1]
# return e * x / N + sum(v for v in V[x:]) / N
ek = mean
for k in range(K):
x = binary_search(V, ek)
if isinstance(x, tuple): x = x[1]
ek = ek * x / N + sum(v for v in V[x:]) / N
return ek
def binary_search(array, value):
lo, hi, mid = 0, len(array), 0
while lo < hi:
mid = (lo + hi) // 2
if value < array[mid]:
hi = mid
elif value > array[mid]:
lo = mid + 1
else:
return mid
lo = mid if value > array[mid] else mid - 1
hi = mid if value < array[mid] else mid + 1
return (lo, hi)
if __name__ == '__main__':
T = int(input())
for t in range(1, T+1):
N, K = map(int, input().split())
V = list(map(int, input().split()))
e = solve(N, K, V)
print('Case #{}: {:.6f}'.format(t, e)) | def expectation(N, K, V, mean):
ek = mean
for k in range(K):
ek = sum((max(v, ek) / N for v in V))
return ek
def solve(N, K, V):
mean = sum(V) / N
return expectation_faster(N, K, sorted(V), mean)
def expectation_faster(N, K, V, mean):
ek = mean
for k in range(K):
x = binary_search(V, ek)
if isinstance(x, tuple):
x = x[1]
ek = ek * x / N + sum((v for v in V[x:])) / N
return ek
def binary_search(array, value):
(lo, hi, mid) = (0, len(array), 0)
while lo < hi:
mid = (lo + hi) // 2
if value < array[mid]:
hi = mid
elif value > array[mid]:
lo = mid + 1
else:
return mid
lo = mid if value > array[mid] else mid - 1
hi = mid if value < array[mid] else mid + 1
return (lo, hi)
if __name__ == '__main__':
t = int(input())
for t in range(1, T + 1):
(n, k) = map(int, input().split())
v = list(map(int, input().split()))
e = solve(N, K, V)
print('Case #{}: {:.6f}'.format(t, e)) |
class Solution:
def findMaxLength(self, nums: List[int]) -> int:
"""Hash table.
"""
res = 0
d = {0: -1}
c = 0
for i, n in enumerate(nums):
if n == 1:
c -= 1
else:
c += 1
if c in d:
res = max(res, i - d[c])
else:
d[c] = i
return res
| class Solution:
def find_max_length(self, nums: List[int]) -> int:
"""Hash table.
"""
res = 0
d = {0: -1}
c = 0
for (i, n) in enumerate(nums):
if n == 1:
c -= 1
else:
c += 1
if c in d:
res = max(res, i - d[c])
else:
d[c] = i
return res |
class Msg:
SERVER_BANNER = '''
##### # ###### ####### ##### # # # ##### ####### ###### # # ####### ######
# # # # # # # # # # # # # # # # # # # # # # #
# # # # # # # # # # # # # # # # # # # #
# # # ###### # # ####### # # ##### ##### ###### # # ##### ######
# ####### # # # # # ####### # # # # # # # # #
# # # # # # # # # # # # # # # # # # # # # #
##### # # # # ##### # # # # ##### ####### # # # ####### # #
'''
SERVER_RULES = '1. The server sends you a captcha and you have 5 seconds to solve it\n'
SERVER_RULES += '2. After solving a lot of captchas, we will reward you\n'
SESSION_START = 'Do you want to start a captcha solution session? (Y/N): '
EXIT = 'Close connection...\n'
SERVER_AWARD = 'Thank you for your help. This is a your award: '
SERVER_AWARD += 'Cup{a6f6f28f15b85a6d0a2a0ae4c1460d97f5326f2cfe09fc1cf9ba663285bbca37}\n'
ANSWER_MSG = '\nAnswer: '
SERVER_ANSWER_TIMEOUT = 'Time to solve is out!\n'
CORRECT_CAPTCHA = '[+] Correct!\n'
INCORRECT_CAPTHCA = "[-] Incorrect!\n" | class Msg:
server_banner = '\n ##### # ###### ####### ##### # # # ##### ####### ###### # # ####### ###### \n# # # # # # # # # # # # # # # # # # # # # # # \n# # # # # # # # # # # # # # # # # # # # \n# # # ###### # # ####### # # ##### ##### ###### # # ##### ###### \n# ####### # # # # # ####### # # # # # # # # # \n# # # # # # # # # # # # # # # # # # # # # # \n ##### # # # # ##### # # # # ##### ####### # # # ####### # # \n'
server_rules = '1. The server sends you a captcha and you have 5 seconds to solve it\n'
server_rules += '2. After solving a lot of captchas, we will reward you\n'
session_start = 'Do you want to start a captcha solution session? (Y/N): '
exit = 'Close connection...\n'
server_award = 'Thank you for your help. This is a your award: '
server_award += 'Cup{a6f6f28f15b85a6d0a2a0ae4c1460d97f5326f2cfe09fc1cf9ba663285bbca37}\n'
answer_msg = '\nAnswer: '
server_answer_timeout = 'Time to solve is out!\n'
correct_captcha = '[+] Correct!\n'
incorrect_capthca = '[-] Incorrect!\n' |
sample_request = {
'id': '91b20aa5-9ccf-498d-8944-5d3a32ab1b37',
'timestamp': '2018-02-17T11:26:58.76Z',
'lang': 'en',
'result': {
'source': 'agent',
'resolvedQuery': 'hello',
'speech': '',
'action': 'hello',
'actionIncomplete': False,
'parameters': {
},
'contexts': [
],
'metadata': {
'intentId': '6e4d06c7-bdd0-4e44-b130-a1169f2920c8',
'webhookUsed': 'true',
'webhookForSlotFillingUsed': 'false',
'intentName': 'hello'
},
'fulfillment': {
'speech': '',
'messages': [
{
'type': 0,
'speech': ''
}
]
},
'score': 1.0
},
'status': {
'code': 200,
'errorType': 'success',
'webhookTimedOut': False
},
'sessionId': '926e72d8-35ee-4640-8a69-a77c87f475f5'
}
sample_context = {
"name": "some-context",
"lifespan": 10,
"parameters": {
"key": "value"
}
}
| sample_request = {'id': '91b20aa5-9ccf-498d-8944-5d3a32ab1b37', 'timestamp': '2018-02-17T11:26:58.76Z', 'lang': 'en', 'result': {'source': 'agent', 'resolvedQuery': 'hello', 'speech': '', 'action': 'hello', 'actionIncomplete': False, 'parameters': {}, 'contexts': [], 'metadata': {'intentId': '6e4d06c7-bdd0-4e44-b130-a1169f2920c8', 'webhookUsed': 'true', 'webhookForSlotFillingUsed': 'false', 'intentName': 'hello'}, 'fulfillment': {'speech': '', 'messages': [{'type': 0, 'speech': ''}]}, 'score': 1.0}, 'status': {'code': 200, 'errorType': 'success', 'webhookTimedOut': False}, 'sessionId': '926e72d8-35ee-4640-8a69-a77c87f475f5'}
sample_context = {'name': 'some-context', 'lifespan': 10, 'parameters': {'key': 'value'}} |
n = int(input())
A = [0] + [int(i) for i in input().split()]
def maxHeapify(i):
left = 2 * i
right = 2 * i + 1
if left <= n and A[left] > A[i]:
largest = left
else:
largest = i
if right <= n and A[right] > A[largest]:
largest = right
if largest != i:
A[i], A[largest] = A[largest], A[i]
maxHeapify(largest)
for i in range(int(n/2), 0, -1):
maxHeapify(i)
print('', *A[1:])
| n = int(input())
a = [0] + [int(i) for i in input().split()]
def max_heapify(i):
left = 2 * i
right = 2 * i + 1
if left <= n and A[left] > A[i]:
largest = left
else:
largest = i
if right <= n and A[right] > A[largest]:
largest = right
if largest != i:
(A[i], A[largest]) = (A[largest], A[i])
max_heapify(largest)
for i in range(int(n / 2), 0, -1):
max_heapify(i)
print('', *A[1:]) |
class SkString:
def __init__(self, text):
self.text = text
def to_upper(self):
return self.text.upper()
def to_lower(self):
return self.text.lower()
def to_title(self):
return self.text.title() | class Skstring:
def __init__(self, text):
self.text = text
def to_upper(self):
return self.text.upper()
def to_lower(self):
return self.text.lower()
def to_title(self):
return self.text.title() |
class Solution:
"""
@param s: The first string
@param b: The second string
@return true or false
"""
def anagram(self, s, t):
# write your code here
l1 = list(s)
l2 = list(t)
length1 = len(l1)
length2 = len(l2)
if length1 != length2:
return False
else:
for i in range(length1):
for j in range(length2):
fg = False
if l1[i] == l2[j]:
l1[i] = 0
l2[j] = 0
fg = True
break
if fg == False:
return False
return True
| class Solution:
"""
@param s: The first string
@param b: The second string
@return true or false
"""
def anagram(self, s, t):
l1 = list(s)
l2 = list(t)
length1 = len(l1)
length2 = len(l2)
if length1 != length2:
return False
else:
for i in range(length1):
for j in range(length2):
fg = False
if l1[i] == l2[j]:
l1[i] = 0
l2[j] = 0
fg = True
break
if fg == False:
return False
return True |
"""Exceptions for versionner"""
class VersionnerError(Exception):
"""Generic versionne error"""
ret_code = 2
class ConfigError(VersionnerError):
"""Configuration error"""
| """Exceptions for versionner"""
class Versionnererror(Exception):
"""Generic versionne error"""
ret_code = 2
class Configerror(VersionnerError):
"""Configuration error""" |
"""Parser classes for SIMBAD"""
__author__ = "Felix Simkovic"
__date__ = "04 May 2017"
__version__ = "0.1"
class _Parser(object):
def __init__(self, fname):
self.logfile = fname
| """Parser classes for SIMBAD"""
__author__ = 'Felix Simkovic'
__date__ = '04 May 2017'
__version__ = '0.1'
class _Parser(object):
def __init__(self, fname):
self.logfile = fname |
def read_file(file_name):
data = ""
with open(file_name, "r") as file:
data = file.read()
return data
def parse_input(text):
lines = text.split("\n")
return lines
def part1():
lines = parse_input(read_file("day4_input.txt"))
good_passphrases = 0
for line in lines:
words = line.split(" ")
mapped_words = set()
is_good_passphrase = True
for word in words:
if word in mapped_words:
is_good_passphrase = False
else:
mapped_words.add(word)
if is_good_passphrase is True:
good_passphrases += 1
print(good_passphrases)
def part2():
lines = parse_input(read_file("day4_input.txt"))
good_passphrases = 0
for line in lines:
words = line.split(" ")
mapped_words = set()
is_good_passphrase = True
for word in words:
sorted_word = ''.join(sorted(word))
if sorted_word in mapped_words:
is_good_passphrase = False
else:
mapped_words.add(sorted_word)
if is_good_passphrase is True:
good_passphrases += 1
print(good_passphrases)
part1()
part2()
| def read_file(file_name):
data = ''
with open(file_name, 'r') as file:
data = file.read()
return data
def parse_input(text):
lines = text.split('\n')
return lines
def part1():
lines = parse_input(read_file('day4_input.txt'))
good_passphrases = 0
for line in lines:
words = line.split(' ')
mapped_words = set()
is_good_passphrase = True
for word in words:
if word in mapped_words:
is_good_passphrase = False
else:
mapped_words.add(word)
if is_good_passphrase is True:
good_passphrases += 1
print(good_passphrases)
def part2():
lines = parse_input(read_file('day4_input.txt'))
good_passphrases = 0
for line in lines:
words = line.split(' ')
mapped_words = set()
is_good_passphrase = True
for word in words:
sorted_word = ''.join(sorted(word))
if sorted_word in mapped_words:
is_good_passphrase = False
else:
mapped_words.add(sorted_word)
if is_good_passphrase is True:
good_passphrases += 1
print(good_passphrases)
part1()
part2() |
#This script will read 3 numbers "n", "x" and "y" and print a validation for each number in the range 1:n of whether the number is divisible by x, divisible by y or divisible by both.
def xyMultiple(n,x,y):
for i in range(1,n+1):
isDivX = False
isDivY = False
res = "Div by "
if i % x == 0:
isDivX = True
res += str(x)
if i % y == 0:
isDivY = True
res += str(y)
if isDivX or isDivY:
if isDivX and isDivY:
res = "Div by Both"
else:
res = i
print(res)
xyMultiple(2500,7,13) | def xy_multiple(n, x, y):
for i in range(1, n + 1):
is_div_x = False
is_div_y = False
res = 'Div by '
if i % x == 0:
is_div_x = True
res += str(x)
if i % y == 0:
is_div_y = True
res += str(y)
if isDivX or isDivY:
if isDivX and isDivY:
res = 'Div by Both'
else:
res = i
print(res)
xy_multiple(2500, 7, 13) |
# -*- coding: utf-8 -*-
def salpeter(m, ksi0=1.0):
return ksi0 * m ** -2.35
| def salpeter(m, ksi0=1.0):
return ksi0 * m ** (-2.35) |
class nmap_plugin():
# user-defined
script_id = 'http-methods'
script_source = 'service'
script_types = ['port_info']
script_obj = None
output = ''
def __init__(self, script_object):
self.script_obj = script_object
self.output = script_object['output']
def port_info(self):
"""
return
{
"protocol": "http",
"info": "Nginx 1.12.0"
}
"""
if "No Allow or Public header in" not in self.output:
return {
'protocol': 'http',
'info': 'HTTP title:\n' + self.output
}
return {}
| class Nmap_Plugin:
script_id = 'http-methods'
script_source = 'service'
script_types = ['port_info']
script_obj = None
output = ''
def __init__(self, script_object):
self.script_obj = script_object
self.output = script_object['output']
def port_info(self):
"""
return
{
"protocol": "http",
"info": "Nginx 1.12.0"
}
"""
if 'No Allow or Public header in' not in self.output:
return {'protocol': 'http', 'info': 'HTTP title:\n' + self.output}
return {} |
"""
Errors about messages.
"""
class SendMessageFailed(Exception):
"""Raises when sending a message is failed."""
pass
class CreateReactionFailed(Exception):
"""Raises when creating the reaction is failed."""
pass
class DeleteReactionFailed(Exception):
"""Raises when deleting the reaction is failed."""
pass
class FetchReactionsFailed(Exception):
"""Raises when fetching the reactions are failed."""
pass
class DeleteReactionsFailed(Exception):
"""Raises when deleting the reactions are failed."""
pass
class EditMessageFailed(Exception):
"""Raises when editing the message is failed."""
pass
class DeleteMessageFailed(Exception):
"""Raises when deleting the message is failed."""
pass
| """
Errors about messages.
"""
class Sendmessagefailed(Exception):
"""Raises when sending a message is failed."""
pass
class Createreactionfailed(Exception):
"""Raises when creating the reaction is failed."""
pass
class Deletereactionfailed(Exception):
"""Raises when deleting the reaction is failed."""
pass
class Fetchreactionsfailed(Exception):
"""Raises when fetching the reactions are failed."""
pass
class Deletereactionsfailed(Exception):
"""Raises when deleting the reactions are failed."""
pass
class Editmessagefailed(Exception):
"""Raises when editing the message is failed."""
pass
class Deletemessagefailed(Exception):
"""Raises when deleting the message is failed."""
pass |
sysconfig = dict(
experiment = 'Exp',
)
devices = dict(
Sample = device('nicos.devices.sample.Sample',
description = 'The currently used sample',
),
Exp = device('nicos.devices.experiment.Experiment',
description = 'experiment object',
dataroot = 'data',
sendmail = True,
serviceexp = 'p0',
sample = 'Sample',
),
)
| sysconfig = dict(experiment='Exp')
devices = dict(Sample=device('nicos.devices.sample.Sample', description='The currently used sample'), Exp=device('nicos.devices.experiment.Experiment', description='experiment object', dataroot='data', sendmail=True, serviceexp='p0', sample='Sample')) |
def order_square(a):
right = 0
while right < len(a) and a[right] < 0:
right +=1
left = right-1
output = []
while left >= 0 and right < len(a):
if a[left]**2 < a[right]**2:
output.append(a[left]**2)
left -=1
else:
output.append(a[right]**2)
right +=1
while left >=0 :
output.append(a[left]**2)
left -=1
while right < len(a):
output.append(a[right]**2)
right +=1
return output
if __name__ == "__main__":
a = [-4, -3, 1, 2, 4]
print(order_square(a)) | def order_square(a):
right = 0
while right < len(a) and a[right] < 0:
right += 1
left = right - 1
output = []
while left >= 0 and right < len(a):
if a[left] ** 2 < a[right] ** 2:
output.append(a[left] ** 2)
left -= 1
else:
output.append(a[right] ** 2)
right += 1
while left >= 0:
output.append(a[left] ** 2)
left -= 1
while right < len(a):
output.append(a[right] ** 2)
right += 1
return output
if __name__ == '__main__':
a = [-4, -3, 1, 2, 4]
print(order_square(a)) |
#
# PySNMP MIB module GENOSALARMNOTIFICATION-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/GENOSALARMNOTIFICATION-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:19:28 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection, ValueSizeConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "ConstraintsUnion", "SingleValueConstraint", "ConstraintsIntersection", "ValueSizeConstraint")
ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup")
ObjectIdentity, Counter32, NotificationType, Integer32, enterprises, TimeTicks, Counter64, Bits, Unsigned32, IpAddress, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, iso, ModuleIdentity = mibBuilder.importSymbols("SNMPv2-SMI", "ObjectIdentity", "Counter32", "NotificationType", "Integer32", "enterprises", "TimeTicks", "Counter64", "Bits", "Unsigned32", "IpAddress", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "iso", "ModuleIdentity")
TextualConvention, TruthValue, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "TruthValue", "DisplayString")
alcatel = MibIdentifier((1, 3, 6, 1, 4, 1, 637))
nmu = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65))
genos = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1))
alarmHandoff = ModuleIdentity((1, 3, 6, 1, 4, 1, 637, 65, 1, 1))
if mibBuilder.loadTexts: alarmHandoff.setLastUpdated('9807030000Z')
if mibBuilder.loadTexts: alarmHandoff.setOrganization('Alcatel GENOS Development')
if mibBuilder.loadTexts: alarmHandoff.setContactInfo('')
if mibBuilder.loadTexts: alarmHandoff.setDescription('The MIB module for GENOS alarm handoff')
alarmHandoffObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1))
unsolicitedEventsEnabled = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 1), TruthValue()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: unsolicitedEventsEnabled.setStatus('current')
if mibBuilder.loadTexts: unsolicitedEventsEnabled.setDescription('Status indicating if unsolicited alarm traps are to be generated')
alarmTable = MibTable((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2), )
if mibBuilder.loadTexts: alarmTable.setStatus('current')
if mibBuilder.loadTexts: alarmTable.setDescription('The list of currently raised alarms')
alarmEntry = MibTableRow((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1), ).setIndexNames((0, "GENOSALARMNOTIFICATION-MIB", "currentAlarmId"))
if mibBuilder.loadTexts: alarmEntry.setStatus('current')
if mibBuilder.loadTexts: alarmEntry.setDescription('Each entry contains 1 alarm description')
class AlarmId(Counter32):
subtypeSpec = Counter32.subtypeSpec + ValueRangeConstraint(1, 4294967295)
currentAlarmId = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 1), AlarmId()).setMaxAccess("readonly")
if mibBuilder.loadTexts: currentAlarmId.setStatus('current')
if mibBuilder.loadTexts: currentAlarmId.setDescription('A unique identifier for an alarm')
friendlyName = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: friendlyName.setStatus('current')
if mibBuilder.loadTexts: friendlyName.setDescription('The source of the alarm in a human readable form')
eventTime = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 3), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: eventTime.setStatus('current')
if mibBuilder.loadTexts: eventTime.setDescription('The time the alarm event occurred')
eventType = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 4), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: eventType.setStatus('current')
if mibBuilder.loadTexts: eventType.setDescription('A conversion of the X721 notification types to a human readable form')
probableCause = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 5), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: probableCause.setStatus('current')
if mibBuilder.loadTexts: probableCause.setDescription('A conversion of the local and global OIDs to a human readable form')
perceivedSeverity = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 6), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: perceivedSeverity.setStatus('current')
if mibBuilder.loadTexts: perceivedSeverity.setDescription('The perceived Severity of the of the alarm it will be one of: indeterminate critical major minor warning cleared')
additionalText = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 7), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: additionalText.setStatus('current')
if mibBuilder.loadTexts: additionalText.setDescription('Additional text for the alarm')
specificProblems = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 8), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: specificProblems.setStatus('current')
if mibBuilder.loadTexts: specificProblems.setDescription('Specific Problems of the alarm')
acknowledgementStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 9), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: acknowledgementStatus.setStatus('current')
if mibBuilder.loadTexts: acknowledgementStatus.setDescription('The Acknowledgement Status of the alarm')
reserveStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 10), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: reserveStatus.setStatus('current')
if mibBuilder.loadTexts: reserveStatus.setDescription('The Reserve Status of the alarm')
additionalInformation = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 11), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: additionalInformation.setStatus('current')
if mibBuilder.loadTexts: additionalInformation.setDescription('The Additional Information of the alarm')
neLocationName = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 12), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: neLocationName.setStatus('current')
if mibBuilder.loadTexts: neLocationName.setDescription('The NE Location Name of the alarm')
managedobjectInstance = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 13), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: managedobjectInstance.setStatus('current')
if mibBuilder.loadTexts: managedobjectInstance.setDescription('The managed object Instance of the alarm')
acknowledgementUserName = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 14), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: acknowledgementUserName.setStatus('current')
if mibBuilder.loadTexts: acknowledgementUserName.setDescription('acknowledgement User Name')
asIdentity = MibTableColumn((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 15), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asIdentity.setStatus('current')
if mibBuilder.loadTexts: asIdentity.setDescription('The identity of the AS')
alarmHandoffTraps = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2))
alarmRaise = NotificationType((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 1)).setObjects(("GENOSALARMNOTIFICATION-MIB", "currentAlarmId"), ("GENOSALARMNOTIFICATION-MIB", "friendlyName"), ("GENOSALARMNOTIFICATION-MIB", "eventTime"), ("GENOSALARMNOTIFICATION-MIB", "eventType"), ("GENOSALARMNOTIFICATION-MIB", "probableCause"), ("GENOSALARMNOTIFICATION-MIB", "perceivedSeverity"), ("GENOSALARMNOTIFICATION-MIB", "additionalText"), ("GENOSALARMNOTIFICATION-MIB", "specificProblems"), ("GENOSALARMNOTIFICATION-MIB", "acknowledgementStatus"), ("GENOSALARMNOTIFICATION-MIB", "reserveStatus"), ("GENOSALARMNOTIFICATION-MIB", "additionalInformation"), ("GENOSALARMNOTIFICATION-MIB", "neLocationName"), ("GENOSALARMNOTIFICATION-MIB", "managedobjectInstance"), ("GENOSALARMNOTIFICATION-MIB", "acknowledgementUserName"), ("GENOSALARMNOTIFICATION-MIB", "asIdentity"))
if mibBuilder.loadTexts: alarmRaise.setStatus('current')
if mibBuilder.loadTexts: alarmRaise.setDescription('Notification that an alarm is currently active')
alarmClear = NotificationType((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 2)).setObjects(("GENOSALARMNOTIFICATION-MIB", "currentAlarmId"), ("GENOSALARMNOTIFICATION-MIB", "eventTime"), ("GENOSALARMNOTIFICATION-MIB", "friendlyName"), ("GENOSALARMNOTIFICATION-MIB", "probableCause"), ("GENOSALARMNOTIFICATION-MIB", "asIdentity"))
if mibBuilder.loadTexts: alarmClear.setStatus('current')
if mibBuilder.loadTexts: alarmClear.setDescription('Notification that an alarm has been cleared')
alarmAck = NotificationType((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 3)).setObjects(("GENOSALARMNOTIFICATION-MIB", "listAlarmIds"), ("GENOSALARMNOTIFICATION-MIB", "operatorName"), ("GENOSALARMNOTIFICATION-MIB", "asIdentity"))
if mibBuilder.loadTexts: alarmAck.setStatus('current')
if mibBuilder.loadTexts: alarmAck.setDescription('Notification that an alarm has been acknowledged')
alarmPurge = NotificationType((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 4)).setObjects(("GENOSALARMNOTIFICATION-MIB", "purgelistAlarmIds"), ("GENOSALARMNOTIFICATION-MIB", "asIdentity"))
if mibBuilder.loadTexts: alarmPurge.setStatus('current')
if mibBuilder.loadTexts: alarmPurge.setDescription('Notification that an alarm has been purged')
alarmReserve = NotificationType((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 5)).setObjects(("GENOSALARMNOTIFICATION-MIB", "reservelistAlarmIds"), ("GENOSALARMNOTIFICATION-MIB", "reserveoperatorName"), ("GENOSALARMNOTIFICATION-MIB", "asIdentity"))
if mibBuilder.loadTexts: alarmReserve.setStatus('current')
if mibBuilder.loadTexts: alarmReserve.setDescription('Notification that an alarm has been reserved')
alarmUnreserve = NotificationType((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 6)).setObjects(("GENOSALARMNOTIFICATION-MIB", "unreservelistAlarmIds"), ("GENOSALARMNOTIFICATION-MIB", "unreserveoperatorName"), ("GENOSALARMNOTIFICATION-MIB", "asIdentity"))
if mibBuilder.loadTexts: alarmUnreserve.setStatus('current')
if mibBuilder.loadTexts: alarmUnreserve.setDescription('Notification that an alarm has been unreserved')
asConnectionStatus = NotificationType((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 7)).setObjects(("GENOSALARMNOTIFICATION-MIB", "asconnectionstatus"), ("GENOSALARMNOTIFICATION-MIB", "asId"))
if mibBuilder.loadTexts: asConnectionStatus.setStatus('current')
if mibBuilder.loadTexts: asConnectionStatus.setDescription('Notification that an AS status is changed')
alarmUnAck = NotificationType((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 8)).setObjects(("GENOSALARMNOTIFICATION-MIB", "unacklistAlarmIds"), ("GENOSALARMNOTIFICATION-MIB", "unackoperatorName"), ("GENOSALARMNOTIFICATION-MIB", "asIdentity"))
if mibBuilder.loadTexts: alarmUnAck.setStatus('current')
if mibBuilder.loadTexts: alarmUnAck.setDescription('Notification that an alarm has been unacknowledged')
alarmHandoffAck = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 3))
listAlarmIds = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 3, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: listAlarmIds.setStatus('current')
if mibBuilder.loadTexts: listAlarmIds.setDescription('The list of Alarms which are acknowledged by the Operator ')
operatorName = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 3, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: operatorName.setStatus('current')
if mibBuilder.loadTexts: operatorName.setDescription('The name of the Operator that performed the acknowledgement ')
ackasIdentityFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 3, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: ackasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts: ackasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarmHandoffFilter = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4))
friendlyNameFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: friendlyNameFilter.setStatus('current')
if mibBuilder.loadTexts: friendlyNameFilter.setDescription('Dinamic Filter for Friendly name ')
eventTimeFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: eventTimeFilter.setStatus('current')
if mibBuilder.loadTexts: eventTimeFilter.setDescription('Dinamic Filter for event Time')
eventTypeFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: eventTypeFilter.setStatus('current')
if mibBuilder.loadTexts: eventTypeFilter.setDescription('Dinamic Filter for event Type')
probableCauseFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 4), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: probableCauseFilter.setStatus('current')
if mibBuilder.loadTexts: probableCauseFilter.setDescription('Dinamic Filter for probable Cause')
perceivedSeverityFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 5), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: perceivedSeverityFilter.setStatus('current')
if mibBuilder.loadTexts: perceivedSeverityFilter.setDescription('Dinamic Filter for perceived Severity')
specificProblemsFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 6), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: specificProblemsFilter.setStatus('current')
if mibBuilder.loadTexts: specificProblemsFilter.setDescription('Dinamic Filter for specific Problems')
nelocationNameFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 7), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: nelocationNameFilter.setStatus('current')
if mibBuilder.loadTexts: nelocationNameFilter.setDescription('Dinamic Filter for nelocation name ')
additionalInformationFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 8), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: additionalInformationFilter.setStatus('current')
if mibBuilder.loadTexts: additionalInformationFilter.setDescription('Dinamic Filter for additional Information ')
managedobjectInstanceFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 9), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: managedobjectInstanceFilter.setStatus('current')
if mibBuilder.loadTexts: managedobjectInstanceFilter.setDescription('Dinamic Filter for managed object Instance ')
asIdentityFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 10), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: asIdentityFilter.setStatus('current')
if mibBuilder.loadTexts: asIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarmHandoffPurge = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 5))
purgelistAlarmIds = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 5, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: purgelistAlarmIds.setStatus('current')
if mibBuilder.loadTexts: purgelistAlarmIds.setDescription('The list of Alarms which are purged by the Operator ')
purgeoperatorName = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 5, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: purgeoperatorName.setStatus('current')
if mibBuilder.loadTexts: purgeoperatorName.setDescription('The name of the Operator that performed the purge ')
purgeasIdentityFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 5, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: purgeasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts: purgeasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarmHandoffReserve = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 6))
reservelistAlarmIds = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 6, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: reservelistAlarmIds.setStatus('current')
if mibBuilder.loadTexts: reservelistAlarmIds.setDescription('The list of Alarms which are reserved by the Operator ')
reserveoperatorName = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 6, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: reserveoperatorName.setStatus('current')
if mibBuilder.loadTexts: reserveoperatorName.setDescription('The name of the Operator that performed the reserved ')
reserveasIdentityFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 6, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: reserveasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts: reserveasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarmHandoffUnreserve = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 7))
unreservelistAlarmIds = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 7, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: unreservelistAlarmIds.setStatus('current')
if mibBuilder.loadTexts: unreservelistAlarmIds.setDescription('The list of Alarms which are unreserved by the Operator ')
unreserveoperatorName = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 7, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: unreserveoperatorName.setStatus('current')
if mibBuilder.loadTexts: unreserveoperatorName.setDescription('The name of the Operator that performed the unreserved ')
unreserveasIdentityFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 7, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: unreserveasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts: unreserveasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarmHandoffasConnectionStatus = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 8))
asconnectionstatus = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 8, 1), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asconnectionstatus.setStatus('current')
if mibBuilder.loadTexts: asconnectionstatus.setDescription('The status of the AS ')
asId = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 8, 2), DisplayString()).setMaxAccess("readonly")
if mibBuilder.loadTexts: asId.setStatus('current')
if mibBuilder.loadTexts: asId.setDescription('The identity of the AS ')
alarmHandoffUnAck = MibIdentifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 9))
unacklistAlarmIds = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 9, 1), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: unacklistAlarmIds.setStatus('current')
if mibBuilder.loadTexts: unacklistAlarmIds.setDescription('The list of Alarms which are unacknowledged by the Operator ')
unackoperatorName = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 9, 2), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: unackoperatorName.setStatus('current')
if mibBuilder.loadTexts: unackoperatorName.setDescription('The name of the Operator that performed the unacknowledgement ')
unackasIdentityFilter = MibScalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 9, 3), DisplayString()).setMaxAccess("readwrite")
if mibBuilder.loadTexts: unackasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts: unackasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
mibBuilder.exportSymbols("GENOSALARMNOTIFICATION-MIB", alarmHandoffObjects=alarmHandoffObjects, eventTime=eventTime, unreserveasIdentityFilter=unreserveasIdentityFilter, friendlyName=friendlyName, genos=genos, alarmEntry=alarmEntry, alarmHandoffFilter=alarmHandoffFilter, reserveasIdentityFilter=reserveasIdentityFilter, asIdentity=asIdentity, unackoperatorName=unackoperatorName, asId=asId, eventTimeFilter=eventTimeFilter, alarmHandoffUnreserve=alarmHandoffUnreserve, alarmAck=alarmAck, asIdentityFilter=asIdentityFilter, additionalInformation=additionalInformation, reservelistAlarmIds=reservelistAlarmIds, alarmHandoffReserve=alarmHandoffReserve, alarmUnreserve=alarmUnreserve, alarmPurge=alarmPurge, probableCause=probableCause, asconnectionstatus=asconnectionstatus, PYSNMP_MODULE_ID=alarmHandoff, friendlyNameFilter=friendlyNameFilter, asConnectionStatus=asConnectionStatus, alarmHandoffUnAck=alarmHandoffUnAck, eventType=eventType, currentAlarmId=currentAlarmId, reserveStatus=reserveStatus, perceivedSeverity=perceivedSeverity, alarmTable=alarmTable, AlarmId=AlarmId, unsolicitedEventsEnabled=unsolicitedEventsEnabled, neLocationName=neLocationName, alarmRaise=alarmRaise, probableCauseFilter=probableCauseFilter, purgeoperatorName=purgeoperatorName, purgeasIdentityFilter=purgeasIdentityFilter, listAlarmIds=listAlarmIds, specificProblems=specificProblems, alarmHandoff=alarmHandoff, managedobjectInstance=managedobjectInstance, alarmHandoffasConnectionStatus=alarmHandoffasConnectionStatus, unackasIdentityFilter=unackasIdentityFilter, alcatel=alcatel, additionalText=additionalText, alarmUnAck=alarmUnAck, alarmHandoffAck=alarmHandoffAck, operatorName=operatorName, alarmHandoffPurge=alarmHandoffPurge, perceivedSeverityFilter=perceivedSeverityFilter, acknowledgementUserName=acknowledgementUserName, alarmHandoffTraps=alarmHandoffTraps, eventTypeFilter=eventTypeFilter, unreservelistAlarmIds=unreservelistAlarmIds, managedobjectInstanceFilter=managedobjectInstanceFilter, acknowledgementStatus=acknowledgementStatus, unreserveoperatorName=unreserveoperatorName, specificProblemsFilter=specificProblemsFilter, nmu=nmu, reserveoperatorName=reserveoperatorName, alarmClear=alarmClear, unacklistAlarmIds=unacklistAlarmIds, alarmReserve=alarmReserve, purgelistAlarmIds=purgelistAlarmIds, ackasIdentityFilter=ackasIdentityFilter, additionalInformationFilter=additionalInformationFilter, nelocationNameFilter=nelocationNameFilter)
| (object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString')
(named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues')
(value_range_constraint, constraints_union, single_value_constraint, constraints_intersection, value_size_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueRangeConstraint', 'ConstraintsUnion', 'SingleValueConstraint', 'ConstraintsIntersection', 'ValueSizeConstraint')
(module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ModuleCompliance', 'NotificationGroup')
(object_identity, counter32, notification_type, integer32, enterprises, time_ticks, counter64, bits, unsigned32, ip_address, mib_identifier, mib_scalar, mib_table, mib_table_row, mib_table_column, gauge32, iso, module_identity) = mibBuilder.importSymbols('SNMPv2-SMI', 'ObjectIdentity', 'Counter32', 'NotificationType', 'Integer32', 'enterprises', 'TimeTicks', 'Counter64', 'Bits', 'Unsigned32', 'IpAddress', 'MibIdentifier', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Gauge32', 'iso', 'ModuleIdentity')
(textual_convention, truth_value, display_string) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'TruthValue', 'DisplayString')
alcatel = mib_identifier((1, 3, 6, 1, 4, 1, 637))
nmu = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65))
genos = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1))
alarm_handoff = module_identity((1, 3, 6, 1, 4, 1, 637, 65, 1, 1))
if mibBuilder.loadTexts:
alarmHandoff.setLastUpdated('9807030000Z')
if mibBuilder.loadTexts:
alarmHandoff.setOrganization('Alcatel GENOS Development')
if mibBuilder.loadTexts:
alarmHandoff.setContactInfo('')
if mibBuilder.loadTexts:
alarmHandoff.setDescription('The MIB module for GENOS alarm handoff')
alarm_handoff_objects = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1))
unsolicited_events_enabled = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 1), truth_value()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
unsolicitedEventsEnabled.setStatus('current')
if mibBuilder.loadTexts:
unsolicitedEventsEnabled.setDescription('Status indicating if unsolicited alarm traps are to be generated')
alarm_table = mib_table((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2))
if mibBuilder.loadTexts:
alarmTable.setStatus('current')
if mibBuilder.loadTexts:
alarmTable.setDescription('The list of currently raised alarms')
alarm_entry = mib_table_row((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1)).setIndexNames((0, 'GENOSALARMNOTIFICATION-MIB', 'currentAlarmId'))
if mibBuilder.loadTexts:
alarmEntry.setStatus('current')
if mibBuilder.loadTexts:
alarmEntry.setDescription('Each entry contains 1 alarm description')
class Alarmid(Counter32):
subtype_spec = Counter32.subtypeSpec + value_range_constraint(1, 4294967295)
current_alarm_id = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 1), alarm_id()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
currentAlarmId.setStatus('current')
if mibBuilder.loadTexts:
currentAlarmId.setDescription('A unique identifier for an alarm')
friendly_name = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
friendlyName.setStatus('current')
if mibBuilder.loadTexts:
friendlyName.setDescription('The source of the alarm in a human readable form')
event_time = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 3), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
eventTime.setStatus('current')
if mibBuilder.loadTexts:
eventTime.setDescription('The time the alarm event occurred')
event_type = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 4), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
eventType.setStatus('current')
if mibBuilder.loadTexts:
eventType.setDescription('A conversion of the X721 notification types to a human readable form')
probable_cause = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 5), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
probableCause.setStatus('current')
if mibBuilder.loadTexts:
probableCause.setDescription('A conversion of the local and global OIDs to a human readable form')
perceived_severity = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 6), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
perceivedSeverity.setStatus('current')
if mibBuilder.loadTexts:
perceivedSeverity.setDescription('The perceived Severity of the of the alarm it will be one of: indeterminate critical major minor warning cleared')
additional_text = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 7), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
additionalText.setStatus('current')
if mibBuilder.loadTexts:
additionalText.setDescription('Additional text for the alarm')
specific_problems = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 8), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
specificProblems.setStatus('current')
if mibBuilder.loadTexts:
specificProblems.setDescription('Specific Problems of the alarm')
acknowledgement_status = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 9), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
acknowledgementStatus.setStatus('current')
if mibBuilder.loadTexts:
acknowledgementStatus.setDescription('The Acknowledgement Status of the alarm')
reserve_status = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 10), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
reserveStatus.setStatus('current')
if mibBuilder.loadTexts:
reserveStatus.setDescription('The Reserve Status of the alarm')
additional_information = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 11), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
additionalInformation.setStatus('current')
if mibBuilder.loadTexts:
additionalInformation.setDescription('The Additional Information of the alarm')
ne_location_name = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 12), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
neLocationName.setStatus('current')
if mibBuilder.loadTexts:
neLocationName.setDescription('The NE Location Name of the alarm')
managedobject_instance = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 13), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
managedobjectInstance.setStatus('current')
if mibBuilder.loadTexts:
managedobjectInstance.setDescription('The managed object Instance of the alarm')
acknowledgement_user_name = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 14), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
acknowledgementUserName.setStatus('current')
if mibBuilder.loadTexts:
acknowledgementUserName.setDescription('acknowledgement User Name')
as_identity = mib_table_column((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 1, 2, 1, 15), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
asIdentity.setStatus('current')
if mibBuilder.loadTexts:
asIdentity.setDescription('The identity of the AS')
alarm_handoff_traps = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2))
alarm_raise = notification_type((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 1)).setObjects(('GENOSALARMNOTIFICATION-MIB', 'currentAlarmId'), ('GENOSALARMNOTIFICATION-MIB', 'friendlyName'), ('GENOSALARMNOTIFICATION-MIB', 'eventTime'), ('GENOSALARMNOTIFICATION-MIB', 'eventType'), ('GENOSALARMNOTIFICATION-MIB', 'probableCause'), ('GENOSALARMNOTIFICATION-MIB', 'perceivedSeverity'), ('GENOSALARMNOTIFICATION-MIB', 'additionalText'), ('GENOSALARMNOTIFICATION-MIB', 'specificProblems'), ('GENOSALARMNOTIFICATION-MIB', 'acknowledgementStatus'), ('GENOSALARMNOTIFICATION-MIB', 'reserveStatus'), ('GENOSALARMNOTIFICATION-MIB', 'additionalInformation'), ('GENOSALARMNOTIFICATION-MIB', 'neLocationName'), ('GENOSALARMNOTIFICATION-MIB', 'managedobjectInstance'), ('GENOSALARMNOTIFICATION-MIB', 'acknowledgementUserName'), ('GENOSALARMNOTIFICATION-MIB', 'asIdentity'))
if mibBuilder.loadTexts:
alarmRaise.setStatus('current')
if mibBuilder.loadTexts:
alarmRaise.setDescription('Notification that an alarm is currently active')
alarm_clear = notification_type((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 2)).setObjects(('GENOSALARMNOTIFICATION-MIB', 'currentAlarmId'), ('GENOSALARMNOTIFICATION-MIB', 'eventTime'), ('GENOSALARMNOTIFICATION-MIB', 'friendlyName'), ('GENOSALARMNOTIFICATION-MIB', 'probableCause'), ('GENOSALARMNOTIFICATION-MIB', 'asIdentity'))
if mibBuilder.loadTexts:
alarmClear.setStatus('current')
if mibBuilder.loadTexts:
alarmClear.setDescription('Notification that an alarm has been cleared')
alarm_ack = notification_type((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 3)).setObjects(('GENOSALARMNOTIFICATION-MIB', 'listAlarmIds'), ('GENOSALARMNOTIFICATION-MIB', 'operatorName'), ('GENOSALARMNOTIFICATION-MIB', 'asIdentity'))
if mibBuilder.loadTexts:
alarmAck.setStatus('current')
if mibBuilder.loadTexts:
alarmAck.setDescription('Notification that an alarm has been acknowledged')
alarm_purge = notification_type((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 4)).setObjects(('GENOSALARMNOTIFICATION-MIB', 'purgelistAlarmIds'), ('GENOSALARMNOTIFICATION-MIB', 'asIdentity'))
if mibBuilder.loadTexts:
alarmPurge.setStatus('current')
if mibBuilder.loadTexts:
alarmPurge.setDescription('Notification that an alarm has been purged')
alarm_reserve = notification_type((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 5)).setObjects(('GENOSALARMNOTIFICATION-MIB', 'reservelistAlarmIds'), ('GENOSALARMNOTIFICATION-MIB', 'reserveoperatorName'), ('GENOSALARMNOTIFICATION-MIB', 'asIdentity'))
if mibBuilder.loadTexts:
alarmReserve.setStatus('current')
if mibBuilder.loadTexts:
alarmReserve.setDescription('Notification that an alarm has been reserved')
alarm_unreserve = notification_type((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 6)).setObjects(('GENOSALARMNOTIFICATION-MIB', 'unreservelistAlarmIds'), ('GENOSALARMNOTIFICATION-MIB', 'unreserveoperatorName'), ('GENOSALARMNOTIFICATION-MIB', 'asIdentity'))
if mibBuilder.loadTexts:
alarmUnreserve.setStatus('current')
if mibBuilder.loadTexts:
alarmUnreserve.setDescription('Notification that an alarm has been unreserved')
as_connection_status = notification_type((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 7)).setObjects(('GENOSALARMNOTIFICATION-MIB', 'asconnectionstatus'), ('GENOSALARMNOTIFICATION-MIB', 'asId'))
if mibBuilder.loadTexts:
asConnectionStatus.setStatus('current')
if mibBuilder.loadTexts:
asConnectionStatus.setDescription('Notification that an AS status is changed')
alarm_un_ack = notification_type((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 2, 8)).setObjects(('GENOSALARMNOTIFICATION-MIB', 'unacklistAlarmIds'), ('GENOSALARMNOTIFICATION-MIB', 'unackoperatorName'), ('GENOSALARMNOTIFICATION-MIB', 'asIdentity'))
if mibBuilder.loadTexts:
alarmUnAck.setStatus('current')
if mibBuilder.loadTexts:
alarmUnAck.setDescription('Notification that an alarm has been unacknowledged')
alarm_handoff_ack = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 3))
list_alarm_ids = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 3, 1), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
listAlarmIds.setStatus('current')
if mibBuilder.loadTexts:
listAlarmIds.setDescription('The list of Alarms which are acknowledged by the Operator ')
operator_name = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 3, 2), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
operatorName.setStatus('current')
if mibBuilder.loadTexts:
operatorName.setDescription('The name of the Operator that performed the acknowledgement ')
ackas_identity_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 3, 3), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
ackasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts:
ackasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarm_handoff_filter = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4))
friendly_name_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 1), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
friendlyNameFilter.setStatus('current')
if mibBuilder.loadTexts:
friendlyNameFilter.setDescription('Dinamic Filter for Friendly name ')
event_time_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 2), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
eventTimeFilter.setStatus('current')
if mibBuilder.loadTexts:
eventTimeFilter.setDescription('Dinamic Filter for event Time')
event_type_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 3), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
eventTypeFilter.setStatus('current')
if mibBuilder.loadTexts:
eventTypeFilter.setDescription('Dinamic Filter for event Type')
probable_cause_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 4), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
probableCauseFilter.setStatus('current')
if mibBuilder.loadTexts:
probableCauseFilter.setDescription('Dinamic Filter for probable Cause')
perceived_severity_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 5), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
perceivedSeverityFilter.setStatus('current')
if mibBuilder.loadTexts:
perceivedSeverityFilter.setDescription('Dinamic Filter for perceived Severity')
specific_problems_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 6), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
specificProblemsFilter.setStatus('current')
if mibBuilder.loadTexts:
specificProblemsFilter.setDescription('Dinamic Filter for specific Problems')
nelocation_name_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 7), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
nelocationNameFilter.setStatus('current')
if mibBuilder.loadTexts:
nelocationNameFilter.setDescription('Dinamic Filter for nelocation name ')
additional_information_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 8), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
additionalInformationFilter.setStatus('current')
if mibBuilder.loadTexts:
additionalInformationFilter.setDescription('Dinamic Filter for additional Information ')
managedobject_instance_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 9), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
managedobjectInstanceFilter.setStatus('current')
if mibBuilder.loadTexts:
managedobjectInstanceFilter.setDescription('Dinamic Filter for managed object Instance ')
as_identity_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 4, 10), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
asIdentityFilter.setStatus('current')
if mibBuilder.loadTexts:
asIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarm_handoff_purge = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 5))
purgelist_alarm_ids = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 5, 1), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
purgelistAlarmIds.setStatus('current')
if mibBuilder.loadTexts:
purgelistAlarmIds.setDescription('The list of Alarms which are purged by the Operator ')
purgeoperator_name = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 5, 2), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
purgeoperatorName.setStatus('current')
if mibBuilder.loadTexts:
purgeoperatorName.setDescription('The name of the Operator that performed the purge ')
purgeas_identity_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 5, 3), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
purgeasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts:
purgeasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarm_handoff_reserve = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 6))
reservelist_alarm_ids = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 6, 1), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
reservelistAlarmIds.setStatus('current')
if mibBuilder.loadTexts:
reservelistAlarmIds.setDescription('The list of Alarms which are reserved by the Operator ')
reserveoperator_name = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 6, 2), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
reserveoperatorName.setStatus('current')
if mibBuilder.loadTexts:
reserveoperatorName.setDescription('The name of the Operator that performed the reserved ')
reserveas_identity_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 6, 3), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
reserveasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts:
reserveasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarm_handoff_unreserve = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 7))
unreservelist_alarm_ids = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 7, 1), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
unreservelistAlarmIds.setStatus('current')
if mibBuilder.loadTexts:
unreservelistAlarmIds.setDescription('The list of Alarms which are unreserved by the Operator ')
unreserveoperator_name = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 7, 2), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
unreserveoperatorName.setStatus('current')
if mibBuilder.loadTexts:
unreserveoperatorName.setDescription('The name of the Operator that performed the unreserved ')
unreserveas_identity_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 7, 3), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
unreserveasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts:
unreserveasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
alarm_handoffas_connection_status = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 8))
asconnectionstatus = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 8, 1), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
asconnectionstatus.setStatus('current')
if mibBuilder.loadTexts:
asconnectionstatus.setDescription('The status of the AS ')
as_id = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 8, 2), display_string()).setMaxAccess('readonly')
if mibBuilder.loadTexts:
asId.setStatus('current')
if mibBuilder.loadTexts:
asId.setDescription('The identity of the AS ')
alarm_handoff_un_ack = mib_identifier((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 9))
unacklist_alarm_ids = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 9, 1), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
unacklistAlarmIds.setStatus('current')
if mibBuilder.loadTexts:
unacklistAlarmIds.setDescription('The list of Alarms which are unacknowledged by the Operator ')
unackoperator_name = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 9, 2), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
unackoperatorName.setStatus('current')
if mibBuilder.loadTexts:
unackoperatorName.setDescription('The name of the Operator that performed the unacknowledgement ')
unackas_identity_filter = mib_scalar((1, 3, 6, 1, 4, 1, 637, 65, 1, 1, 9, 3), display_string()).setMaxAccess('readwrite')
if mibBuilder.loadTexts:
unackasIdentityFilter.setStatus('current')
if mibBuilder.loadTexts:
unackasIdentityFilter.setDescription('Dinamic Filter for AS Identity ')
mibBuilder.exportSymbols('GENOSALARMNOTIFICATION-MIB', alarmHandoffObjects=alarmHandoffObjects, eventTime=eventTime, unreserveasIdentityFilter=unreserveasIdentityFilter, friendlyName=friendlyName, genos=genos, alarmEntry=alarmEntry, alarmHandoffFilter=alarmHandoffFilter, reserveasIdentityFilter=reserveasIdentityFilter, asIdentity=asIdentity, unackoperatorName=unackoperatorName, asId=asId, eventTimeFilter=eventTimeFilter, alarmHandoffUnreserve=alarmHandoffUnreserve, alarmAck=alarmAck, asIdentityFilter=asIdentityFilter, additionalInformation=additionalInformation, reservelistAlarmIds=reservelistAlarmIds, alarmHandoffReserve=alarmHandoffReserve, alarmUnreserve=alarmUnreserve, alarmPurge=alarmPurge, probableCause=probableCause, asconnectionstatus=asconnectionstatus, PYSNMP_MODULE_ID=alarmHandoff, friendlyNameFilter=friendlyNameFilter, asConnectionStatus=asConnectionStatus, alarmHandoffUnAck=alarmHandoffUnAck, eventType=eventType, currentAlarmId=currentAlarmId, reserveStatus=reserveStatus, perceivedSeverity=perceivedSeverity, alarmTable=alarmTable, AlarmId=AlarmId, unsolicitedEventsEnabled=unsolicitedEventsEnabled, neLocationName=neLocationName, alarmRaise=alarmRaise, probableCauseFilter=probableCauseFilter, purgeoperatorName=purgeoperatorName, purgeasIdentityFilter=purgeasIdentityFilter, listAlarmIds=listAlarmIds, specificProblems=specificProblems, alarmHandoff=alarmHandoff, managedobjectInstance=managedobjectInstance, alarmHandoffasConnectionStatus=alarmHandoffasConnectionStatus, unackasIdentityFilter=unackasIdentityFilter, alcatel=alcatel, additionalText=additionalText, alarmUnAck=alarmUnAck, alarmHandoffAck=alarmHandoffAck, operatorName=operatorName, alarmHandoffPurge=alarmHandoffPurge, perceivedSeverityFilter=perceivedSeverityFilter, acknowledgementUserName=acknowledgementUserName, alarmHandoffTraps=alarmHandoffTraps, eventTypeFilter=eventTypeFilter, unreservelistAlarmIds=unreservelistAlarmIds, managedobjectInstanceFilter=managedobjectInstanceFilter, acknowledgementStatus=acknowledgementStatus, unreserveoperatorName=unreserveoperatorName, specificProblemsFilter=specificProblemsFilter, nmu=nmu, reserveoperatorName=reserveoperatorName, alarmClear=alarmClear, unacklistAlarmIds=unacklistAlarmIds, alarmReserve=alarmReserve, purgelistAlarmIds=purgelistAlarmIds, ackasIdentityFilter=ackasIdentityFilter, additionalInformationFilter=additionalInformationFilter, nelocationNameFilter=nelocationNameFilter) |
def test_case_mme_update(populated_database, case_obj, user_obj, mme_patient, mme_submission):
""" Test the function that registers an effected individual as submitted to MatchMaker """
adapter = populated_database
mme_submission['server_responses'] = [ {'patient': mme_patient }]
# Make sure no case has MME submission:
assert adapter.case_collection.find({'mme_submission' : { '$exists' : True}}).count() == 0
updated_case = adapter.case_mme_update(case_obj, user_obj, mme_submission)
# One case has MME submission now
assert updated_case['mme_submission']
assert adapter.case_collection.find({'mme_submission' : { '$exists' : True}}).count()
def test_case_mme_delete(populated_database, case_obj, user_obj, mme_patient):
""" Test the function that updates a case by deleting a MME submission associated to it """
adapter = populated_database
mme_subm_obj = 'mock_submission_object'
# Register a MME submission for a case
adapter.case_collection.update_one({ '_id': case_obj['_id']}, {'$set' : {'mme_submission' : mme_subm_obj} })
submitted_case = adapter.case_collection.find_one({'mme_submission': {'$exists': True}})
assert submitted_case['mme_submission'] == mme_subm_obj
# Now remove submission using the adapter function
updated_case = adapter.case_mme_delete(submitted_case, user_obj)
# Case should not have associated MME submission data any more
assert updated_case['mme_submission'] is None
| def test_case_mme_update(populated_database, case_obj, user_obj, mme_patient, mme_submission):
""" Test the function that registers an effected individual as submitted to MatchMaker """
adapter = populated_database
mme_submission['server_responses'] = [{'patient': mme_patient}]
assert adapter.case_collection.find({'mme_submission': {'$exists': True}}).count() == 0
updated_case = adapter.case_mme_update(case_obj, user_obj, mme_submission)
assert updated_case['mme_submission']
assert adapter.case_collection.find({'mme_submission': {'$exists': True}}).count()
def test_case_mme_delete(populated_database, case_obj, user_obj, mme_patient):
""" Test the function that updates a case by deleting a MME submission associated to it """
adapter = populated_database
mme_subm_obj = 'mock_submission_object'
adapter.case_collection.update_one({'_id': case_obj['_id']}, {'$set': {'mme_submission': mme_subm_obj}})
submitted_case = adapter.case_collection.find_one({'mme_submission': {'$exists': True}})
assert submitted_case['mme_submission'] == mme_subm_obj
updated_case = adapter.case_mme_delete(submitted_case, user_obj)
assert updated_case['mme_submission'] is None |
def array123(arr):
myarr = [1,2,3]
for i in range(len(arr)):
if arr[i: (i+3)] == myarr:
return True
return False
result = array123([1, 1, 2, 3, 1])
print(result)
result = array123([1, 1, 2, 4, 1])
print(result)
result = array123([1, 1, 2, 1, 2, 3])
print(result) | def array123(arr):
myarr = [1, 2, 3]
for i in range(len(arr)):
if arr[i:i + 3] == myarr:
return True
return False
result = array123([1, 1, 2, 3, 1])
print(result)
result = array123([1, 1, 2, 4, 1])
print(result)
result = array123([1, 1, 2, 1, 2, 3])
print(result) |
def getListInFile(fileName):
'''
DOCSTRING : Gets and reads a file in args
INPUT : name of file to open
OUTPUT : return list of colours
'''
with open(fileName, mode='r') as cFile:
listOfColours = cFile.readlines()
return listOfColours
cFile.close() | def get_list_in_file(fileName):
"""
DOCSTRING : Gets and reads a file in args
INPUT : name of file to open
OUTPUT : return list of colours
"""
with open(fileName, mode='r') as c_file:
list_of_colours = cFile.readlines()
return listOfColours
cFile.close() |
class DictAsObject(dict):
def __getattr__(self, name):
return self.__getitem__(name)
def __getitem__(self, name):
value = dict.__getitem__(self, name)
if isinstance(value, dict) and not isinstance(value, DictAsObject):
value = DictAsObject(value)
dict.__setitem__(self, name, value)
return value
def __setattr__(self, name, value):
if isinstance(value, dict) and not isinstance(value, DictAsObject):
value = DictAsObject(value)
dict.__setitem__(self, name, value)
def __delattr__(self, name):
return self.__delitem__(name)
| class Dictasobject(dict):
def __getattr__(self, name):
return self.__getitem__(name)
def __getitem__(self, name):
value = dict.__getitem__(self, name)
if isinstance(value, dict) and (not isinstance(value, DictAsObject)):
value = dict_as_object(value)
dict.__setitem__(self, name, value)
return value
def __setattr__(self, name, value):
if isinstance(value, dict) and (not isinstance(value, DictAsObject)):
value = dict_as_object(value)
dict.__setitem__(self, name, value)
def __delattr__(self, name):
return self.__delitem__(name) |
def find_median(Arr, start, size):
myList = []
for i in range(start, start + size):
myList.append(Arr[i])
myList.sort()
return myList[size // 2]
def fastSelect(array, k):
n = len(array)
if 0 < k <= n:
setOfMedians = []
arr_less_P = []
arr_equal_P = []
arr_more_P = []
i = 0
while i < n // 5:
median = find_median(array, 5 * i, 5)
setOfMedians.append(median)
i += 1
if 5 * i < n:
median = find_median(array, 5 * i, n % 5)
setOfMedians.append(median)
if len(setOfMedians) == 1:
pivot = setOfMedians[0]
elif len(setOfMedians) > 1:
pivot = fastSelect(setOfMedians, len(setOfMedians) // 2)
for element in array:
if element < pivot:
arr_less_P.append(element)
elif element > pivot:
arr_more_P.append(element)
else:
arr_equal_P.append(element)
if k <= len(arr_less_P):
return fastSelect(arr_less_P, k)
elif k > (len(arr_less_P) + len(arr_equal_P)):
return fastSelect(arr_more_P, (k - len(arr_less_P) - len(arr_equal_P)))
else:
return pivot
if __name__ == '__main__':
Arr = [6, 80, 36, 8, 23, 7, 10, 12, 42]
k = 5
print(fastSelect(Arr, k)) # Outputs 12
Arr = [5, 2, 20, 17, 11, 13, 8, 9, 11]
k = 5
print(fastSelect(Arr, k)) # Outputs 11
Arr = [6, 80, 36, 8, 23, 7, 10, 12, 42, 99]
k = 10
print(fastSelect(Arr, k)) # Outputs 99
| def find_median(Arr, start, size):
my_list = []
for i in range(start, start + size):
myList.append(Arr[i])
myList.sort()
return myList[size // 2]
def fast_select(array, k):
n = len(array)
if 0 < k <= n:
set_of_medians = []
arr_less_p = []
arr_equal_p = []
arr_more_p = []
i = 0
while i < n // 5:
median = find_median(array, 5 * i, 5)
setOfMedians.append(median)
i += 1
if 5 * i < n:
median = find_median(array, 5 * i, n % 5)
setOfMedians.append(median)
if len(setOfMedians) == 1:
pivot = setOfMedians[0]
elif len(setOfMedians) > 1:
pivot = fast_select(setOfMedians, len(setOfMedians) // 2)
for element in array:
if element < pivot:
arr_less_P.append(element)
elif element > pivot:
arr_more_P.append(element)
else:
arr_equal_P.append(element)
if k <= len(arr_less_P):
return fast_select(arr_less_P, k)
elif k > len(arr_less_P) + len(arr_equal_P):
return fast_select(arr_more_P, k - len(arr_less_P) - len(arr_equal_P))
else:
return pivot
if __name__ == '__main__':
arr = [6, 80, 36, 8, 23, 7, 10, 12, 42]
k = 5
print(fast_select(Arr, k))
arr = [5, 2, 20, 17, 11, 13, 8, 9, 11]
k = 5
print(fast_select(Arr, k))
arr = [6, 80, 36, 8, 23, 7, 10, 12, 42, 99]
k = 10
print(fast_select(Arr, k)) |
def BiRNN(x, weights, biases):
lstm_fw_cell = rnn_cell.BasicLSTMCell(n_hidden, forget_bias=1.0)
lstm_bw_cell = rnn_cell.BasicLSTMCell(n_hidden, forget_bias=1.0)
outputs = rnn.bidirectional_rnn(lstm_fw_cell, lstm_bw_cell, x, dtype=tf.float32)
return tf.matmul(outputs[-1], weights['out']) + biases['out'] | def bi_rnn(x, weights, biases):
lstm_fw_cell = rnn_cell.BasicLSTMCell(n_hidden, forget_bias=1.0)
lstm_bw_cell = rnn_cell.BasicLSTMCell(n_hidden, forget_bias=1.0)
outputs = rnn.bidirectional_rnn(lstm_fw_cell, lstm_bw_cell, x, dtype=tf.float32)
return tf.matmul(outputs[-1], weights['out']) + biases['out'] |
# https://app.codesignal.com/arcade/code-arcade/mirror-lake/rNrF4v5etMdFNKD3s
def isSubstitutionCipher(string1, string2):
# Is one string able to be made with a substitution cipher?
# We don't know what it is, but we can start comparing both
# and inferring what a candidate substitution may be. Then,
# this substitution has to hold on onwards for it to be valid.
cipher = {}
used = {}
for i in range(len(string1)):
char1, char2 = string1[i], string2[i]
# Character found has not been substituted so far.
if not(char1 in cipher):
# But we have to find out if the characters that will
# be used for substitution hasn't been used elsewhere.
if char2 in used:
return False
cipher[char1] = char2
used[char2] = 1
# The cipher is not consistent with previous substitutions.
elif cipher[char1] != char2:
return False
# The substitutions were consistent all along.
return True
| def is_substitution_cipher(string1, string2):
cipher = {}
used = {}
for i in range(len(string1)):
(char1, char2) = (string1[i], string2[i])
if not char1 in cipher:
if char2 in used:
return False
cipher[char1] = char2
used[char2] = 1
elif cipher[char1] != char2:
return False
return True |
STACK_COUNT = 6
INITIAL_STACK_SIZE = 6
MAX_STACK_SIZE = 15
STACK_RANGE = range(STACK_COUNT)
class GameState:
def __init__(self):
self.actions_taken = 0
# List of lists of tuples
# Finished stacks become None - won state contains 4 Nones and 2 empty lists
self.stacks = []
# List of booleans
# True if the stack at index i has a cheated card on top
self.cheats = []
# Initialize all stacks as empty
for i in STACK_RANGE:
self.stacks.append([])
self.cheats.append(False)
def clone(self):
"""
Clones the given GameState object
"""
clone = GameState()
for i in STACK_RANGE:
clone.cheats[i] = self.cheats[i]
if self.stacks[i] is None:
clone.stacks[i] = None
continue
for j in range(len(self.stacks[i])):
# Copy each card from each stack
card = self.stacks[i][j]
clone.stacks[i].append(card)
clone.actions_taken = self.actions_taken
return clone
def is_won(self):
"""
Determine if the current state is the won end state
"""
# If any stack has open cards, return False
for i in STACK_RANGE:
if self.stacks[i] is not None and len(self.stacks[i]) > 0:
return False
return True
def query_stack_top(self, index):
"""
Return the card that is on top of the given stack at index. Returns None if stack is empty or finished
Does not remove the card from the stack
"""
stack = self.stacks[index]
if stack is None or len(stack) == 0:
return None
return stack[-1]
def get_total_card_count(self):
"""
Returns the total card count in the stacks
"""
return sum([len(x) for x in self.stacks])
def pull_from_stack(self, index, count):
"""
Return given number of cards from the given stack
Removes the said cards from the stack
"""
stack = self.stacks[index]
start = stack[:-count]
end = stack[-count:]
# Set the "new" stack and return the extra
self.stacks[index] = start
return end
def parse_card_into_stack(self, index, card):
"""
Puts the given card at the top of the stack, used in the image parsing
"""
self.stacks[index].append(card)
def get_legal_actions(self, allow_cheats):
"""
Returns all legal actions as a 2-tuple:
(from, to)
"from" is a 2-tuple
(stack_index, card_index)
with card_index meaning the index of the card in the given stack
"to" is a 4-tuple
(cheat, collapse, stack_index, stack_size)
with cheat meaning whether the move is a "cheating" move,
collapse meaning a stack collapse action,
stack_index being the target stack index, and
stack_size being the current size of the target stack (for replaying the actions accurately)
"""
actions = []
# Loop through all stacks, and list out all legal actions
for stack_index in STACK_RANGE:
stack = self.stacks[stack_index]
if stack is None:
continue
# Check for being able to collapse the stack (a top slice of it)
can_collapse = True
collapse_check_value = 6
for card_index in range(len(stack))[::-1]:
card = stack[card_index]
# Early exit conditions for cards that are not the topmost
if card_index < len(stack) - 1:
# If the value of the card is not +1 of the value on top of it, break from this stack loop
# (no cards below can be moved either)
if stack[card_index + 1] + 1 != stack[card_index]:
break
# Any card below a cheated card cannot be moved, break
if self.cheats[stack_index] == True:
break
# Check for collapsing
if collapse_check_value == card and can_collapse:
collapse_check_value += 1
if card == 14: # Add a collapse action, if there is a free slow
can_collapse = False
empty_stack_index = self.get_empty_stack()
if empty_stack_index >= 0:
actions.append((
(stack_index, card_index), (False,
True, empty_stack_index, 0)
))
else:
can_collapse = False
# Check if the card can be placed onto any other stack
for target_stack_index in STACK_RANGE:
# Can not move onto the same stack (legal nor cheating)
if stack_index == target_stack_index:
continue
# Can not move onto a finished stack (legal nor cheating)
if self.stacks[target_stack_index] is None:
continue
# Can not move onto a cheated stack
if self.cheats[target_stack_index]:
continue
if self.can_place(card, target_stack_index):
# Check if the action will perform a collapse
# Check that the target stack supports it - must start from 14 at the bottom and end somewhere
# before 6
target_card_value = 14
for i in self.stacks[target_stack_index]:
if i == target_card_value:
target_card_value -= 1
else:
target_card_value = -1
# Target stack supports collapse - now check the source stack
for i in range(len(self.stacks[stack_index])):
if i < card_index:
continue
if self.stacks[stack_index][i] == target_card_value:
target_card_value -= 1
# The action will perform a collapse if the above checks result in a target_card_value of 5
action_is_collapse = target_card_value == 5
actions.append((
(stack_index, card_index), (False,
action_is_collapse, target_stack_index, len(self.stacks[target_stack_index]))
))
else:
# Check for cheat moves (only for other stacks that have cards and where we cannot normally move)
# Can only cheat the topmost card
# Can not re-cheat a cheated card
if allow_cheats and card_index == len(stack) - 1 and not self.cheats[stack_index]:
actions.append((
(stack_index, card_index), (True,
False, target_stack_index, len(
self.stacks[target_stack_index]))
))
return actions
def can_place(self, card, stack_index):
"""
Returns true if the given card can be placed onto the given stack (legally)
"""
# Can always place on empty stack
if len(self.stacks[stack_index]) == 0:
return True
target_card = self.stacks[stack_index][-1]
return target_card == card + 1
def apply_action(self, action):
"""
Applies the given action to this state. Assumes that the action is valid.
"""
self.actions_taken += 1
action_from = action[0]
action_to = action[1]
# Moving a card or stack onto another stack
from_stack_index = action_from[0]
from_card_index = action_from[1]
to_cheat_state = action_to[0]
to_collapsing = action_to[1]
to_stack_index = action_to[2]
cards_to_pull = len(
self.stacks[from_stack_index]) - from_card_index
cards = self.pull_from_stack(from_stack_index, cards_to_pull)
if to_collapsing:
self.stacks[to_stack_index] = None
else:
self.stacks[to_stack_index] += cards
# Set the cheat state of the topmost card. Has a real effect only if moving a cheat card
self.cheats[to_stack_index] = to_cheat_state
# If moving a cheated card to a valid position, un-cheat that stack
if self.cheats[from_stack_index]:
self.cheats[from_stack_index] = False
def get_heuristic_value(self):
"""
Returns a heuristic value for choosing a state over another
"""
score = 0
# Completed stacks is very good
# Empty slots is good
for stack in self.stacks:
if stack is None:
score += 50
elif len(stack) == 0:
score += 10
# High stacks is good (consecutive cards)
for stack in self.stacks:
if stack is not None and len(stack) > 5:
score += (len(stack) - 5) * 2
# Lots of cheated cards is bad
score -= sum(self.cheats) * 15
return score
def get_empty_stack(self):
"""
Returns the index of a stack that is empty, or -1 if none are.
"""
for i in STACK_RANGE:
if self.stacks[i] is not None and len(self.stacks[i]) == 0:
return i
return -1
def __eq__(self, other):
for i in STACK_RANGE:
if self.stacks[i] != other.stacks[i]:
return False
return True
def hash_string(self):
stacks_hash = "-".join([",".join([str(y) for y in x])
if (x is not None and len(x) > 0)
else("C" if x is None else "E")
for x in self.stacks])
cheats_hash = "".join("C" if x else "L" for x in self.cheats)
return stacks_hash + "-" + cheats_hash
def __hash__(self):
return hash(self.hash_string())
def __str__(self):
return ("Board:\n" +
"\n".join([", ".join(
map(lambda slot: str(slot), self.stacks[stack_index])) + (" C" if self.cheats[stack_index] else "")
if self.stacks[stack_index] is not None else "COLLAPSED"
for stack_index in STACK_RANGE]
))
| stack_count = 6
initial_stack_size = 6
max_stack_size = 15
stack_range = range(STACK_COUNT)
class Gamestate:
def __init__(self):
self.actions_taken = 0
self.stacks = []
self.cheats = []
for i in STACK_RANGE:
self.stacks.append([])
self.cheats.append(False)
def clone(self):
"""
Clones the given GameState object
"""
clone = game_state()
for i in STACK_RANGE:
clone.cheats[i] = self.cheats[i]
if self.stacks[i] is None:
clone.stacks[i] = None
continue
for j in range(len(self.stacks[i])):
card = self.stacks[i][j]
clone.stacks[i].append(card)
clone.actions_taken = self.actions_taken
return clone
def is_won(self):
"""
Determine if the current state is the won end state
"""
for i in STACK_RANGE:
if self.stacks[i] is not None and len(self.stacks[i]) > 0:
return False
return True
def query_stack_top(self, index):
"""
Return the card that is on top of the given stack at index. Returns None if stack is empty or finished
Does not remove the card from the stack
"""
stack = self.stacks[index]
if stack is None or len(stack) == 0:
return None
return stack[-1]
def get_total_card_count(self):
"""
Returns the total card count in the stacks
"""
return sum([len(x) for x in self.stacks])
def pull_from_stack(self, index, count):
"""
Return given number of cards from the given stack
Removes the said cards from the stack
"""
stack = self.stacks[index]
start = stack[:-count]
end = stack[-count:]
self.stacks[index] = start
return end
def parse_card_into_stack(self, index, card):
"""
Puts the given card at the top of the stack, used in the image parsing
"""
self.stacks[index].append(card)
def get_legal_actions(self, allow_cheats):
"""
Returns all legal actions as a 2-tuple:
(from, to)
"from" is a 2-tuple
(stack_index, card_index)
with card_index meaning the index of the card in the given stack
"to" is a 4-tuple
(cheat, collapse, stack_index, stack_size)
with cheat meaning whether the move is a "cheating" move,
collapse meaning a stack collapse action,
stack_index being the target stack index, and
stack_size being the current size of the target stack (for replaying the actions accurately)
"""
actions = []
for stack_index in STACK_RANGE:
stack = self.stacks[stack_index]
if stack is None:
continue
can_collapse = True
collapse_check_value = 6
for card_index in range(len(stack))[::-1]:
card = stack[card_index]
if card_index < len(stack) - 1:
if stack[card_index + 1] + 1 != stack[card_index]:
break
if self.cheats[stack_index] == True:
break
if collapse_check_value == card and can_collapse:
collapse_check_value += 1
if card == 14:
can_collapse = False
empty_stack_index = self.get_empty_stack()
if empty_stack_index >= 0:
actions.append(((stack_index, card_index), (False, True, empty_stack_index, 0)))
else:
can_collapse = False
for target_stack_index in STACK_RANGE:
if stack_index == target_stack_index:
continue
if self.stacks[target_stack_index] is None:
continue
if self.cheats[target_stack_index]:
continue
if self.can_place(card, target_stack_index):
target_card_value = 14
for i in self.stacks[target_stack_index]:
if i == target_card_value:
target_card_value -= 1
else:
target_card_value = -1
for i in range(len(self.stacks[stack_index])):
if i < card_index:
continue
if self.stacks[stack_index][i] == target_card_value:
target_card_value -= 1
action_is_collapse = target_card_value == 5
actions.append(((stack_index, card_index), (False, action_is_collapse, target_stack_index, len(self.stacks[target_stack_index]))))
elif allow_cheats and card_index == len(stack) - 1 and (not self.cheats[stack_index]):
actions.append(((stack_index, card_index), (True, False, target_stack_index, len(self.stacks[target_stack_index]))))
return actions
def can_place(self, card, stack_index):
"""
Returns true if the given card can be placed onto the given stack (legally)
"""
if len(self.stacks[stack_index]) == 0:
return True
target_card = self.stacks[stack_index][-1]
return target_card == card + 1
def apply_action(self, action):
"""
Applies the given action to this state. Assumes that the action is valid.
"""
self.actions_taken += 1
action_from = action[0]
action_to = action[1]
from_stack_index = action_from[0]
from_card_index = action_from[1]
to_cheat_state = action_to[0]
to_collapsing = action_to[1]
to_stack_index = action_to[2]
cards_to_pull = len(self.stacks[from_stack_index]) - from_card_index
cards = self.pull_from_stack(from_stack_index, cards_to_pull)
if to_collapsing:
self.stacks[to_stack_index] = None
else:
self.stacks[to_stack_index] += cards
self.cheats[to_stack_index] = to_cheat_state
if self.cheats[from_stack_index]:
self.cheats[from_stack_index] = False
def get_heuristic_value(self):
"""
Returns a heuristic value for choosing a state over another
"""
score = 0
for stack in self.stacks:
if stack is None:
score += 50
elif len(stack) == 0:
score += 10
for stack in self.stacks:
if stack is not None and len(stack) > 5:
score += (len(stack) - 5) * 2
score -= sum(self.cheats) * 15
return score
def get_empty_stack(self):
"""
Returns the index of a stack that is empty, or -1 if none are.
"""
for i in STACK_RANGE:
if self.stacks[i] is not None and len(self.stacks[i]) == 0:
return i
return -1
def __eq__(self, other):
for i in STACK_RANGE:
if self.stacks[i] != other.stacks[i]:
return False
return True
def hash_string(self):
stacks_hash = '-'.join([','.join([str(y) for y in x]) if x is not None and len(x) > 0 else 'C' if x is None else 'E' for x in self.stacks])
cheats_hash = ''.join(('C' if x else 'L' for x in self.cheats))
return stacks_hash + '-' + cheats_hash
def __hash__(self):
return hash(self.hash_string())
def __str__(self):
return 'Board:\n' + '\n'.join([', '.join(map(lambda slot: str(slot), self.stacks[stack_index])) + (' C' if self.cheats[stack_index] else '') if self.stacks[stack_index] is not None else 'COLLAPSED' for stack_index in STACK_RANGE]) |
class humano:
def __init__(self, nombre, armadura, nivel, ataque, ojos=2, piernas=2, dientes=32,salud=100):
self.ojos=ojos
self.piernas=piernas
self.dientes=dientes
self.nombre=nombre
self.armadura=armadura
self.nivel=nivel
self.ataque=ataque
self.salud=salud
def atacar_humano(self,orco):
orco.salud=orco.salud-(self.ataque-orco.armadura)
print(orco.salud)
return(orco.salud)
def no_vivo_humano(self):
if self.salud<=0:
return(True)
else:
return(False)
def todos_atributos_humano(self):
print(f"ojos:{self.ojos} | piernas: {self.piernas} | dientes:{self.dientes} |\
nombre:{self.nombre} | armadura:{self.armadura} | nivel:{self.nivel} |\
ataque:{self.ataque} | salud:{self.salud}") | class Humano:
def __init__(self, nombre, armadura, nivel, ataque, ojos=2, piernas=2, dientes=32, salud=100):
self.ojos = ojos
self.piernas = piernas
self.dientes = dientes
self.nombre = nombre
self.armadura = armadura
self.nivel = nivel
self.ataque = ataque
self.salud = salud
def atacar_humano(self, orco):
orco.salud = orco.salud - (self.ataque - orco.armadura)
print(orco.salud)
return orco.salud
def no_vivo_humano(self):
if self.salud <= 0:
return True
else:
return False
def todos_atributos_humano(self):
print(f'ojos:{self.ojos} | piernas: {self.piernas} | dientes:{self.dientes} | nombre:{self.nombre} | armadura:{self.armadura} | nivel:{self.nivel} | ataque:{self.ataque} | salud:{self.salud}') |
for _ in range(int(input())):
c = [int(n) for n in input()]
i_t = (c[3] ^ c[4] ^ c[5] ^ c[6]) << 2 | (c[1] ^ c[2] ^ c[5] ^ c[6]) << 1 | (c[0] ^ c[2] ^ c[4] ^ c[6])
if i_t: c[i_t - 1] ^= 1
print(''.join(map(str, [c[2], c[4], c[5], c[6]])))
| for _ in range(int(input())):
c = [int(n) for n in input()]
i_t = (c[3] ^ c[4] ^ c[5] ^ c[6]) << 2 | (c[1] ^ c[2] ^ c[5] ^ c[6]) << 1 | c[0] ^ c[2] ^ c[4] ^ c[6]
if i_t:
c[i_t - 1] ^= 1
print(''.join(map(str, [c[2], c[4], c[5], c[6]]))) |
#################################### User part start ##################################
""" GUI Color Theme. Set True for light mode, Valid values True, False """
DARK_THEME = False
""" Units for time expenses. Valid values are 'seconds', minutes', 'hours' """
UNITS = 'minutes'
""" Time to process a single word """
WORD = 0.1
""" Time to process a single table """
TABLE = 25
""" Time to process a single image/screenshot """
IMAGE = 35
""" Time to process a single chart """
CHART = 45
#################################### User part end ##################################
def __validate__():
if not UNITS in ['seconds', 'minutes', 'hours']:
raise IOError('Invaid config value %s for time units' % UNITS)
if type(DARK_THEME) is not bool:
raise IOError('Invalid config value %s for color mode' % DARK_THEME)
for _ in (WORD, TABLE, IMAGE, CHART):
if type(_) is not int and type(_) is not float:
raise IOError('Invalid config value %s for time variables' % _)
__validate__() | """ GUI Color Theme. Set True for light mode, Valid values True, False """
dark_theme = False
" Units for time expenses. Valid values are 'seconds', minutes', 'hours' "
units = 'minutes'
' Time to process a single word '
word = 0.1
' Time to process a single table '
table = 25
' Time to process a single image/screenshot '
image = 35
' Time to process a single chart '
chart = 45
def __validate__():
if not UNITS in ['seconds', 'minutes', 'hours']:
raise io_error('Invaid config value %s for time units' % UNITS)
if type(DARK_THEME) is not bool:
raise io_error('Invalid config value %s for color mode' % DARK_THEME)
for _ in (WORD, TABLE, IMAGE, CHART):
if type(_) is not int and type(_) is not float:
raise io_error('Invalid config value %s for time variables' % _)
__validate__() |
class Config:
batch_size = 100
n_epochs = 50
init_lr = 1e-2 # this would not take effect as using cyclic lr
momentum = 0.0
weight_decay = 5e-4
eta_min = 1e-5
eta_max = 1e-2
shuffle = False
part_labeled = 0.3 # the percentage of labeled data
n_features = 39
n_classes = 48
n_hidden_nodes = n_classes*2
temp = 1
teacher_tar_fmt = 'teacher_plbl{plbl}.tar'
baseline_tar_fmt = 'baseline_plbl{plbl}.tar'
student_tar_fmt = 'student_plbl{plbl}_T{temp}.tar'
cmp_tar_fmt = "cmp_optim_{optim}_plbl{plbl}.tar" | class Config:
batch_size = 100
n_epochs = 50
init_lr = 0.01
momentum = 0.0
weight_decay = 0.0005
eta_min = 1e-05
eta_max = 0.01
shuffle = False
part_labeled = 0.3
n_features = 39
n_classes = 48
n_hidden_nodes = n_classes * 2
temp = 1
teacher_tar_fmt = 'teacher_plbl{plbl}.tar'
baseline_tar_fmt = 'baseline_plbl{plbl}.tar'
student_tar_fmt = 'student_plbl{plbl}_T{temp}.tar'
cmp_tar_fmt = 'cmp_optim_{optim}_plbl{plbl}.tar' |
# TO DO
# Move constants/codes to new file
class Tokenizer:
"""
Advances through raw Jack code, ignores irrelevant characters, separates tokens, and identifies token types.
"""
KEYWORD = 0
IDENTIFIER = 1
SYMBOL = 2
INT_CONSTANT = 3
STRING_CONSTANT = 4
SYMBOLS = r"{}()[].,;+-*/&|<>=~"
KEYWORDS = [
"class", "constructor", "function", "method", "field", "static", "var", "int", "char", "boolean", "void", "true","false", "null", "this", "let", "do", "if", "else", "while", "return"]
def __init__(self, file):
self.file = file
self.i = 0
self.length = len(self.file)
self.token = None
self.token_type = None
def advance(self):
"""Advances to the next token. Sets token and token_type. Ignores whitespace and comments."""
self.token = None
while (self.token == None) and self.has_more_chars():
# Ignore whitespace and comments
if self.file[self.i].isspace():
self.i += 1
elif self.file[self.i : self.i+2] == "//":
self.ignore_line_comment()
elif self.file[self.i : self.i+2] == "/*":
self.ignore_open_close_comment()
# Process words (keyword or identifier)
elif self.file[self.i].isidentifier():
self.process_keyword_or_identifier()
# Process symbols
elif self.file[self.i] in self.SYMBOLS:
self.process_symbol()
# Process constants
elif self.file[self.i].isdigit():
self.process_integer_constant()
elif self.file[self.i] == '"':
self.process_string_constant()
else:
print(self.file[self.i])
raise Exception(
"UNEXPECTED CHARACTER: unable to process '{}'"\
.format(self.file[self.i]))
def has_more_chars(self):
"""Returns true if there are more characters to process."""
return self.i < self.length
def ignore_line_comment(self):
"""Advances to the end of the current line comment."""
self.i += 2
while self.has_more_chars():
if self.file[self.i] == "\n":
self.i += 1
return
self.i += 1
def ignore_open_close_comment(self):
"""Advances to the end of the current open-close comment."""
self.i += 2
while self.has_more_chars():
if self.file[self.i : self.i+2] == "*/":
self.i += 2
return
self.i += 1
# TO DO -- raise Exception for comment that didn't close???
def process_keyword_or_identifier(self):
"""Processes token and identifies as either keyword or identifier. Sets token and token_type."""
start = self.i
self.i += 1
while self.has_more_chars():
if not self.file[start : self.i+1].isidentifier():
self.token = self.file[start : self.i]
if self.token in self.KEYWORDS:
self.token_type = self.KEYWORD
else:
self.token_type = self.IDENTIFIER
return
self.i += 1
raise Exception("UNEXPECTED EOF")
def process_symbol(self):
"""Processes symbol token. Sets token and token_type."""
self.token = self.file[self.i]
self.token_type = self.SYMBOL
self.i += 1
def process_integer_constant(self):
"""Processes integer constant token. Sets token and token_type."""
start = self.i
self.i += 1
while self.has_more_chars():
if not self.file[self.i].isdigit():
self.token = self.file[start : self.i]
self.token_type = self.INT_CONSTANT
return
self.i += 1
raise Exception("UNEXPECTED EOF: expected to read ';'")
def process_string_constant(self):
"""Processes string constant token. Sets token and token_type."""
start = self.i
self.i += 1
while self.has_more_chars():
if self.file[self.i] == '"':
self.i += 1
self.token = self.file[start+1 : self.i-1]
self.token_type = self.STRING_CONSTANT
return
self.i += 1
raise Exception("UNEXPECTED EOF: expected to read '\"'") | class Tokenizer:
"""
Advances through raw Jack code, ignores irrelevant characters, separates tokens, and identifies token types.
"""
keyword = 0
identifier = 1
symbol = 2
int_constant = 3
string_constant = 4
symbols = '{}()[].,;+-*/&|<>=~'
keywords = ['class', 'constructor', 'function', 'method', 'field', 'static', 'var', 'int', 'char', 'boolean', 'void', 'true', 'false', 'null', 'this', 'let', 'do', 'if', 'else', 'while', 'return']
def __init__(self, file):
self.file = file
self.i = 0
self.length = len(self.file)
self.token = None
self.token_type = None
def advance(self):
"""Advances to the next token. Sets token and token_type. Ignores whitespace and comments."""
self.token = None
while self.token == None and self.has_more_chars():
if self.file[self.i].isspace():
self.i += 1
elif self.file[self.i:self.i + 2] == '//':
self.ignore_line_comment()
elif self.file[self.i:self.i + 2] == '/*':
self.ignore_open_close_comment()
elif self.file[self.i].isidentifier():
self.process_keyword_or_identifier()
elif self.file[self.i] in self.SYMBOLS:
self.process_symbol()
elif self.file[self.i].isdigit():
self.process_integer_constant()
elif self.file[self.i] == '"':
self.process_string_constant()
else:
print(self.file[self.i])
raise exception("UNEXPECTED CHARACTER: unable to process '{}'".format(self.file[self.i]))
def has_more_chars(self):
"""Returns true if there are more characters to process."""
return self.i < self.length
def ignore_line_comment(self):
"""Advances to the end of the current line comment."""
self.i += 2
while self.has_more_chars():
if self.file[self.i] == '\n':
self.i += 1
return
self.i += 1
def ignore_open_close_comment(self):
"""Advances to the end of the current open-close comment."""
self.i += 2
while self.has_more_chars():
if self.file[self.i:self.i + 2] == '*/':
self.i += 2
return
self.i += 1
def process_keyword_or_identifier(self):
"""Processes token and identifies as either keyword or identifier. Sets token and token_type."""
start = self.i
self.i += 1
while self.has_more_chars():
if not self.file[start:self.i + 1].isidentifier():
self.token = self.file[start:self.i]
if self.token in self.KEYWORDS:
self.token_type = self.KEYWORD
else:
self.token_type = self.IDENTIFIER
return
self.i += 1
raise exception('UNEXPECTED EOF')
def process_symbol(self):
"""Processes symbol token. Sets token and token_type."""
self.token = self.file[self.i]
self.token_type = self.SYMBOL
self.i += 1
def process_integer_constant(self):
"""Processes integer constant token. Sets token and token_type."""
start = self.i
self.i += 1
while self.has_more_chars():
if not self.file[self.i].isdigit():
self.token = self.file[start:self.i]
self.token_type = self.INT_CONSTANT
return
self.i += 1
raise exception("UNEXPECTED EOF: expected to read ';'")
def process_string_constant(self):
"""Processes string constant token. Sets token and token_type."""
start = self.i
self.i += 1
while self.has_more_chars():
if self.file[self.i] == '"':
self.i += 1
self.token = self.file[start + 1:self.i - 1]
self.token_type = self.STRING_CONSTANT
return
self.i += 1
raise exception('UNEXPECTED EOF: expected to read \'"\'') |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.