content stringlengths 7 1.05M |
|---|
# encoding: utf8
class End(object):
def __init__(self, connection=None):
self.connection = connection
self.__point = None
def paint(self, painter, point):
self.connection.paint(painter, self, point)
def set_point(self, point):
self.__point = point
def get_point(self):
return self.__point
|
# Straight down to your spine(After u crash into a "PROTEIN THINGNY" by E235 at 65km/h, imagine that high-speed and safe brought u by JR East and ATC/ATS)
# Be "straight" here for sure: This is for some external features that I just want to share around the repo and test it out
# Btw, remenber what this repo for?
def unwrap(incoming: str):
dump = incoming
# What a typical Win32 API(I guess, wmi.WMI().Win32_LogicalDisk()) output looks like:
# instance of Win32_LogicalDisk
# {
# Access = 0;
# Caption = "C:";
# Compressed = FALSE;
# CreationClassName = "Win32_LogicalDisk";
# Description = "Local Fixed Disk";
# DeviceID = "C:";
# DriveType = 3;
# FileSystem = "NTFS";
# FreeSpace = "114514191981";
# MaximumComponentLength = 255;
# MediaType = 12;
# Name = "C:";
# Size = "1145141919810";
# SupportsDiskQuotas = FALSE;
# SupportsFileBasedCompression = TRUE;
# SystemCreationClassName = "Win32_ComputerSystem";
# SystemName = "NA-ME";
# VolumeName = "";
# VolumeSerialNumber = ""; #Your S/N
# };
# Messy.
# So I am gonna process this in this file in my own way(String stuff) before I get a better option(Hope for help on this)
try:
head = dump.index("{")
except Exception:
return IOError
try:
tail = dump.index("};")
except Exception:
return IOError
dump = dump[head-1:tail-1]
raw_val = dump.split(";")
counter = 0
backed_val = {}
for i in raw_val:
name = i.split("\ = \ ")[0]
data = i.split("\ = \ ")[1]
backed_val[name] = data
return backed_val
|
'''
Aprimore o desafio 093 para que ele funcione com vários jogadores, incluindo um sistema de visualização de detalhes do aproeitamento de cada jogador.
'''
campeonato = list()
while True:
jogador = dict()
partidas = list()
jogador['nome'] = str(input('Nome do jogador: '))
tot = int(input(f'quantas partidas o {jogador["nome"]} jogou? '))
for c in range( 0,tot):
partidas.append(int(input(f' Quantos gols na partida {c} ? ')))
jogador['gols'] = partidas[:]
jogador['total'] = sum(partidas)
campeonato.append(jogador.copy())
# print(campeonato)
resp = str(input('Deseja continuar ? ')).upper()[0]
if resp in 'nN':
break
print(f'\tNo. Nome Gols Total')
for k,v in enumerate(campeonato):
print(f'\t{k:<3} {v["nome"]:<14} {v["gols"]} {v["total"]:>5} ')
print('-' * 30)
rsp = int(input('Mostrar dados de qual jogador ? '))
print(f'-- LEVANTAMENTO DO JOGADOR: {campeonato[rsp]["nome"]}')
for k,v in enumerate(campeonato[rsp]["gols"]):
print(f'\tNo jogo {k} fez {v} gols')
print("<< VOLTE SEMPRE >>")
'''
print('-=' * 30)
print(jogador)
print('-=' * 30)
for k, v in jogador.items():
print(f'\tO jogador {k} tem o valor {v} ')
print('-=' * 30)
print(f'O jogador {jogador["nome"]} jogou {len(jogador["gols"])} partidas')
for i, v in enumerate(jogador['gols']):
print(f' => Na partida {i}, fex {v} gols.')
print(f'Foi um total de {jogador["total"]} gols ')
'''
'''
lista = {}
gols = []
soma = 0
lista['nome'] = str(input('Nome: '))
lista['partidas'] = int(input(f'Quantas partidas {lista["nome"]} jogou? '))
for n in range( 0,int(lista['partidas']) ):
gols.append( int(input(f'Quantos gols ele fez na {n+1}o. partida: ')) )
soma += gols[n]
lista['gols'] = gols.copy()
lista['total'] = soma
print('-=' * 30)
print(lista)
print('-=' * 30)
for k, v in lista.items():
print(f'O campo {k} tem o valor {v}.')
print('-=' * 30)
print( f'O jogador {lista["nome"]} jogou {lista["partidas"]} partidas. ')
for k,v in enumerate(gols):
print(f'\t=> Na partida {k+1}, fez {v} gol(s). ')
print(f'Foi um total de {lista["total"]} gols.')
'''
|
num = float(input())
if (100 > num or num > 200) and num != 0:
print("invalid")
elif num == 0:
print()
|
# 21300 - [Job Adv] (Lv.60) Aran
sm.setSpeakerID(1510009)
sm.sendNext("How is the training going? Hm, Lv. 60? You still ahve a long way to go, but it's definitely praiseworthy compared to the first time I met you. Continue to train diligently, and I'm sure you'll regain your strength soon!")
if sm.sendAskYesNo("But first, you must head to #b#m140000000##k your #b#p1201001##k is acting weird again. I think it has something to tell you. It might be able to restore your abilities, so please hurry."):
sm.startQuest(parentID)
sm.sendSayOkay("Anyway, I thought it was really something that a weapon had its own identity, but this weapon gets extremely annoying. It cries, saying that I'm not paying attention to its needs, and now... Oh, please keep this a secret from the Polearm. I don't think it's a good idea to upset the weapon any more than I already have.")
sm.dispose()
else:
sm.dispose() |
"""
Дана база данных о продажах некоторого интернет-магазина. Каждая строка входного файла представляет собой запись вида
Покупатель товар количество, где
Покупатель — имя покупателя (строка без пробелов),
товар — название товара (строка без пробелов),
количество — количество приобретенных единиц товара.
Создайте список всех покупателей, а для каждого покупателя подсчитайте количество приобретенных им единиц каждого
вида товаров.
Формат ввода
Вводятся сведения о покупках в указанном формате.
Формат вывода
Выведите список всех покупателей в лексикографическом порядке,после имени каждого покупателя выведите двоеточие,
затем выведите список названий всех приобретенных данным покупателем товаров в лексикографическом порядке,
после названия каждого товара выведите количество единиц товара, приобретенных данным покупателем.Информация о каждом
товаре выводится в отдельной строке.
"""
fin = open('input.txt', 'r', encoding='utf-8')
myDict = dict()
for line in fin.readlines():
customer, product, value = line.split()
value = int(value)
if customer in myDict:
if product in myDict[customer]:
myDict[customer][product] += value
else:
myDict[customer][product] = value
else:
myDict[customer] = {product: value}
for key in sorted(myDict.keys()):
print(key + ':')
for product in sorted(myDict[key]):
print(product, myDict[key][product])
|
i = 0
while True:
print(i)
i = i + 1
|
"""
Faça uma função que receba um número N e retorne a soma dos algarítimos de N!. Ex: se N = 4, N! = 24. Logo, a soma de seus algarismos é 2 + 4 = 6.
Doctests:
>>> somaalgarismos(4)
6
>>> somaalgarismos(12)
27
>>> somaalgarismos(7)
9
>>> somaalgarismos(0)
1
"""
def somaalgarismos(n: int):
fat = 1
soma = 0
for c in range(1, n+1):
fat *= c
fat = str(fat)
for p in range(0, len(fat)):
soma += int(fat[p])
return soma
|
# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findBottomLeftValue(self, root):
"""
:type root: TreeNode
:rtype: int
"""
def dfs(root, h, w):
if not root:
return (float("inf"), float("inf"), None)
left = dfs(root.left, h - 1, w - 1)
right = dfs(root.right, h - 1, w + 1)
return min((h, w, root.val), left, right)
return dfs(root, 0, 0)[2] |
# Please be warned, that when turning on the "saving_enabled" feature, it will consume a lot of ram while it is saving
# The frames. This is because every single frame that is played during the animation is recorded into the memory
# At the moment, I dont see any other way to output a gif straight out of pygame. Increasing optimization_level alleviates
# this to some extent
saving_enabled = False # Record the animation
optimization_level = 1 # Every Nth frame to record while saving_enabled = True
duration = 8 # Pillow says this is duration of each frame in millisecond in the output gif but its weird
display_stats = True # Display stats like pixels drawn, fps
display_grid = True # displays a grid of tilesize x tilesize
silhouette = True # Shows original position while animating
brush_size = 3 # Default size of the brush
res = (800, 600) # window size
tile_size = 5 # size of each tile, as well as the size of grid if enabled
lerp_speed = 0.1 # How fast should pieces assemble together. 0.01 = 1% of the distance covered per frame
output_name = "out" # Name of the GIF generated if saving_enabled = True. (Do not include file extension!)
colors = [ # Edit these values to change or add more colors
(255, 0, 0), # red
(0, 255, 0), # green
(0, 0, 255), # blue
(170, 0, 210), # magenta
(0, 130, 200), # cyan
(255, 128, 128), # pale_red
(255, 255, 255), # White
]
default_background_color = (80, 80, 80) # Default canvas background color
palette_width = 50 #palette width
|
# EDITION
# PLAYING WITH NUMBERS
my_var_int = 1234
my_var_int = my_var_int + 20
print(f"my_var_int: {my_var_int}")
my_var_int += 20# my_var_int = my_var_int + 20
print(f"my_var_int: {my_var_int}")
my_var_int = my_var_int - 75 # substraction
print(f"my_var_int: {my_var_int}")
my_var_int = my_var_int / 2 # division
print(f"my_var_int: {my_var_int}")
my_var_int = my_var_int * 10 # multiplication
print(f"my_var_int: {my_var_int}")
my_var_int = my_var_int % 10 # modulo. Modulo is the rest when removing the operator to the value as much as possible and keep a positive value
# Example 20-10=10, we can still remove 10, 10-10=0, we can't remove 10 anymore so 20 % 10 = 0
# 21 % 10 = 21 - 10 - 10 = 1, 21 % 10 = 1
print(f"my_var_int: {my_var_int}")
print("") # SPACING
# PLAYING WITH STRINGS
my_var_string = "S_A"
print(f"my_var_string 1: {my_var_string}")
o_var = "S_other"
my_var_string = o_var + my_var_string # "S_A" + "S_other"
print(f"my_var_string 2: {my_var_string}")
my_var_string += o_var
print(f"my_var_string 3: {my_var_string}")
my_var_string = "S_A"
# my_var_string[0] = "B" # BREAKS
print("") # SPACING
# PLAYING WITH ARRAY
my_var_array = [1, 2, 3, 4]
my_var_array.append("a")
print(f"my_var_array after append: {my_var_array}")
my_var_array[0] = "AAA"
print(f"my_var_array after edition at index: {my_var_array}")
my_var_array = [ 123 ]+my_var_array + [9,8]
print(f"my_var_array after addition: {my_var_array}")
my_var_array = my_var_array[1:4] #this "slice" the array and keep between the 2 indexes
print(f"my_var_array after slice: {my_var_array}")
print("") # SPACING
# PLAYING WITH DICT
my_var_dict = {
'a':'TITI'
}
my_var_dict["a"] = "TOTO"
print(f"my_var_dict 1: {my_var_dict}")
my_var_dict["b"] = "BLABLA"
print(f"my_var_dict 2: {my_var_dict}")
my_var_dict["b"] = "APPLE"
print(f"my_var_dict 3: {my_var_dict}")
|
# Copyright 2012 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
'target_name': 'core_lib',
'type': 'static_library',
'sources': [
'address.cc',
'address.h',
'address_filter.h',
'address_filter_impl.h',
'address_range.cc',
'address_range.h',
'address_space.cc',
'address_space.h',
'address_space_internal.h',
'disassembler.cc',
'disassembler.h',
'disassembler_util.cc',
'disassembler_util.h',
'file_util.cc',
'file_util.h',
'json_file_writer.cc',
'json_file_writer.h',
'random_number_generator.cc',
'random_number_generator.h',
'section_offset_address.cc',
'section_offset_address.h',
'serialization.cc',
'serialization.h',
'serialization_impl.h',
'string_table.cc',
'string_table.h',
'zstream.cc',
'zstream.h',
],
'dependencies': [
'<(src)/base/base.gyp:base',
'<(src)/syzygy/assm/assm.gyp:assm_lib',
'<(src)/syzygy/common/common.gyp:common_lib',
'<(src)/third_party/distorm/distorm.gyp:distorm',
'<(src)/third_party/zlib/zlib.gyp:zlib',
],
},
{
'target_name': 'core_unittest_utils',
'type': 'static_library',
'sources': [
'unittest_util.cc',
'unittest_util.h',
],
'dependencies': [
'core_lib',
'<(src)/base/base.gyp:base',
'<(src)/testing/gtest.gyp:gtest',
],
},
{
'target_name': 'core_unittests',
'type': 'executable',
'includes': ['../build/masm.gypi'],
'sources': [
'address_unittest.cc',
'address_filter_unittest.cc',
'address_space_unittest.cc',
'address_range_unittest.cc',
'disassembler_test_code.asm',
'disassembler_unittest.cc',
'disassembler_util_unittest.cc',
'file_util_unittest.cc',
'json_file_writer_unittest.cc',
'section_offset_address_unittest.cc',
'serialization_unittest.cc',
'string_table_unittest.cc',
'unittest_util_unittest.cc',
'zstream_unittest.cc',
'<(src)/syzygy/testing/run_all_unittests.cc',
],
'dependencies': [
'core_lib',
'core_unittest_utils',
'<(src)/base/base.gyp:base',
'<(src)/base/base.gyp:test_support_base',
'<(src)/syzygy/assm/assm.gyp:assm_unittest_utils',
'<(src)/testing/gmock.gyp:gmock',
'<(src)/testing/gtest.gyp:gtest',
'<(src)/third_party/distorm/distorm.gyp:distorm',
'<(src)/third_party/zlib/zlib.gyp:zlib',
],
},
],
}
|
class MinStack:
def __init__(self):
"""
initialize your data structure here.
"""
self.l = []
self.min_stack = [math.inf]
def push(self, x: int) -> None:
self.l.append(x)
self.min_stack.append(min(x, self.min_stack[-1]))
def pop(self) -> None:
self.l.pop()
self.min_stack.pop()
def top(self) -> int:
return self.l[-1]
def getMin(self) -> int:
return self.min_stack[-1]
# Your MinStack object will be instantiated and called as such:
# obj = MinStack()
# obj.push(x)
# obj.pop()
# param_3 = obj.top()
# param_4 = obj.getMin()
|
r=int(input("enter radius\n"))
area=3.14*r*r
print(area)
r=int(input("enter radius\n"))
circumference=2*3.14*r
print(circumference)
|
"""
pythonbible-parser is a Python library for parsing Bible texts in various formats
and convert them into a format for easy and efficient use in Python.
"""
__version__ = "0.0.3"
|
plugins_modules = [
"authorization",
"anonymous",
]
|
SEND_TEXT = 'send_text'
SEND_IMAGE = 'send_image'
SEND_TEXT_AND_BUTTON = 'send_text_and_button'
CHECK_STATUS_MESSAGES = 'check_status_messages'
API = [SEND_TEXT, SEND_IMAGE, SEND_TEXT_AND_BUTTON, CHECK_STATUS_MESSAGES]
API_CHOICES = [(api, api) for api in API] |
def reverse(list):
if len(list) < 2:
return list
return [list[-1]] + reverse(list[:-1])
assert reverse([]) == []
assert reverse([2]) == [2]
assert reverse([2, 6, 5]) == [5, 6, 2] |
ENTRY_POINT = 'compare_one'
#[PROMPT]
def compare_one(a, b):
"""
Create a function that takes integers, floats, or strings representing
real numbers, and returns the larger variable in its given variable type.
Return None if the values are equal.
Note: If a real number is represented as a string, the floating point might be . or ,
compare_one(1, 2.5) ➞ 2.5
compare_one(1, "2,3") ➞ "2,3"
compare_one("5,1", "6") ➞ "6"
compare_one("1", 1) ➞ None
"""
#[SOLUTION]
temp_a, temp_b = a, b
if isinstance(temp_a, str): temp_a = temp_a.replace(',','.')
if isinstance(temp_b, str): temp_b = temp_b.replace(',','.')
if float(temp_a) == float(temp_b): return None
return a if float(temp_a) > float(temp_b) else b
#[CHECK]
def check(candidate):
# Check some simple cases
assert candidate(1, 2) == 2
assert candidate(1, 2.5) == 2.5
assert candidate(2, 3) == 3
assert candidate(5, 6) == 6
assert candidate(1, "2,3") == "2,3"
assert candidate("5,1", "6") == "6"
assert candidate("1", "2") == "2"
assert candidate("1", 1) == None
# Check some edge cases that are easy to work out by hand.
assert True
|
class Arvore():
def __init__(self, valor, esq=None, dir=None):
self.dir = dir
self.esq = esq
self.valor = valor
def __iter__(self):
yield self.valor
if self.esq:
for valor in self.esq:
yield valor
if self.dir:
for valor in self.dir:
yield valor
c = Arvore('C')
d = Arvore('D')
b = Arvore('B', c, d)
e = Arvore('E')
a = Arvore('A', b, e)
for valor in a:
print(valor) |
#4
row=0
while row<10:
col=0
while col<9:
if col+row==6 or row==6 or (col==6):
print("*",end=" ")
else:
print(" ",end=" ")
col +=1
row +=1
print()
|
def hex(number):
if number == 0:
return '0'
res = ''
while number > 0:
digit = number % 16
if digit <= 9:
digit = str(digit)
elif digit <= 13:
if digit <= 11:
if digit == 10:
digit = 'A'
else:
digit = 'B'
elif digit == 12:
digit = 'C'
else:
digit = 'D'
elif digit == 14:
digit = 'E'
else:
digit = 'F'
res = digit + res
number = number // 16
return res
|
class Singleton(type):
_instances = {}
def __call__(cls, tree):
if cls not in cls._instances:
cls._instances[cls] = super(Singleton, cls).__call__(tree)
instance = cls._instances[cls]
instance.tree = tree # update tree
return instance
def clear(cls):
try:
del Singleton._instances[cls]
except KeyError:
return
|
#Joe is a prisoner who has been sentenced to hard labor for his crimes. Each day he is given a pile of large rocks to break into tiny rocks. To make matters worse, they do not provide any tools to work with. Instead, he must use the rocks themselves. He always picks up the largest two stones and smashes them together. If they are of equal weight, they both disintegrate entirely. If one is larger, the smaller one is disintegrated and the larger one is reduced by the weight of the smaller one. Eventually there is either one stone left that cannot be broken or all of the stones have been smashed. Determine the weight of the last stone, or return 0 if there is none.
a_count = int(input().strip())
a = []
for _ in range(a_count):
a_item = int(input().strip())
a.append(a_item)
def lastStoneWeight(a):
# Write your code here
print(f"before sort: {a}")
a.sort()
print(f"after sort: {a}")
b = a[0]
for i in range(len(a)):
if len(a) >= 2:
b = abs(a[-1] - a[-2])
if b == 0:
a.remove(a[-1])
a.remove(a[-1])
else:
a.remove(a[-1])
a[-1] = b
else:
print(f"last output: {a}")
return b
print(f"result: {lastStoneWeight(a)}") |
#! python3
"""A number n is called deficient if the sum of its proper divisors is less
than n and it is called abundant if this sum exceeds n.
Find the sum of all the positive integers which cannot
be written as the sum of two abundant numbers."""
mn, mx = 12, 28123
def sdivisors_until(m):
"""Sum of divisors generator"""
yield 0
yield 1
sieve = [1] * m
for i in range(2, m):
yield sieve[i]
for mul in range(i, m, i):
sieve[mul] += i
divisors = tuple(sdivisors_until(mx))
abundant = tuple(i for i in range(mn, mx) if divisors[i] > i)
abundantSet = set(abundant) # Sets are faster checking existance
def can_be_written(n):
for i in abundant:
if i > n:
break
if n - i in abundantSet:
return True
return False
print(sum(i for i in range(1, mx) if not can_be_written(i)))
|
# (C) Datadog, Inc. 2020 - Present
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
GENERIC_METRICS = {
'go_gc_duration_seconds': 'go.gc_duration_seconds',
'go_goroutines': 'go.goroutines',
'go_info': 'go.info',
'go_memstats_alloc_bytes': 'go.memstats.alloc_bytes',
'go_memstats_alloc_bytes_total': 'go.memstats.alloc_bytes_total',
'go_memstats_buck_hash_sys_bytes': 'go.memstats.buck_hash_sys_bytes',
'go_memstats_frees_total': 'go.memstats.frees_total',
'go_memstats_gc_cpu_fraction': 'go.memstats.gc_cpu_fraction',
'go_memstats_gc_sys_bytes': 'go.memstats.gc_sys_bytes',
'go_memstats_heap_alloc_bytes': 'go.memstats.heap_alloc_bytes',
'go_memstats_heap_idle_bytes': 'go.memstats.heap_idle_bytes',
'go_memstats_heap_inuse_bytes': 'go.memstats.heap_inuse_bytes',
'go_memstats_heap_objects': 'go.memstats.heap_objects',
'go_memstats_heap_released_bytes': 'go.memstats.heap_released_bytes',
'go_memstats_heap_sys_bytes': 'go.memstats.heap_sys_bytes',
'go_memstats_last_gc_time_seconds': 'go.memstats.last_gc_time_seconds',
'go_memstats_lookups_total': 'go.memstats.lookups_total',
'go_memstats_mallocs_total': 'go.memstats.mallocs_total',
'go_memstats_mcache_inuse_bytes': 'go.memstats.mcache_inuse_bytes',
'go_memstats_mcache_sys_bytes': 'go.memstats.mcache_sys_bytes',
'go_memstats_mspan_inuse_bytes': 'go.memstats.mspan_inuse_bytes',
'go_memstats_mspan_sys_bytes': 'go.memstats.mspan_sys_bytes',
'go_memstats_next_gc_bytes': 'go.memstats.next_gc_bytes',
'go_memstats_other_sys_bytes': 'go.memstats.other_sys_bytes',
'go_memstats_stack_inuse_bytes': 'go.memstats.stack_inuse_bytes',
'go_memstats_stack_sys_bytes': 'go.memstats.stack_sys_bytes',
'go_memstats_sys_bytes': 'go.memstats.sys_bytes',
'go_threads': 'go.threads',
'process_cpu_seconds_total': 'process.cpu_seconds_total',
'process_max_fds': 'process.max_fds',
'process_open_fds': 'process.open_fds',
'process_resident_memory_bytes': 'process.resident_memory_bytes',
'process_start_time_seconds': 'process.start_time_seconds',
'process_virtual_memory_bytes': 'process.virtual_memory_bytes',
}
CITADEL_METRICS = {
'citadel_secret_controller_csr_err_count': 'secret_controller.csr_err_count',
'citadel_secret_controller_secret_deleted_cert_count': ('secret_controller.secret_deleted_cert_count'),
'citadel_secret_controller_svc_acc_created_cert_count': ('secret_controller.svc_acc_created_cert_count'),
'citadel_secret_controller_svc_acc_deleted_cert_count': ('secret_controller.svc_acc_deleted_cert_count'),
'citadel_server_authentication_failure_count': 'server.authentication_failure_count',
'citadel_server_citadel_root_cert_expiry_timestamp': ('server.citadel_root_cert_expiry_timestamp'),
'citadel_server_csr_count': 'server.csr_count',
'citadel_server_csr_parsing_err_count': 'server.csr_parsing_err_count',
'citadel_server_id_extraction_err_count': 'server.id_extraction_err_count',
'citadel_server_success_cert_issuance_count': 'server.success_cert_issuance_count',
'citadel_server_root_cert_expiry_timestamp': 'server.root_cert_expiry_timestamp',
}
GALLEY_METRICS = {
'endpoint_no_pod': 'endpoint_no_pod',
'galley_mcp_source_clients_total': 'mcp_source.clients_total',
'galley_runtime_processor_event_span_duration_milliseconds': ('runtime_processor.event_span_duration_milliseconds'),
'galley_runtime_processor_events_processed_total': 'runtime_processor.events_processed_total',
'galley_runtime_processor_snapshot_events_total': 'runtime_processor.snapshot_events_total',
'galley_runtime_processor_snapshot_lifetime_duration_milliseconds': (
'runtime_processor.snapshot_lifetime_duration_milliseconds'
),
'galley_runtime_processor_snapshots_published_total': ('runtime_processor.snapshots_published_total'),
'galley_runtime_state_type_instances_total': 'runtime_state_type_instances_total',
'galley_runtime_strategy_on_change_total': 'runtime_strategy.on_change_total',
'galley_runtime_strategy_timer_max_time_reached_total': ('runtime_strategy.timer_max_time_reached_total'),
'galley_runtime_strategy_timer_quiesce_reached_total': 'runtime_strategy.quiesce_reached_total',
'galley_runtime_strategy_timer_resets_total': 'runtime_strategy.timer_resets_total',
'galley_source_kube_dynamic_converter_success_total': ('source_kube.dynamic_converter_success_total'),
'galley_source_kube_event_success_total': 'source_kube.event_success_total',
'galley_validation_cert_key_updates': 'validation.cert_key_updates',
'galley_validation_config_load': 'validation.config_load',
'galley_validation_config_updates': 'validation.config_update',
'galley_validation_passed': 'validation.passed',
# These metrics supported Istio 1.5
'galley_validation_config_update_error': 'validation.config_update_error',
}
MESH_METRICS = {
# These metrics support Istio 1.5
'istio_request_duration_milliseconds': 'request.duration.milliseconds',
# These metrics support Istio 1.0
'istio_requests_total': 'request.count',
'istio_request_duration_seconds': 'request.duration',
'istio_request_bytes': 'request.size',
'istio_response_bytes': 'response.size',
# These metrics support Istio 0.8
'istio_request_count': 'request.count',
'istio_request_duration': 'request.duration',
'istio_request_size': 'request.size',
'istio_response_size': 'response.size',
# TCP metrics
'istio_tcp_connections_closed_total': 'tcp.connections_closed.total',
'istio_tcp_connections_opened_total': 'tcp.connections_opened.total',
'istio_tcp_received_bytes_total': 'tcp.received_bytes.total',
'istio_tcp_sent_bytes_total': 'tcp.send_bytes.total',
}
MIXER_METRICS = {
# Pre 1.1 metrics
'grpc_server_handled_total': 'grpc.server.handled_total',
'grpc_server_handling_seconds': 'grpc.server.handling_seconds',
'grpc_server_msg_received_total': 'grpc.server.msg_received_total',
'grpc_server_msg_sent_total': 'grpc.server.msg_sent_total',
'grpc_server_started_total': 'grpc.server.started_total',
'mixer_adapter_dispatch_count': 'adapter.dispatch_count',
'mixer_adapter_dispatch_duration': 'adapter.dispatch_duration',
'mixer_adapter_old_dispatch_count': 'adapter.old_dispatch_count',
'mixer_adapter_old_dispatch_duration': 'adapter.old_dispatch_duration',
'mixer_config_resolve_actions': 'config.resolve_actions',
'mixer_config_resolve_count': 'config.resolve_count',
'mixer_config_resolve_duration': 'config.resolve_duration',
'mixer_config_resolve_rules': 'config.resolve_rules',
# 1.1 metrics
'grpc_io_server_completed_rpcs': 'grpc_io_server.completed_rpcs',
'grpc_io_server_received_bytes_per_rpc': 'grpc_io_server.received_bytes_per_rpc',
'grpc_io_server_sent_bytes_per_rpc': 'grpc_io_server.sent_bytes_per_rpc',
'grpc_io_server_server_latency': 'grpc_io_server.server_latency',
'mixer_config_attributes_total': 'config.attributes_total',
'mixer_config_handler_configs_total': 'config.handler_configs_total',
'mixer_config_instance_configs_total': 'config.instance_configs_total',
'mixer_config_rule_configs_total': 'config.rule_configs_total',
'mixer_dispatcher_destinations_per_request': 'dispatcher.destinations_per_request',
'mixer_dispatcher_instances_per_request': 'dispatcher.instances_per_request',
'mixer_handler_daemons_total': 'handler.daemons_total',
'mixer_handler_new_handlers_total': 'handler.new_handlers_total',
'mixer_mcp_sink_reconnections': 'mcp_sink.reconnections',
'mixer_mcp_sink_request_acks_total': 'mcp_sink.request_acks_total',
'mixer_runtime_dispatches_total': 'runtime.dispatches_total',
'mixer_runtime_dispatch_duration_seconds': 'runtime.dispatch_duration_seconds',
}
PILOT_METRICS = {
'pilot_conflict_inbound_listener': 'conflict.inbound_listener',
'pilot_conflict_outbound_listener_http_over_current_tcp': ('conflict.outbound_listener.http_over_current_tcp'),
'pilot_conflict_outbound_listener_tcp_over_current_http': ('conflict.outbound_listener.tcp_over_current_http'),
'pilot_conflict_outbound_listener_tcp_over_current_tcp': ('conflict.outbound_listener.tcp_over_current_tcp'),
'pilot_destrule_subsets': 'destrule_subsets',
'pilot_duplicate_envoy_clusters': 'duplicate_envoy_clusters',
'pilot_eds_no_instances': 'eds_no_instances',
'pilot_endpoint_not_ready': 'endpoint_not_ready',
'pilot_invalid_out_listeners': 'invalid_out_listeners',
'pilot_mcp_sink_reconnections': 'mcp_sink.reconnections',
'pilot_mcp_sink_recv_failures_total': 'mcp_sink.recv_failures_total',
'pilot_mcp_sink_request_acks_total': 'mcp_sink.request_acks_total',
'pilot_no_ip': 'no_ip',
'pilot_proxy_convergence_time': 'proxy_convergence_time',
'pilot_rds_expired_nonce': 'rds_expired_nonce',
'pilot_services': 'services',
'pilot_total_xds_internal_errors': 'total_xds_internal_errors',
'pilot_total_xds_rejects': 'total_xds_rejects',
'pilot_virt_services': 'virt_services',
'pilot_vservice_dup_domain': 'vservice_dup_domain',
'pilot_xds': 'xds',
'pilot_xds_eds_instances': 'xds.eds_instances',
'pilot_xds_push_context_errors': 'xds.push.context_errors',
'pilot_xds_push_timeout': 'xds.push.timeout',
'pilot_xds_push_timeout_failures': 'xds.push.timeout_failures',
'pilot_xds_pushes': 'xds.pushes',
'pilot_xds_write_timeout': 'xds.write_timeout',
'pilot_xds_rds_reject': 'pilot.xds.rds_reject',
'pilot_xds_eds_reject': 'pilot.xds.eds_reject',
'pilot_xds_cds_reject': 'pilot.xds.cds_reject',
'pilot_xds_lds_reject': 'pilot.xds.lds_reject',
}
ISTIOD_METRICS = {
# Maintain namespace compatibility from legacy components
# Generic metrics
'go_gc_duration_seconds': 'go.gc_duration_seconds',
'go_goroutines': 'go.goroutines',
'go_info': 'go.info',
'go_memstats_alloc_bytes': 'go.memstats.alloc_bytes',
'go_memstats_alloc_bytes_total': 'go.memstats.alloc_bytes_total',
'go_memstats_buck_hash_sys_bytes': 'go.memstats.buck_hash_sys_bytes',
'go_memstats_frees_total': 'go.memstats.frees_total',
'go_memstats_gc_cpu_fraction': 'go.memstats.gc_cpu_fraction',
'go_memstats_gc_sys_bytes': 'go.memstats.gc_sys_bytes',
'go_memstats_heap_alloc_bytes': 'go.memstats.heap_alloc_bytes',
'go_memstats_heap_idle_bytes': 'go.memstats.heap_idle_bytes',
'go_memstats_heap_inuse_bytes': 'go.memstats.heap_inuse_bytes',
'go_memstats_heap_objects': 'go.memstats.heap_objects',
'go_memstats_heap_released_bytes': 'go.memstats.heap_released_bytes',
'go_memstats_heap_sys_bytes': 'go.memstats.heap_sys_bytes',
'go_memstats_last_gc_time_seconds': 'go.memstats.last_gc_time_seconds',
'go_memstats_lookups_total': 'go.memstats.lookups_total',
'go_memstats_mallocs_total': 'go.memstats.mallocs_total',
'go_memstats_mcache_inuse_bytes': 'go.memstats.mcache_inuse_bytes',
'go_memstats_mcache_sys_bytes': 'go.memstats.mcache_sys_bytes',
'go_memstats_mspan_inuse_bytes': 'go.memstats.mspan_inuse_bytes',
'go_memstats_mspan_sys_bytes': 'go.memstats.mspan_sys_bytes',
'go_memstats_next_gc_bytes': 'go.memstats.next_gc_bytes',
'go_memstats_other_sys_bytes': 'go.memstats.other_sys_bytes',
'go_memstats_stack_inuse_bytes': 'go.memstats.stack_inuse_bytes',
'go_memstats_stack_sys_bytes': 'go.memstats.stack_sys_bytes',
'go_memstats_sys_bytes': 'go.memstats.sys_bytes',
'go_threads': 'go.threads',
'process_cpu_seconds_total': 'process.cpu_seconds_total',
'process_max_fds': 'process.max_fds',
'process_open_fds': 'process.open_fds',
'process_resident_memory_bytes': 'process.resident_memory_bytes',
'process_start_time_seconds': 'process.start_time_seconds',
'process_virtual_memory_bytes': 'process.virtual_memory_bytes',
'pilot_conflict_inbound_listener': 'pilot.conflict.inbound_listener',
'pilot_conflict_outbound_listener_http_over_current_tcp': (
'pilot.conflict.outbound_listener.http_over_current_tcp'
),
'pilot_conflict_outbound_listener_tcp_over_current_http': (
'pilot.conflict.outbound_listener.tcp_over_current_http'
),
'pilot_conflict_outbound_listener_tcp_over_current_tcp': ('pilot.conflict.outbound_listener.tcp_over_current_tcp'),
'pilot_destrule_subsets': 'pilot.destrule_subsets',
'pilot_duplicate_envoy_clusters': 'pilot.duplicate_envoy_clusters',
'pilot_eds_no_instances': 'pilot.eds_no_instances',
'pilot_endpoint_not_ready': 'pilot.endpoint_not_ready',
'pilot_invalid_out_listeners': 'pilot.invalid_out_listeners',
'pilot_mcp_sink_reconnections': 'pilot.mcp_sink.reconnections',
'pilot_mcp_sink_recv_failures_total': 'pilot.mcp_sink.recv_failures_total',
'pilot_mcp_sink_request_acks_total': 'pilot.mcp_sink.request_acks_total',
'pilot_no_ip': 'pilot.no_ip',
'pilot_proxy_convergence_time': 'pilot.proxy_convergence_time',
'pilot_rds_expired_nonce': 'pilot.rds_expired_nonce',
'pilot_services': 'pilot.services',
'pilot_total_xds_internal_errors': 'pilot.total_xds_internal_errors',
'pilot_total_xds_rejects': 'pilot.total_xds_rejects',
'pilot_virt_services': 'pilot.virt_services',
'pilot_vservice_dup_domain': 'pilot.vservice_dup_domain',
'pilot_xds': 'pilot.xds',
'pilot_xds_eds_instances': 'pilot.xds.eds_instances',
'pilot_xds_push_context_errors': 'pilot.xds.push.context_errors',
'pilot_xds_push_timeout': 'pilot.xds.push.timeout',
'pilot_xds_push_timeout_failures': 'pilot.xds.push.timeout_failures',
'pilot_xds_pushes': 'pilot.xds.pushes',
'pilot_xds_write_timeout': 'pilot.xds.write_timeout',
'pilot_xds_rds_reject': 'pilot.xds.rds_reject',
'pilot_xds_eds_reject': 'pilot.xds.eds_reject',
'pilot_xds_cds_reject': 'pilot.xds.cds_reject',
'pilot_xds_lds_reject': 'pilot.xds.lds_reject',
'grpc_server_handled_total': 'grpc.server.handled_total',
'grpc_server_handling_seconds': 'grpc.server.handling_seconds',
'grpc_server_msg_received_total': 'grpc.server.msg_received_total',
'grpc_server_msg_sent_total': 'grpc.server.msg_sent_total',
'grpc_server_started_total': 'grpc.server.started_total',
'grpc_io_server_completed_rpcs': 'mixer.grpc_io_server.completed_rpcs',
'grpc_io_server_received_bytes_per_rpc': 'mixer.grpc_io_server.received_bytes_per_rpc',
'grpc_io_server_sent_bytes_per_rpc': 'mixer.grpc_io_server.sent_bytes_per_rpc',
'grpc_io_server_server_latency': 'mixer.grpc_io_server.server_latency',
'mixer_config_attributes_total': 'mixer.config.attributes_total',
'mixer_config_handler_configs_total': 'mixer.config.handler_configs_total',
'mixer_config_instance_configs_total': 'mixer.config.instance_configs_total',
'mixer_config_rule_configs_total': 'mixer.config.rule_configs_total',
'mixer_dispatcher_destinations_per_request': 'mixer.dispatcher.destinations_per_request',
'mixer_dispatcher_instances_per_request': 'mixer.dispatcher.instances_per_request',
'mixer_handler_daemons_total': 'mixer.handler.daemons_total',
'mixer_handler_new_handlers_total': 'mixer.handler.new_handlers_total',
'mixer_mcp_sink_reconnections': 'mixer.mcp_sink.reconnections',
'mixer_mcp_sink_request_acks_total': 'mixer.mcp_sink.request_acks_total',
'mixer_runtime_dispatches_total': 'mixer.runtime.dispatches_total',
'mixer_runtime_dispatch_duration_seconds': 'mixer.runtime.dispatch_duration_seconds',
'endpoint_no_pod': 'galley.endpoint_no_pod',
'galley_mcp_source_clients_total': 'galley.mcp_source.clients_total',
'galley_runtime_processor_event_span_duration_milliseconds': (
'galley.runtime_processor.event_span_duration_milliseconds'
),
'galley_runtime_processor_events_processed_total': 'galley.runtime_processor.events_processed_total',
'galley_runtime_processor_snapshot_events_total': 'galley.runtime_processor.snapshot_events_total',
'galley_runtime_processor_snapshot_lifetime_duration_milliseconds': (
'galley.runtime_processor.snapshot_lifetime_duration_milliseconds'
),
'galley_runtime_processor_snapshots_published_total': ('galley.runtime_processor.snapshots_published_total'),
'galley_runtime_state_type_instances_total': 'galley.runtime_state_type_instances_total',
'galley_runtime_strategy_on_change_total': 'galley.runtime_strategy.on_change_total',
'galley_runtime_strategy_timer_max_time_reached_total': ('galley.runtime_strategy.timer_max_time_reached_total'),
'galley_runtime_strategy_timer_quiesce_reached_total': 'galley.runtime_strategy.quiesce_reached_total',
'galley_runtime_strategy_timer_resets_total': 'galley.runtime_strategy.timer_resets_total',
'galley_source_kube_dynamic_converter_success_total': ('galley.source_kube.dynamic_converter_success_total'),
'galley_source_kube_event_success_total': 'galley.source_kube.event_success_total',
'galley_validation_config_load': 'galley.validation.config_load',
'galley_validation_config_updates': 'galley.validation.config_update',
'citadel_secret_controller_csr_err_count': 'citadel.secret_controller.csr_err_count',
'citadel_secret_controller_secret_deleted_cert_count': ('citadel.secret_controller.secret_deleted_cert_count'),
'citadel_secret_controller_svc_acc_created_cert_count': ('citadel.secret_controller.svc_acc_created_cert_count'),
'citadel_secret_controller_svc_acc_deleted_cert_count': ('citadel.secret_controller.svc_acc_deleted_cert_count'),
'citadel_server_authentication_failure_count': 'citadel.server.authentication_failure_count',
'citadel_server_citadel_root_cert_expiry_timestamp': ('citadel.server.citadel_root_cert_expiry_timestamp'),
'citadel_server_csr_count': 'citadel.server.csr_count',
'citadel_server_csr_parsing_err_count': 'citadel.server.csr_parsing_err_count',
'citadel_server_id_extraction_err_count': 'citadel.server.id_extraction_err_count',
'citadel_server_success_cert_issuance_count': 'citadel.server.success_cert_issuance_count',
# These metrics supported Istio 1.5
'galley_validation_config_update_error': 'galley.validation.config_update_error',
'citadel_server_root_cert_expiry_timestamp': 'citadel.server.root_cert_expiry_timestamp',
'galley_validation_passed': 'galley.validation.passed',
'galley_validation_failed': 'galley.validation.failed',
'pilot_conflict_outbound_listener_http_over_https': 'pilot.conflict.outbound_listener.http_over_https',
'pilot_inbound_updates': 'pilot.inbound_updates',
'pilot_k8s_cfg_events': 'pilot.k8s.cfg_events',
'pilot_k8s_reg_events': 'pilot.k8s.reg_events',
'pilot_proxy_queue_time': 'pilot.proxy_queue_time',
'pilot_push_triggers': 'pilot.push.triggers',
'pilot_xds_eds_all_locality_endpoints': 'pilot.xds.eds_all_locality_endpoints',
'pilot_xds_push_time': 'pilot.xds.push.time',
'process_virtual_memory_max_bytes': 'process.virtual_memory_max_bytes',
'sidecar_injection_requests_total': 'sidecar_injection.requests_total',
'sidecar_injection_success_total': 'sidecar_injection.success_total',
'sidecar_injection_failure_total': 'sidecar_injection.failure_total',
'sidecar_injection_skip_total': 'sidecar_injection.skip_total',
}
|
N, M = list(map(int, input().split()))
a_list = [[0 for _ in range(M)] for _ in range(N)]
for i in range(N):
a_list[i] = list(map(int, input().split()))
ans = 0
for t1 in range(M-1):
for t2 in range(t1+1, M):
score = 0
for i in range(N):
score += max(a_list[i][t1], a_list[i][t2])
ans = max(ans, score)
print(ans)
|
a = int(input())
b = int(input())
c = int(input())
max = a
if max < b:
max = b
if max < c:
max = c
elif max < c:
max = c
print(max) |
students = {
"males" : ["joseph", "stephen", "theophilus"],
"females" : ["kara", "sharon", "lois"]
}
print(students["males"])
print(students["females"]) |
def hourglassSum(arr):
dic = {}
top = 0
mid = 1
bot = 2
top_one = 0
mid_one = 1
bot_one = 0
num = 0
max = float('-inf')
while bot < len(arr):
while bot_one < len(arr[-1])-2:
dic[num] = sum(arr[top][top_one : top_one + 3]) + arr[mid][mid_one] + sum(arr[bot][bot_one : bot_one + 3])
if dic[num] > max:
max = dic[num]
num += 1
top_one += 1
mid_one += 1
bot_one += 1
top += 1
mid += 1
bot += 1
top_one = 0
mid_one = 1
bot_one = 0
return max |
'''
Various utility methods for building html attributes.
'''
def styles(*styles):
'''Join multiple "conditional styles" and return a single style attribute'''
return '; '.join(filter(None, styles))
def classes(*classes):
'''Join multiple "conditional classes" and return a single class attribute'''
return ' '.join(filter(None, classes)) |
SNOW_START = -100
SNOW_END = 0
GRASS_START = 0
GRASS_END = 40
SAND_START = 40
SAND_END = 100
def color_rgb(r,g,b):
"""r,g,b are intensities of red, green, and blue in range(256)
Returns color specifier string for the resulting color"""
return "#%02x%02x%02x" % (r,g,b)
def climate_color(temperature, brightness):
r = g = b = brightness
color_range = 255 - brightness
if SAND_START <= temperature:
r_step = color_range / (SAND_END - SAND_START)
change = brightness + (temperature - SAND_START) * r_step
r = brightness + (temperature - SAND_START) * r_step * 2
g = 255 - color_range/4 - change*0.5
b = brightness
if r > 255:
r = 255
if r < brightness + color_range*3/4:
g = 255 - color_range/4 - change*0.25
if GRASS_START <= temperature <= GRASS_END:
g_step = color_range / (GRASS_END - GRASS_START)
r = 255 - (temperature - GRASS_START) * g_step
g = 255 - (temperature - GRASS_START) * g_step/4
b = r
if SNOW_START <= temperature <= SNOW_END:
b_step = color_range / (SNOW_END - SNOW_START)
r = brightness + (temperature - SNOW_START) * b_step
g = r
b = 255
return int(r), int(g), int(b)
def temperature_color(temperature, brightness):
if temperature > 0:
r_step = brightness / 100
b = int(255 - temperature * r_step)
g = b
r = 255
else:
b_step = brightness / 100
r = int(temperature * b_step * -1)
g = r
b = 255
return (r,g,b)
|
class Solution:
def smallestSubsequence(self, s: str) -> str:
stack, seen, lastOccurence = deque([]), set(), {char: index for index, char in enumerate(s)}
for index, char in enumerate(s):
if char not in seen:
while stack and char < stack[-1] and index < lastOccurence[stack[-1]]:
seen.discard(stack.pop())
seen.add(char)
stack.append(char)
return ''.join(stack) |
power = {'BUSES': {'Area': 1.33155,
'Bus/Area': 1.33155,
'Bus/Gate Leakage': 0.00662954,
'Bus/Peak Dynamic': 0.0,
'Bus/Runtime Dynamic': 0.0,
'Bus/Subthreshold Leakage': 0.0691322,
'Bus/Subthreshold Leakage with power gating': 0.0259246,
'Gate Leakage': 0.00662954,
'Peak Dynamic': 0.0,
'Runtime Dynamic': 0.0,
'Subthreshold Leakage': 0.0691322,
'Subthreshold Leakage with power gating': 0.0259246},
'Core': [{'Area': 32.6082,
'Execution Unit/Area': 8.2042,
'Execution Unit/Complex ALUs/Area': 0.235435,
'Execution Unit/Complex ALUs/Gate Leakage': 0.0132646,
'Execution Unit/Complex ALUs/Peak Dynamic': 0.339469,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.469322,
'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': 1.86907,
'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.747295,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.017004,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00962066,
'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00730101,
'Execution Unit/Instruction Scheduler/Instruction Window/Area': 1.00996,
'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00529112,
'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 2.07911,
'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 1.29404,
'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.742171,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.0178624,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00897339,
'Execution Unit/Instruction Scheduler/Runtime Dynamic': 2.78351,
'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.452115,
'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': 9.11463,
'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.353107,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.02709,
'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.321529,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.200347,
'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.674637,
'Execution Unit/Register Files/Runtime Dynamic': 0.227437,
'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.869948,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 1.89569,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.0920413,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0345155,
'Execution Unit/Runtime Dynamic': 5.78133,
'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.00190701,
'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.00190701,
'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.0016663,
'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.000647952,
'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.00287801,
'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.00835833,
'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.0180948,
'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.192599,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 6.43323,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.408587,
'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.654153,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104,
'Instruction Fetch Unit/Peak Dynamic': 8.96874,
'Instruction Fetch Unit/Runtime Dynamic': 1.28179,
'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.107557,
'L2/Runtime Dynamic': 0.0240835,
'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': 6.07328,
'Load Store Unit/Data Cache/Runtime Dynamic': 2.33608,
'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.156461,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.156461,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 6.81514,
'Load Store Unit/Runtime Dynamic': 3.26415,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.385807,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.771615,
'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.136924,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.138523,
'Memory Management Unit/Dtlb/Subthreshold Leakage': 0.0155699,
'Memory Management Unit/Dtlb/Subthreshold Leakage with power gating': 0.00887485,
'Memory Management Unit/Gate Leakage': 0.00813591,
'Memory Management Unit/Itlb/Area': 0.301552,
'Memory Management Unit/Itlb/Gate Leakage': 0.00393464,
'Memory Management Unit/Itlb/Peak Dynamic': 0.399995,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0670319,
'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.795209,
'Memory Management Unit/Runtime Dynamic': 0.205554,
'Memory Management Unit/Subthreshold Leakage': 0.0769113,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462,
'Peak Dynamic': 30.363,
'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.23191,
'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.0530365,
'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.363154,
'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': 1.6481,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime Dynamic': 12.205,
'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.0272949,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.224127,
'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.146891,
'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.182022,
'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.293594,
'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.148196,
'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.623812,
'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.18566,
'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.44528,
'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.0277509,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0076348,
'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.0654488,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.056464,
'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.0931997,
'Execution Unit/Register Files/Runtime Dynamic': 0.0640988,
'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.144707,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.386727,
'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.70414,
'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.00201186,
'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.00201186,
'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.00177066,
'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.000695482,
'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.00081111,
'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.00660548,
'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.0186343,
'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.0542803,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 3.4527,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.135931,
'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.18436,
'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': 5.83878,
'Instruction Fetch Unit/Runtime Dynamic': 0.399811,
'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.087312,
'L2/Runtime Dynamic': 0.0225642,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80901,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 3.0,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.868286,
'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.0570332,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0570332,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 3.26932,
'Load Store Unit/Runtime Dynamic': 1.20659,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.140634,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.281268,
'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.0499115,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0511594,
'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.214676,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0224716,
'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.456524,
'Memory Management Unit/Runtime Dynamic': 0.0736311,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 17.6867,
'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.0730004,
'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.00910071,
'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.0906376,
'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.172739,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 3.57947,
'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.017421,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.216372,
'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.0958656,
'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.21304,
'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.343625,
'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.173451,
'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.730116,
'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.228957,
'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.43883,
'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.0181111,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00893585,
'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.0710667,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0660861,
'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.0891778,
'Execution Unit/Register Files/Runtime Dynamic': 0.0750219,
'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.154074,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.408842,
'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.83573,
'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.00287308,
'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.00287308,
'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.0025297,
'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.000994196,
'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.000949332,
'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.00922519,
'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.0265731,
'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.0635302,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 4.04107,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.137871,
'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.215777,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104,
'Instruction Fetch Unit/Peak Dynamic': 6.4557,
'Instruction Fetch Unit/Runtime Dynamic': 0.452977,
'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.0610716,
'L2/Runtime Dynamic': 0.015899,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80901,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 3.07716,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.89597,
'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.0595297,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0595298,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 3.35827,
'Load Store Unit/Runtime Dynamic': 1.24908,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.14679,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.293581,
'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.0520963,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0529689,
'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.251259,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0227343,
'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.49686,
'Memory Management Unit/Runtime Dynamic': 0.0757032,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 18.4002,
'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.0476425,
'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.0101916,
'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.106236,
'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.16407,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 3.79346,
'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.0365397,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.231388,
'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.187354,
'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.154054,
'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.248484,
'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.125426,
'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.527964,
'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.14747,
'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.44723,
'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.0353952,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00646173,
'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.0608119,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0477884,
'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.0962071,
'Execution Unit/Register Files/Runtime Dynamic': 0.0542501,
'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.137251,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.352115,
'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.57109,
'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.00126933,
'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.00126933,
'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.00112434,
'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.000445509,
'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.000686484,
'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.00434948,
'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.0115001,
'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.0459402,
'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.92219,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.111018,
'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.156034,
'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': 5.28253,
'Instruction Fetch Unit/Runtime Dynamic': 0.328841,
'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.0632142,
'L2/Runtime Dynamic': 0.015954,
'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.70282,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.723928,
'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.0474188,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0474187,
'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.92674,
'Load Store Unit/Runtime Dynamic': 1.0052,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.116927,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.233853,
'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.0414976,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.042427,
'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.181691,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0182592,
'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.409086,
'Memory Management Unit/Runtime Dynamic': 0.0606862,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 16.7183,
'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.0931091,
'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.00808362,
'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.0766694,
'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.177862,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 3.15964,
'Subthreshold Leakage': 6.16288,
'Subthreshold Leakage with power gating': 2.55328}],
'DRAM': {'Area': 0,
'Gate Leakage': 0,
'Peak Dynamic': 3.533383256030436,
'Runtime Dynamic': 3.533383256030436,
'Subthreshold Leakage': 4.252,
'Subthreshold Leakage with power gating': 4.252},
'L3': [{'Area': 61.9075,
'Gate Leakage': 0.0484137,
'Peak Dynamic': 0.188067,
'Runtime Dynamic': 0.0976171,
'Subthreshold Leakage': 6.80085,
'Subthreshold Leakage with power gating': 3.32364}],
'Processor': {'Area': 191.908,
'Gate Leakage': 1.53485,
'Peak Dynamic': 83.3562,
'Peak Power': 116.468,
'Runtime Dynamic': 22.8352,
'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': 83.1681,
'Total Cores/Runtime Dynamic': 22.7376,
'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.188067,
'Total L3s/Runtime Dynamic': 0.0976171,
'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}} |
print('Hello World')
# This code supports my weekly habit of seeing if I can
# afford a ferrari. The general algorithm is to compare
# my bank account amount to the current cost of a ferrari.
"""
:)
:|
:(
"""
bank_balance = 100
ferrari_cost = 50
if bank_balance >= ferrari_cost:
# If it's greater I can finally buy one.
print('Why not?')
print('Go ahead, buy it')
else:
print('Sorry')
print('Try again next week') # bummer
|
def study_template(p):
study_regex = r"Study"
for template in p.filter_templates(matches=study_regex):
if template.name.strip() == study_regex:
return template
return None
|
cont = ('zero', 'um', 'dois', 'três', 'quatro', 'cinco', 'seis', 'sete', 'oito', 'nove', 'dez')
r = ''
while True:
n = int(input('Digite um número de 0 a 10'))
while n not in range(0, 11):
n = int(input('Tente novamente. Digite um numero de 0 a 10'))
print(f'{n} por extenso é {cont[n]}.')
r = str(input('Deseja continuar?')).upper()[0]
if r == 'N':
print('Reclama da vida mas não vive sem ela. Enfim a hipocrisia...')
print('Fim do programa, volte sempre.')
break |
"""
Version of platform_services
"""
__version__ = '0.19.0'
|
'''
*Book Record Management in Python*
With this project a used can Add/Delete/Update/View the book records
the project is implement in python
Inbuilt data structures used: LIST
concepts of functions, try-catch statements, if else statements and loops are used in this program.
'''
Books=[]
def gap():
print("\n"*2)
print(" * "*20)
def add_book():
print("\t # Adding Book Record # \n")
book_name=input("Enter Book Name: ")
book_author=input("Enter \'{}\' Author: ".format(book_name))
try:
book_price=float(input("Enter \'{}\' Price: ".format(book_name)))
l=[book_name,book_author,book_price]
Books.append(l)
input("\nBook Added Successfully!\nPress Any Key To Continue..")
except:
input("INCORRECT DATA!\n\t\tPress any key to continue..")
def delete_book():
print("\t # Deleting Book Record # \n")
print("\tBook_ID\tBook_Name\tBook_Author\tBook_Price")
for i in range(len(Books)):
print(" \t {0} \t {1}\t\t{2}\t\t{3}".format(i,Books[i][0],Books[i][1],Books[i][2]))
try:
ch=int(input("\nEnter The ID of Book to be Removed"))
Books.pop(ch)
input("\nBook Deleted Successfully!\nPress Any Key To Continue..")
except:
input("INCORRECT DATA!\n\t\tPress any key to continue..")
def update_book():
print("\t # Updating Book Record #\n\n")
print("\tBook_ID\tBook_Name\tBook_Author\tBook_Price")
for i in range(len(Books)):
print(" \t {0} \t {1}\t\t{2}\t\t{3}".format(i,Books[i][0],Books[i][1],Books[i][2]))
try:
ch=int(input("\nEnter The ID of Book to be Updated"))
Books[ch][0]=input("\nEnter New Book Name: ")
Books[ch][1]=input("Enter New Author Name: ")
Books[ch][2]=float(input("Enter New Price: "))
input("Record updated Successfully!\nPress Any Key To Continue..")
except:
input("INCORRECT DATA!\n\t\tPress any key to continue..")
def view_book():
print("\t # Viewing Book Record # \n\n")
print("\tBook_ID\tBook_Name\tBook_Author\tBook_Price")
for i in range(len(Books)):
print(" \t {0} \t {1}\t\t{2}\t\t{3}".format(i,Books[i][0],Books[i][1],Books[i][2]))
input("\nPress Any key to return to Continue")
def HomePage():
a=True
while(a):
gap()
print("\t# Welcome To Book Record Management! #")
print("\n\t1:Add Boook\t\t2:Delete Book\n\t3:Update Book\t\t4:View Book")
print("\t\t#To exit press \'quit\'#\n")
ch=input("Enter Your Choice:")
if(ch=='1'):
gap()
add_book()
elif(ch=='2'):
gap()
delete_book()
elif(ch=='3'):
gap()
update_book()
elif(ch=='4'):
gap()
view_book()
elif(ch=='quit'):
a=False
else:
input("INCORRECT DATA!\n\t\tPress any key to continue..")
HomePage()
gap()
print("\n\n* * Thank You! Do Visit Again..!! * *")
|
def f(x, y, z): return "{}時の{}は{}".format(x, y, z)
print(f(12, "気温", 22.4))
|
nomes_paises = ('Brasil', 'Argentina', 'China', 'Canadá', 'Japão')
print(nomes_paises)
nome_estado = 'São Paulo',
print(nome_estado, type(nome_estado))
len(nomes_paises)
nomes_paises[0]
b, a, c, ca, j = nomes_paises
print(b, c, j)
print(*nomes_paises)
|
DEPS = [
'archive',
'depot_tools/bot_update',
'chromium',
'chromium_tests',
'chromium_android',
'commit_position',
'file',
'depot_tools/gclient',
'isolate',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
'recipe_engine/python',
'recipe_engine/step',
'swarming',
'test_utils',
'trigger',
'depot_tools/tryserver',
]
|
class Configs:
def __init__(self, client_id, client_secret, tenant_id):
"""
Configs(...)
configs = Configs()
Initializes client_id, client_secret and tenant_id.
Required arguments:
client_id: client_id of application
client_secret: client_secret of application
tenant_id: tenant_id
"""
self.client_id = client_id
self.client_secret = client_secret
self.tenant_id = tenant_id
def get_configs(self):
"""
get_configs(...)
configs = Configs()
extra_configs = configs.get_configs()
Returns the extra configs required to mount ADLS.
"""
return {
"fs.azure.account.auth.type": "OAuth",
"fs.azure.account.oauth.provider.type": "org.apache.hadoop.fs.azurebfs.oauth2.ClientCredsTokenProvider",
"fs.azure.account.oauth2.client.id": self.client_id,
"fs.azure.account.oauth2.client.secret": self.client_secret,
"fs.azure.account.oauth2.client.endpoint": f"https://login.microsoftonline.com/{self.tenant_id}/oauth2/token"
}
|
### All lines that are commented out (and some that aren't) are optional ###
### Telegram Settings
### Get your own api_id and api_hash from https://my.telegram.org, under API Development
### Default vaules are exmaple and will not work
API_ID = 123456 # Int value, example: 123456
API_HASH = 'e59ffe6c16bfaafb6821a629fd057bc8' # Example: '0123456789abcdef0123456789abcdef'
#PROXY = None # Optional, for those who can't run telegram in their network
# SGPokemap Gym Filter Setting
# Current workable channels: @SGPokemapEXRaid, @SGPokemapLegendary, @SGPokemapRaid
FILTER_GYM_NAME = 'Rib Cage Sculpture|Potting Garden|Tamarind Road Playground' # 'Name 1|Name 2' Use | to seperate the gyms that you want to filter
FORWARD_ID = 50000001 # Where will be the filtered message be sending to. Can be Channel ID: -100564384368, chat ID: 50000001, Public Chat/Channel Gorup: '@GROUP_OR_CAHNNEL_NAME'
|
class DatasetParameter:
def __init__(self, db_url, **dataset_kwargs):
self.db_url = db_url
self.dataset_kwargs = dataset_kwargs
@property
def DbUrl(self): return self.db_url
@property
def DbKwargs(self): return self.dataset_kwargs
|
"""
Patient Tracking
"""
module = request.controller
if not settings.has_module(module):
raise HTTP(404, body="Module disabled: %s" % module)
# -----------------------------------------------------------------------------
def index():
"Module's Home Page"
module_name = settings.modules[module].get("name_nice")
response.title = module_name
return dict(module_name=module_name)
# -----------------------------------------------------------------------------
def person():
""" Person controller for AddPersonWidget """
def prep(r):
if r.representation != "s3json":
# Do not serve other representations here
return False
else:
current.xml.show_ids = True
return True
s3.prep = prep
return crud_controller("pr", "person")
# -----------------------------------------------------------------------------
def patient():
""" RESTful CRUD controller """
tablename = "patient_patient"
# Load Models
s3db.table("patient_patient")
s3db.configure(tablename,
create_next = URL(args=["[id]", "relative"]))
# Pre-process
def prep(r):
if r.id:
s3db.configure("patient_relative",
create_next = URL(args=[str(r.id), "home"]))
return True
s3.prep = prep
# Post-process
def postp(r, output):
# No Delete-button in list view
s3_action_buttons(r, deletable=False)
return output
s3.postp = postp
tabs = [(T("Basic Details"), None),
(T("Accompanying Relative"), "relative"),
(T("Home"), "home")]
rheader = lambda r: patient_rheader(r, tabs=tabs)
return crud_controller(rheader=rheader)
# -----------------------------------------------------------------------------
def patient_rheader(r, tabs=[]):
""" Resource Page Header """
if r.representation == "html":
if r.record is None:
# List or Create form: rheader makes no sense here
return None
table = db.patient_patient
rheader_tabs = s3_rheader_tabs(r, tabs)
patient = r.record
if patient.person_id:
name = s3_fullname(patient.person_id)
else:
name = None
if patient.country:
country = table.country.represent(patient.country)
else:
country = None
if patient.hospital_id:
hospital = table.hospital_id.represent(patient.hospital_id)
else:
hospital = None
rheader = DIV(TABLE(
TR(
TH("%s: " % T("Patient")),
name,
TH("%s: " % COUNTRY),
country),
TR(
TH(),
TH(),
TH("%s: " % T("Hospital")),
hospital,
)
), rheader_tabs)
return rheader
return None
# END =========================================================================
|
# This program demonstrates variable reassignment.
# Assign a value to the dollars variable.
dollars = 2.75
print('I have', dollars, 'in my account.')
# Reassign dollars so it references
# a different value.
dollars = 99.95
print('But now I have', dollars, 'in my account!')
|
suffix_slang_3 = {
'ine': '9',
'aus': 'oz',
'ate': '8',
'for': '4',
}
suffix_slang_4 = {
'ause': 'oz',
'fore': '4',
}
general_slang = {
'you': 'u',
'for': '4',
'thanks': 'thnx',
'are': 'r',
'they': 'dey',
'this': 'dis',
'that': 'dat',
}
prefix_slang_3 = {
'for': '4'
}
prefix_slang_4 = {
'fore': '4'
}
abbreviations = {
"away from the keyboard": 'AFK',
"as soon as possible": 'ASAP',
"be back later": 'BBL',
"be back shortly": 'BBS',
"be right back": 'BRB',
"be back in a bit": 'BBIAB',
"be back in a few": 'BBIAF',
"bye bye for now": 'BBFN',
"by the way": 'BTW',
"care to chat": 'CTC',
"see ya": 'CYA',
"frequently asked questions": 'FAQ',
"Falling off chair laughing": 'FOCL',
"laughing out loud": 'LOL',
"for what it's worth": 'FWIW',
"for your information": 'FYI',
"i see": 'IC',
"in my opinion": 'IMO',
"in my humble opinion": 'IMHO',
"in other words": 'IOW',
"just kidding": 'J/K',
}
|
def ClumpFinder(k,L,t,Genome):
#Length of Genome
N = len(Genome)
#Storing Frequent patterns
freq_patterns = []
for i in range(N-L+1):
#choosing region of length L in the Genome
region = Genome[i:i+L]
#Calculating the Frequency array in the first iteration
if i==0:
freq_dict = {}
for j in range(L-k+1):
#for each kmer in this region
kmer = region[j:j+k]
#Update count
freq_dict[kmer] = freq_dict.get(kmer,0) + 1
#Append to freq_patterns if the kmer occurs at least t times
for pattern in freq_dict:
if freq_dict[pattern] >= t:
freq_patterns.append(pattern)
else:
#Reduce count of the first kmer of previous region by 1
first = Genome[i-1:k+i-1]
freq_dict[first] -= 1
#Increase count of the last kmer of current region by 1
last = Genome[i+L-k:i+L]
freq_dict[last] = freq_dict.get(last,0) + 1
#If the last kmer's count is at least t and not present already in freq_patterns, append it
if freq_dict[last] >=t and last not in freq_patterns:
freq_patterns.append(last)
#Sort patterns in lexicological order
freq_patterns = sorted(freq_patterns)
return freq_patterns
Genome = input()
inputs = input().split()
k = int(inputs[0])
L = int(inputs[1])
t = int(inputs[2])
start_time = time.time()
print(" ".join(ClumpFinder(k,L,t,Genome)))
print(time.time()-start_time) |
# coding: utf-8
def humor(request):
return {
'site_authors': [
'добрыми питонистами',
'заботливыми программистами',
'рьяными энтузиастами',
'по вечерам и выходным дням',
'сообществом разработчиков'
]
}
|
PDBCUTOFF = 33.0
DSSPCUTOFF = 0.55
TEST=False
three2oneAA={
"ALA": "A",
"ARG": "R",
"ASN": "N",
"ASP": "D",
"CYS": "C",
"GLN": "Q",
"GLU": "E",
"GLY": "G",
"HIS": "H",
"ILE": "I",
"LEU": "L",
"LYS": "K",
"MET": "M",
"PHE": "F",
"PRO": "P",
"SER": "S",
"THR": "T",
"TRP": "W",
"TYR": "Y",
"VAL": "V"
}
"""
Maximum Allowed Solvent Accessibilites of Residues in Proteins
Matthew Z. Tien,
Austin G. Meyer,
Dariya K. Sydykova,
Stephanie J. Spielman,
Claus O. Wilke
2013, PLOS ONE
https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0080635
"""
RSA_norm={
"A": 129,
"R": 274,
"N": 195,
"D": 193,
"C": 167,
"Q": 225,
"E": 223,
"G": 104,
"H": 224,
"I": 197,
"L": 201,
"K": 236,
"M": 224,
"F": 240,
"P": 159,
"S": 155,
"T": 172,
"W": 285,
"Y": 263,
"V": 174
} |
#PROGRESSÃO ARITMÉTICA(PA)3.0
p1 = int(input('digite o primeiro termo: '))
r = int(input('digite a razão: '))
pa = p1
cont = 1
total = 0
mais = 10
while mais != 0:
total += mais
while cont <= total:
print(pa,end=' -> ')
pa += r
cont += 1
print('PAUSA')
mais = int(input('quantos termos a mais voce quer? '))
print(f'PA finalizada com {total} termos.')
|
price, size = map(int, input().split())
dislikes = list(map(int, input().split()))
likes = list(set(range(10)) - set(dislikes))
digits = [int(digit) for digit in str(price)]
r_digits = list(reversed(digits))
res = []
for i in range(len(r_digits)):
if r_digits[i] in likes:
res.append(r_digits[i])
elif max(likes) > r_digits[i]:
res = [min(likes) for i in range(i)] + [
min(x for x in likes if x > r_digits[i])
]
else:
res = [min(likes) for i in range(i + 1)]
if i == len(r_digits) - 1:
res.append(min(x for x in likes if x > 0))
else:
r_digits[i + 1] += 1
ans = "".join([str(num) for num in list(reversed(res))])
print(ans)
|
# # Literate Programming in Markdown
# ---------------------------------------------------------------------------
# Literate Programming in Markdown takes a markdown file and converts it into a programming language. Traditional programming often begins with writing code, followed by adding comments. The Literate Programming approach encourages the programmer to document one's program prior to writing executable code.
# # Literate Python
# ---------------------------------------------------------------------------
# The first language to experiment with is Python. The Main Purpose of the Literate Python package is to convert a text or markdown file into an executable python file. Literate Python looks like markdown. The key difference is that the code blocks will become live code, and the rest of the document becomes the documentation.
# **NOTE**: This README file is, infact, the parser itself! Using "README.py" to parse "README.md" will produce the identical python file "README.py"!
# # File Names
# ---------------------------------------------------------------------------
# Basic Input Starts by identifying the file that is to be parsed. While we call this "the markdown file" it shouldn't actually matter what the filetype is, so long as it is text.
inputFile_name = str(input("Type the Input File:"))
outputFile_name = str(input("Output File Name (.py added automatically):"))
# # Reading the Input File
# ---------------------------------------------------------------------------
# Now that we have a File's name specified, we will read the file. We only need the data inside the file, and don't need to keep it open any longer than is neccesary. We open the file, then copy the data to an array, and then close the file agan. The array is a list of strings (one string for each line),
with open(inputFile_name) as inputFile:
inputFile_data = list(inputFile)
# # Initialize some Variables
# ---------------------------------------------------------------------------
# Since we are generating a new file with new lines, let's initialize another list. This will start empty, but we will add strings to it as we go. We will also need a boolean for detecting if we are inside a Code Block or not.
newFile_string = str()
insideCodeBlock = False
# # Line by Line
# ---------------------------------------------------------------------------
# We will iterate through each line of the text. We either add comments, or add live code.
# 1. Checking to see if the first line contains 3x the symbol "~" will tell us we are at either the beginning, or the end, of a codeblock. Flipping the boolean "insideCodeBlock" will help us keep track.
# 2. If we ARE inside of a codeblock, then we just print lines without any modification. These lines become live code.
# 3. Blank lines are printed as blank lines. No need to change anything.
# 4. Reaching this point in the for-loop means that we are outside of a codeblock. Add a comment to the line.
for line in inputFile_data:
if (line[:3] == '~~~'):
insideCodeBlock = not insideCodeBlock
continue
if insideCodeBlock:
newFile_string += line
continue
if (line[:2] == '\n'):
newFile_string += '\n'
continue
newFile_string += '# ' + line
# Fun feature - add commented lines underneath the headers.
if (line[:1]) == '#': newFile_string += '# ' + '-' * 75 + '\n'
# # Write to the File.
# ---------------------------------------------------------------------------
# Finally, Write the newly created string of data into the a new file.
with open(outputFile_name + '.py', "w") as newFile:
newFile.write(newFile_string)
|
# -*- coding: utf-8 -*-
"""
awsecommerceservice
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class ItemSearchRequest(object):
"""Implementation of the 'ItemSearchRequest' model.
TODO: type model description here.
Attributes:
actor (string): TODO: type description here.
artist (string): TODO: type description here.
availability (AvailabilityEnum): TODO: type description here.
audience_rating (list of AudienceRatingEnum): TODO: type description
here.
author (string): TODO: type description here.
brand (string): TODO: type description here.
browse_node (string): TODO: type description here.
composer (string): TODO: type description here.
condition (ConditionEnum): TODO: type description here.
conductor (string): TODO: type description here.
director (string): TODO: type description here.
item_page (int): TODO: type description here.
keywords (string): TODO: type description here.
manufacturer (string): TODO: type description here.
maximum_price (int): TODO: type description here.
merchant_id (string): TODO: type description here.
minimum_price (int): TODO: type description here.
min_percentage_off (int): TODO: type description here.
music_label (string): TODO: type description here.
orchestra (string): TODO: type description here.
power (string): TODO: type description here.
publisher (string): TODO: type description here.
related_item_page (object): TODO: type description here.
relationship_type (list of string): TODO: type description here.
response_group (list of string): TODO: type description here.
search_index (string): TODO: type description here.
sort (string): TODO: type description here.
title (string): TODO: type description here.
release_date (string): TODO: type description here.
include_reviews_summary (string): TODO: type description here.
truncate_reviews_at (int): TODO: type description here.
"""
# Create a mapping from Model property names to API property names
_names = {
"actor":'Actor',
"artist":'Artist',
"availability":'Availability',
"audience_rating":'AudienceRating',
"author":'Author',
"brand":'Brand',
"browse_node":'BrowseNode',
"composer":'Composer',
"condition":'Condition',
"conductor":'Conductor',
"director":'Director',
"item_page":'ItemPage',
"keywords":'Keywords',
"manufacturer":'Manufacturer',
"maximum_price":'MaximumPrice',
"merchant_id":'MerchantId',
"minimum_price":'MinimumPrice',
"min_percentage_off":'MinPercentageOff',
"music_label":'MusicLabel',
"orchestra":'Orchestra',
"power":'Power',
"publisher":'Publisher',
"related_item_page":'RelatedItemPage',
"relationship_type":'RelationshipType',
"response_group":'ResponseGroup',
"search_index":'SearchIndex',
"sort":'Sort',
"title":'Title',
"release_date":'ReleaseDate',
"include_reviews_summary":'IncludeReviewsSummary',
"truncate_reviews_at":'TruncateReviewsAt'
}
def __init__(self,
actor=None,
artist=None,
availability=None,
audience_rating=None,
author=None,
brand=None,
browse_node=None,
composer=None,
condition=None,
conductor=None,
director=None,
item_page=None,
keywords=None,
manufacturer=None,
maximum_price=None,
merchant_id=None,
minimum_price=None,
min_percentage_off=None,
music_label=None,
orchestra=None,
power=None,
publisher=None,
related_item_page=None,
relationship_type=None,
response_group=None,
search_index=None,
sort=None,
title=None,
release_date=None,
include_reviews_summary=None,
truncate_reviews_at=None):
"""Constructor for the ItemSearchRequest class"""
# Initialize members of the class
self.actor = actor
self.artist = artist
self.availability = availability
self.audience_rating = audience_rating
self.author = author
self.brand = brand
self.browse_node = browse_node
self.composer = composer
self.condition = condition
self.conductor = conductor
self.director = director
self.item_page = item_page
self.keywords = keywords
self.manufacturer = manufacturer
self.maximum_price = maximum_price
self.merchant_id = merchant_id
self.minimum_price = minimum_price
self.min_percentage_off = min_percentage_off
self.music_label = music_label
self.orchestra = orchestra
self.power = power
self.publisher = publisher
self.related_item_page = related_item_page
self.relationship_type = relationship_type
self.response_group = response_group
self.search_index = search_index
self.sort = sort
self.title = title
self.release_date = release_date
self.include_reviews_summary = include_reviews_summary
self.truncate_reviews_at = truncate_reviews_at
@classmethod
def from_dictionary(cls,
dictionary):
"""Creates an instance of this model from a dictionary
Args:
dictionary (dictionary): A dictionary representation of the object as
obtained from the deserialization of the server's response. The keys
MUST match property names in the API description.
Returns:
object: An instance of this structure class.
"""
if dictionary is None:
return None
# Extract variables from the dictionary
actor = dictionary.get('Actor')
artist = dictionary.get('Artist')
availability = dictionary.get('Availability')
audience_rating = dictionary.get('AudienceRating')
author = dictionary.get('Author')
brand = dictionary.get('Brand')
browse_node = dictionary.get('BrowseNode')
composer = dictionary.get('Composer')
condition = dictionary.get('Condition')
conductor = dictionary.get('Conductor')
director = dictionary.get('Director')
item_page = dictionary.get('ItemPage')
keywords = dictionary.get('Keywords')
manufacturer = dictionary.get('Manufacturer')
maximum_price = dictionary.get('MaximumPrice')
merchant_id = dictionary.get('MerchantId')
minimum_price = dictionary.get('MinimumPrice')
min_percentage_off = dictionary.get('MinPercentageOff')
music_label = dictionary.get('MusicLabel')
orchestra = dictionary.get('Orchestra')
power = dictionary.get('Power')
publisher = dictionary.get('Publisher')
related_item_page = dictionary.get('RelatedItemPage')
relationship_type = dictionary.get('RelationshipType')
response_group = dictionary.get('ResponseGroup')
search_index = dictionary.get('SearchIndex')
sort = dictionary.get('Sort')
title = dictionary.get('Title')
release_date = dictionary.get('ReleaseDate')
include_reviews_summary = dictionary.get('IncludeReviewsSummary')
truncate_reviews_at = dictionary.get('TruncateReviewsAt')
# Return an object of this model
return cls(actor,
artist,
availability,
audience_rating,
author,
brand,
browse_node,
composer,
condition,
conductor,
director,
item_page,
keywords,
manufacturer,
maximum_price,
merchant_id,
minimum_price,
min_percentage_off,
music_label,
orchestra,
power,
publisher,
related_item_page,
relationship_type,
response_group,
search_index,
sort,
title,
release_date,
include_reviews_summary,
truncate_reviews_at)
|
class Solution(object):
def climbStairs(self, n):
"""
:type n: int
:rtype: int
"""
dp = [0] * (n + 1)
dp[0] = 1
dp[1] = 1
for i in range(2, n + 1):
dp[i] = dp[i - 1] + dp[i - 2]
return dp[-1]
|
class UserNotValidException(Exception):
pass
class PhoneNotValidException(Exception):
pass
class ConfigFileParseException(Exception):
pass
class DuplicateUserException(Exception):
pass
class IndexOutofRangeException(Exception):
pass
class IndexNotGivenException(Exception):
pass |
class User:
def __init__(self, user_id, username):
self.id = user_id
self.username = username
self.followers = 0
self.following = 0
def follow(self, user):
user.followers += 1
self.following += 1
user_1 = User("001", "nuno")
user_2 = User("003", "paula")
user_1.follow(user_2)
print(user_1.followers)
print(user_1.following)
print(user_2.followers)
print(user_2.following) |
#Eliminar
conjuntos = set()
conjuntos = {1,2,3,"brian", 4.6}
conjuntos.discard(3)
print (conjuntos)
("==================================================================================")
|
#The code is implemented to print the range of numbers from 100-15000
for x in range(50,750):
x = x * 2
print(x)
print("Even number") |
#coding: utf-8
#------------------------------------------------------------------------------
# Um programa que tem uma tupla preenchida com uma contagem por extenso de
# zero à vinte. O programa recebe um número inteiro e retorna esse em extenso.
#------------------------------------------------------------------------------
# Números por Extrenso (TUPLAS) - Exercício #072
#------------------------------------------------------------------------------
c = ('zero', 'um','dois', 'tres', 'quatro', 'cinco',
'seis', 'sete', 'oito', 'nove', 'dez','onze', 'doze',
'treze', 'quatorze', 'quinze', 'dezesseis',
'dezesete', 'dezoito', 'dezenove', 'vinte')
print()
while True:
n = int(input('Digite um número entre 0 e 20: '))
if 0 <= n <= 20:
break
print('Tente Novamente. ',end='')
print('....' * 11)
print(f'Voce digitou o número {c[n]}')
print('....' * 11)
|
# class for tiles
class Tile:
def __init__(self, name, items=None, player_on=False, mob_on=False):
if name == 'w' or name == 'mt' or name == 'sb':
self.obstacle = True
else:
self.obstacle = False
self.name = name
self.items = items
self.player_on = player_on
self.mob_on = mob_on
self.mob = None
self.player = None
def is_obstacle(self):
return self.obstacle
def get_name(self):
return self.name
def get_items(self):
return self.items
def add_items(self, item):
self.items.append(item)
def add_player(self):
self.player_on = True
def del_player(self):
self.player_on = False
if __name__ == '__init__':
pass
|
def draw_event_cb(e):
dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
if dsc.part == lv.PART.TICKS and dsc.id == lv.chart.AXIS.PRIMARY_X:
month = ["Jan", "Febr", "March", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"]
# dsc.text is defined char text[16], I must therefore convert the Python string to a byte_array
dsc.text = bytes(month[dsc.value],"ascii")
#
# Add ticks and labels to the axis and demonstrate scrolling
#
# Create a chart
chart = lv.chart(lv.scr_act())
chart.set_size(200, 150)
chart.center()
chart.set_type(lv.chart.TYPE.BAR)
chart.set_range(lv.chart.AXIS.PRIMARY_Y, 0, 100)
chart.set_range(lv.chart.AXIS.SECONDARY_Y, 0, 400)
chart.set_point_count(12)
chart.add_event_cb(draw_event_cb, lv.EVENT.DRAW_PART_BEGIN, None)
# Add ticks and label to every axis
chart.set_axis_tick(lv.chart.AXIS.PRIMARY_X, 10, 5, 12, 3, True, 40)
chart.set_axis_tick(lv.chart.AXIS.PRIMARY_Y, 10, 5, 6, 2, True, 50)
chart.set_axis_tick(lv.chart.AXIS.SECONDARY_Y, 10, 5, 3, 4,True, 50)
# Zoom in a little in X
chart.set_zoom_x(800)
# Add two data series
ser1 = lv.chart.add_series(chart, lv.palette_lighten(lv.PALETTE.GREEN, 2), lv.chart.AXIS.PRIMARY_Y)
ser2 = lv.chart.add_series(chart, lv.palette_darken(lv.PALETTE.GREEN, 2), lv.chart.AXIS.SECONDARY_Y)
# Set the next points on 'ser1'
chart.set_next_value(ser1, 31)
chart.set_next_value(ser1, 66)
chart.set_next_value(ser1, 10)
chart.set_next_value(ser1, 89)
chart.set_next_value(ser1, 63)
chart.set_next_value(ser1, 56)
chart.set_next_value(ser1, 32)
chart.set_next_value(ser1, 35)
chart.set_next_value(ser1, 57)
chart.set_next_value(ser1, 85)
chart.set_next_value(ser1, 22)
chart.set_next_value(ser1, 58)
# Directly set points on 'ser2'
ser2.y_points = [92,71,61,15,21,35,35,58,31,53,33,73]
chart.refresh() # Required after direct set
|
def linha(tam=42):
return '-'*tam
def cabeçalho(txt):
print(linha())
print(f'{txt:^42}')
print(linha())
def leiaint(msg):
while True:
try:
n = int(input(msg))
except(ValueError, TypeError):
print('\033[31m ERRO: por favor, digite um número inteiro válido.\033[m')
continue
except KeyboardInterrupt:
print('Entrada de dados interrompida pelo usuário.')
return 0
else:
return n
def menu(lista):
cabeçalho('MENU PRINCIPAL')
c = 1
for item in lista:
print(f'{c} - {item}')
c += 1
print(linha())
opc = leiaint('Sua opção: ')
return opc |
"""
## Call graph rbreak
Build a function call graph of the non-dynamic functions of an executable.
This implementation is very slow for very large projects, where `rbreak .` takes forever to complete.
- http://stackoverflow.com/questions/9549693/gdb-list-of-all-function-calls-made-in-an-application
- http://stackoverflow.com/questions/311948/make-gdb-print-control-flow-of-functions-as-they-are-called
What happens on the output:
- First line is:
../csu/init-first.c : _init : argc = 1, argv = 0x7fffffffd728, envp = 0x7fffffffd738
It actually does get called before the `_start`:
http://stackoverflow.com/questions/31379422/why-is-init-from-glibcs-csu-init-first-c-called-before-start-even-if-start-i
I think it has a level deeper than one because the callees are not broke on:
they are not part of the executable.
"""
gdb.execute('file ./call_graph_py.out', to_string=True)
gdb.execute('set confirm off')
# rbreak before run to ignore dynamically linked stdlib functions which take too long.
# If we do it before, we would also go into stdlib functions, which is often what we don't want,
# since we already understand them.
gdb.execute('rbreak .', to_string=True)
gdb.execute('run', to_string=True)
depth_string = 4 * ' '
thread = gdb.inferiors()[0].threads()[0]
while thread.is_valid():
frame = gdb.selected_frame()
symtab = frame.find_sal().symtab
stack_depth = 0
f = frame
while f:
stack_depth += 1
f = f.older()
# Not present for files without debug symbols.
source_path = '???'
if symtab:
#source_path = symtab.fullname()
source_path = symtab.filename
# Not present for files without debug symbols.
args = '???'
block = None
try:
block = frame.block()
except:
pass
if block:
args = ''
for symbol in block:
if symbol.is_argument:
args += '{} = {}, '.format(symbol.name, symbol.value(frame))
print('{}{} : {} : {}'.format(
stack_depth * depth_string,
source_path,
frame.name(),
args
))
gdb.execute('continue', to_string=True)
|
class Params:
"""Model parameters."""
NUM_HIDDEN = 75
NUM_LAYERS = 3
KEEP_PROB = 0.5
EPOCH = 50
BATCH_SIZE = 400
MAX_LENGTH = 100
ERROR = 0.5
def __init__(self):
self.num_hidden = self.NUM_HIDDEN
self.num_layers = self.NUM_LAYERS
self.keep_prob = self.KEEP_PROB
self.epoch = self.EPOCH
self.batch_size = self.BATCH_SIZE
self.max_length = self.MAX_LENGTH
self.error = self.ERROR
def fill(self, dic):
self.num_hidden = self.get(dic, 'num_hidden', self.num_hidden)
self.num_layers = self.get(dic, 'num_layers', self.num_layers)
self.keep_prob = self.get(dic, 'keep_prob', self.keep_prob)
self.epoch = self.get(dic, 'epoch', self.epoch)
self.batch_size = self.get(dic, 'batch_size', self.batch_size)
self.max_length = self.get(dic, 'max_length', self.max_length)
self.error = self.get(dic, 'error', self.error)
def to_dic(self):
return {
'num_hidden': self.num_hidden,
'num_layers': self.num_layers,
'keep_prob': self.keep_prob,
'epoch': self.epoch,
'batch_size': self.batch_size,
'max_length': self.max_length,
'error': self.error
}
@staticmethod
def get(dic, key, default):
# Use default value if None is explicitly stored in dic
value = dic.get(key, default)
return value if value is not None else default
|
# [기초-산술연산] 정수 2개 입력받아 합 출력하기2(설명)
# minso.jeong@daum.net
'''
문제링크 : https://www.codeup.kr/problem.php?id=1039
'''
n1, n2 = map(int, input().split())
print(n1+n2) |
## bisenetv2
cfg = dict(
model_type='bisenetv2',
num_aux_heads=4,
lr_start = 5e-2,
weight_decay=5e-4,
warmup_iters = 1000,
max_iter = 150000,
im_root='/remote-home/source/Cityscapes/',
train_im_anns='../datasets/cityscapes/train.txt',
val_im_anns='../datasets/cityscapes/val.txt',
scales=[0.25, 2.],
cropsize=[512, 1024],
ims_per_gpu=8,
use_fp16=True,
use_sync_bn=False,
respth='./res',
num_classes=2,
)
|
def factorials(number: int, iteratively=True) -> int:
"""
Calculates factorials iteratively as well as recursively. Default iteratively. Takes linear time.
Args:
- ``number`` (int): Number for which you want to get a factorial.
- ``iteratively`` (bool): Set this to False you want to perform a recursion factorial calculation. By default calculates iteratively
"""
if iteratively:
if not (isinstance(number, int) and number >= 0):
# Raise non negative number error
raise ValueError("'number' must be a non-negative integer.")
result = 1
if number == 0:
return 1
for i in range(2, number+1):
result *= i
return result
else:
# If user want's to perform a recursive factorial calculation
if not (isinstance(number, int) and number >= 0):
# Raise non negative number error
raise ValueError("'number' must be a non-negative integer.")
if number == 0:
return 1
result = number * factorials(number - 1)
return result
if __name__ == "__main__":
print(factorials(5, True)) |
LOOKUPS = {
"AirConditioning": {
"C":"Central",
"F":"Free Standing",
"M":"Multi-Zone",
"N":"None",
"T":"Through the Wall",
"U":"Unknown Type",
"W":"Window Units",
},
"Borough": {
"BK":"Brooklyn",
"BX":"Bronx",
"NY":"Manhattan",
"QN":"Queens",
"SI":"Staten Island",
},
"BuildingAccess": {
"A":"Attended Elevator",
"E":"Elevator",
"K":"Keyed Elevator",
"N":"None",
"W":"Walk-up",
},
"BuildingAge": {
"O":"Post-war",
"R":"Pre-war",
},
"BuildingType": {
"D":"Development Site",
"F":"Loft",
"G":"Garage",
"H":"High-Rise",
"L":"Low-Rise",
"M":"Mid-Rise",
"O":"Hotel",
"P":"Parking Lot",
"S":"House",
"T":"Townhouse",
"V":"Vacant Lot",
},
"Heat": {
"B":"Baseboard",
"C":"Central",
"E":"Electric",
"G":"Gas",
"M":"Multi-Zone",
"O":"Oil",
"R":"Radiator",
"U":"Unknown Type",
},
"LeaseTerm": {
"1":"One Year",
"2":"Two Year",
"3":"Short-term",
"4":"Month-to-month",
"5":"Specific term",
"6":"One or Two year",
"7":"Short or Long term",
},
"LeaseType": {
"B":"Stabilized Lease",
"C":"Commercial",
"N":"Non-Stabilized Lease",
"On-Line":"Residential, Inc | IDX API documentation v1.0 | Published 11/01/2014 | Page 27 of 29",
"S":"Stabilized Sublease",
"U":"Non-Stabilized Sublease",
},
# Docs say ListingStatus, but the data is actually Status. So I'm duplicating this lookup here
"Status": {
"A":"Active",
"B":"Board Approved",
"C":"Contract Signed",
"E":"Leases Signed",
"H":"TOM",
"I":"POM",
"J":"Exclusive Expired",
"L":"Leases Out",
"O":"Contract Out",
"P":"Offer Accepted/Application",
"R":"Rented",
"S":"Sold",
},
"ListingStatus": {
"A":"Active",
"B":"Board Approved",
"C":"Contract Signed",
"E":"Leases Signed",
"H":"TOM",
"I":"POM",
"J":"Exclusive Expired",
"L":"Leases Out",
"O":"Contract Out",
"P":"Offer Accepted/Application",
"R":"Rented",
"S":"Sold",
},
"ListingStatusRental": {
"A":"Active",
"E":"Leases Signed",
"H":"TOM",
"I":"POM",
"J":"Exclusive Expired",
"L":"Leases Out",
"P":"Application",
"R":"Rented",
},
"ListingStatusSale": {
"A":"Active",
"B":"Board Approved",
"C":"Contract Signed",
"H":"TOM",
"I":"POM",
"J":"Exclusive Expired",
"O":"Contract Out",
"P":"Offer Accepted",
"S":"Sold",
},
"ListingType": {
"A":"Ours Alone",
"B":"Exclusive",
"C":"COF",
"L":"Limited",
"O":"Open",
"Y":"Courtesy",
"Z":"Buyer's Broker",
},
"MediaType": {
"F":"Floor plan",
"I":"Interior Photo",
"M":"Video",
"O":"Other",
"V":"Virtual Tour",
},
"Ownership": {
"C":"Commercial",
"D":"Condop",
"G":"Garage",
"I":"Income Property",
"M":"Multi-Family",
"N":"Condo",
"P":"Co-op",
"R":"Rental Property",
"S":"Single Family",
"T":"Institutional",
"V":"Development Site",
"X":"Mixed Use",
},
"PayPeriod": {
"M":"Monthly",
"Y":"Yearly",
},
"PetPolicy": {
"A":"Pets Allowed",
"C":"Case By Case",
"D":"No Dogs",
"N":"No Pets",
"T":"No Cats",
},
"SalesOrRent": {
"R":"Apartment for Rent",
"S":"Apartment for Sale",
"T":"Building for Sale",
},
"ServiceLevel": {
"A":"Attended Lobby",
"C":"Concierge",
"F":"Full Time Doorman",
"I":"Voice Intercom",
"N":"None",
"P":"Part Time Doorman",
"S":"Full Service",
"U":"Virtual Doorman",
"V":"Video Intercom",
}
}
def expand_row(row):
output = {}
for k, v in row.items():
if k in LOOKUPS:
output[k] = LOOKUPS[k].get(v, 'UNKNOWN')
elif hasattr(v, 'items'):
output[k] = expand_row(v)
else:
output[k] = v
return output
|
class DotDictMeta(type):
def __repr__(cls):
return cls.__name__
class DotDict(dict, metaclass=DotDictMeta):
"""Dictionary that supports dot notation as well as dictionary access notation.
Use the dot motation only for get values, not for setting.
usage:
>>> d1 = DotDict()
>>> d['val2'] = 'second'
>>> print(d.val2)
"""
__slots__ = ()
__setattr__ = dict.__setitem__
__delattr__ = dict.__delitem__
def __getattr__(self, k):
"""Get property"""
value = self.get(k)
if isinstance(value, dict):
return DotDict(value)
return value
def __setitem__(self, *args, **kwargs):
new_args = [args[0], args[1]]
if isinstance(new_args[1], dict):
new_args[1] = DotDict(new_args[1])
return super().__setitem__(*new_args, **kwargs)
def get(self, k, default=None):
value = super().get(k, default)
if isinstance(value, dict):
return DotDict(value)
return value
def update(self, *args, **kwargs):
super().update(*args, **kwargs)
return self
def copy(self): # don't delegate w/ super - dict.copy() -> dict :(
return type(self)(self)
|
token = ''
Whitelist = 'whitelist.txt'
Masterkey = '1bc45'
Students = 'students.txt'
|
"""
Package version
"""
__version__ = "0.1.0"
|
# define constants
DETALHE_FILE_NAME = 'detalhe_votacao_secao'
MUNZONA_FILE_NAME = 'detalhe_votacao_zona'
DC_CODE = '58335'
TURNO = '2'
SECAO_FILE = 'detalhe_votacao_secao_2016_RJ.txt'
BOLETIM_FILE = 'bweb_2t_RJ_31102016134235.txt'
COLUMNS_TO_DETALHE_SECAO = [
'codigo_municipio',
'secao',
'zona',
'aptos',
'abstencoes',
'nao_considerados',
'votos_anulados',
'votos_brancos',
'votos_legenda',
'votos_nominais',
'votos_nulos',
'percentual_abstencoes',
'percentual_anulados',
'percentual_brancos',
'percentual_legenda',
'percentual_nominais',
'percentual_nulos'
]
# COLUMNS_TO_DETALHE_ZONA = [
# 'abstencoes',
# 'aptos',
# 'nao_considerados',
# 'votos_anulados',
# 'votos_brancos',
# 'votos_legenda',
# 'votos_nominais',
# 'votos_nulos'
# ]
|
class Singleton:
__instance = None
def __new__(cls, val=None):
if Singleton.__instance is None:
Singleton.__instance = object.__new__(cls)
Singleton.__instance.val = val
return Singleton.__instance
|
with open("input.txt") as f:
card_public, door_public = [int(x) for x in f.readlines()]
def transform_once(subject: int, num: int) -> int:
return (subject * num) % 20201227
num = 1
i = 0
while num != door_public:
i += 1
num = transform_once(7, num)
door_loop = i
num = 1
for _ in range(door_loop):
num = transform_once(card_public, num)
print(num)
|
# Definition for a binary tree node.
class TreeNode:
def __init__(self, val=0, left=None, right=None):
self.val = val
self.left = left
self.right = right
class Solution:
def insertIntoBST(self, root: TreeNode, val: int) -> TreeNode:
# Iteration (1): Time O(h) Space O(1)
if not root:
return TreeNode(val)
node = root
while node:
if val < node.val:
if not node.left:
node.left = TreeNode(val)
break
else:
node = node.left
else:
if not node.right:
node.right = TreeNode(val)
break
else:
node = node.right
return root
# Iteration (2): Time O(h) Space O(1)
'''
if not root:
return TreeNode(val)
node = root
succ = root.left if val < root.val else root.right
while succ:
node = succ
succ = succ.left if val < succ.val else succ.right
if val < node.val:
node.left = TreeNode(val)
else:
node.right = TreeNode(val)
return root
'''
# Recursion (1): Time O(h) Space O(h)
'''
def insert_node(root, val):
if val < root.val:
if not root.left:
root.left = TreeNode(val)
return
else:
insert_node(root.left, val)
else:
if not root.right:
root.right = TreeNode(val)
return
else:
insert_node(root.right, val)
if not root:
return TreeNode(val)
insert_node(root, val)
return root
'''
# Recursion (2): Time O(h) Space O(h)
'''
if not root:
return TreeNode(val)
if val < root.val:
root.left = self.insertIntoBST(root.left, val)
else:
root.right = self.insertIntoBST(root.right, val)
return root
''' |
class Student:
"""This is a very simple Student class"""
course_marks = {}
name = ""
family = ""
def __init__(self, name, family):
self.name = name
self.family = family
def addCourseMark(self, course, mark):
"""Add the course to the course dictionary,
this will overide the old mark if one exists."""
self.course_marks[course] = mark
def average(self):
"""Calculates the average grade percentage based on
all courses added to the studetn with formula:
sum(courses)/count(courses)
-Returns: Integer(0 if no courses)
"""
mark_sum = 0
courses_total = 0
for course, mark in self.course_marks.items():
mark_sum += mark
courses_total += 1
if courses_total != 0:
return mark_sum/courses_total
else:
return 0
#Start
if __name__ == "__main__":
#Make a new student, John Doe
student = Student("John", "Doe")
#Add several course grades
student.addCourseMark("CMPUT 101", 25)
student.addCourseMark("SCIENCE 101", 50)
student.addCourseMark("ART 101", 75)
student.addCourseMark("MUSIC 101", 100)
student.addCourseMark("DANCE 101", 50)
#Print the average, the average should be 60%
print("{0}'s average is: {1}%".format(student.name, student.average()))
|
""" This file handles default application config settings for Flask-User.
:copyright: (c) 2013 by Ling Thio
:author: Ling Thio (ling.thio@gmail.com)
:license: Simplified BSD License, see LICENSE.txt for more details."""
def set_default_settings(user_manager, app_config):
""" Set default app.config settings,
but only if they have not been set before """
# define short names
um = user_manager
sd = app_config.setdefault
# Retrieve obsoleted settings
# These plural settings have been replaced by singular settings
obsoleted_enable_emails = sd('USER_ENABLE_EMAILS', True)
obsoleted_enable_retype_passwords = sd(
'USER_ENABLE_RETYPE_PASSWORDS', True)
obsoleted_enable_usernames = sd('USER_ENABLE_USERNAMES', True)
obsoleted_enable_registration = sd('USER_ENABLE_REGISTRATION', True)
# General settings
um.app_name = sd('USER_APP_NAME', 'AppName')
# Set default features
um.enable_change_password = sd('USER_ENABLE_CHANGE_PASSWORD', True)
um.enable_change_username = sd('USER_ENABLE_CHANGE_USERNAME', True)
um.enable_email = sd('USER_ENABLE_EMAIL', obsoleted_enable_emails)
um.enable_confirm_email = sd('USER_ENABLE_CONFIRM_EMAIL', um.enable_email)
um.enable_forgot_password = sd(
'USER_ENABLE_FORGOT_PASSWORD', um.enable_email)
um.enable_login_without_confirm_email = sd(
'USER_ENABLE_LOGIN_WITHOUT_CONFIRM_EMAIL', False)
um.enable_multiple_emails = sd('USER_ENABLE_MULTIPLE_EMAILS', False)
um.enable_register = sd(
'USER_ENABLE_REGISTER', obsoleted_enable_registration)
um.enable_remember_me = sd('USER_ENABLE_REMEMBER_ME', True)
um.enable_retype_password = sd(
'USER_ENABLE_RETYPE_PASSWORD', obsoleted_enable_retype_passwords)
um.enable_username = sd('USER_ENABLE_USERNAME', obsoleted_enable_usernames)
# Set default settings
um.auto_login = sd('USER_AUTO_LOGIN', True)
um.auto_login_after_confirm = sd(
'USER_AUTO_LOGIN_AFTER_CONFIRM', um.auto_login)
um.auto_login_after_register = sd(
'USER_AUTO_LOGIN_AFTER_REGISTER', um.auto_login)
um.auto_login_after_reset_password = sd(
'USER_AUTO_LOGIN_AFTER_RESET_PASSWORD', um.auto_login)
um.auto_login_at_login = sd('USER_AUTO_LOGIN_AT_LOGIN', um.auto_login)
um.confirm_email_expiration = sd(
'USER_CONFIRM_EMAIL_EXPIRATION', 2*24*3600) # 2 days
um.invite_expiration = sd('USER_INVITE_EXPIRATION', 90*24*3600) # 90 days
um.password_hash_mode = sd('USER_PASSWORD_HASH_MODE', 'passlib')
um.password_hash = sd('USER_PASSWORD_HASH', 'bcrypt')
um.password_salt = sd('USER_PASSWORD_SALT', app_config['SECRET_KEY'])
um.reset_password_expiration = sd(
'USER_RESET_PASSWORD_EXPIRATION', 2*24*3600) # 2 days
um.enable_invitation = sd('USER_ENABLE_INVITATION', False)
um.require_invitation = sd('USER_REQUIRE_INVITATION', False)
um.send_password_changed_email = sd(
'USER_SEND_PASSWORD_CHANGED_EMAIL', um.enable_email)
um.send_registered_email = sd(
'USER_SEND_REGISTERED_EMAIL', um.enable_email)
um.send_username_changed_email = sd(
'USER_SEND_USERNAME_CHANGED_EMAIL', um.enable_email)
um.show_username_email_does_not_exist = sd(
'USER_SHOW_USERNAME_EMAIL_DOES_NOT_EXIST', um.enable_register)
# Set default URLs
um.change_password_url = sd(
'USER_CHANGE_PASSWORD_URL', '/user/change-password')
um.change_username_url = sd(
'USER_CHANGE_USERNAME_URL', '/user/change-username')
um.change_theme_url = sd(
'USER_CHANGE_THEME_URL', '/user/change-theme')
um.add_tenant_url = sd(
'USER_ADD_TENANT_URL', '/user/add-tenant')
um.edit_tenant_url = sd(
'USER_EDIT_TENANT_URL', '/user/edit-tenant')
um.add_tenant_user_url = sd(
'USER_ADD_TENANT_USER_URL', '/user/add-tenant-user')
um.remove_tenant_user_url = sd(
'USER_REMOVE_TENANT_USER_URL', '/user/remove-tenant-user')
um.delete_tenant_url = sd(
'USER_DELETE_TENANT_URL', '/user/delete-tenant')
um.confirm_email_url = sd(
'USER_CONFIRM_EMAIL_URL', '/user/confirm-email/<token>')
um.email_action_url = sd(
'USER_EMAIL_ACTION_URL', '/user/email/<id>/<action>')
um.forgot_password_url = sd(
'USER_FORGOT_PASSWORD_URL', '/user/forgot-password')
um.login_url = sd('USER_LOGIN_URL', '/user/sign-in')
um.logout_url = sd('USER_LOGOUT_URL', '/user/sign-out')
um.manage_emails_url = sd('USER_MANAGE_EMAILS_URL', '/user/manage-emails')
um.register_url = sd('USER_REGISTER_URL', '/user/register')
um.resend_confirm_email_url = sd(
'USER_RESEND_CONFIRM_EMAIL_URL', '/user/resend-confirm-email')
um.reset_password_url = sd(
'USER_RESET_PASSWORD_URL', '/user/reset-password/<token>')
um.user_profile_url = sd('USER_PROFILE_URL', '/user/profile')
um.invite_url = sd('USER_INVITE_URL', '/user/invite')
# Set default ENDPOINTs
home_endpoint = ''
login_endpoint = um.login_endpoint = 'user.login'
um.after_change_password_endpoint = sd(
'USER_AFTER_CHANGE_PASSWORD_ENDPOINT', home_endpoint)
um.after_change_username_endpoint = sd(
'USER_AFTER_CHANGE_USERNAME_ENDPOINT', home_endpoint)
um.after_change_theme_endpoint = sd(
'USER_AFTER_CHANGE_THEME_ENDPOINT', home_endpoint)
um.after_add_tenant_endpoint = sd(
'USER_AFTER_ADD_TENANT_ENDPOINT', home_endpoint)
um.after_edit_tenant_endpoint = sd(
'USER_AFTER_EDIT_TENANT_ENDPOINT', home_endpoint)
um.after_add_tenant_user_endpoint = sd(
'USER_AFTER_ADD_TENANT_USER_ENDPOINT', home_endpoint)
um.after_remove_tenant_user_endpoint = sd(
'USER_AFTER_REMOVE_TENANT_USER_ENDPOINT', home_endpoint)
um.after_delete_tenant_endpoint = sd(
'USER_AFTER_DELETE_TENANT_ENDPOINT', home_endpoint)
um.after_confirm_endpoint = sd(
'USER_AFTER_CONFIRM_ENDPOINT', home_endpoint)
um.after_forgot_password_endpoint = sd(
'USER_AFTER_FORGOT_PASSWORD_ENDPOINT', home_endpoint)
um.after_login_endpoint = sd('USER_AFTER_LOGIN_ENDPOINT', home_endpoint)
um.after_logout_endpoint = sd('USER_AFTER_LOGOUT_ENDPOINT', login_endpoint)
um.after_register_endpoint = sd(
'USER_AFTER_REGISTER_ENDPOINT', home_endpoint)
um.after_resend_confirm_email_endpoint = sd(
'USER_AFTER_RESEND_CONFIRM_EMAIL_ENDPOINT', home_endpoint)
um.after_reset_password_endpoint = sd(
'USER_AFTER_RESET_PASSWORD_ENDPOINT', home_endpoint)
um.after_invite_endpoint = sd('USER_INVITE_ENDPOINT', home_endpoint)
um.unconfirmed_email_endpoint = sd(
'USER_UNCONFIRMED_EMAIL_ENDPOINT', home_endpoint)
um.unauthenticated_endpoint = sd(
'USER_UNAUTHENTICATED_ENDPOINT', login_endpoint)
um.unauthorized_endpoint = sd('USER_UNAUTHORIZED_ENDPOINT', home_endpoint)
# Set default template files
um.change_password_template = sd(
'USER_CHANGE_PASSWORD_TEMPLATE', 'flask_user/change_password.html')
um.change_username_template = sd(
'USER_CHANGE_USERNAME_TEMPLATE', 'flask_user/change_username.html')
um.change_theme_template = sd(
'USER_CHANGE_THEME_TEMPLATE', 'flask_user/change_theme.html')
um.add_tenant_template = sd(
'USER_ADD_TENANT_TEMPLATE', 'flask_user/add_tenant.html')
um.edit_tenant_template = sd(
'USER_EDIT_TENANT_TEMPLATE', 'flask_user/edit_tenant.html')
um.add_tenant_user_template = sd(
'USER_ADD_TENANT_USER_TEMPLATE', 'flask_user/add_tenant_user.html')
um.remove_tenant_user_template = sd(
'USER_REMOVE_TENANT_USER_TEMPLATE', 'flask_user/remove_tenant_user.html') # noqa
um.delete_tenant_template = sd(
'USER_DELETE_TENANT_TEMPLATE', 'flask_user/delete_tenant.html')
um.forgot_password_template = sd(
'USER_FORGOT_PASSWORD_TEMPLATE', 'flask_user/forgot_password.html')
um.login_template = sd('USER_LOGIN_TEMPLATE', 'flask_user/login.html')
um.manage_emails_template = sd(
'USER_MANAGE_EMAILS_TEMPLATE', 'flask_user/manage_emails.html')
um.register_template = sd(
'USER_REGISTER_TEMPLATE', 'flask_user/register.html')
um.resend_confirm_email_template = sd(
'USER_RESEND_CONFIRM_EMAIL_TEMPLATE',
'flask_user/resend_confirm_email.html'
)
um.reset_password_template = sd(
'USER_RESET_PASSWORD_TEMPLATE', 'flask_user/reset_password.html')
um.user_profile_template = sd(
'USER_PROFILE_TEMPLATE', 'flask_user/user_profile.html')
um.invite_template = sd('USER_INVITE_TEMPLATE', 'flask_user/invite.html')
um.invite_accept_template = sd(
'USER_INVITE_ACCEPT_TEMPLATE', 'flask_user/register.html')
# Set default email template files
um.confirm_email_email_template = sd(
'USER_CONFIRM_EMAIL_EMAIL_TEMPLATE', 'flask_user/emails/confirm_email')
um.forgot_password_email_template = sd(
'USER_FORGOT_PASSWORD_EMAIL_TEMPLATE',
'flask_user/emails/forgot_password'
)
um.password_changed_email_template = sd(
'USER_PASSWORD_CHANGED_EMAIL_TEMPLATE',
'flask_user/emails/password_changed'
)
um.registered_email_template = sd(
'USER_REGISTERED_EMAIL_TEMPLATE', 'flask_user/emails/registered')
um.username_changed_email_template = sd(
'USER_USERNAME_CHANGED_EMAIL_TEMPLATE',
'flask_user/emails/username_changed'
)
um.invite_email_template = sd(
'USER_INVITE_EMAIL_TEMPLATE', 'flask_user/emails/invite')
def check_settings(user_manager):
""" Verify config combinations. Produce a helpful error messages
for inconsistent combinations."""
# Define custom Exception
class ConfigurationError(Exception):
pass
um = user_manager
""" USER_ENABLE_REGISTER=True must have USER_ENABLE_USERNAME=True or
USER_ENABLE_EMAIL=True or both."""
if um.enable_register and not(um.enable_username or um.enable_email):
raise ConfigurationError(
'USER_ENABLE_REGISTER=True must have USER_ENABLE_USERNAME=True '
'or USER_ENABLE_EMAIL=True or both.')
# USER_ENABLE_CONFIRM_EMAIL=True must have USER_ENABLE_EMAIL=True
if um.enable_confirm_email and not um.enable_email:
raise ConfigurationError(
'USER_ENABLE_CONFIRM_EMAIL=True must have USER_ENABLE_EMAIL=True.')
# USER_ENABLE_MULTIPLE_EMAILS=True must have USER_ENABLE_EMAIL=True
if um.enable_multiple_emails and not um.enable_email:
raise ConfigurationError(
'USER_ENABLE_MULTIPLE_EMAILS=True must have '
'USER_ENABLE_EMAIL=True.')
# USER_ENABLE_CHANGE_USERNAME=True must have USER_ENABLE_USERNAME=True.
if um.enable_change_username and not um.enable_username:
raise ConfigurationError(
'USER_ENABLE_CHANGE_USERNAME=True must have '
'USER_ENABLE_USERNAME=True.')
# USER_SEND_REGISTERED_EMAIL=True must have USER_ENABLE_EMAIL=True
if um.send_registered_email and not um.enable_email:
raise ConfigurationError(
'USER_SEND_REGISTERED_EMAIL=True must have '
'USER_ENABLE_EMAIL=True.')
if um.require_invitation and not um.enable_invitation:
raise ConfigurationError(
'USER_REQUIRE_INVITATION=True must have '
'USER_ENABLE_INVITATION=True.')
if um.enable_invitation and not um.db_adapter.UserInvitationClass:
raise ConfigurationError(
'USER_ENABLE_INVITATION=True must pass UserInvitationClass '
'to SQLAlchemyAdapter().')
|
def setup_application():
# Example to change config stuff, call this method before everything else.
# config.cache_config.cache_dir = "abc"
a = 1
|
# Databricks notebook source
GFMGVNZKIYBRLMUHVQJSGYOCQYAYFKD
NATXOZQANOZFMUPBDEBUCJBHQ
BJWJMKDTNLLWEEQGCDJHHROEXMTBAULGXCRKMKPAOIFSOXERBMUOUQBBIVEWZHMSYRLVABWGSRFDRZXZCVSGFRALYARODLWSCWHPCCCYDSNEVCUWSKZJHCKBJDB
HRYAMXRDXHYWHJVTVBJEHAQTXYHBGBHHTNXU
OICSMCKGDPDCHROEZXHBROAOVOMOHKSZQSTZHZOBOUBKWKFQJFW
XVYHXHBOYUJCZFNBKYBKR
TEWCCYBEPDI
DEFSCRSOVVPZHNI
KISUCFDUZAYEICXBFKOZUPDBAM
BSHBTZYDVNPDJSQFVHPBNLBJGGINDB
# COMMAND ----------
ESKGUAFJMEKBAGXFUF
# COMMAND ----------
DWPLXDZXSHIEWXDMMMARTDSJBC
ECMMKVDMGTRWOCQUTDMEVRBJ
MH
AMUDHMBFXFGIMSALDYHVJMGZNXJBYGBAJJL
YPOLJBQLIHMWCRCJAWWNLOPQALQOIVYY
YPAJWHZEBGIKPXQFYYELAUCU
LLLKMEMCONCXRFCCVSUUQFTKZEGGLUPFDHVIDMSKKBLXMUMARJMQUHQOOFGUAXPYCUVWTWEIRUGJG
NJDQLJWDKTHCHMRTONUWUZAHLCVCFIFGESGKVBFQIWDRCFCSEYSKT
FUCTGTUZOVHJTGDFN
KA
ERIVNWSXMHROMCIASDPQCAEURCKNRWDNGJXGRLC
BOOWXSHMVACOLCQNJZXPGMN
UWEYIRCZXMJOLMFAKCVCXF
MKHAOAIFYDNYGUJ
CNEEHCXHXDECAFXEAZLLCUXBHBBUXRERLGYGCCQGFWPSFVPZIWIREHPMEEC
PEGNOUEQZGQCCMHJRDRUFF
CH
SEMDESHMMLHGVZYSXVCZKVAZOHKQSWFLOSCLYCGKFALOENWFZPGOJRFOXCOEUHYKYPLMWQHCVVPLGTXTCVHQHXQRZUKQTQGJJDSHAJKWKSQP
ARSWHTNFWHIRXENNMTFTXZWMGHVJLTIFBQFCYJGPASFGXGIDCQZDLIKKHYIBZQTVDJPEARMSBNFABJFKEOAIKKNWBHYYASVXOW
XJDEGMPMPMIUFHMICABFTFBVLFRFMAPCYSGBKNABGWHLHLZDKAOQKVKPXP
VUCSXTX
XUJVLKRPWJCLTRYUFKYAABETCUUJWEEASSUKPKVGSWIWMQMDRGQOTJTIRLRCSJXRGNDGSTKHMYWRGBJLYN
QLWMRILZQNAKJCIYZXPEPPRFSUWWMDNJZUXFNSEQRRMJFYBBQFBRQHZZYMXRDGUVEPMOCIXCBUZEXFIWMCMVYKH
SXNKUWHCTGTLTXFPGCPRYCQLICRPEJMDSEPUKKYQRELIXXRKLOJIJIJRDKMFZBQORL
NVJYLAXPNRDNBNUGWEIJONEFPJAVXDCVGNQPKSPZMBXKWFAIUQLEZKQXZXZ
SBXQXMKNYINFHHQRETHEMUDQVYXTDZLOCXYFJKCYOBHINWJBGLA
GOJTIGVYRPAIGMULYJDZSRETRCTCJQRMPHK
ULJNZUUYAZXIJSLPJMBURKZYIRJWAROZXV
FCBNDHJSUOTZOPWANWNXLWJLVTSWJPQOYONKWPAGAYMXQKJZKZZTOWLXQAKTVKHXJTYTXPAYIRQOYSWDSM
DUUTJTX
KHWFYFOWNCSZLNIMLEOLPZMVETMYYAWXNHVKSL
QMXXAFGGKGKWFUFMJKUAEYATOBNIE
EHWAXOGVKNIGGRMRNHREJFQNFBKOZPTHJXJGHTRMSCROXRFBQBMDUZZMFXDJUMPARBTKSKDNADNIWODQBAQHVBOLUBVJWFCJNUKBXIWQMKBJYTWTYVDKXIONRIELPXDXPZPYGOGXTPEUZIJ
ABZLXDUPKFZECGTCDGWPOQJMSWOVP
MAQPAIGDEPRNSBCXBOABUBSDWSPQ
YXMI |
def tambor_desplazamiento (entrada_TD, acarreo_entrada_TD, senal_control_TD):
resultado_TD = [0]*8
if senal_control_TD[2] == 0: # Rotaciones
if senal_control_TD[1] == 0: # Rotaciones a Derecha
for i in range (0,7):
resultado_TD[i] = entrada_TD[i+1]
if senal_control_TD[0] == 0: # Rotación a Derecha sin Acarreo
resultado_TD[7] = entrada_TD[0]
acarreo_salida_TD = acarreo_entrada_TD
elif senal_control_TD[0] == 1: # Rotación a Derecha con Acarreo
resultado_TD[7] = acarreo_entrada_TD
acarreo_salida_TD = entrada_TD[0]
elif senal_control_TD[1] == 1: # Rotaciones a Izquierda
for i in range(0,7):
resultado_TD[i+1] = entrada_TD[i]
if senal_control_TD[0] == 0: # Rotación a Izquierda sin Acarreo
resultado_TD[0] = entrada_TD[7]
acarreo_salida_TD = acarreo_entrada_TD
elif senal_control_TD[0] == 1: # Rotación a Izquierda con Acarreo
resultado_TD[0] = acarreo_entrada_TD
acarreo_salida_TD = entrada_TD[7]
elif senal_control_TD[2] == 1: # Desplazamientos
if senal_control_TD[1] == 0: # Desplazamientos a Derecha
for i in range(0,7):
resultado_TD[i] = entrada_TD[i+1]
if senal_control_TD[0] == 0: # Desplazamiento Aritmético a Derecha
resultado_TD[7] = entrada_TD[7]
acarreo_salida_TD = entrada_TD[0]
elif senal_control_TD[0] == 1: # Desplazamiento Lógico a Derecha
resultado_TD[7] = 0
acarreo_salida_TD = entrada_TD[0]
elif senal_control_TD[0:2] == [0, 1]: # Desplazamiento Aritmético a Izquierda
for i in range(0,7):
resultado_TD[i+1] = entrada_TD[i]
resultado_TD[0] = 0
acarreo_salida_TD = entrada_TD[7]
return resultado_TD, acarreo_salida_TD
|
DEFAULT_DOTENV_KWARGS = dict(
driver='MSDSS_DATABASE_DRIVER',
user='MSDSS_DATABASE_USER',
password='MSDSS_DATABASE_PASSWORD',
host='MSDSS_DATABASE_HOST',
port='MSDSS_DATABASE_PORT',
database='MSDSS_DATABASE_NAME',
env_file='./.env',
key_path=None,
defaults=dict(
driver='postgresql',
user='msdss',
password='msdss123',
host='localhost',
port='5432',
database='msdss'
)
)
DEFAULT_SUPPORTED_OPERATORS = ['=', '!=', '>', '>=', '>', '<', '<=', 'LIKE', 'NOTLIKE', 'ILIKE', 'NOTILIKE', 'CONTAINS', 'STARTSWITH', 'ENDSWITH'] |
class param:
"""
Copyright (c) 2018 van Ovost Automatisering b.v.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
you may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
# ------------------------------
# Fetch a numeric parameter
# and make sure it is a string
# ------------------------------
@staticmethod
def numpar(map, name, default=None):
res = map.get(name, default)
if res is not None:
if not isinstance(res, str):
res = str(res)
if not res.isdigit():
raise Exception(name + ' is not numeric')
return res
@staticmethod
def strpar(map, name, default=None):
res = map.get(name, default)
if res is not None:
if not isinstance(res, str):
res = str(res)
return res
|
# Enter your code here. Read input from STDIN. Print output to STDOUT
dateActually, monthActually, yearActually = list(map(int, input().split()))
dateExpected, monthExpected, yearExpected = list(map(int, input().split()))
fine = 0
if (yearActually > yearExpected):
fine = 10000
elif (yearActually == yearExpected):
if (monthActually > monthExpected):
fine = (monthActually - monthExpected) * 500
elif (monthActually == monthExpected and dateActually > dateExpected):
fine = (dateActually - dateExpected) * 15
print(fine) |
"""Util functions and classes."""
# Copyright 2013-2018 The Home Assistant Authors
# https://github.com/home-assistant/home-assistant/blob/master/LICENSE.md
class Registry(dict):
"""Registry of items."""
def register(self, name):
"""Return decorator to register item with a specific name."""
def decorator(func):
"""Register decorated function."""
self[name] = func
return func
return decorator
|
x = int(input())
numbers = 0
while numbers < x:
y = int(input())
numbers += y
print(numbers)
|
# def f():
# x=10
if 1:
x=10
print(x) |
def add(matrix_a, matrix_b):
rows = len(matrix_a)
columns = len(matrix_a[0])
matrix_c = []
for i in range(rows):
list_1 = []
for j in range(columns):
val = matrix_a[i][j] + matrix_b[i][j]
list_1.append(val)
matrix_c.append(list_1)
return matrix_c
def scalarMultiply(matrix, n):
return [[x * n for x in row] for row in matrix]
def multiply(matrix_a, matrix_b):
matrix_c = []
n = len(matrix_a)
for i in range(n):
list_1 = []
for j in range(n):
val = 0
for k in range(n):
val = val + matrix_a[i][k] * matrix_b[k][j]
list_1.append(val)
matrix_c.append(list_1)
return matrix_c
def identity(n):
return [[int(row == column) for column in range(n)] for row in range(n)]
def transpose(matrix):
return map(list, zip(*matrix))
def minor(matrix, row, column):
minor = matrix[:row] + matrix[row + 1:]
minor = [row[:column] + row[column + 1:] for row in minor]
return minor
def determinant(matrix):
if len(matrix) == 1: return matrix[0][0]
res = 0
for x in range(len(matrix)):
res += matrix[0][x] * determinant(minor(matrix, 0, x)) * (-1) ** x
return res
def inverse(matrix):
det = determinant(matrix)
if det == 0: return None
matrixMinor = [[] for _ in range(len(matrix))]
for i in range(len(matrix)):
for j in range(len(matrix)):
matrixMinor[i].append(determinant(minor(matrix, i, j)))
cofactors = [[x * (-1) ** (row + col) for col, x in enumerate(matrixMinor[row])] for row in range(len(matrix))]
adjugate = transpose(cofactors)
return scalarMultiply(adjugate, 1 / det)
def main():
matrix_a = [[12, 10], [3, 9]]
matrix_b = [[3, 4], [7, 4]]
matrix_c = [[11, 12, 13, 14], [21, 22, 23, 24], [31, 32, 33, 34], [41, 42, 43, 44]]
matrix_d = [[3, 0, 2], [2, 0, -2], [0, 1, 1]]
print(add(matrix_a, matrix_b))
print(multiply(matrix_a, matrix_b))
print(identity(5))
print(minor(matrix_c, 1, 2))
print(determinant(matrix_b))
print(inverse(matrix_d))
if __name__ == '__main__':
main()
|
# EDIT THESE WITH YOUR OWN DATASET/TABLES
billing_project_id = 'project_id'
billing_dataset_id = 'billing_dataset'
billing_table_name = 'billing_data'
output_dataset_id = 'output_dataset'
output_table_name = 'transformed_table'
# You can leave this unless you renamed the file yourself.
sql_file_path = 'cud_sud_attribution_query.sql'
# There are two slightly different allocation methods that affect how the
# Commitment charge is allocated:
# Method 1: Only UTILIZED commitment charges are allocated to projects.
# (P_method_1_CUD_commitment_cost): Utilized CUD commitment charges are
# proportionally allocated to each project based on its share of total eligible
# VM usage during the time increment (P_usage_percentage). Any unutilized
# commitment cost remains unallocated (BA_unutilized_commitment_cost) and is
# allocated to the shell project.
# Method 2: ALL commitment charges are allocated to projects (regardless of utilization).
# (P_method_2_CUD_commitment_cost): All CUD commitment charges are
# proportionally allocated to each project based on its share of total eligible
# VM usage during the time increment (P_usage_percentage). All commitment cost
# is allocated into the projects proportionally based on the CUD credits that
# they consumed, even if the commitment is not fully utilized.
allocation_method = 'P_method_2_commitment_cost'
|
# testing the bargaining power proxy
def barPower(budget, totalBudget, N):
'''
(float, float, integer) => float
computes bargaining power within a project
'''
bP = ( N * budget - totalBudget) / (N * totalBudget)
return bP
projects = []
project1 = [10, 10, 10, 10, 1000]
project2 = [50, 50, 50]
project3 = [70, 40, 57, 3, 190]
projects.append(project1)
projects.append(project2)
projects.append(project3)
for project in projects:
bigN =len(project)
tot = sum(budget for budget in project)
barPowers = []
for item in project:
barP = ( bigN * item - tot) / (bigN * tot)
barPowers.append(barP)
print (str(project) + ': ' + str(barPowers) +' checksum: ' + str(sum (item for item in barPowers)))
|
"""
This module houses the GDAL & SRS Exception objects, and the
check_err() routine which checks the status code returned by
GDAL/OGR methods.
"""
# #### GDAL & SRS Exceptions ####
class GDALException(Exception):
pass
class SRSException(Exception):
pass
# #### GDAL/OGR error checking codes and routine ####
# OGR Error Codes
OGRERR_DICT = {
1: (GDALException, 'Not enough data.'),
2: (GDALException, 'Not enough memory.'),
3: (GDALException, 'Unsupported geometry type.'),
4: (GDALException, 'Unsupported operation.'),
5: (GDALException, 'Corrupt data.'),
6: (GDALException, 'OGR failure.'),
7: (SRSException, 'Unsupported SRS.'),
8: (GDALException, 'Invalid handle.'),
}
# CPL Error Codes
# https://www.gdal.org/cpl__error_8h.html
CPLERR_DICT = {
1: (GDALException, 'AppDefined'),
2: (GDALException, 'OutOfMemory'),
3: (GDALException, 'FileIO'),
4: (GDALException, 'OpenFailed'),
5: (GDALException, 'IllegalArg'),
6: (GDALException, 'NotSupported'),
7: (GDALException, 'AssertionFailed'),
8: (GDALException, 'NoWriteAccess'),
9: (GDALException, 'UserInterrupt'),
10: (GDALException, 'ObjectNull'),
}
ERR_NONE = 0
def check_err(code, cpl=False):
"""
Check the given CPL/OGRERR and raise an exception where appropriate.
"""
err_dict = CPLERR_DICT if cpl else OGRERR_DICT
if code == ERR_NONE:
return
elif code in err_dict:
e, msg = err_dict[code]
raise e(msg)
else:
raise GDALException('Unknown error code: "%s"' % code)
|
class Solution:
def maxDepth(self, s: str) -> int:
z=0
m=0
for i in s:
if i=="(":
z+=1
elif i==")":
z-=1
m=max(m,z)
return m
|
## Animal is-a object
class Animal(object):
pass
## Dog is-a Animal
class Dog(Animal):
def __init__(self, name):
## Dog has-a name
self.name = name
## Cat is-a Animal
class Cat(Animal):
def __init__(self, name):
## Cat has-a name
self.name = name
## Person is-a object
class Person(object):
def __init__(self, name):
## Person has-a name
self.name = name
## Person has-a pet of some kind
self.pet = None
## Employee is-a Person
class Employee(Person):
def __init__(self, name, salary):
## ?? hmm what is this strange magic?
super(Employee, self).__init__(name)
## Employee has-a salary
self.salary = salary
## Fish is-a object
class Fish(object):
pass
## Salmon is-a Fish
class Salmon(Fish):
pass
## Halaibut is-a Fish
class Halibut(Fish):
pass
## rover is-a Dog
rover = Dog("Rover")
## satan is-a Cat
satan = Cat("Satan")
## mary is-a Person
mary = Person("Mary")
## Mary has-a pet cat name of satan
mary.pet = satan
## Frank is-a Employee
frank = Employee("Frank", 120000)
## Frank has-a pet dog name of rover
frank.pet = rover
## flipper is-a Fish
flipper = Fish()
## crouse is-a Salmon Fish
crouse = Salmon()
## harry is-a Halibut Fish
harry = Halibut()
|
class Project:
def __init__(self, name=None, description=None, id=None):
self.name = name
self.description = description
self.id = id |
__all__ = [
"max",
"min",
"pow",
"sqrt",
"exp",
"log",
"sin",
"cos",
"tan",
"arcsin",
"arccos",
"arctan",
"fabs",
"floor",
"ceil",
"isinf",
"isnan",
]
def max(a: float, b: float) -> float:
raise NotImplementedError
def min(a: float, b: float) -> float:
raise NotImplementedError
def pow(base: float, exp: float) -> float:
raise NotImplementedError
def sqrt(arg: float) -> float:
raise NotImplementedError
def exp(exp: float) -> float:
raise NotImplementedError
def log(arg: float) -> float:
raise NotImplementedError
def sin(arg: float) -> float:
raise NotImplementedError
def cos(arg: float) -> float:
raise NotImplementedError
def tan(arg: float) -> float:
raise NotImplementedError
def arcsin(arg: float) -> float:
raise NotImplementedError
def arccos(arg: float) -> float:
raise NotImplementedError
def arctan(arg: float) -> float:
raise NotImplementedError
def fabs(arg: float) -> float:
raise NotImplementedError
def floor(arg: float) -> float:
raise NotImplementedError
def ceil(arg: float) -> float:
raise NotImplementedError
def isinf(arg: float) -> float:
raise NotImplementedError
def isnan(arg: float) -> float:
raise NotImplementedError
|
class Message(object):
""" Implements a Windows message. """
def Instance(self):
""" This function has been arbitrarily put into the stubs"""
return Message()
@staticmethod
def Create(hWnd,msg,wparam,lparam):
"""
Create(hWnd: IntPtr,msg: int,wparam: IntPtr,lparam: IntPtr) -> Message
Creates a new System.Windows.Forms.Message.
hWnd: The window handle that the message is for.
msg: The message ID.
wparam: The message wparam field.
lparam: The message lparam field.
Returns: A System.Windows.Forms.Message that represents the message that was created.
"""
pass
def Equals(self,o):
"""
Equals(self: Message,o: object) -> bool
Determines whether the specified object is equal to the current object.
o: The object to compare with the current object.
Returns: true if the specified object is equal to the current object; otherwise,false.
"""
pass
def GetHashCode(self):
"""
GetHashCode(self: Message) -> int
Returns: A 32-bit signed integer that is the hash code for this instance.
"""
pass
def GetLParam(self,cls):
"""
GetLParam(self: Message,cls: Type) -> object
Gets the System.Windows.Forms.Message.LParam value and converts the value to an object.
cls: The type to use to create an instance. This type must be declared as a structure type.
Returns: An System.Object that represents an instance of the class specified by the cls parameter,with the data from the System.Windows.Forms.Message.LParam field of the message.
"""
pass
def ToString(self):
"""
ToString(self: Message) -> str
Returns a System.String that represents the current System.Windows.Forms.Message.
Returns: A System.String that represents the current System.Windows.Forms.Message.
"""
pass
def __eq__(self,*args):
""" x.__eq__(y) <==> x==y """
pass
def __ne__(self,*args):
pass
HWnd=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the window handle of the message.
Get: HWnd(self: Message) -> IntPtr
Set: HWnd(self: Message)=value
"""
LParam=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Specifies the System.Windows.Forms.Message.LParam field of the message.
Get: LParam(self: Message) -> IntPtr
Set: LParam(self: Message)=value
"""
Msg=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the ID number for the message.
Get: Msg(self: Message) -> int
Set: Msg(self: Message)=value
"""
Result=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Specifies the value that is returned to Windows in response to handling the message.
Get: Result(self: Message) -> IntPtr
Set: Result(self: Message)=value
"""
WParam=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets the System.Windows.Forms.Message.WParam field of the message.
Get: WParam(self: Message) -> IntPtr
Set: WParam(self: Message)=value
"""
|
# These contain production data that impacts logic
# no dependencies (besides DB migration)
ESSENTIAL_DATA_FIXTURES = (
'counties',
'organizations',
'addresses',
'groups',
'template_options',
)
# These contain fake accounts for each org
# depends on ESSENTIAL_DATA_FIXTURES
MOCK_USER_ACCOUNT_FIXTURES = (
'mock_profiles',
)
# These are form submissions & fake applicant data
# depends on ESSENTIAL_DATA_FIXTURES
MOCK_APPLICATION_FIXTURES = (
'mock_2_submissions_to_a_pubdef',
'mock_2_submissions_to_ebclc',
'mock_2_submissions_to_cc_pubdef',
'mock_2_submissions_to_sf_pubdef',
'mock_2_submissions_to_monterey_pubdef',
'mock_2_submissions_to_solano_pubdef',
'mock_2_submissions_to_san_diego_pubdef',
'mock_2_submissions_to_san_joaquin_pubdef',
'mock_2_submissions_to_santa_clara_pubdef',
'mock_2_submissions_to_santa_cruz_pubdef',
'mock_2_submissions_to_fresno_pubdef',
'mock_2_submissions_to_sonoma_pubdef',
'mock_2_submissions_to_tulare_pubdef',
'mock_2_submissions_to_ventura_pubdef',
'mock_2_submissions_to_santa_barbara_pubdef',
'mock_2_submissions_to_yolo_pubdef',
'mock_2_submissions_to_stanislaus_pubdef',
'mock_2_submissions_to_marin_pubdef',
'mock_1_submission_to_multiple_orgs',
)
MOCK_TRANSFER_FIXTURES = (
'mock_2_transfers',
)
# These are fake bundles of applications
# depends on MOCK_APPLICATION_FIXTURES
MOCK_BUNDLE_FIXTURES = (
'mock_1_bundle_to_a_pubdef',
'mock_1_bundle_to_ebclc',
'mock_1_bundle_to_sf_pubdef',
'mock_1_bundle_to_cc_pubdef',
'mock_1_bundle_to_monterey_pubdef',
'mock_1_bundle_to_solano_pubdef',
'mock_1_bundle_to_san_diego_pubdef',
'mock_1_bundle_to_san_joaquin_pubdef',
'mock_1_bundle_to_santa_clara_pubdef',
'mock_1_bundle_to_santa_cruz_pubdef',
'mock_1_bundle_to_fresno_pubdef',
'mock_1_bundle_to_sonoma_pubdef',
'mock_1_bundle_to_tulare_pubdef',
'mock_1_bundle_to_ventura_pubdef',
'mock_1_bundle_to_santa_barbara_pubdef',
'mock_1_bundle_to_yolo_pubdef',
'mock_1_bundle_to_stanislaus_pubdef',
)
# These all the fake mocked data
# depends on ESSENTIAL_DATA_FIXTURES
ALL_MOCK_DATA_FIXTURES = (
MOCK_USER_ACCOUNT_FIXTURES +
MOCK_APPLICATION_FIXTURES +
MOCK_TRANSFER_FIXTURES +
MOCK_BUNDLE_FIXTURES
)
|
#!/usr/bin/env python
"""
Copyright 2014-2015 Taxamo, Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
class Report:
"""NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually."""
def __init__(self):
self.swaggerTypes = {
'currency_code': 'str',
'skip_moss': 'bool',
'country_code': 'str',
'tax_region': 'str',
'country_subdivision': 'str',
'amount': 'number',
'tax_amount': 'number',
'tax_rate': 'number',
'country_name': 'str'
}
#Three-letter ISO currency code.
self.currency_code = None # str
#If true, this line should not be entered into MOSS and is provided for informative purposes only. For example because the country is the same as MOSS registration country and merchant country.
self.skip_moss = None # bool
#Two letter ISO country code.
self.country_code = None # str
#Tax region key
self.tax_region = None # str
#Country subdivision (e.g. state or provice or county)
self.country_subdivision = None # str
#Amount w/o tax
self.amount = None # number
#Tax amount
self.tax_amount = None # number
#Tax rate
self.tax_rate = None # number
#Country name
self.country_name = None # str
|
"""used to check if data existed in database already
"""
def duplicate_checker(tuple1,list_all):
return tuple1 in list_all
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.