content
stringlengths
7
1.05M
""" Test that the game controller is implemented properly. """ # Unit tests for the functions in tetris_controller require an interactive # form of testing like mock patch or event injection. We have verified that # the controller interacts with the game in an error-free manner, and that the # functions it calls run properly.
def build_model(): pass def save_model(): pass def load_model(model_path): pass def load_best_model(): pass
# Databricks notebook source print("hello world") # COMMAND ---------- print("let's make some changes and commit!") # COMMAND ----------
#!/usr/bin/env python # test print('test!')
N = int(input()) V = list(map(int, input().split())) V.sort() v_sum = (V[0]+V[1]) / (2**(len(V)-1)) for i in range(2, len(V)): v_sum += V[i] / (2**(len(V)-i)) print(v_sum)
class KeyValue: def __init__(self, key: None, value: None): self.key = key self.value = value class HashMap: def __init__(self, size:int = 11): self.size: int = size self.items: list = [None] * self.size self.length: int = 0 def put(self, key, value): keyValue: KeyValue = KeyValue(key, value) hash: int = self.hash(key) if self.items[hash] is None: self.items[hash] = [keyValue] self.length += 1 else: count: int = 0 found: bool = False while count < len(self.items[hash]) and not found: if self.items[hash][count].key == keyValue.key: found = True else: count += 1 if found: self.items[hash][count] = keyValue else: self.items[hash].append(keyValue) self.length += 1 def get(self, key): hash: int = self.hash(key) if self.items[hash] is None: return None else: count: int = 0 found: bool = False while count < len(self.items[hash]) and not found: if self.items[hash][count].key == key: found = True else: count += 1 if found: return self.items[hash][count].value else: return None def contains(self, key)->bool: hash: int = self.hash(key) if self.items[hash] is None: return False else: count: int = 0 found: bool = False while count < len(self.items[hash]) and not found: if self.items[hash][count].key == key: found = True else: count += 1 return found def delete(self, key): hash: int = self.hash(key) if self.items[hash] is None: return None else: count: int = 0 found: bool = False while count < len(self.items[hash]) and not found: if self.items[hash][count].key == key: found = True else: count += 1 if found: return self.items[hash].pop(count) else: return None def hash(self, key): return key % self.size ht: HashMap = HashMap() ht.put(11, "string 11") ht.put(22, "string 22") ht.put(33, "string 33") ht.put(44, "string 44") ht.put(12, "string 12") ht.put(21, "string 21") print(ht.contains(11), ht.contains(33), ht.contains(21), ht.contains(117)) print(ht.delete(11).value) print(ht.contains(22)) print(ht.get(22))
class EllysTSP: def getMax(self, places): c = places.count('C') v = len(places) - c return 2 * min(c, v) + min(abs(c-v), 1)
students = [] def get_students_titlecase(): students_titlecase = [] for student in students: students_titlecase = student.title() return students_titlecase def print_students_titlecase(): student_titlecase = get_students_titlecase() print(students_titlecase) def add_student(name, student_id=223): student = {"name": name, "student_id": student_id} students.append(student) def var_args(name, **kwargs): print(name) print(kwargs["description"],kwargs["feedback"]) student_list = get_students_titlecase() add_student(name = "Mark",student_id= 15) var_args("mark",description="loves pyth",feedback=None)
def posicionesAdyacentes2(self,fila,columna,mapa): retorno=[] #Norte if(fila>=1 and (mapa[fila-1][columna]!="W" and mapa[fila-1][columna]!="X")): retorno.append([fila-1,columna]) #Este if(columna<=10 and (mapa[fila][columna+1]!="W" and mapa[fila][columna+1]!="X")): retorno.append([fila,columna+1]) #Sur if(fila<=10 and (mapa[fila+1][columna]!="W" and mapa[fila+1][columna]!="X")): retorno.append([fila+1,columna]) #Oeste if(columna>=1 and (mapa[fila][columna-1]!="W" and mapa[fila][columna-1]!="X")): retorno.append([fila,columna-1]) return retorno
for t in range(int(input())): a, b, threshold = map(int, input().split()) steps = 0 while a <= threshold and b <= threshold: if a < b: a += b else: b += a steps += 1 print(steps)
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") def folly_deps(with_gflags = 1, with_syslibs = 0): if with_gflags: maybe( http_archive, name = "com_github_gflags_gflags", sha256 = "34af2f15cf7367513b352bdcd2493ab14ce43692d2dcd9dfc499492966c64dcf", strip_prefix = "gflags-2.2.2", urls = [ "https://github.com/gflags/gflags/archive/v2.2.2.tar.gz", ], ) maybe( http_archive, name = "com_github_google_glog", strip_prefix = "glog-0.5.0", build_file_content = """ load(":bazel/glog.bzl", "glog_library") glog_library(with_gflags = {}) """.format(with_gflags), sha256 = "eede71f28371bf39aa69b45de23b329d37214016e2055269b3b5e7cfd40b59f5", urls = [ "https://github.com/google/glog/archive/v0.5.0.tar.gz", ], ) if with_syslibs: maybe( native.new_local_repository, name = "double-conversion", path = "/usr/include", build_file = "@com_github_storypku_rules_folly//third_party/syslibs:double-conversion.BUILD", ) else: maybe( http_archive, name = "double-conversion", strip_prefix = "double-conversion-3.1.5", sha256 = "a63ecb93182134ba4293fd5f22d6e08ca417caafa244afaa751cbfddf6415b13", urls = ["https://github.com/google/double-conversion/archive/v3.1.5.tar.gz"], ) if with_syslibs: maybe( native.new_local_repository, name = "zlib", path = "/usr/include", build_file = "@com_github_storypku_rules_folly//third_party/syslibs:zlib.BUILD", ) else: maybe( http_archive, name = "zlib", sha256 = "629380c90a77b964d896ed37163f5c3a34f6e6d897311f1df2a7016355c45eff", strip_prefix = "zlib-1.2.11", build_file = "@com_github_storypku_rules_folly//third_party/zlib:zlib.BUILD", urls = ["https://github.com/madler/zlib/archive/v1.2.11.tar.gz"], ) if with_syslibs: maybe( native.new_local_repository, name = "com_github_google_snappy", path = "/usr/include", build_file = "@com_github_storypku_rules_folly//third_party/syslibs:snappy.BUILD", ) else: maybe( http_archive, name = "com_github_google_snappy", build_file = "@com_github_storypku_rules_folly//third_party/snappy:snappy.BUILD", strip_prefix = "snappy-1.1.9", sha256 = "75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7", urls = [ "https://github.com/google/snappy/archive/1.1.9.tar.gz", ], ) # ===== libevent (libevent.org) dependency ===== if with_syslibs: maybe( native.new_local_repository, name = "com_github_libevent_libevent", path = "/usr/include", build_file = "@com_github_storypku_rules_folly//third_party/syslibs:libevent.BUILD", ) else: maybe( http_archive, name = "com_github_libevent_libevent", sha256 = "316ddb401745ac5d222d7c529ef1eada12f58f6376a66c1118eee803cb70f83d", urls = ["https://github.com/libevent/libevent/archive/release-2.1.8-stable.tar.gz"], strip_prefix = "libevent-release-2.1.8-stable", build_file = "@com_github_storypku_rules_folly//third_party/libevent:libevent.BUILD", ) maybe( http_archive, name = "com_github_fmtlib_fmt", urls = ["https://github.com/fmtlib/fmt/archive/8.0.1.tar.gz"], sha256 = "b06ca3130158c625848f3fb7418f235155a4d389b2abc3a6245fb01cb0eb1e01", strip_prefix = "fmt-8.0.1", build_file = "@com_github_storypku_rules_folly//third_party/fmtlib:fmtlib.BUILD", ) # Note(jiaming): # Here we choose the latest (as of 08.04.2021) version of rules_boost as # AArch64 support was only complete in recent versions. We had to resolve # all build errors caused by API changes since Boost 1.69+ and refactored # HttpProxy implementation as it was dependent on Boost.Beast. # PS: Use of git_repository is discouraged. Ref: # https://docs.bazel.build/versions/main/external.html#repository-rules rules_boost_commit = "fb9f3c9a6011f966200027843d894923ebc9cd0b" maybe( http_archive, name = "com_github_nelhage_rules_boost", sha256 = "046f774b185436d506efeef8be6979f2c22f1971bfebd0979bafa28088bf28d0", strip_prefix = "rules_boost-{}".format(rules_boost_commit), urls = [ "https://github.com/nelhage/rules_boost/archive/{}.tar.gz".format(rules_boost_commit), ], ) maybe( native.new_local_repository, name = "openssl", path = "/usr/include", build_file = "@com_github_storypku_rules_folly//third_party/syslibs:openssl.BUILD", ) gtest_version = "1.11.0" maybe( http_archive, name = "com_google_googletest", sha256 = "b4870bf121ff7795ba20d20bcdd8627b8e088f2d1dab299a031c1034eddc93d5", strip_prefix = "googletest-release-{}".format(gtest_version), urls = [ "https://github.com/google/googletest/archive/refs/tags/release-{}.tar.gz".format(gtest_version), ], ) # NOTE(storypku): The following failed with error: # external/folly/folly/ssl/OpenSSLVersionFinder.h:29:26: # error: 'OPENSSL_VERSION' was not declared in this scope # 29 | return OpenSSL_version(OPENSSL_VERSION); # maybe( # http_archive, # name = "openssl", # sha256 = "17f5e63875d592ac8f596a6c3d579978a7bf943247c1f8cbc8051935ea42b3e5", # strip_prefix = "boringssl-b3d98af9c80643b0a36d495693cc0e669181c0af", # urls = ["https://github.com/google/boringssl/archive/b3d98af9c80643b0a36d495693cc0e669181c0af.tar.gz"], # ) # TODO(storypku): Ref: https://github.com/google/glog/blob/master/bazel/glog.bzl folly_version = "2021.09.06.00" http_archive( name = "folly", # build_file = "@com_github_storypku_rules_folly//third_party/folly:folly.BUILD", build_file_content = """ load("@com_github_storypku_rules_folly//bazel:folly.bzl", "folly_library") package(default_visibility = ["//visibility:public"]) folly_library(with_gflags = {}) """.format(with_gflags), strip_prefix = "folly-{}".format(folly_version), sha256 = "8fb0a5392cbf6da1233c59933fff880dd77bbe61e0e2d578347ff436c776eda5", urls = [ "https://github.com/facebook/folly/archive/v{}.tar.gz".format(folly_version), ], patch_args = ["-p1"], patches = [ "@com_github_storypku_rules_folly//third_party/folly:p00_double_conversion_include_fix.patch", ], )
n = int(input().strip()) x = [int(i) for i in input().strip().split(' ')] w = [int(i) for i in input().strip().split(' ')] s = sum([x[i]*w[i] for i in range(0,n)]) wmean = s/sum(w) print("{:0.1f}".format(wmean))
# Solution-1 - Lisa Murray # User needs to enter integer number = input("Please enter a positive integer:") # Number needs to be converted from string format to number format, and add 1 to inclued the number chosen num2 = int(number) + 1 # Creating variable for sum sum = 0 # create loop to loop through all numbers up to number user entered for i in range(num2): sum += i # Print the sum to the screen print (sum)
words = ('Oi', 'eu', 'aprendo', 'Python', 'pelo', 'Curso', 'em', 'video') for p in words: print(f'\nNa palavra {p.upper()} temos ', end='') for letra in p: if letra.lower() in 'aeiou': print(letra, end=' ')
# Event: LCCS Python Fundamental Skills Workshop # Date: May 2018 # Author: Joe English, PDST # eMail: [email protected] # Purpose: A program to calculate the average height of 5 people # Version: 1.0 (This program contains deliberate errors) print("Average height calculator") print("=========================") # Read in the 5 values h1 = int(input("Enter first height (cm): ")) h2 = int(input("Enter second height (cm): ")) h3 = int(input("Enter third height (cm): ")) h4 = int(input("Enter fourth height (cm): ")) h5 = int(input("Enter fifth height (cm): ")) # Calculate the average height avgHeigth = h1+h2+h3+h4+h3/5 # Display the result print("The average height is ", avgHeigth, "cm")
class Solution: # @param word1 & word2: Two string. # @return: The minimum number of steps. def minDistance(self, word1, word2): # write your code here if word1 == word2: return 0 if len(word1) == 0: return len(word2) if len(word2) == 0: return len(word1) m, n = len(word1), len(word2) d = [[0 for j in xrange(n + 1)] for i in xrange(m + 1)] for i in xrange(0, m + 1): d[i][0] = i for j in xrange(0, n + 1): d[0][j] = j for i in xrange(1, m + 1): for j in xrange(1, n + 1): if word1[i - 1] == word2[j - 1]: d[i][j] = d[i - 1][j - 1] else: d[i][j] = min(d[i - 1][j], d[i][j - 1], d[i - 1][j - 1]) + 1 return d[m][n]
def analyze(vw): for fva in vw.getFunctions(): analyzeFunction(vw, fva) def analyzeFunction(vw, fva): fakename = vw.getName(fva+1) if fakename is not None: vw.makeName(fva+1, None) vw.makeName(fva, fakename)
"""exercism bob module.""" def response(hey_bob): """ Model responses for input text. :param hey_bob string - The input provided. :return string - The respons. """ answer = 'Whatever.' hey_bob = hey_bob.strip() yelling = hey_bob.isupper() asking_question = len(hey_bob) > 0 and hey_bob[-1] == '?' if asking_question and yelling: answer = "Calm down, I know what I'm doing!" elif asking_question: answer = 'Sure.' elif yelling: answer = 'Whoa, chill out!' elif hey_bob == '': answer = 'Fine. Be that way!' return answer
# problem : https://leetcode.com/problems/first-missing-positive/ # time complexity : O(N) class Solution: def firstMissingPositive(self, nums: List[int]) -> int: s = set(nums) ans = 1 for num in nums: if(ans in s): ans += 1 else: break return ans
M = [] Schedule = [] def maximum(a,b): if a > b : return a else: return b def calculate_predecessor(jobs,n): p = [0 for i in range(n+1)] cur_job = n chosen_job = cur_job - 1 while cur_job > 1 : if chosen_job <= 0 : p[cur_job] = 0 cur_job=cur_job-1 chosen_job=cur_job-1 else: if jobs[cur_job][0] < jobs[chosen_job][1]: chosen_job = chosen_job - 1 else: p[cur_job] = chosen_job cur_job = cur_job-1 chosen_job = cur_job -1 return p def opt(j,jobs,p): global M if j == 0: return M[j] elif j ==1: M[j] = maximum(jobs[j][2],0) return M[j] else: if M[j] == -1: M[j] = maximum(opt(j-1,jobs,p),jobs[j][2]+opt(p[j],jobs,p)) return M[j] def wis(jobs,n): p = calculate_predecessor(jobs,n) value = opt(n,jobs,p) return value,p def find_solution(j,jobs,p): global M global Schedule if j > 0 : if jobs[j][2] + M[p[j]] >= M[j-1]: Schedule.append(j) find_solution(p[j],jobs,p) else: find_solution(j-1,jobs,p) return def main(): n = int(input("Enter the number of jobs: ")) global M M = [-1 for i in range(n+1)] M[0] = 0 jobs = [0] for i in range(n): s = int(input("Start time: ")) f = int(input("Finish time: ")) v = int(input("Value: ")) jobs.append((s,f,v)) max_value,p = wis(jobs,n) print(M) print(max_value) global Schedule find_solution(n,jobs,p) print(Schedule) return main()
# This file defines the board layout, as well as some other information # about the bitmaps. BaseName = '@/usr/home/srn/work/scrabble/bitmaps/' Bitmaps = { 'D':{'bitmap':BaseName + 'DW.xbm', 'background':'pink'}, 'd':{'bitmap':BaseName + 'DL.xbm', 'background':'sky blue'}, 'T':{'bitmap':BaseName + 'TW.xbm', 'background':'red'}, 't':{'bitmap':BaseName + 'TL.xbm', 'background':'blue'}, ' ':{'bitmap':BaseName + 'Blank.xbm', 'background':'light yellow'}, 'S':{'bitmap':BaseName + 'Star.xbm', 'background':'pink'} } Squares = [ ['T',' ',' ','d',' ',' ',' ','T',' ',' ',' ','d',' ',' ','T'], [' ','D',' ',' ',' ','t',' ',' ',' ','t',' ',' ',' ','D',' '], [' ',' ','D',' ',' ',' ','d',' ','d',' ',' ',' ','D',' ',' '], ['d',' ',' ','D',' ',' ',' ','d',' ',' ',' ','D',' ',' ','d'], [' ',' ',' ',' ','D',' ',' ',' ',' ',' ','D',' ',' ',' ',' '], [' ','t',' ',' ',' ','t',' ',' ',' ','t',' ',' ',' ','t',' '], [' ',' ','d',' ',' ',' ','d',' ','d',' ',' ',' ','d',' ',' '], ['T',' ',' ','d',' ',' ',' ','S',' ',' ',' ','d',' ',' ','T'], [' ',' ','d',' ',' ',' ','d',' ','d',' ',' ',' ','d',' ',' '], [' ','t',' ',' ',' ','t',' ',' ',' ','t',' ',' ',' ','t',' '], [' ',' ',' ',' ','D',' ',' ',' ',' ',' ','D',' ',' ',' ',' '], ['d',' ',' ','D',' ',' ',' ','d',' ',' ',' ','D',' ',' ','d'], [' ',' ','D',' ',' ',' ','d',' ','d',' ',' ',' ','D',' ',' '], [' ','D',' ',' ',' ','t',' ',' ',' ','t',' ',' ',' ','D',' '], ['T',' ',' ','d',' ',' ',' ','T',' ',' ',' ','d',' ',' ','T'] ] # This is the size of a "hole" in the board - bitmaps are Cell - 2. Cell = 45 Scores ={ 'A':1, 'B':3, 'C':3, 'D':2, 'E':1, 'F':4, 'G':2, 'H':4, 'I':1, 'J':8, 'K':5, 'L':1, 'M':3, 'N':1, 'O':1, 'P':3, 'Q':10, 'R':1, 'S':1, 'T':1, 'U':1, 'V':4, 'W':4, 'X':8, 'Y':4, 'Z':10, '_':0 };
def je_prastevilo(n): if n < 2 or n % 2 == 0: return n == 2 i = 3 while i * i <= n: if n % i == 0: return False i += 2 return True def poljuben_krog(n): return ( 2 * n - 1 ) ** 2 - ( 2 * ( n - 1 ) - 1 ) ** 2 if n != 1 else 1 def je_lih_kvadrat(n): return n ** ( 1 / 2 ) % 2 == 1 def seznam_krogov(n): seznam = list() s = 1 trenutni = list() while len(seznam) != n: if je_lih_kvadrat(s): trenutni.append(s) seznam.append(trenutni) trenutni = list() s += 1 else: trenutni.append(s) s += 1 return seznam def funkcija(n): seznam = [1] for i in range(2, n + 1): k = ( 2 * i - 1 ) ** 2 p = k ** (1/2) - 1 seznam += sorted([ int( k - i * p ) for i in range(1, 4)]) return seznam def delez(n): return len([i for i in funkcija(n) if je_prastevilo(i)]) / ( (n-1) * 4 + 1 ) slovar = {2: 0.6} s = 0.6 n = 3 while s > 0.1: if n in slovar: s = slovar[n] n += 1 else: p = 2 * n - 2 t = [i for i in [int((2*n-1)**2 - i * p ) for i in range(1, 4)] if je_prastevilo(i)] s = (slovar[n-1] * ((n-2)*4+1) + len(t) ) / ( ( n - 1 ) * 4 + 1 ) slovar[n] = s n += 1
# # PySNMP MIB module ASYNCOS-MAIL-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ASYNCOS-MAIL-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:13:32 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ConstraintsUnion, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint") asyncOSMail, = mibBuilder.importSymbols("IRONPORT-SMI", "asyncOSMail") NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance") Integer32, TimeTicks, ModuleIdentity, MibIdentifier, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, Counter64, Counter32, Gauge32, ObjectIdentity, IpAddress, NotificationType, Bits, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "TimeTicks", "ModuleIdentity", "MibIdentifier", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "Counter64", "Counter32", "Gauge32", "ObjectIdentity", "IpAddress", "NotificationType", "Bits", "Unsigned32") TruthValue, DisplayString, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "TruthValue", "DisplayString", "TextualConvention") asyncOSMailObjects = ModuleIdentity((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1)) asyncOSMailObjects.setRevisions(('2011-03-07 00:00', '2010-07-01 00:00', '2009-04-07 00:00', '2009-01-15 00:00', '2005-03-07 00:00', '2005-01-09 00:00',)) if mibBuilder.loadTexts: asyncOSMailObjects.setLastUpdated('201103070000Z') if mibBuilder.loadTexts: asyncOSMailObjects.setOrganization('IronPort Systems') asyncOSMailNotifications = MibIdentifier((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2)) perCentMemoryUtilization = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: perCentMemoryUtilization.setStatus('current') perCentCPUUtilization = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: perCentCPUUtilization.setStatus('current') perCentDiskIOUtilization = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 3), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: perCentDiskIOUtilization.setStatus('current') perCentQueueUtilization = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 4), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 100))).setMaxAccess("readonly") if mibBuilder.loadTexts: perCentQueueUtilization.setStatus('current') queueAvailabilityStatus = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 5), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("queueSpaceAvailable", 1), ("queueSpaceShortage", 2), ("queueFull", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: queueAvailabilityStatus.setStatus('current') resourceConservationReason = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("noResourceConservation", 1), ("memoryShortage", 2), ("queueSpaceShortage", 3), ("queueFull", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: resourceConservationReason.setStatus('current') memoryAvailabilityStatus = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 7), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("memoryAvailable", 1), ("memoryShortage", 2), ("memoryFull", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: memoryAvailabilityStatus.setStatus('current') powerSupplyTable = MibTable((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 8), ) if mibBuilder.loadTexts: powerSupplyTable.setStatus('current') powerSupplyEntry = MibTableRow((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 8, 1), ).setIndexNames((0, "ASYNCOS-MAIL-MIB", "powerSupplyIndex")) if mibBuilder.loadTexts: powerSupplyEntry.setStatus('current') powerSupplyIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 8, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 8))).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyIndex.setStatus('current') powerSupplyStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 8, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4))).clone(namedValues=NamedValues(("powerSupplyNotInstalled", 1), ("powerSupplyHealthy", 2), ("powerSupplyNoAC", 3), ("powerSupplyFaulty", 4)))).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyStatus.setStatus('current') powerSupplyRedundancy = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 8, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("powerSupplyRedundancyOK", 1), ("powerSupplyRedundancyLost", 2)))).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyRedundancy.setStatus('current') powerSupplyName = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 8, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: powerSupplyName.setStatus('current') temperatureTable = MibTable((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 9), ) if mibBuilder.loadTexts: temperatureTable.setStatus('current') temperatureEntry = MibTableRow((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 9, 1), ).setIndexNames((0, "ASYNCOS-MAIL-MIB", "temperatureIndex")) if mibBuilder.loadTexts: temperatureEntry.setStatus('current') temperatureIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 9, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))) if mibBuilder.loadTexts: temperatureIndex.setStatus('current') degreesCelsius = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 9, 1, 2), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: degreesCelsius.setStatus('current') temperatureName = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 9, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: temperatureName.setStatus('current') fanTable = MibTable((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 10), ) if mibBuilder.loadTexts: fanTable.setStatus('current') fanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 10, 1), ).setIndexNames((0, "ASYNCOS-MAIL-MIB", "fanIndex")) if mibBuilder.loadTexts: fanEntry.setStatus('current') fanIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 10, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 64))) if mibBuilder.loadTexts: fanIndex.setStatus('current') fanRPMs = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 10, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanRPMs.setStatus('current') fanName = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 10, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanName.setStatus('current') workQueueMessages = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 11), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: workQueueMessages.setStatus('current') keyExpirationTable = MibTable((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 12), ) if mibBuilder.loadTexts: keyExpirationTable.setStatus('current') keyExpirationEntry = MibTableRow((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 12, 1), ).setIndexNames((0, "ASYNCOS-MAIL-MIB", "keyExpirationIndex")) if mibBuilder.loadTexts: keyExpirationEntry.setStatus('current') keyExpirationIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 12, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly") if mibBuilder.loadTexts: keyExpirationIndex.setStatus('current') keyDescription = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 12, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: keyDescription.setStatus('current') keyIsPerpetual = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 12, 1, 3), TruthValue()).setMaxAccess("readonly") if mibBuilder.loadTexts: keyIsPerpetual.setStatus('current') keySecondsUntilExpire = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 12, 1, 4), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: keySecondsUntilExpire.setStatus('current') updateTable = MibTable((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 13), ) if mibBuilder.loadTexts: updateTable.setStatus('current') updateEntry = MibTableRow((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 13, 1), ).setIndexNames((0, "ASYNCOS-MAIL-MIB", "updateIndex")) if mibBuilder.loadTexts: updateEntry.setStatus('current') updateIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 13, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly") if mibBuilder.loadTexts: updateIndex.setStatus('current') updateServiceName = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 13, 1, 2), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: updateServiceName.setStatus('current') updates = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 13, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: updates.setStatus('current') updateFailures = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 13, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: updateFailures.setStatus('current') oldestMessageAge = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 14), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: oldestMessageAge.setStatus('current') outstandingDNSRequests = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 15), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: outstandingDNSRequests.setStatus('current') pendingDNSRequests = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 16), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pendingDNSRequests.setStatus('current') raidEvents = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 17), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: raidEvents.setStatus('current') raidTable = MibTable((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 18), ) if mibBuilder.loadTexts: raidTable.setStatus('current') raidEntry = MibTableRow((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 18, 1), ).setIndexNames((0, "ASYNCOS-MAIL-MIB", "raidIndex")) if mibBuilder.loadTexts: raidEntry.setStatus('current') raidIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 18, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 1024))).setMaxAccess("readonly") if mibBuilder.loadTexts: raidIndex.setStatus('current') raidStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 18, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2, 3))).clone(namedValues=NamedValues(("driveHealthy", 1), ("driveFailure", 2), ("driveRebuild", 3)))).setMaxAccess("readonly") if mibBuilder.loadTexts: raidStatus.setStatus('current') raidID = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 18, 1, 3), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: raidID.setStatus('current') raidLastError = MibTableColumn((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 18, 1, 4), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: raidLastError.setStatus('current') openFilesOrSockets = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 19), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: openFilesOrSockets.setStatus('current') mailTransferThreads = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 20), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: mailTransferThreads.setStatus('current') connectionURL = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 21), DisplayString()).setMaxAccess("accessiblefornotify") if mibBuilder.loadTexts: connectionURL.setStatus('current') hsmErrorReason = MibScalar((1, 3, 6, 1, 4, 1, 15497, 1, 1, 1, 22), DisplayString()).setMaxAccess("readonly") if mibBuilder.loadTexts: hsmErrorReason.setStatus('current') resourceConservationMode = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 1)).setObjects(("ASYNCOS-MAIL-MIB", "resourceConservationReason")) if mibBuilder.loadTexts: resourceConservationMode.setStatus('current') powerSupplyStatusChange = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 2)).setObjects(("ASYNCOS-MAIL-MIB", "powerSupplyStatus")) if mibBuilder.loadTexts: powerSupplyStatusChange.setStatus('current') highTemperature = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 3)).setObjects(("ASYNCOS-MAIL-MIB", "temperatureName")) if mibBuilder.loadTexts: highTemperature.setStatus('current') fanFailure = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 4)).setObjects(("ASYNCOS-MAIL-MIB", "fanName")) if mibBuilder.loadTexts: fanFailure.setStatus('current') keyExpiration = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 5)).setObjects(("ASYNCOS-MAIL-MIB", "keyDescription")) if mibBuilder.loadTexts: keyExpiration.setStatus('current') updateFailure = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 6)).setObjects(("ASYNCOS-MAIL-MIB", "updateServiceName")) if mibBuilder.loadTexts: updateFailure.setStatus('current') raidStatusChange = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 7)).setObjects(("ASYNCOS-MAIL-MIB", "raidID")) if mibBuilder.loadTexts: raidStatusChange.setStatus('current') connectivityFailure = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 8)).setObjects(("ASYNCOS-MAIL-MIB", "connectionURL")) if mibBuilder.loadTexts: connectivityFailure.setStatus('current') memoryUtilizationExceeded = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 9)).setObjects(("ASYNCOS-MAIL-MIB", "perCentMemoryUtilization")) if mibBuilder.loadTexts: memoryUtilizationExceeded.setStatus('current') cpuUtilizationExceeded = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 10)).setObjects(("ASYNCOS-MAIL-MIB", "perCentCPUUtilization")) if mibBuilder.loadTexts: cpuUtilizationExceeded.setStatus('current') hsmInitializationFailure = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 11)).setObjects(("ASYNCOS-MAIL-MIB", "hsmErrorReason")) if mibBuilder.loadTexts: hsmInitializationFailure.setStatus('current') hsmResetLoginFailure = NotificationType((1, 3, 6, 1, 4, 1, 15497, 1, 1, 2, 12)).setObjects(("ASYNCOS-MAIL-MIB", "hsmErrorReason")) if mibBuilder.loadTexts: hsmResetLoginFailure.setStatus('current') mibBuilder.exportSymbols("ASYNCOS-MAIL-MIB", updateServiceName=updateServiceName, powerSupplyStatusChange=powerSupplyStatusChange, workQueueMessages=workQueueMessages, pendingDNSRequests=pendingDNSRequests, fanIndex=fanIndex, memoryAvailabilityStatus=memoryAvailabilityStatus, powerSupplyEntry=powerSupplyEntry, fanName=fanName, raidLastError=raidLastError, keyDescription=keyDescription, fanEntry=fanEntry, oldestMessageAge=oldestMessageAge, degreesCelsius=degreesCelsius, outstandingDNSRequests=outstandingDNSRequests, fanTable=fanTable, temperatureEntry=temperatureEntry, raidEvents=raidEvents, keyExpirationIndex=keyExpirationIndex, resourceConservationMode=resourceConservationMode, updateIndex=updateIndex, powerSupplyTable=powerSupplyTable, updateFailure=updateFailure, hsmInitializationFailure=hsmInitializationFailure, keyExpirationEntry=keyExpirationEntry, raidID=raidID, powerSupplyIndex=powerSupplyIndex, powerSupplyName=powerSupplyName, mailTransferThreads=mailTransferThreads, highTemperature=highTemperature, openFilesOrSockets=openFilesOrSockets, updateTable=updateTable, powerSupplyStatus=powerSupplyStatus, hsmErrorReason=hsmErrorReason, hsmResetLoginFailure=hsmResetLoginFailure, updateEntry=updateEntry, connectivityFailure=connectivityFailure, raidTable=raidTable, resourceConservationReason=resourceConservationReason, temperatureTable=temperatureTable, perCentMemoryUtilization=perCentMemoryUtilization, updateFailures=updateFailures, memoryUtilizationExceeded=memoryUtilizationExceeded, perCentQueueUtilization=perCentQueueUtilization, cpuUtilizationExceeded=cpuUtilizationExceeded, PYSNMP_MODULE_ID=asyncOSMailObjects, asyncOSMailObjects=asyncOSMailObjects, keySecondsUntilExpire=keySecondsUntilExpire, connectionURL=connectionURL, keyExpiration=keyExpiration, raidStatus=raidStatus, raidStatusChange=raidStatusChange, perCentCPUUtilization=perCentCPUUtilization, temperatureName=temperatureName, fanRPMs=fanRPMs, powerSupplyRedundancy=powerSupplyRedundancy, fanFailure=fanFailure, raidEntry=raidEntry, perCentDiskIOUtilization=perCentDiskIOUtilization, temperatureIndex=temperatureIndex, keyExpirationTable=keyExpirationTable, keyIsPerpetual=keyIsPerpetual, updates=updates, asyncOSMailNotifications=asyncOSMailNotifications, queueAvailabilityStatus=queueAvailabilityStatus, raidIndex=raidIndex)
def bytes_to_iso(i): numbers = [(1000, 'k'), (1000000, 'M'), (1000000000, 'G'), (1000000000000, 'T')] if i < 1000: return '{} B'.format(i) for n in numbers: if i < n[0] * 1000: return '{:.1f} {}B'.format(i / n[0], n[1]) return '{:.1f} PB'.format(i) def iso_to_bytes(i): numbers = {'K': 1000, 'M': 1000000, 'G': 1000000000, 'T': 1000000000000} try: return int(i) except: pass try: n = numbers[i[-1].upper()] except: raise ValueError('Invalid size: {}'.format(i)) return float(i[:-1]) * n
""" basic box type follow: """ BOX_TYPE_FTYP="FTYP" BOX_TYPE_MDAT="MDAT" BOX_TYPE_MOOV="MOOV" BOX_TYPE_UDTA="UDTA" BOX_HEADER_SIZE =8
dataset_type = 'SUNRGBDDataset' data_root = 'data/sunrgbd/' class_names = ('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub') train_pipeline = [ dict( type='LoadPointsFromFile', coord_type='DEPTH', shift_height=True, load_dim=6, use_dim=[0, 1, 2]), dict(type='LoadAnnotations3D'), dict(type='RandomFlip3D', sync_2d=False, flip_ratio_bev_horizontal=0.5), dict( type='GlobalRotScaleTrans', rot_range=[-0.523599, 0.523599], scale_ratio_range=[0.85, 1.15], shift_height=True), dict(type='IndoorPointSample', num_points=20000), dict( type='DefaultFormatBundle3D', class_names=('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub')), dict(type='Collect3D', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ] test_pipeline = [ dict( type='LoadPointsFromFile', coord_type='DEPTH', shift_height=True, load_dim=6, use_dim=[0, 1, 2]), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), pts_scale_ratio=1, flip=False, transforms=[ dict( type='GlobalRotScaleTrans', rot_range=[0, 0], scale_ratio_range=[1.0, 1.0], translation_std=[0, 0, 0]), dict( type='RandomFlip3D', sync_2d=False, flip_ratio_bev_horizontal=0.5), dict(type='IndoorPointSample', num_points=20000), dict( type='DefaultFormatBundle3D', class_names=('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub'), with_label=False), dict(type='Collect3D', keys=['points']) ]) ] data = dict( samples_per_gpu=8, workers_per_gpu=4, train=dict( type='RepeatDataset', times=5, dataset=dict( type='SUNRGBDDataset', data_root='data/sunrgbd/', ann_file='data/sunrgbd/sunrgbd_infos_train.pkl', pipeline=[ dict( type='LoadPointsFromFile', coord_type='DEPTH', shift_height=True, load_dim=6, use_dim=[0, 1, 2]), dict(type='LoadAnnotations3D'), dict( type='RandomFlip3D', sync_2d=False, flip_ratio_bev_horizontal=0.5), dict( type='GlobalRotScaleTrans', rot_range=[-0.523599, 0.523599], scale_ratio_range=[0.85, 1.15], shift_height=True), dict(type='IndoorPointSample', num_points=20000), dict( type='DefaultFormatBundle3D', class_names=('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub')), dict( type='Collect3D', keys=['points', 'gt_bboxes_3d', 'gt_labels_3d']) ], classes=('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub'), filter_empty_gt=False, box_type_3d='Depth')), val=dict( type='SUNRGBDDataset', data_root='data/sunrgbd/', ann_file='data/sunrgbd/sunrgbd_infos_val.pkl', pipeline=[ dict( type='LoadPointsFromFile', coord_type='DEPTH', shift_height=True, load_dim=6, use_dim=[0, 1, 2]), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), pts_scale_ratio=1, flip=False, transforms=[ dict( type='GlobalRotScaleTrans', rot_range=[0, 0], scale_ratio_range=[1.0, 1.0], translation_std=[0, 0, 0]), dict( type='RandomFlip3D', sync_2d=False, flip_ratio_bev_horizontal=0.5), dict(type='IndoorPointSample', num_points=20000), dict( type='DefaultFormatBundle3D', class_names=('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub'), with_label=False), dict(type='Collect3D', keys=['points']) ]) ], classes=('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub'), test_mode=True, box_type_3d='Depth'), test=dict( type='SUNRGBDDataset', data_root='data/sunrgbd/', ann_file='data/sunrgbd/sunrgbd_infos_val.pkl', pipeline=[ dict( type='LoadPointsFromFile', coord_type='DEPTH', shift_height=True, load_dim=6, use_dim=[0, 1, 2]), dict( type='MultiScaleFlipAug3D', img_scale=(1333, 800), pts_scale_ratio=1, flip=False, transforms=[ dict( type='GlobalRotScaleTrans', rot_range=[0, 0], scale_ratio_range=[1.0, 1.0], translation_std=[0, 0, 0]), dict( type='RandomFlip3D', sync_2d=False, flip_ratio_bev_horizontal=0.5), dict(type='IndoorPointSample', num_points=20000), dict( type='DefaultFormatBundle3D', class_names=('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub'), with_label=False), dict(type='Collect3D', keys=['points']) ]) ], classes=('bed', 'table', 'sofa', 'chair', 'toilet', 'desk', 'dresser', 'night_stand', 'bookshelf', 'bathtub'), test_mode=True, box_type_3d='Depth')) model = dict( type='BRNet', backbone=dict( type='PointNet2SASSG', in_channels=4, num_points=(2048, 1024, 512, 256), radius=(0.2, 0.4, 0.8, 1.2), num_samples=(64, 32, 16, 16), sa_channels=((64, 64, 128), (128, 128, 256), (128, 128, 256), (128, 128, 256)), fp_channels=((256, 256), (256, 256)), norm_cfg=dict(type='BN2d'), sa_cfg=dict( type='PointSAModule', pool_mod='max', use_xyz=True, normalize_xyz=True)), rpn_head=dict( type='CAVoteHead', vote_module_cfg=dict( in_channels=256, vote_per_seed=1, gt_per_seed=3, conv_channels=(256, 256), conv_cfg=dict(type='Conv1d'), norm_cfg=dict(type='BN1d'), norm_feats=True, vote_loss=dict( type='ChamferDistance', mode='l1', reduction='none', loss_dst_weight=10.0)), vote_aggregation_cfg=dict( type='PointSAModule', num_point=256, radius=0.3, num_sample=16, mlp_channels=[256, 128, 128, 128], use_xyz=True, normalize_xyz=True), pred_layer_cfg=dict( in_channels=128, shared_conv_channels=(128, 128), bias=True), conv_cfg=dict(type='Conv1d'), norm_cfg=dict(type='BN1d'), objectness_loss=dict( type='CrossEntropyLoss', class_weight=[0.2, 0.8], reduction='sum', loss_weight=10.0), dir_class_loss=dict( type='CrossEntropyLoss', reduction='sum', loss_weight=1.0), dir_res_loss=dict( type='SmoothL1Loss', reduction='sum', loss_weight=10.0), size_res_loss=dict( type='SmoothL1Loss', reduction='sum', loss_weight=5.0, beta=0.15), num_classes=10, bbox_coder=dict( type='ClassAgnosticBBoxCoder', num_dir_bins=12, with_rot=True)), roi_head=dict( type='BRRoIHead', roi_extractor=dict( type='RepPointRoIExtractor', rep_type='ray', density=2, seed_feat_dim=256, sa_radius=0.2, sa_num_sample=16, num_seed_points=1024), bbox_head=dict( type='BRBboxHead', pred_layer_cfg=dict( in_channels=256, shared_conv_channels=(128, 128), bias=True), dir_res_loss=dict( type='SmoothL1Loss', beta=0.26166666666666666, reduction='sum', loss_weight=2.6), size_res_loss=dict( type='SmoothL1Loss', beta=0.15, reduction='sum', loss_weight=5.0), semantic_loss=dict( type='CrossEntropyLoss', reduction='sum', loss_weight=1.0), num_classes=10, bbox_coder=dict( type='ClassAgnosticBBoxCoder', num_dir_bins=12, with_rot=True))), train_cfg=dict( rpn=dict( pos_distance_thr=0.3, neg_distance_thr=0.3, sample_mod='seed'), rpn_proposal=dict(use_nms=False), rcnn=dict( pos_distance_thr=0.3, neg_distance_thr=0.3, sample_mod='seed')), test_cfg=dict( rpn=dict(sample_mod='seed', use_nms=False), rcnn=dict( sample_mod='seed', nms_thr=0.25, score_thr=0.5, per_class_proposal=True))) optimizer_config = dict(grad_clip=dict(max_norm=10, norm_type=2)) lr_config = dict(policy='CosineAnnealing', min_lr=0) total_epochs = 44 checkpoint_config = dict(interval=1) log_config = dict( interval=30, hooks=[dict(type='TextLoggerHook'), dict(type='TensorboardLoggerHook')]) dist_params = dict(backend='nccl') log_level = 'INFO' work_dir = 'work_dirs/brnet-sunrgbd8' load_from = None resume_from = None workflow = [('train', 1), ('val', 1)] lr = 0.001 optimizer = dict(type='AdamW', lr=0.001, weight_decay=0.01) gpu_ids = range(0, 1)
n = int(input()) while n != 0: db = {} for i in range(n): name = input() color_size = input() if color_size in db: aux = db[color_size] aux.append(name) db[color_size] = aux else: db[color_size] = [name] print('') if "white S" in db: aux = db.get('white S') for i in aux: print('white S', i) if "white M" in db: aux = db.get('white M') for i in aux: print('white M', i) if "white L" in db: aux = db.get('white L') for i in aux: print('white L', i) if "red S" in db: aux = db.get('red S') for i in aux: print('red S', i) if "red M" in db: aux = db.get('red M') for i in aux: print('red M', i) if "red G" in db: aux = db.get('red G') for i in aux: print('red G', i) n = int(input())
""" Contains defintions for all custom exceptions raised. """ class ConfigError(Exception): """ Indicates an error with the specified configuration file. """ def __init__(self, message, response=({"status": "Config File Error"}, 500)): super().__init__(message) self.response = response class APIError(Exception): """ Indicates that the API encountered an error. """ def __init__(self, message, response=({"status": "API Error"}, 500)): super().__init__(message) self.response = response class SignatureError(Exception): """ Indicates an error in the process of validating the request signature. """ def __init__(self, message): super().__init__(message) self.response = ({ 'status': 'Signature Validation Error', 'message': message }, 400)
"""Production settings unique to the remote gradebook plugin.""" def plugin_settings(settings): """Settings for the canvas integration plugin.""" settings.CANVAS_ACCESS_TOKEN = settings.AUTH_TOKENS.get( "CANVAS_ACCESS_TOKEN", settings.CANVAS_ACCESS_TOKEN ) settings.CANVAS_BASE_URL = settings.ENV_TOKENS.get( "CANVAS_BASE_URL", settings.CANVAS_BASE_URL )
""" Design a Tic-tac-toe game that is played between two players on a n x n grid. You may assume the following rules: A move is guaranteed to be valid and is placed on an empty block. Once a winning condition is reached, no more moves is allowed. A player who succeeds in placing n of their marks in a horizontal, vertical, or diagonal row wins the game. Example: Given n = 3, assume that player 1 is "X" and player 2 is "O" in the board. TicTacToe toe = new TicTacToe(3); toe.move(0, 0, 1); -> Returns 0 (no one wins) |X| | | | | | | // Player 1 makes a move at (0, 0). | | | | toe.move(0, 2, 2); -> Returns 0 (no one wins) |X| |O| | | | | // Player 2 makes a move at (0, 2). | | | | toe.move(2, 2, 1); -> Returns 0 (no one wins) |X| |O| | | | | // Player 1 makes a move at (2, 2). | | |X| toe.move(1, 1, 2); -> Returns 0 (no one wins) |X| |O| | |O| | // Player 2 makes a move at (1, 1). | | |X| toe.move(2, 0, 1); -> Returns 0 (no one wins) |X| |O| | |O| | // Player 1 makes a move at (2, 0). |X| |X| toe.move(1, 0, 2); -> Returns 0 (no one wins) |X| |O| |O|O| | // Player 2 makes a move at (1, 0). |X| |X| toe.move(2, 1, 1); -> Returns 1 (player 1 wins) |X| |O| |O|O| | // Player 1 makes a move at (2, 1). |X|X|X| Follow up: Could you do better than O(n2) per move() operation? Hint: Could you trade extra space such that move() operation can be done in O(1)? You need two arrays: int rows[n], int cols[n], plus two variables: diagonal, anti_diagonal. """ class TicTacToe(object): def __init__(self, n): """ Initialize your data structure here. :type n: int """ self.n = n self.rsum = [0] * n self.csum = [0] * n self.dsum = [0, 0] def move(self, row, col, player): """ Player {player} makes a move at ({row}, {col}). @param row The row of the board. @param col The column of the board. @param player The player, can be either 1 or 2. @return The current winning condition, can be either: 0: No one wins. 1: Player 1 wins. 2: Player 2 wins. :type row: int :type col: int :type player: int :rtype: int """ diag0 = row == col diag1 = row + col == self.n - 1 if player == 1: num = 1 else: num = -1 self.rsum[row] += num if self.rsum[row] == self.n: return 1 elif self.rsum[row] == -self.n: return 2 self.csum[col] += num if self.csum[col] == self.n: return 1 elif self.csum[col] == -self.n: return 2 if diag0: self.dsum[0] += num if self.dsum[0] == self.n: return 1 elif self.dsum[0] == -self.n: return 2 if diag1: self.dsum[1] += num if self.dsum[1] == self.n: return 1 elif self.dsum[1] == -self.n: return 2 return 0 # Your TicTacToe object will be instantiated and called as such: # obj = TicTacToe(n) # param_1 = obj.move(row,col,player) a = TicTacToe(3) print(a.move(0,0,1)) print(a.move(0,2,2)) print(a.move(2,1,1)) print(a.move(1,1,2)) print(a.move(2,0,1)) print(a.move(1,0,2)) print(a.move(2,1,1))
#intitial Variable setup List_Base = [] Image_Scale = [] Image=[] def Input(): # Gets the users input values for the image, makes sure input is exactly 100 characters and only includes 1 and 0 User_Input = str(input("Enter values here: \n")) while any(c.isalpha() for c in User_Input) is True: print("\nERROR: Input can only contain 1's and 0's.\n") User_Input = str(input("Enter values here: \n")) while len(User_Input) != 100: print("\nERROR: Invalid input, must be exactly 100 digits.\n") User_Input = str(input("Enter values here: \n")) return User_Input def Creation(): # Creation of the base image(no scaling, no rotation) User_Input = Input() Symbol = input("Next select a symbol that will be used as the base of your image. (Image looks best if you use one of the following symbols!)(!@#$%^&*)\n") # selects symbol to create image with Scale = input("Would you like to scale the image? (Answer with a 'y' or 'n')\n") # Decides how large to scale the image #creation of list broken into chunks of 10 for rows in image while (len(User_Input) > 0): x = (User_Input)[0:(10)] #first 10 * scaling number digits each pass List_Base.append(x) User_Input = (User_Input[(10):]) #strips first 10 digits so it does not repeate entries and converts back to int # creation of the image while (len(List_Base) > 0): # replaces 1's and 0's with a space and the selected symbol x = List_Base.pop(0) x = str(x) x = x.replace("0"," ") x = x.replace("1", Symbol) Image.append(x) x = "" return Scale, Image, Symbol def Scaled_Image(): # functions to scale and rotate the image created Scale, Image, Symbol = Creation() Scale = str(Scale) if Scale.lower() == 'y': Scaling = int(input("How many times would you like to scale the Image? (Image will double)(Input a integer) \n")) Image_copy = Image.copy() while Scaling > 0: i = 20 while (len(Image_copy)> 0): # Scales image by replacing one sybol with two and doubling the spaces between them z = Image_copy.pop(0) # While loop does this for every line in the list to create the new image z = str(z) z = z.replace(Symbol, Symbol+Symbol) z = z.replace(" ", " ") Image_Scale.append(z) Image_Scale.append(z) z = "" i = i - 1 Image_copy = Image_Scale.copy() Image_Scale.clear() Scaling = Scaling - 1 Rotate = input("Would you like to rotate the image? (Answer with a 'y' or 'n')\n") if Rotate.lower() == 'y': # function to rotate the image created Transform_Degree = str(input("How much would you like to rotate the image? (possible rotations in degrees 90, 180, 270)\n")) if Transform_Degree == "90": print("\n-------------------------------------------------------------------------------------------------------\n\n") # aesthetic line for i in range(len(Image_copy)): for n in Image_copy: print(n[i], end =' ') print() if Transform_Degree == "180": print("\n-------------------------------------------------------------------------------------------------------\n\n") # aesthetic line for i in Image_copy[::-1]: print(i) if Transform_Degree == "270": Image_copy.reverse() print("\n-------------------------------------------------------------------------------------------------------\n\n") # aesthetic line for i in range(len(Image_copy)): for n in Image_copy: print(n[i], end =' ') print() if Scale.lower() == 'y' and Rotate.lower() == 'n': print("\n-------------------------------------------------------------------------------------------------------\n \n \n \n") # aesthetic line(all lines like this are the same) print(*Image_copy, sep = "\n") if Scale.lower() == 'n': Rotate = input("Would you like to rotate the image? (Answer with a 'y' or 'n')\n") if Rotate.lower() == 'y': Transform_Degree = str(input("How much would you like to rotate the image? (possible rotations in degrees 90, 180, 270)\n")) if Transform_Degree == "90": # takes lines and prints them so that the top is to the left print("\n-------------------------------------------------------------------------------------------------------\n\n") for i in range(len(Image)): for n in Image: print(n[i], end =' ') print() if Transform_Degree == "180": # Turns image upside down print("\n-------------------------------------------------------------------------------------------------------\n\n") for i in Image[::-1]: print(i) if Transform_Degree == "270": # turns image so the top is to the right Image.reverse() print("\n-------------------------------------------------------------------------------------------------------\n\n") for i in range(len(Image)): for n in Image: print(n[i], end =' ') print() if Rotate.lower() == 'n': print("\n-------------------------------------------------------------------------------------------------------\n\n") print(*Image, sep = "\n") def Intilization(): #Flavor text to start the program print("This program is designed to create an image from the input of 100 booleon characters (1's and 0's)!!!!") print("Lets get started by inputing our values! Beware!! You must include exactly 100 characters that are either a '1' or a '0'.\n") def Main(): #function to drive the program Intilization() Scaled_Image() if __name__ == "__main__": # Starts program Main()
def detail_samtools(Regions, Read_depth): # create a detailed list with all depth values from the same region in a sub list. From samtools depth calculations # samtools generates a depth file with: chr, position and coverage depth value # Regeions comes from the bed file with chr, start, stop, region name detailed =[] list_temp=[] previous_chr = Read_depth[0][0] Region_row = 0 count=0 index = 0 size_list = len(Read_depth) for line in Read_depth: Region_row = Regions[index] if str(line[0]) == str(previous_chr) and (int(line[1])) <= int(Region_row[2]): list_temp.append(line[2]) else: previous_chr=line[0] detailed.append(list_temp) list_temp=[] list_temp.append(line[2]) index+=1 count+=1 if count == size_list: detailed.append(list_temp) return detailed
"""Demonstrate docstrings and does nothing really.""" def myfunc(): """Simple function to demonstrate circleci.""" return 1 print(myfunc())
# 치즈 접시가 비어 있어요 cheeze = [] # 치즈 접시에 문자열 '치즈'가 무한으로 추가되고, 그때마다 '치즈 추가!'를 출력해요 while True: cheeze.append('치즈') print('치즈 추가!') # cheeze 속 치즈가 50개가 되면 추가를 멈추고 '아이~ 배불러!'를 출력해요 if len(cheeze) == 50: print('아이~ 배불러!') break
# -*- coding: utf-8 -*- """All tests for the project."""
target_prime = 10000 current_num = 2 current_denominator = current_num - 1 while True: if current_denominator == 1: # this is a prime number # print(current_num) target_prime = target_prime - 1 if target_prime == 0: print("Prime number is " + str(current_num)) break current_num = current_num + 1 current_denominator = current_num - 1 if current_num % current_denominator != 0: current_denominator = current_denominator - 1 continue # not divisible, keep going if current_num % current_denominator == 0: # divisible, this is definitely not prime current_num = current_num + 1 current_denominator = current_num - 1 continue
s = open('day01.txt', 'r').read() left = 0 right = 0 for i in range(len(s)): if s[i] == '(': left += 1 else: right += 1 if left - right == -1: print(i) break
N = int(input()) # input() gets the whole line, int() converts from string to int dictionary = {} # dictionaries appear to work the same as objects in javascript for i in range(0, N): inputArray = input().split() # okay this line is cool, converts indices 1->end of inputArray to floats, puts them in a list # getting the sum of everything from the index 1 to the end. (ignoring the name in the list for the sum value) marks = list(map(float, inputArray[1:])) # sum(marks) adds up everything in marks dictionary[inputArray[0]] = sum(marks)/float(len(marks)) # print(output) formatted to 2 decimal places print("%.2f" % dictionary[input()])
# Bo Pace, Oct 2016 # Quicksort # Quicksort has a similar divide-and-conquer strategy to that # of merge sort, but has a space advantage of doing all of the # sorting in place. The worst case complexity is worse than # merge sort, however. Quicksort has a best and average case # complexity of O(nlogn), with a worst case complexity of # O(n^2). However, the space complexity is only O(logn), # whereas merge sort has a space complexity of O(n). def quicksort(arr, first=0, last=None): if last == None: last = len(arr) - 1 if first < last: split_index = partition(arr, first, last) quicksort(arr, first, split_index-1) quicksort(arr, split_index+1, last) return arr def partition(arr, first, last): pivot_val = arr[first] left_mark = first + 1 right_mark = last done = False while not done: while left_mark <= right_mark and arr[left_mark] <= pivot_val: left_mark += 1 while arr[right_mark] >= pivot_val and right_mark >= left_mark: right_mark -= 1 if right_mark < left_mark: done = True else: arr[left_mark], arr[right_mark] = arr[right_mark], arr[left_mark] arr[first], arr[right_mark] = arr[right_mark], arr[first] return right_mark
# This file is part of the pylint-ignore project # https://github.com/mbarkhau/pylint-ignore # # Copyright (c) 2020 Manuel Barkhau ([email protected]) - MIT License # SPDX-License-Identifier: MIT __version__ = "2020.1017"
class Solution: def XXX(self, nums: List[int]) -> List[List[int]]: def dfs(nums,index,ans,cur=[]): ans.append(cur) for i in range(index,len(nums)):# 剪枝后树的大小有限 dfs(nums,i+1,ans,cur+[nums[i]]) ans = [] dfs(nums,0,ans) return ans
#Kunal Gautam #Codewars : @Kunalpod #Problem name: CamelCase Method #Problem level: 6 kyu def camel_case(string): return ''.join([x[0].upper()+x[1:] for x in string.lower().split()])
RUN_TEST = False TEST_SOLUTION = 26 TEST_INPUT_FILE = 'test_input_day_11.txt' INPUT_FILE = 'input_day_11.txt' MIN_NUM_SEATS_TO_MAKE_EMPTY = 5 ARGS = [MIN_NUM_SEATS_TO_MAKE_EMPTY] def main_part2(input_file, min_num_seats_to_make_empty): with open(input_file) as file: seat_occupations = list(map(lambda line: line.rstrip(), file.readlines())) prev_seat_occupations = None cur_seat_occupations = list(map(list, seat_occupations)) iteration_num = 0 while cur_seat_occupations != prev_seat_occupations: print(iteration_num) prev_seat_occupations = cur_seat_occupations cur_seat_occupations = evolve(cur_seat_occupations, min_num_seats_to_make_empty) iteration_num += 1 print() solution = count_total_occupied_seats(cur_seat_occupations) return solution def evolve(seat_occupations, min_num_seats_to_make_empty): dim = len(seat_occupations) # side length of occupations square evolved_seat_occupations = [] for row_index, seat_row in enumerate(seat_occupations): evolved_seat_row = [] for pos_index, position in enumerate(seat_row): num_vis_occ_seats = count_visible_occupied_seats(row_index, pos_index, seat_occupations, dim) if position == 'L' and num_vis_occ_seats == 0: new_position = '#' elif position == '#' and num_vis_occ_seats >= min_num_seats_to_make_empty: new_position = 'L' else: new_position = position evolved_seat_row.append(new_position) evolved_seat_occupations.append(evolved_seat_row) return evolved_seat_occupations def count_visible_occupied_seats(row_index, pos_index, seat_occupations, dim): horiz_count = count_horizontally(row_index, pos_index, seat_occupations, dim) vert_count = count_vertically(row_index, pos_index, seat_occupations, dim) diag_count1 = count_topleft_bottomright(row_index, pos_index, seat_occupations, dim) diag_count2 = count_bottomleft_topright(row_index, pos_index, seat_occupations, dim) return horiz_count + vert_count + diag_count1 + diag_count2 def count_horizontally(row_index, pos_index, seat_occupations, dim): seats = seat_occupations[row_index] return count_in_seats(pos_index, seats, dim) def count_vertically(row_index, pos_index, seat_occupations, dim): seats = [seat_occupations[i][pos_index] for i in range(dim)] return count_in_seats(row_index, seats, dim) def count_topleft_bottomright(row_index, pos_index, seat_occupations, dim): seats = get_diagonal(row_index, pos_index, seat_occupations, dim, '\\') relevant_ind = pos_index if pos_index <= row_index else row_index return count_in_seats(relevant_ind, seats, dim) def count_bottomleft_topright(row_index, pos_index, seat_occupations, dim): seats = get_diagonal(row_index, pos_index, seat_occupations, dim, '/') if row_index + pos_index <= dim - 1: # top half = closer to top than to bottom relevant_ind = pos_index # dist to left else: relevant_ind = (dim - 1) - row_index # dist to bottom return count_in_seats(relevant_ind, seats, dim) def count_in_seats(index, seats, dim): result = 0 # before current index cur_index = index - 1 while cur_index >= 0: if seats[cur_index] == 'L': break elif seats[cur_index] == '#': result += 1 break cur_index -= 1 # to right cur_index = index + 1 while cur_index < len(seats): if seats[cur_index] == 'L': break elif seats[cur_index] == '#': result += 1 break cur_index += 1 return result def get_diagonal(row_index, pos_index, seat_occupations, dim, mode): if mode == '/': # bottom left to top right dist_to_bottom = (dim - 1) - row_index # dist of square to bottom dist_to_left = pos_index # dist of square to left if dist_to_left <= dist_to_bottom: # row_index = how far down we are; dist_to_left = steps to go bottomleft_pos = (row_index + dist_to_left, 0) else: # row_index = how far down we are; dist_to_left = steps to go bottomleft_pos = (dim - 1, pos_index - dist_to_bottom) # range_bound = min(row_index, (dim - 1) - pos_index) + 1 # = min(dist_to_top, dist_to_right) range_bound = min(bottomleft_pos[0], (dim - 1) - bottomleft_pos[1]) + 1 diag = [seat_occupations[bottomleft_pos[0] - i][bottomleft_pos[1] + i] for i in range(range_bound)] else: # '\' # top left to bottom right row_pos_diff = row_index - pos_index topleft_pos = (row_pos_diff, 0) if row_pos_diff >= 0 else (0, -row_pos_diff) diag = [seat_occupations[topleft_pos[0] + i][topleft_pos[1] + i] for i in range(dim - max(topleft_pos))] return diag def count_total_occupied_seats(seat_occupations): return sum(map(lambda seat_row: seat_row.count('#'), seat_occupations)) def print_seat_occupations(seat_occupations): output = '\n'.join(map(''.join, seat_occupations)) print(output) if __name__ == '__main__': if RUN_TEST: solution = main_part2(TEST_INPUT_FILE, *ARGS) print(solution) assert (TEST_SOLUTION == solution) else: solution = main_part2(INPUT_FILE, *ARGS) print(solution)
# Problem 1: What will be the output of the following code x = 1 def f(): return x print (x) # Ans-1 print (f()) # Ans-1 #Problem 2: What will be the output of the following program? x = 1 def f(): x = 2 return x print (x) # Ans-1 print (f()) # Ans-2 print (x) # Ans-1 #Problem 3: What will be the output of the following program? x = 1 def f(): #y = x # UnboundLocalError: local variable 'x' referenced before assignment x = 2 y=1 return x + y print (x) # Ans-1 print (f()) # Ans-3 print (x) # Ans-1 # What will be the output of the following program? x = 2 def f(a): x = a * a return x y = f(3) print (x, y) # 2, 9 #Functions can be called with keyword arguments. def difference(x, y): return x - y difference(5, 2) # There is another way of creating functions, using the lambda operator. cube = lambda x: x ** 3 print(cube(2)) # Write a function count_digits to find number of digits in the given number. #find_length = lambda dig: len(dig) def find_num_len(x): num_len = len(str(x)) return num_len print("Number length is: ",find_num_len(123567890))
# Code Listing - #12 """ Module palindrome - Returns whether an input string is palindrome or not """ # Note - this is the first version of palindrome, so called palindrome1.py def is_palindrome(in_string): """ Returns True whether in_string is palindrome, False otherwise """ # Case insensitive in_string = in_string.lower() # Check if string is same as in reverse # TODO: このスライスは覚える。 return in_string == in_string[-1::-1]
# https://leetcode.com/submissions/detail/433325047/?from=explore&item_id=3577 # 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 isBalanced(self, root: TreeNode) -> bool: def helper(node): if not node: return 0,True l_height,l_corr = helper(node.left) if not l_corr: return -1,False r_height,r_corr = helper(node.right) if not r_corr: return -1,False return (1 + max(l_height,r_height), abs(l_height - r_height) <= 1) return helper(root)[1] class Solution_faster(object): def isBalanced(self, root): def check(root): if not root: return 0 left = check(root.left) if left == -1: return -1 right = check(root.right) if right == -1: return -1 if abs(left - right) > 1: return -1 return max(left, right) + 1 return check(root) != -1
''' Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4. However, you can add any number of parenthesis at any position to change the priority of operations. You should find out how to add parenthesis to get the maximum result, and return the corresponding expression in string format. Your expression should NOT contain redundant parenthesis. Example: Input: [1000,100,10,2] Output: "1000/(100/10/2)" Explanation: 1000/(100/10/2) = 1000/((100/10)/2) = 200 However, the bold parenthesis in "1000/((100/10)/2)" are redundant, since they don't influence the operation priority. So you should return "1000/(100/10/2)". Other cases: 1000/(100/10)/2 = 50 1000/(100/(10/2)) = 50 1000/100/10/2 = 0.5 1000/100/(10/2) = 2 Note: The length of the input array is [1, 10]. Elements in the given array will be in range [2, 1000]. There is only one optimal division for each test case. ''' class Solution(object): def optimalDivision(self, nums): """ :type nums: List[int] :rtype: str """ if not nums: return '' if len(nums) == 1: return str(nums[0]) if len(nums) == 2: return str(nums[0]) + '/' + str(nums[1]) res = str(nums[0]) + '/(' for i in xrange(1, len(nums) - 1): res += str(nums[i]) + '/' res += str(nums[-1]) + ')' return res
class constants: # username, Type: String # this email id shouldn't have 2 factor authentication username = "<enter a valid email id>" # password, Type: String password = "<enter the appropriate password>" # to email addresses => Enter a valid to email address and this email id need not disable the 2 step verification, Type: String # to enter more than 1 email id append them spearated with a comma ex) ['[email protected]', '[email protected]',...] to_addresses = ['<--to email address-->'] # required age, Type: Int # change the age to 45 if required req_age = 18 # required slot number, Type: Int # change the slot to 2 if u r looking for the second slot req_slot = 1 # pin code, Type: Int # change the pincode to your area pincode or the interested one and if more than 1 then add comma to add the remaining. ex) [530040, 530020] pincode = [530040] # pin code api url, (Do not change this) pin_code_url = 'api/v2/appointment/sessions/public/findByPin' # number of days to check starting from today as 1, tomorrow as 2,..etc, Type: Int day_check_count = 3 # sleep time is the time interval between each api request made and this has to be carefully scrutinized based on: # sleep time for peak time, Type: Int sleep_peak_time = 5 # sleep time for non peak time, Type: Int sleep_non_peak_time = 30 # peak hour start time, Type: Int start_time = 14 # peak hour end time, Type: Int end_time = 18
# Time: O(n) # Space: O(1) # Given two integers n and k, # you need to construct a list which contains n different positive integers ranging # from 1 to n and obeys the following requirement: # Suppose this list is [a1, a2, a3, ... , an], # then the list [|a1 - a2|, |a2 - a3|, |a3 - a4|, ... , |an-1 - an|] has exactly k distinct integers. # # If there are multiple answers, print any of them. # # Example 1: # Input: n = 3, k = 1 # Output: [1, 2, 3] # Explanation: The [1, 2, 3] has three different positive integers ranging from 1 to 3, # and the [1, 1] has exactly 1 distinct integer: 1. # # Example 2: # Input: n = 3, k = 2 # Output: [1, 3, 2] # Explanation: The [1, 3, 2] has three different positive integers ranging from 1 to 3, # and the [2, 1] has exactly 2 distinct integers: 1 and 2. # # Note: # The n and k are in the range 1 <= k < n <= 10^4. class Solution(object): def constructArray(self, n, k): """ :type n: int :type k: int :rtype: List[int] """ result = [] left, right = 1, n while left <= right: if k % 2: result.append(left) left += 1 else: result.append(right) right -= 1 if k > 1: k -= 1 return result
class Solution: def countStudents(self, students: List[int], sandwiches: List[int]) -> int: sandwiches = deque(sandwiches) students = deque(students) while not (all(a!=sandwiches[0] for a in students)): if students[0] == sandwiches[0]: students.popleft() sandwiches.popleft() else: students.append(students.popleft()) return len(students)
class DictX(dict): def __getattr__(self, key): try: return self[key] except KeyError as k: raise AttributeError(k) def __setattr__(self, key, value): self[key] = value def __delattr__(self, key): try: del self[key] except KeyError as k: raise AttributeError(k) def __repr__(self): return '<DictX ' + dict.__repr__(self) + '>' def get_params(): return DictX({ 'MODE': 'normal', 'DATA_PATH': 'data/', 'CUT_RATE_SEC': 5, 'RANDOM_SEED': 42, 'OSU_TRACKS_DIR': 'osu_maps', 'ENUMERATE_FROM': 1, 'SAMPLE_RATE': 16000, # model params 'OUT_SHAPE': 5000, 'N_EPOCHS': 5, 'LEARNING_RATE': 0.0003, 'ITER_LOG': 50, 'BATCH_SIZE': 32, 'MODEL_PATH': 'tempo_model.pth', 'LOAD_MODEL': False })
class Model: def __init__(self, model, feature_names): self.model = model self.feature_names = feature_names self.ID = "" def get_ID(self): return self.ID def fit(self, X, y): self.model.fit(X, y) def predict(self, X): return self.model.predict(X) def score(self, X, y): return {0: (self.model.score(X, y), len(X))} def get_num_submodels(self): return [1]
#input={'names_raw':names_raw,'orders_raw':orders_raw,'phones_raw':phones_raw,'emails_raw':emails_raw,'start_index':0,'limit':500,'length':1251} start_index = int(float(input['start_index'])) limit = int(input['limit']) length = int(float(input['length'])) if (start_index+limit) >= length: end_index = length finished = True else: end_index = start_index+limit finished = False names = input['names_raw'].split('*')[start_index:end_index] orders = input['orders_raw'].split('*')[start_index:end_index] phones = input['phones_raw'].split('*')[start_index:end_index] emails = input['emails_raw'].split('*')[start_index:end_index] return{'end_index':end_index, 'names':names, 'orders':orders, 'phones':phones, 'emails':emails, 'finished':finished}
""" Utility functions for canary tests """ CANARY_TYPES = ["cpu_noise", "fio", "iperf"] def should_run(config): """ Checks if canary tests should run. """ if "canaries" in config["bootstrap"] and config["bootstrap"]["canaries"] == "none": return False if "canaries" in config["test_control"] and config["test_control"]["canaries"] == "none": return False return True class _BaseCanary: """ Base class for a canary test. """ def __init__(self, test_id, test_type, output_files, cmd): self.test_id = test_id self.test_type = test_type self.output_files = output_files self.cmd = cmd def as_dict(self): """ Generate the static YAML representation of the config for the canary. Ideally all Python code would use this class directly, but test_control.py currently does not, so we need to generate the dict format for backwards compatibility. """ raise ValueError( "to_json method must be implemented by the subclass: ", self.__class__.__name__ ) class CpuNoise(_BaseCanary): """ Class for cpu_noise canary test. """ def __init__(self, config): numactl_prefix = config["test_control"]["numactl_prefix_for_workload_client"] mongodb_hostname = config["mongodb_setup"]["meta"]["hostname"] mongodb_port = config["mongodb_setup"]["meta"]["port"] mongodb_sharded = config["mongodb_setup"]["meta"]["is_sharded"] mongodb_replica = config["mongodb_setup"]["meta"]["is_replset"] mongodb_shell_ssl_options = config["mongodb_setup"]["meta"]["shell_ssl_options"] self.config_filename = "workloads.yml" base_canary_config = { "test_id": "cpu_noise", "test_type": "cpu_noise", "output_files": ["workloads/workload_timestamps.csv"], "cmd": "cd workloads && " + numactl_prefix + " ./run_workloads.py -c ../" + self.config_filename, } super().__init__(**base_canary_config) self.workload_config = { "tests": {"default": ["cpu_noise"]}, "target": mongodb_hostname, "port": mongodb_port, "sharded": mongodb_sharded, "replica": mongodb_replica, "shell_ssl_options": mongodb_shell_ssl_options, } self.skip_validate = True def as_dict(self): return { "id": self.test_id, "type": self.test_type, "output_files": self.output_files, "cmd": self.cmd, "config_filename": self.config_filename, "workload_config": self.workload_config, "skip_validate": self.skip_validate, } class Fio(_BaseCanary): """ Class for fio canary test. """ def __init__(self, config): numactl_prefix = config["test_control"]["numactl_prefix_for_workload_client"] mongodb_hostname = config["mongodb_setup"]["meta"]["hostname"] base_canary_config = { "test_id": "fio", "test_type": "fio", "output_files": ["fio.json", "fio_results.tgz"], "cmd": numactl_prefix + " ./fio-test.sh " + mongodb_hostname, } super().__init__(**base_canary_config) self.config_filename = "fio.ini" self.skip_validate = True self.workload_config = config["test_control"]["common_fio_config"] def as_dict(self): return { "id": self.test_id, "type": self.test_type, "output_files": self.output_files, "cmd": self.cmd, "config_filename": self.config_filename, "skip_validate": self.skip_validate, "workload_config": self.workload_config, } class IPerf(_BaseCanary): """ Class for iperf canary test. """ def __init__(self, config): numactl_prefix = config["test_control"]["numactl_prefix_for_workload_client"] mongodb_hostname = config["mongodb_setup"]["meta"]["hostname"] base_canary_config = { "test_id": "iperf", "test_type": "iperf", "output_files": ["iperf.json"], "cmd": numactl_prefix + " ./iperf-test.sh " + mongodb_hostname, } super().__init__(**base_canary_config) self.skip_validate = True def as_dict(self): return { "id": self.test_id, "type": self.test_type, "output_files": self.output_files, "cmd": self.cmd, "skip_validate": self.skip_validate, } def get_canary(canary_type, config): """ Get the canary test for a given canary type. :return: an instance of a _BaseCanary subclass. """ if canary_type == "cpu_noise": return CpuNoise(config) if canary_type == "fio": return Fio(config) if canary_type == "iperf": return IPerf(config) return None def get_canaries(config): """ Get all the canaries that should run. :return: the list of canary tests as dict that should run. """ canaries = [] if should_run(config): for canary_type in CANARY_TYPES: canaries.append(get_canary(canary_type, config).as_dict()) return canaries
print(f'{"LISTA DE JOGOS DE PS4:":^38}') #O ^ serve para centralizar jogos = ('God of War', 80, 'Red Dead Redemption 2', 250, 'Dying Light', 150, 'Horizon Zera Dawn', 80, 'The Last of Us: Part 2', 280, "Marvel's Spider-Man", 130, 'Death Stranding', 146.50, 'Bloodborne', 80, 'Sekiro: Shadows Die Twice', 230) for game in range(0, len(jogos)): if game % 2 == 0: print(f'{jogos[game]:.<30}', end='') #O < serve para alinhar à esquerda. 30 é a quantidade de "espaços" else: print(f'R${jogos[game]:>7.2f}') #O > serve para alinhar à direita
''' def find( element, list): for i, j in enumerate( list): if( j == element): return i; return -1 data_path = "../data/data_uci.pgn" fd = open( data_path) ''' def find( element, list): for i, j in enumerate( list): if( j[0:2] == element): return i; return -1 data_path = "../data/data_uci.pgn" fd = open( data_path) ''' fd_white = open( "results/castle_white.fea", "w") fd_black = open( "results/castle_black.fea", "w") fd_castle = open( "results/castle.fea", "w") for row in fd: if row[0] != '\n' and row[0] != '[': moves = row.split( ' ') white_c = find( "e1g1", moves) black_c = find( "e8g8", moves) if( white_c == -1): white_c = find( "e1c1", moves) if( white_c == -1): w = 1 else: w = white_c / float( len(moves)) if( black_c == -1): black_c = find( "e8c8", moves) if( black_c == -1): b = 1 else: b = white_c / float( len(moves)) fd_white.write( str( w) + "\n") fd_black.write( str( b) + "\n") fd_castle.write( str( (w+b) * 0.5) + "\n") fd.close() fd_white.close() fd_castle.close() fd_black.close() ''' #Queen First Move fd_white = open( "results/queen_white.fea", "w") fd_black = open( "results/queen_black.fea", "w") fd_queen = open( "results/queen.fea", "w") for row in fd: if row[0] != '\n' and row[0] != '[': moves = row.split( ' ') white_c = find( "d1", moves) black_c = find( "d8", moves) #if( white_c == -1): # white_c = find( "e1c1", moves) if( white_c == -1): w = 1 else: w = white_c / float( len(moves)) #if( black_c == -1): # black_c = find( "e8c8", moves) if( black_c == -1): b = 1 else: b = white_c / float( len(moves)) fd_white.write( str( w) + "\n") fd_black.write( str( b) + "\n") fd_queen.write( str( (w+b) * 0.5) + "\n") fd.close() fd_white.close() fd_queen.close() fd_black.close()
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.306958, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.443787, '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.76799, '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.744131, '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.28857, '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.739029, '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.77173, '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.464485, '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': 8.91233, '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.334012, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0269753, '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.3055, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.199499, '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.639512, 'Execution Unit/Register Files/Runtime Dynamic': 0.226475, '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.822308, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 1.84225, '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.68962, '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.00124349, '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.00124349, '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.0010876, '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.000423501, '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.00286582, '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.00644039, '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.0117608, '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.191784, '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.399668, '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.651384, '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.26104, '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.0723851, 'L2/Runtime Dynamic': 0.013777, '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.64646, 'Load Store Unit/Data Cache/Runtime Dynamic': 2.60142, '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.175005, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.175005, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 7.47624, 'Load Store Unit/Runtime Dynamic': 3.63949, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.431533, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.863066, '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.153152, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.154232, '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.065541, '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.823265, 'Memory Management Unit/Runtime Dynamic': 0.219773, 'Memory Management Unit/Subthreshold Leakage': 0.0769113, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462, 'Peak Dynamic': 30.8147, '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.16529, '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.0520731, '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.365967, '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.58333, 'Renaming Unit/Subthreshold Leakage': 0.070483, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779, 'Runtime Dynamic': 12.407, '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.153474, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.323234, '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.889369, '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.319682, '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.515635, '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.260275, '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': 1.09559, '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.229269, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 5.80398, '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.168021, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0134089, '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.151959, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.099167, '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.31998, 'Execution Unit/Register Files/Runtime Dynamic': 0.112576, '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.358512, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.808434, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 2.74521, '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.000575747, '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.000575747, '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.000505076, '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.000197493, '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.00142454, '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.00308111, '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.00539152, '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.0953318, '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.06392, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.196904, '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.32379, '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.57673, 'Instruction Fetch Unit/Runtime Dynamic': 0.624498, '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.0344139, 'L2/Runtime Dynamic': 0.00634291, '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.95497, 'Load Store Unit/Data Cache/Runtime Dynamic': 1.30647, '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.0879289, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0879288, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 4.37019, 'Load Store Unit/Runtime Dynamic': 1.82803, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.216818, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.433635, '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.0769493, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0774625, '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.377032, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0322897, '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.665326, 'Memory Management Unit/Runtime Dynamic': 0.109752, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 23.0401, '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.441986, '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.019802, '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.154726, '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.616515, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 5.93035, '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.155088, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.324501, '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.89669, '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.318493, '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.513717, '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.259307, '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': 1.09152, '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.226788, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 5.81282, '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.169404, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.013359, '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.152259, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0987981, '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.321663, 'Execution Unit/Register Files/Runtime Dynamic': 0.112157, '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.359548, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.808066, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 2.74162, '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.000525531, '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.000525531, '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.000460386, '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.000179671, '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.00141924, '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.00293069, '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.00494412, '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.0949771, '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.04136, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.193978, '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.322585, '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.55307, 'Instruction Fetch Unit/Runtime Dynamic': 0.619415, '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.0324443, 'L2/Runtime Dynamic': 0.00559454, '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.9073, 'Load Store Unit/Data Cache/Runtime Dynamic': 1.28315, '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.0863866, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0863866, 'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961, 'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918, 'Load Store Unit/Peak Dynamic': 4.31523, 'Load Store Unit/Runtime Dynamic': 1.79557, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.213015, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.426029, '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.0755996, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0760829, '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.375629, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0318111, '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.661605, 'Memory Management Unit/Runtime Dynamic': 0.107894, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 22.9646, '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.445624, '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.0197927, '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.154067, '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.619484, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 5.88957, '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.123459, 'Execution Unit/Complex ALUs/Runtime Dynamic': 0.299658, '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.697425, '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.274346, '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.44251, '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.223364, '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.940221, '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.206848, 'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344, 'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222, 'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833, 'Execution Unit/Peak Dynamic': 5.43897, '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.131759, 'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0115073, '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.128185, 'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0851036, '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.259943, 'Execution Unit/Register Files/Runtime Dynamic': 0.0966109, '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.300921, 'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.680616, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478, 'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543, 'Execution Unit/Runtime Dynamic': 2.42248, '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.000743591, '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.000743591, '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.00065549, '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.000258029, '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.00122252, '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.00336519, '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.00684999, '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.0818123, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885, 'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682, 'Instruction Fetch Unit/Instruction Cache/Area': 3.14635, 'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931, 'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 5.20396, 'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.174669, '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.277871, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943, 'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104, 'Instruction Fetch Unit/Peak Dynamic': 7.67504, 'Instruction Fetch Unit/Runtime Dynamic': 0.544568, '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.0365819, 'L2/Runtime Dynamic': 0.00712371, '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.36629, 'Load Store Unit/Data Cache/Runtime Dynamic': 1.02666, '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.0688837, 'Load Store Unit/LoadQ/Runtime Dynamic': 0.0688837, '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.69157, 'Load Store Unit/Runtime Dynamic': 1.43526, 'Load Store Unit/StoreQ/Area': 0.322079, 'Load Store Unit/StoreQ/Gate Leakage': 0.00329971, 'Load Store Unit/StoreQ/Peak Dynamic': 0.169855, 'Load Store Unit/StoreQ/Runtime Dynamic': 0.339711, '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.0602822, 'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0608277, '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.323563, 'Memory Management Unit/Itlb/Runtime Dynamic': 0.0286458, '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.583226, 'Memory Management Unit/Runtime Dynamic': 0.0894735, 'Memory Management Unit/Subthreshold Leakage': 0.0766103, 'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333, 'Peak Dynamic': 21.0149, '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.346596, '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.0165957, '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.133413, '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.496604, 'Renaming Unit/Subthreshold Leakage': 0.0552466, 'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461, 'Runtime Dynamic': 4.99551, 'Subthreshold Leakage': 6.16288, 'Subthreshold Leakage with power gating': 2.55328}], 'DRAM': {'Area': 0, 'Gate Leakage': 0, 'Peak Dynamic': 0.4907122877281571, 'Runtime Dynamic': 0.4907122877281571, 'Subthreshold Leakage': 4.252, 'Subthreshold Leakage with power gating': 4.252}, 'L3': [{'Area': 61.9075, 'Gate Leakage': 0.0484137, 'Peak Dynamic': 0.0912997, 'Runtime Dynamic': 0.0508145, 'Subthreshold Leakage': 6.80085, 'Subthreshold Leakage with power gating': 3.32364}], 'Processor': {'Area': 191.908, 'Gate Leakage': 1.53485, 'Peak Dynamic': 97.9256, 'Peak Power': 131.038, 'Runtime Dynamic': 29.2733, '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': 97.8343, 'Total Cores/Runtime Dynamic': 29.2225, '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.0912997, 'Total L3s/Runtime Dynamic': 0.0508145, 'Total L3s/Subthreshold Leakage': 6.80085, 'Total L3s/Subthreshold Leakage with power gating': 3.32364, 'Total Leakage': 33.1122, 'Total NoCs/Area': 1.33155, 'Total NoCs/Gate Leakage': 0.00662954, 'Total NoCs/Peak Dynamic': 0.0, 'Total NoCs/Runtime Dynamic': 0.0, 'Total NoCs/Subthreshold Leakage': 0.0691322, 'Total NoCs/Subthreshold Leakage with power gating': 0.0259246}}
# -*- coding: utf-8 -*- """ Created on Tue Oct 2 13:17:03 2018 @author: michaelek """ ##################################### ### Misc parameters for the various functions hydro_server = 'edwprod01' hydro_database = 'hydro' crc_server = 'edwdev01' crc_database = 'ConsentsReporting' allo_table = 'reporting.CrcAlloSiteSumm' site_table = 'ExternalSite' ts_summ_table = 'TSDataNumericDailySumm' ts_table = 'TSDataNumericDaily' lf_table = 'reporting.TSCrcBlockRestr' dataset_dict = {9: 'Surface Water', 12: 'Groundwater'} #sd_dict = {7: 'sd1_7', 30: 'sd1_30', 150: 'sd1_150'} status_codes = ['Terminated - Replaced', 'Issued - Active', 'Terminated - Surrendered', 'Terminated - Cancelled', 'Terminated - Expired', 'Terminated - Lapsed', 'Issued - s124 Continuance', 'Issued - Inactive'] #use_type_dict = {'Aquaculture': 'irrigation', 'Dairy Shed (Washdown/Cooling)': 'stockwater', 'Intensive Farming - Dairy': 'irrigation', 'Intensive Farming - Other (Washdown/Stockwater/Cooling)': 'stockwater', 'Intensive Farming - Poultry': 'irrigation', 'Irrigation - Arable (Cropping)': 'irrigation', 'Irrigation - Industrial': 'irrigation', 'Irrigation - Mixed': 'irrigation', 'Irrigation - Pasture': 'irrigation', 'Irrigation Scheme': 'irrigation' , 'Viticulture': 'irrigation', 'Community Water Supply': 'water_supply', 'Domestic Use': 'water_supply', 'Construction': 'industrial', 'Construction - Dewatering': 'industrial', 'Cooling Water (non HVAC)': 'industrial', 'Dewatering': 'industrial', 'Gravel Extraction/Processing': 'industrial', 'HVAC': 'industrial', 'Industrial Use - Concrete Plant': 'industrial', 'Industrial Use - Food Products': 'industrial', 'Industrial Use - Other': 'industrial', 'Industrial Use - Water Bottling': 'industrial', 'Mining': 'industrial', 'Firefighting ': 'municipal', 'Firefighting': 'municipal', 'Flood Control': 'municipal', 'Landfills': 'municipal', 'Stormwater': 'municipal', 'Waste Water': 'municipal', 'Stockwater': 'stockwater', 'Snow Making': 'industrial', 'Augment Flow/Wetland': 'other', 'Fisheries/Wildlife Management': 'other', 'Other': 'other', 'Recreation/Sport': 'other', 'Research (incl testing)': 'other', 'Power Generation': 'hydroelectric', 'Drainage': 'municipal', 'Frost Protection': 'municipal'} #restr_type_dict = {'max rate': 'max_rate_crc', 'daily volume': 'daily_vol', 'annual volume': 'feav'} allo_type_dict = {'D': 'AllocatedRate', 'W': 'AllocatedRate', 'M': 'AllocatedAnnualVolume', 'A-JUN': 'AllocatedAnnualVolume', 'A': 'AllocatedAnnualVolume'} freq_codes = ['D', 'W', 'M', 'A-JUN', 'A'] dataset_types = ['Allo', 'RestrAllo', 'MeteredAllo', 'MeteredRestrAllo', 'Usage'] pk = ['RecordNumber', 'AllocationBlock', 'Wap', 'Date'] allo_cols = ['RecordNumber', 'HydroFeature', 'AllocationBlock', 'ExtSiteID', 'FromDate', 'ToDate', 'FromMonth', 'ToMonth', 'AllocatedRate', 'AllocatedAnnualVolume', 'WaterUse', 'IrrigationArea', 'ConsentStatus'] site_cols = ['ExtSiteID', 'ExtSiteName', 'NZTMX', 'NZTMY', 'CatchmentName', 'CatchmentNumber', 'CatchmentGroupName', 'CatchmentGroupNumber', 'SwazName', 'SwazGroupName', 'SwazSubRegionalName', 'GwazName', 'CwmsName'] #temp_datasets = ['allo_ts', 'total_allo_ts', 'restr_allo_ts', 'lf_restr', 'usage_crc_ts', 'usage_ts', 'usage_crc_ts', 'metered_allo_ts', 'metered_restr_allo_ts'] #datasets = {'allo': ['total_allo', 'sw_allo', 'gw_allo'],
"""Internal utilities (not exposed to the API).""" def pop(obj, *args, **kwargs): """Safe pop for list or dict. Parameters ---------- obj : list or dict Input collection. elem : default=-1 fot lists, mandatory for dicts Element to pop. default : optional Default value. Raise exception if elem does not exist and default not provided. Returns ------- value : Popped value """ # Parse arguments args = list(args) kwargs = dict(kwargs) elem = None elem_known = False default = None default_known = False if len(args) > 0: elem = args.pop(0) elem_known = True if len(args) > 0: default = args.pop(0) default_known = True if len(args) > 0: raise ValueError('Maximum two positional arguments. Got {}' .format(len(args)+2)) if 'elem' in kwargs.keys(): if elem_known: raise ValueError('Arg `elem` cannot be passed as both a ' 'positional and keyword.') else: elem = kwargs.pop('elem') elem_known = True if 'default' in kwargs.keys(): if default_known: raise ValueError('Arg `default` cannot be passed as both a ' 'positional and keyword.') else: default = kwargs.pop('default') default_known = True # --- LIST --- if isinstance(obj, list): if not elem_known: elem = -1 if default_known: try: value = obj.pop(elem) except IndexError: value = default else: value = obj.pop(elem) # --- DICT --- elif isinstance(obj, dict): if not elem_known: raise ValueError('Arg `elem` is mandatory for type dict.') if default_known: value = obj.pop(elem, default) else: value = obj.pop(elem) # --- OTHER --- else: raise TypeError('Input object should be a list or dict.') return value def _apply_nested(structure, fn): """Recursively apply a function to the elements of a list/tuple/dict.""" if isinstance(structure, list): return list(_apply_nested(elem, fn) for elem in structure) elif isinstance(structure, tuple): return tuple(_apply_nested(elem, fn) for elem in structure) elif isinstance(structure, dict): return dict([(k, _apply_nested(v, fn)) for k, v in structure.items()]) else: return fn(structure)
numbers = [1,3,5,4,6,2,8,9,7] prime_numbers = [] non_prime_numbers = [] i = 0 while i < len(numbers): if numbers[i] % 2 == 0: prime_numbers.append(numbers[i]) else: non_prime_numbers.append(numbers[i]) i += 1 print(f'Obshii spisok {numbers}') print(f'4etnye 4islami: {prime_numbers}') print(f'Ne4etnye 4isla: {non_prime_numbers}')
# # PySNMP MIB module TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:27:18 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ConstraintsUnion, ValueRangeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ConstraintsUnion", "ValueRangeConstraint", "ConstraintsIntersection", "SingleValueConstraint") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") iso, IpAddress, Unsigned32, TimeTicks, ModuleIdentity, Bits, MibScalar, MibTable, MibTableRow, MibTableColumn, Gauge32, MibIdentifier, NotificationType, ObjectIdentity, Integer32, Counter64, Counter32 = mibBuilder.importSymbols("SNMPv2-SMI", "iso", "IpAddress", "Unsigned32", "TimeTicks", "ModuleIdentity", "Bits", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Gauge32", "MibIdentifier", "NotificationType", "ObjectIdentity", "Integer32", "Counter64", "Counter32") TextualConvention, DisplayString, MacAddress = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "MacAddress") TrpzApNum, TrpzRadioRateEx, TrpzApRadioIndex, TrpzChannelNum, TrpzRssi = mibBuilder.importSymbols("TRAPEZE-NETWORKS-AP-TC", "TrpzApNum", "TrpzRadioRateEx", "TrpzApRadioIndex", "TrpzChannelNum", "TrpzRssi") TrpzRFDetectNetworkingMode, TrpzRFDetectClassificationReason, TrpzRFDetectClassification, TrpzRFDetectDot11ModulationStandard = mibBuilder.importSymbols("TRAPEZE-NETWORKS-RF-DETECT-TC", "TrpzRFDetectNetworkingMode", "TrpzRFDetectClassificationReason", "TrpzRFDetectClassification", "TrpzRFDetectDot11ModulationStandard") trpzMibs, = mibBuilder.importSymbols("TRAPEZE-NETWORKS-ROOT-MIB", "trpzMibs") trpzInfoRFDetectMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 14525, 4, 9)) trpzInfoRFDetectMib.setRevisions(('2011-07-27 00:22', '2009-08-18 00:21', '2007-06-27 00:11', '2007-04-18 00:10', '2006-10-11 00:03',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: trpzInfoRFDetectMib.setRevisionsDescriptions(('v1.3.2: Revised for 7.7 release.', 'v1.3.1: Added one table: trpzInfoRFDetectClientTable to support detected Clients and RFID tags (for 7.7 release).', 'v1.2.0: Added one scalar: trpzInfoRFDetectCurrentXmtrTableSize (for 6.2 release)', 'v1.1.0: Added three new columnar objects: - trpzInfoRFDetectXmtrNetworkingMode, - trpzInfoRFDetectXmtrClassification, - trpzInfoRFDetectXmtrClassificationReason (for 6.2 release)', 'v1.0.3: Initial version, for 6.0 release',)) if mibBuilder.loadTexts: trpzInfoRFDetectMib.setLastUpdated('201107270022Z') if mibBuilder.loadTexts: trpzInfoRFDetectMib.setOrganization('Trapeze Networks') if mibBuilder.loadTexts: trpzInfoRFDetectMib.setContactInfo('Trapeze Networks Technical Support www.trapezenetworks.com US: 866.TRPZ.TAC International: 925.474.2400 [email protected]') if mibBuilder.loadTexts: trpzInfoRFDetectMib.setDescription("RF Detect MIB. Copyright 2007-2011 Trapeze Networks, Inc. All rights reserved. This Trapeze Networks SNMP Management Information Base Specification (Specification) embodies Trapeze Networks' confidential and proprietary intellectual property. Trapeze Networks retains all title and ownership in the Specification, including any revisions. This Specification is supplied 'AS IS' and Trapeze Networks makes no warranty, either express or implied, as to the use, operation, condition, or performance of the Specification.") trpzInfoRFDetectObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1)) trpzInfoRFDetectDataObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1)) trpzInfoRFDetectXmtrTable = MibTable((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1), ) if mibBuilder.loadTexts: trpzInfoRFDetectXmtrTable.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrTable.setDescription('Transmitter table. May contain tens of thousands of entries (different Transmitter-Listener-Channel combinations).') trpzInfoRFDetectXmtrEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1, 1), ).setIndexNames((0, "TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrTransmitterMacAddress"), (0, "TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrListenerMacAddress"), (0, "TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrChannelNum")) if mibBuilder.loadTexts: trpzInfoRFDetectXmtrEntry.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrEntry.setDescription('Transmitter-Listener-Channel combination.') trpzInfoRFDetectXmtrTransmitterMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1, 1, 1), MacAddress()) if mibBuilder.loadTexts: trpzInfoRFDetectXmtrTransmitterMacAddress.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrTransmitterMacAddress.setDescription('The MAC Address of this Transmitter.') trpzInfoRFDetectXmtrListenerMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1, 1, 2), MacAddress()) if mibBuilder.loadTexts: trpzInfoRFDetectXmtrListenerMacAddress.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrListenerMacAddress.setDescription('The MAC Address of this Listener.') trpzInfoRFDetectXmtrChannelNum = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1, 1, 3), TrpzChannelNum()) if mibBuilder.loadTexts: trpzInfoRFDetectXmtrChannelNum.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrChannelNum.setDescription('Channel Number this transmitter was using when this listener detected it.') trpzInfoRFDetectXmtrRssi = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1, 1, 4), TrpzRssi()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectXmtrRssi.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrRssi.setDescription('Received Signal Strength Indicator at this listener.') trpzInfoRFDetectXmtrSsid = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1, 1, 5), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectXmtrSsid.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrSsid.setDescription('The service/SSID name this transmitter was using. Zero-length string when unknown or not applicable.') trpzInfoRFDetectXmtrNetworkingMode = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1, 1, 6), TrpzRFDetectNetworkingMode()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectXmtrNetworkingMode.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrNetworkingMode.setDescription('The way this transmitter is doing wireless networking: ad-hoc mode networking or infrastructure mode networking.') trpzInfoRFDetectXmtrClassification = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1, 1, 7), TrpzRFDetectClassification()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectXmtrClassification.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrClassification.setDescription('The RF classification of this transmitter.') trpzInfoRFDetectXmtrClassificationReason = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 1, 1, 8), TrpzRFDetectClassificationReason()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectXmtrClassificationReason.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrClassificationReason.setDescription('The reason why this transmitter was classified by RF detection the way it is.') trpzInfoRFDetectClientTable = MibTable((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3), ) if mibBuilder.loadTexts: trpzInfoRFDetectClientTable.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientTable.setDescription('Client table, including RFID tags. Contains Client-Listener combinations.') trpzInfoRFDetectClientEntry = MibTableRow((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1), ).setIndexNames((0, "TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientMacAddress"), (0, "TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientListenerMacAddress")) if mibBuilder.loadTexts: trpzInfoRFDetectClientEntry.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientEntry.setDescription('Information about a particular Client, as it was detected by a particular listener (AP radio).') trpzInfoRFDetectClientMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 1), MacAddress()) if mibBuilder.loadTexts: trpzInfoRFDetectClientMacAddress.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientMacAddress.setDescription('The MAC Address of this Client.') trpzInfoRFDetectClientListenerMacAddress = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 2), MacAddress()) if mibBuilder.loadTexts: trpzInfoRFDetectClientListenerMacAddress.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientListenerMacAddress.setDescription('The MAC Address of this Listener (AP radio).') trpzInfoRFDetectClientConnectedBssid = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 3), MacAddress()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectClientConnectedBssid.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientConnectedBssid.setDescription('The service MAC address (a.k.a. BSSID) this Client was Connected to when last detected by this listener. If this information is not available, the value will be 0:0:0:0:0:0.') trpzInfoRFDetectClientApNum = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 4), TrpzApNum()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectClientApNum.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientApNum.setDescription('Number of the AP (listener) that detected this Client.') trpzInfoRFDetectClientApRadioIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 5), TrpzApRadioIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectClientApRadioIndex.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientApRadioIndex.setDescription('Number of the AP Radio (listener) that detected this Client.') trpzInfoRFDetectClientModulation = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 6), TrpzRFDetectDot11ModulationStandard()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectClientModulation.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientModulation.setDescription('802.11 Modulation standard this Client was using when last detected by this listener (a, b, g, n/a, n/g).') trpzInfoRFDetectClientChannelNum = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 7), TrpzChannelNum()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectClientChannelNum.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientChannelNum.setDescription('Channel Number this Client was using when last detected by this listener.') trpzInfoRFDetectClientRate = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 8), TrpzRadioRateEx()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectClientRate.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientRate.setDescription('Packet data rate this Client was using when last detected by this listener.') trpzInfoRFDetectClientRssi = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 9), TrpzRssi()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectClientRssi.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientRssi.setDescription('Received Signal Strength Indicator for this Client when last detected by this listener.') trpzInfoRFDetectClientClassification = MibTableColumn((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 3, 1, 10), TrpzRFDetectClassification()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectClientClassification.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientClassification.setDescription('The RF classification of this Client.') trpzInfoRFDetectCurrentXmtrTableSize = MibScalar((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 1, 2), Gauge32()).setMaxAccess("readonly") if mibBuilder.loadTexts: trpzInfoRFDetectCurrentXmtrTableSize.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectCurrentXmtrTableSize.setDescription('Current number of Transmitter-Listener-Channel combinations found and recorded by RF detection.') trpzInfoRFDetectConformance = MibIdentifier((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 2)) trpzInfoRFDetectCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 2, 1)) trpzInfoRFDetectGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 2, 2)) trpzInfoRFDetectCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 2, 1, 1)).setObjects(("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrGroup"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrClassificationGroup"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectCurrentXmtrTableSizeGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpzInfoRFDetectCompliance = trpzInfoRFDetectCompliance.setStatus('obsolete') if mibBuilder.loadTexts: trpzInfoRFDetectCompliance.setDescription('The compliance statement for devices that implement the RF Detect MIB. This compliance statement is for releases 6.0 to 7.6 of AC (wireless switch) software.') trpzInfoRFDetectComplianceRev2 = ModuleCompliance((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 2, 1, 2)).setObjects(("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrGroup"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrClassificationGroup"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectCurrentXmtrTableSizeGroup"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpzInfoRFDetectComplianceRev2 = trpzInfoRFDetectComplianceRev2.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectComplianceRev2.setDescription('The compliance statement for devices that implement the RF Detect MIB. This compliance statement is for releases 7.7 and greater of AC (wireless switch) software.') trpzInfoRFDetectXmtrGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 2, 2, 1)).setObjects(("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrRssi"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrSsid")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpzInfoRFDetectXmtrGroup = trpzInfoRFDetectXmtrGroup.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrGroup.setDescription('Mandatory group of objects implemented to provide RF Detect Transmitter info.') trpzInfoRFDetectXmtrClassificationGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 2, 2, 2)).setObjects(("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrNetworkingMode"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrClassification"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectXmtrClassificationReason")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpzInfoRFDetectXmtrClassificationGroup = trpzInfoRFDetectXmtrClassificationGroup.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectXmtrClassificationGroup.setDescription('Group of objects implemented to provide RF Detect Classification info. Introduced in 6.2 release.') trpzInfoRFDetectCurrentXmtrTableSizeGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 2, 2, 3)).setObjects(("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectCurrentXmtrTableSize")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpzInfoRFDetectCurrentXmtrTableSizeGroup = trpzInfoRFDetectCurrentXmtrTableSizeGroup.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectCurrentXmtrTableSizeGroup.setDescription('Group for one object that provides the current number of Transmitter-Listener-Channel combinations found and recorded by RF detection. Introduced in 6.2 release.') trpzInfoRFDetectClientGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 14525, 4, 9, 1, 2, 2, 4)).setObjects(("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientConnectedBssid"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientApNum"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientApRadioIndex"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientModulation"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientChannelNum"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientRate"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientRssi"), ("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", "trpzInfoRFDetectClientClassification")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): trpzInfoRFDetectClientGroup = trpzInfoRFDetectClientGroup.setStatus('current') if mibBuilder.loadTexts: trpzInfoRFDetectClientGroup.setDescription('Mandatory group of objects implemented to provide RF Detect Client info in releases 7.7 and greater.') mibBuilder.exportSymbols("TRAPEZE-NETWORKS-INFO-RF-DETECT-MIB", trpzInfoRFDetectClientConnectedBssid=trpzInfoRFDetectClientConnectedBssid, trpzInfoRFDetectXmtrTable=trpzInfoRFDetectXmtrTable, trpzInfoRFDetectXmtrClassification=trpzInfoRFDetectXmtrClassification, trpzInfoRFDetectClientClassification=trpzInfoRFDetectClientClassification, trpzInfoRFDetectClientRssi=trpzInfoRFDetectClientRssi, trpzInfoRFDetectMib=trpzInfoRFDetectMib, trpzInfoRFDetectCurrentXmtrTableSizeGroup=trpzInfoRFDetectCurrentXmtrTableSizeGroup, trpzInfoRFDetectXmtrListenerMacAddress=trpzInfoRFDetectXmtrListenerMacAddress, trpzInfoRFDetectXmtrClassificationGroup=trpzInfoRFDetectXmtrClassificationGroup, trpzInfoRFDetectClientListenerMacAddress=trpzInfoRFDetectClientListenerMacAddress, trpzInfoRFDetectXmtrChannelNum=trpzInfoRFDetectXmtrChannelNum, trpzInfoRFDetectXmtrTransmitterMacAddress=trpzInfoRFDetectXmtrTransmitterMacAddress, trpzInfoRFDetectClientRate=trpzInfoRFDetectClientRate, trpzInfoRFDetectClientChannelNum=trpzInfoRFDetectClientChannelNum, trpzInfoRFDetectClientGroup=trpzInfoRFDetectClientGroup, trpzInfoRFDetectObjects=trpzInfoRFDetectObjects, trpzInfoRFDetectClientEntry=trpzInfoRFDetectClientEntry, trpzInfoRFDetectClientApNum=trpzInfoRFDetectClientApNum, trpzInfoRFDetectClientTable=trpzInfoRFDetectClientTable, trpzInfoRFDetectXmtrSsid=trpzInfoRFDetectXmtrSsid, trpzInfoRFDetectCurrentXmtrTableSize=trpzInfoRFDetectCurrentXmtrTableSize, trpzInfoRFDetectXmtrRssi=trpzInfoRFDetectXmtrRssi, trpzInfoRFDetectComplianceRev2=trpzInfoRFDetectComplianceRev2, PYSNMP_MODULE_ID=trpzInfoRFDetectMib, trpzInfoRFDetectXmtrClassificationReason=trpzInfoRFDetectXmtrClassificationReason, trpzInfoRFDetectCompliance=trpzInfoRFDetectCompliance, trpzInfoRFDetectCompliances=trpzInfoRFDetectCompliances, trpzInfoRFDetectXmtrEntry=trpzInfoRFDetectXmtrEntry, trpzInfoRFDetectConformance=trpzInfoRFDetectConformance, trpzInfoRFDetectClientApRadioIndex=trpzInfoRFDetectClientApRadioIndex, trpzInfoRFDetectGroups=trpzInfoRFDetectGroups, trpzInfoRFDetectXmtrNetworkingMode=trpzInfoRFDetectXmtrNetworkingMode, trpzInfoRFDetectClientMacAddress=trpzInfoRFDetectClientMacAddress, trpzInfoRFDetectClientModulation=trpzInfoRFDetectClientModulation, trpzInfoRFDetectDataObjects=trpzInfoRFDetectDataObjects, trpzInfoRFDetectXmtrGroup=trpzInfoRFDetectXmtrGroup)
# Created by MechAviv # Kinesis Introduction # Map ID :: 331001000 # Hideout :: HQ JAY = 1531001 sm.setNpcOverrideBoxChat(JAY) if sm.sendAskYesNo("You lost your gear? Ugh, dude! Don't trash my stuff! It takes time to hack those things together. Here, I have backups of your primary and secondary, but only the basic models. TRY to respect these, hmm?"): sm.giveItem(1353200) sm.giveItem(1262000)
class RealtimeException(Exception): pass class ParseFailureException(Exception): """Failure to parse a logical replication test_decoding message"""
users = [] class User(): def __init__(self, username, pin, balance=0): self.username = username self.pin = pin self.balance = balance def deposit(self, amount): self.balance += amount print(f"Deposited ${amount} into account {self.username}") self.print_balance() def deposit_with_input(self): self.deposit(get_amount()) def withdrawal(self, amount): self.balance -= amount print(f"Withdrew ${amount} from account {self.username}") self.print_balance() def withdrawal_with_input(self): self.withdrawal(get_amount()) def request_balance(self): return self.balance def print_balance(self): print(f"Balance for {self.username}: ${self.balance}") users.append(User("spudmix", "1234")) def check_user_exists(username): return username in [user.username for user in users] def get_user(username): return [user for user in users if user.username == username][0] def check_user_pin(user, pin): return user.pin == pin def try_username(max_tries): user_prompt = "Enter Username: " for i in range(max_tries): user_input = input(user_prompt) if check_user_exists(user_input): return get_user(user_input) else: print("User not found") return False def try_pin(max_tries, user): pin_prompt = "Enter Password: " for i in range(max_tries): pin_input = input(pin_prompt) if check_user_pin(user, pin_input): return user else: print("Wrong password") return False def get_amount(): while True: amount_prompt = "Enter Amount: $" input_amount = validate_number(input(amount_prompt)) if input_amount: return input_amount else: print("Please enter a number") def validate_number(num): try: return float(num) except: return False def main_menu(current_user): options = { '1': current_user.deposit_with_input, '2': current_user.withdrawal_with_input, '3': current_user.print_balance, '4': False, 'x': False, } prompt = "Choose an option: \n"\ "1: Deposit\n"\ "2: Withdrawal\n"\ "3: Request Balance\n"\ "4: Exit\n" while True: input_string = input(prompt).strip() if input_string in options: if not options[input_string]: break else: options[input_string]() else: print("Please choose an option from the list") def login(): user = try_username(3) if user: current_user = try_pin(3, user) if current_user: print(f"Succesfully logged in as {current_user.username}") return current_user else: print(f"Password lockout") return False else: print(f"Username lockout") return False current_user = login() if current_user: main_menu(current_user)
def is_it_true(anything): if anything: print('yes, it is true') else: print('no, it is false')
# -*- coding: utf-8 -*- def split_data(filename): data = {} with open(filename, 'r') as openFile: f = openFile.readlines()[1:] for line in f: line_elements = line.rstrip('\r\n').split(',') key = line_elements[1] if key in data: data[key].append([line_elements[0],line_elements[2]]) else: data[key] = [[line_elements[0], line_elements[2]]] for key in data: with open('data/%s' % key, 'w+') as writeFile: for elem in data[key]: line = ','.join(elem) line += '\n' writeFile.write(line) def reshape_data(): data = {} # raw data with open('Tianchi_power.csv','r') as openFile: f = openFile.readlines()[1:] for line in f: line_elements = line.rstrip('\n\r').split(',') current_spot = int(line_elements[1]) key = '%s' % current_spot value = float(line_elements[2]) if key in data: data[key].append(value) else: data[key] = [value] max_values = [] with open('data/data','w+') as openFile: for i in range(1,1455): key = '%s' % i values = data[key] max_value = max(values) max_values.append((key, max_value)) line = '%s,' % key length = len(values) line += ','.join(['%s' % (x/max_value) for x in values[length-606:length]]) line += '\n' openFile.write(line) with open('data/max_value', 'w+') as openFile: for i in max_values: openFile.write('%s,%s\n' % (i[0],i[1])) reshape_data()
""" Created by Epic at 9/1/20 """ class HTTPException(Exception): """Exception that's thrown when an HTTP request operation fails.""" def __init__(self, request, data): self.request = request self.data = data super().__init__(data) class Forbidden(HTTPException): """Exception that's thrown for when status code 403 occurs. Subclass of :exc:`HTTPException` """ pass class NotFound(HTTPException): """Exception that's thrown when status code 404 occurs. Subclass of :exc:`HTTPException` """ def __init__(self, request): self.request = request Exception.__init__(self, "The selected resource was not found") class Unauthorized(HTTPException): """Exception that's thrown when status code 401 occurs. Subclass of :exc:`HTTPException` """ def __init__(self, request): self.request = request Exception.__init__(self, "You are not authorized to view this resource") class LoginException(Exception): """Exception that's thrown when an issue occurs during login attempts.""" pass class InvalidToken(LoginException): """Exception that's thrown when an attempt to login with invalid token is made.""" def __init__(self): super().__init__("Invalid token provided.") class ConnectionsExceeded(LoginException): """Exception that's thrown when all gateway connections are exhausted.""" def __init__(self): super().__init__("You have exceeded your gateway connection limits") class GatewayException(Exception): """Exception that's thrown whenever a gateway error occurs.""" pass class GatewayClosed(GatewayException): """Exception that's thrown when the gateway is used while in a closed state.""" def __init__(self): super().__init__("You can't do this as the gateway is closed.") class GatewayUnavailable(GatewayException): """Exception that's thrown when the gateway is unreachable.""" def __init__(self): super().__init__("Can't reach the Discord gateway. Have you tried checking your internet?")
# -*- coding:utf-8 -*- sinhala_rashi=["මේෂ","වෘෂභ","මිථුන","කටක","සිංහ","කන්‍යා","තුලා","වෘශ්චික","ධනු","මකර","කුම්භ","මීන"] sinhala_rashis_short=[ "මේ","වෘෂ","මිථු", "කට","සිං","කං", "තුලා","වෘශ්","ධනු", "මක","කුම්","මීන"] sinhala_planets_short={ "Sun":"ර", "Moon":"ච", "Moon_Node":"රා", "Moon_S_Node":"කේ", "Mercury":"බු", "Venus":"ශු", "Mars":"කු", "Jupiter":"ගු", "Saturn":"ශ", "Uranus":"යු", "Neptune":"නැ", "Pluto":"ප්", "I":"ල", "X":"10" } sinhala_planets={ "Sun":"රවි", "Moon":"චන්ද්‍ර", "Moon_Node":"රාහු", "Moon_S_Node":"කේතු", "Mercury":"බුධ", "Venus":"ශුක්‍ර", "Mars":"කුජ", "Jupiter":"ගුරු", "Saturn":"ශනි", "Uranus":"යුරේනස්", "Neptune":"නැප්චූන්", "Pluto":"ප්ලුටෝ", "I":"ලග්න", "X":"10" } #sinhala_nakshatra=[ #"asvidxa(kee)","beranxa(sxu)", #"kaetxi(ra)","rehenxa(ca)","muvasirasa(ku)","adxa(raa)","punaavasa(gu)","pusha(sxa)","aslisa(bu)","maa(kee)","puvapal(sxu)", #"utxrapal(ra)","hatxa(ca)","sitxa(ku)","saa(raa)","visaa(gu)","anura(sxa)","dxeta(bu)","mula(kee)","puvasala(sxu)", #"utxurusala(ra)","suvana(ca)","dxenata(ku)","siyaavasa(raa)","puvaputupa(gu)","utxraputupa(sxa)","reevatxii(bu)"] sinhala_nakshatra=[ "අස්විද","බෙරණ", "කැති","රෙහෙණ","මුවසිරස","අද","පුනාවස","පුෂ","අස්ලිස","මා","පුවපල්", "උත්‍රපල්","හත","සිත","සා","විසා","අනුර","දෙට","මුල","පුවසල", "උතුරුසල","සුවන","දෙනට","සියාවස","පුවපුටුප","උත්‍රපුටුප","රේවතී"] sinhala_thithi=['පුර පෑළවිය','පුර දියවක','පුර තියවක','පුර ජාලවක','පුර විසේනිය','පුර සැටවක','පුර සතවක','පුර අටවක','පුර නවවක','පුර දසවක','පුර එකොළොස්වක','පුර දොළොස්වක','පුර තෙළෙස්වක','පුර තුදුස්වක','පුර පසළොස්වක','අව පෑළවිය','අව දියවක','අව තියවක','අව ජාලවක','අව විසේනිය','අව සැටවක','අව සතවක','අව අටවක','අව නවවක','අව දසවක','අව එකොළොස්වක','අව දොළොස්වක','අව තෙළෙස්වක','අව තුදුස්වක','අමාවක'] dasha_prama=[7,20,6,10,7,18,16,19,17] dasha_prama_acc=[sum(dasha_prama[:i]) for i in range(len(dasha_prama))] nakshatra_lords=['Moon_S_Node','Venus','Sun','Moon','Mars','Moon_Node','Jupiter','Saturn','Mercury']*3
# Duolingo username and password USERNAME = 'username' PASSWORD = 'password' # Locations # Production # DB_FILE = r"db/personal.db" # LOG_DIR = 'path to logging directory' # WEB_PAGE = 'path to destination web page' # TEMPLATE_PAGE = 'path to template for web page' # Development & Test DB_FILE = r"db/personal.db" LOG_DIR = './example/logs/' WEB_PAGE = './example/duo.html' TEMPLATE_PAGE = './templates/duo_template.html'
print("Question 1:") ''' Use for, .split(), and if to create a Statement that will print out words that start with 's': st = 'Print only the words that start with s in this sentence' ''' st = 'Print only the words that start with s in this sentence' list_worlds = st.split(' ') for word in list_worlds: if word[0] == 's': print(word) print('\n') print("Question 2:") ''' Use range() to print all the even numbers from 0 to 10. ''' for num in range(0, 11): if num%2 == 0: print(num) listOfNums = list(range(0,11,2)) print(listOfNums) print('\n') print("Question 3:") ''' Use a List Comprehension to create a list of all numbers between 1 and 50 that are divisible by 3. ''' my_list = [ num for num in range(1, 50) if num%3 == 0 ] print(my_list) print('\n') print('Question 4:') ''' Go through the string below and if the length of a word is even print "even!" st = 'Print every word in this sentence that has an even number of letters' ''' st = 'Print every word in this sentence that has an even number of letters' words = st.split(' ') for word in words: if len(word) % 2 == 0 : print(word + 'is even!') print("Another Approch") myList = [word for word in st.split(' ') if len(word) % 2 == 0] print(myList) print('\n') print('Question 5:') ''' Write a program that prints the integers from 1 to 100. But for multiples of three print "Fizz" instead of the number, and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". ''' nums = range(1, 101) for num in nums: if num % 3 == 0 and num % 5 == 0 : print('FizzBuzz') elif num % 3 == 0: print('Fizz') elif num % 5 == 0: print('Buzz') else: print(num) print('\n') print('Question 6:') ''' Use List Comprehension to create a list of the first letters of every word in the string below: st = 'Create a list of the first letters of every word in this string' ''' st = 'Create a list of the first letters of every word in this string' my_list = [ letter[0] for letter in st.split(' ')] print(my_list)
print('Digite seu nome:') nome = input() print('Digite sua idade:') idade = int(input()) podeVotar = idade>=16 print(nome,'tem',idade,'anos:',podeVotar)
# _*_ coding: utf-8 _*_ class NullURLError(Exception): '''空URL异常''' pass
OK = '+OK\r\n' def reply(v): ''' formats the value as a redis reply ''' return '$%s\r\n%s\r\n' % (len(v), v)
lost_fights = int(input()) helmet_price = float(input()) sword_price = float(input()) shield_price = float(input()) armor_price = float(input()) shield_repair_count = 0 total_cost = 0 for i in range(1, lost_fights+1): if i % 2 == 0: total_cost += helmet_price if i % 3 == 0: total_cost += sword_price if i % 2 == 0 and i % 3 == 0: total_cost += shield_price shield_repair_count += 1 if shield_repair_count == 2: total_cost += armor_price shield_repair_count = 0 print(f'Gladiator expenses: {total_cost:.2f} aureus')
# -*- coding: utf-8 -*- def get_version_info(): """Provide the package version""" VERSION = '0.0.2' return VERSION __version__ = get_version_info()
def end_other(a, b): a = a.lower() b = b.lower() if a[-(len(b)):] == b or a == b[-(len(a)):]: return True return False
""" This module contains the result sentences and intents for the German version of the Assistant information app. """ # Result sentences RESULT_ASSISTANT_APPS = "Ich habe {} apps: {}." RESULT_ASSISTANT_ID = "Meine ID ist {}." RESULT_ASSISTANT_INTENTS = "Ich kenne {} Befehle." RESULT_ASSISTANT_NAME = "Mein Name ist {}." RESULT_ASSISTANT_PLATFORM = "Ich laufe auf der {} platform." RESULT_HOSTNAME = "Mein Host-Name ist {}." RESULT_IP_ADDRESS = "Meine IP Adresse ist {}." RESULT_SNIPS_VERSION = "Ich laufe mit Snips version {}." AND = ", und " # TTS workarounds REPLACE_TTS_RASPI = "Raspberrie Pei" # Intents INTENT_ASSISTANT_APPS = 'Philipp:AssistantApps' INTENT_ASSISTANT_ID = 'Philipp:AssistantID' INTENT_ASSISTANT_INTENTS = 'Philipp:AssistantIntents' INTENT_ASSISTANT_NAME = 'Philipp:AssistantName' INTENT_ASSISTANT_PLATFORM = 'Philipp:AssistantPlatform' INTENT_HOSTNAME = 'Philipp:Hostname' INTENT_IP_ADDRESS = 'Philipp:IPAddress' INTENT_SNIPS_VERSION = 'Philipp:SnipsVersion'
class ParameterTypeError(Exception): """Exception raised for errors in the input parameter. Attributes: parameter -- input parameter which caused the error message -- explanation of the error """ def __init__(self, parameter, parameter_name, parameter_type, message="The parameter can only be of type {}!"): self.parameter = parameter self.message = message.replace("parameter", parameter_name).replace("{}", parameter_type) self.parameter_name = parameter_name super().__init__(self.message) def __str__(self): return f'{self.parameter} is of type {type(self.parameter).__name__}. -> {self.message}' class SetError(Exception): """Exception raised for errors in the type of the argument to the set method of any ConsoleWidget. Attributes: parameter -- input parameter which caused the error """ def __init__(self, parameter, message="The argument of the set method can only be of type dict!"): self.parameter = parameter self.message = message super().__init__(self.message) def __str__(self): return f'{self.parameter} is of type {type(self.parameter).__name__}. -> {self.message}' class ParseError(Exception): """Exception raised for errors in the type of the argument to the parse_text function. Attributes: text -- input text which caused the error """ def __init__(self, text, message="The argument of the parse_text function can only be of type str!"): self.text = text self.message = message super().__init__(self.message) def __str__(self): return f'{self.text} is of type {type(self.text).__name__}. -> {self.message}'
""" Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree is symmetric: 1 / \ 2 2 / \ / \ 3 4 4 3 But the following is not: 1 / \ 2 2 \ \ 3 3 """ # 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 isSymmetric(self, root): """ :type root: TreeNode :rtype: bool """ if root is None: return True if root.left is None and root.right is None: return True if root.left is not None and root.right is not None: return self._isSymmetric(root.left, root.right) return False def _isSymmetric(self, left, right): if left is None and right is None: return True if left is not None and right is not None: return (left.val == right.val and self._isSymmetric(left.left, right.right) and self._isSymmetric(left.right, right.left)) return False
#%% """ TQC+ 程式語言Python 701 串列數組轉換 請撰寫一程式,輸入數個整數並儲存至串列中, 以輸入-9999為結束點(串列中不包含-9999), 再將此串列轉換成數組,最後顯示該數組以及其長度(Length) 、最大值(Max)、最小值(Min)、總和(Sum)。 輸入說明 n個整數,直至-9999結束輸入 輸出說明 數組 數組的長度 數組中的最大值 數組中的最小值 數組內的整數總和 範例輸入 -4 0 37 19 26 -43 9 -9999 範例輸出 (-4, 0, 37, 19, 26, -43, 9) Length: 7 Max: 37 Min: -43 Sum: 44 """ ll=[] x=int(input()) while (x!=(-9999)): ll.append(x) x=int(input()) tt=tuple(ll) print(tt) print('Length:', len(tt)) print('Max:', max(tt)) print('Min:', min(tt)) print('Sum:', sum(tt)) #%% """ TQC+ 程式語言Python 702 數組合併排序 請撰寫一程式,輸入並建立兩組數組, 各以-9999為結束點(數組中不包含-9999)。 將此兩數組合併並從小到大排序之,顯示排序前的數組和排序後的串列。 輸入說明 兩個數組,直至-9999結束輸入 輸出說明 排序前的數組 排序後的串列 輸入與輸出會交雜如下,輸出的部份以粗體字表示 Create tuple1: 9 0 -1 3 8 -9999 Create tuple2: 28 16 39 56 78 88 -9999 Combined tuple before sorting: (9, 0, -1, 3, 8, 28, 16, 39, 56, 78, 88) Combined list after sorting: [-1, 0, 3, 8, 9, 16, 28, 39, 56, 78, 88] """ la=[] print("Create tuple1:") x=int(input()) while (x!=(-9999)): la.append(x) x=int(input()) lb=[] print("Create tuple2:") x=int(input()) while (x!=(-9999)): lb.append(x) x=int(input()) lc=la+lb tt=tuple(lc) print('Combined tuple before sorting:', tt) print('Combined list after sorting:', sorted(lc)) #%% """ TQC+ 程式語言Python 703 數組條件判斷 請撰寫一程式,輸入一些字串至數組(至少輸入五個字串) 以字串"end"為結束點(數組中不包含字串"end")。 接著輸出該數組, 再分別顯示該數組的第一個元素到第三個元素和倒數三個元素。 輸入說明 至少輸入五個字串至數組,直至end結束輸入 輸出說明 數組 該數組的前三個元素 該數組最後三個元素 範例輸入 president dean chair staff teacher student end 範例輸出 ('president', 'dean', 'chair', 'staff', 'teacher', 'student') ('president', 'dean', 'chair') ('staff', 'teacher', 'student') """ ll=[] while True: x=input() if x=='end': break ll.append(x) tt=tuple(ll) print(tt) print(tt[0:3]) print(tt[(-3):]) #%% """ TQC+ 程式語言Python 704 集合條件判斷 請撰寫一程式,輸入數個整數並儲存至集合, 以輸入-9999為結束點(集合中不包含-9999), 最後顯示該集合的長度(Length)、最大值(Max) 最小值(Min)、總和(Sum)。 輸入說明 輸入n個整數至集合,直至-9999結束輸入 輸出說明 集合的長度 集合中的最大值 集合中的最小值 集合內的整數總和 範例輸入 34 -23 29 7 0 -1 -9999 範例輸出 Length: 6 Max: 34 Min: -23 Sum: 46 """ ss=set() while True: x=int(input()) if x==(-9999): break ss.add(x) print('Length:',len(ss)) print('Max:',max(ss)) print('Min:',min(ss)) print('Sum:',sum(ss)) #%% """ TQC+ 程式語言Python 705 子集合與超集合 請撰寫一程式,依序輸入五個、三個、九個整數, 並各自儲存到集合set1、set2、set3中。 接著回答:set2是否為set1的子集合(subset)? set3是否為set1的超集合(superset)? 輸入說明 依序分別輸入五個、三個、九個整數 輸出說明 顯示回覆: set2是否為set1的子集合(subset)? set3是否為set1的超集合(superset)? 輸入與輸出會交雜如下,輸出的部份以粗體字表示 Input to set1: 3 28 -2 7 39 Input to set2: 2 77 0 Input to set3: 3 28 12 99 39 7 -1 -2 65 set2 is subset of set1: False set3 is superset of set1: True """ # ============================================================================= # 聯集: A B 集合的所有項目 # 交集: A B 集合的共有項目 # 差集: A 集合扣掉 A B 集合的共有項目 # 對稱差集: A B 集合的獨有項目 # # 子集合 (sebset) : # 若 A 集合的所有項目是 B 集合的部分集合, 則稱 A 為 B 的子集合 # 超集合 (superset) : # 若 A 集合的所有項目是 B 集合的部分集合, 則稱 B 為 A 的超集合 # ============================================================================= # s1={3,28,-2,7,39} s1=set() print('Input to set1:') for i in range(5): s1.add(int(input())) # s2={2,77,0} s2=set() print('Input to set2:') for i in range(3): s2.add(int(input())) # s3={3,28,12,99,39,7,-1,-2,65} s3=set() print('Input to set3:') for i in range(9): s3.add(int(input())) print('set2 is subset of set1:',s2.issubset(s1)) print('set3 is superset of set1:',s3.issuperset(s1)) #%% """ TQC+ 程式語言Python 706 全字母句 全字母句(Pangram)是英文字母表所有的字母都出現至少一次 (最好只出現一次)的句子。 請撰寫一程式,要求使用者輸入一正整數k(代表有k筆測試資料), 每一筆測試資料為一句子,程式判斷該句子是否為Pangram, 並印出對應結果True(若是)或False(若不是)。 提示:不區分大小寫字母 輸入說明 先輸入一個正整數表示測試資料筆數,再輸入測試資料 輸出說明 輸入的資料是否為全字母句 輸入與輸出會交雜如下,輸出的部份以粗體字表示 第1組 3 The quick brown fox jumps over the lazy dog True Learning Python is funny False Pack my box with five dozen liquor jugs True 輸入與輸出會交雜如下,輸出的部份以粗體字表示 第2組 2 Quick fox jumps nightly above wizard True These can be weapons of terror False """ # ============================================================================= # s1=set('The quick brown fox jumps over the lazy dog') # s11={'The quick brown fox jumps over the lazy dog'} # #上面是兩種set 差很多 要注意 # s2=set('The quick brown fox jumps over the lazy do55555') # # len(s1.upper()) #會報錯 # len(s2.upper()) #會報錯 # # 'set' object has no attribute 'upper' # # 所以要在設成set之前就要處理大小寫 # ============================================================================= x=int(input()) for i in range(x): ss=set(input().upper()) #如果有數字 這行是無法判斷的 考試沒差 print(len(ss)==27) #%% """ TQC+ 程式語言Python 707 共同科目 請撰寫一程式,輸入X組和Y組各自的科目至集合中, 以字串"end"作為結束點(集合中不包含字串"end")。 請依序分行顯示(1) X組和Y組的所有科目、 (2)X組和Y組的共同科目、(3)Y組有但X組沒有的科目, 以及(4) X組和Y組彼此沒有的科目(不包含相同科目)。 提示:科目須參考範例輸出樣本,依字母由小至大進行排序。 輸入說明 輸入X組和Y組各自的科目至集合,直至end結束輸入 輸出說明 X組和Y組的所有科目 X組和Y組的共同科目 Y組有但X組沒有的科目 X組和Y組彼此沒有的科目(不包含相同科目) 輸入輸出範例 輸入與輸出會交雜如下,輸出的部份以粗體字表示 Enter group X's subjects: Math Literature English History Geography end Enter group Y's subjects: Math Literature Chinese Physical Chemistry end ['Chemistry', 'Chinese', 'English', 'Geography', 'History', 'Literature', 'Math', 'Physical'] ['Literature', 'Math'] ['Chemistry', 'Chinese', 'Physical'] ['Chemistry', 'Chinese', 'English', 'Geography', 'History', 'Physical'] """ x=set() y=set() print("Enter group X's subjects:") while True: enter=input() if enter=="end": break x.add(enter) print("Enter group Y's subjects:") while True: enter=input() if enter=="end": break y.add(enter) print(sorted(x|y)) print(sorted(x&y)) print(sorted(y-x)) print(sorted(x^y)) #%% """ TQC+ 程式語言Python 708 詞典合併 請撰寫一程式,自行輸入兩個詞典 (以輸入鍵值"end"作為輸入結束點,詞典中將不包含鍵值"end"), 將此兩詞典合併,並根據key值字母由小到大排序輸出, 如有重複key值,後輸入的key值將覆蓋前一key值。 輸入說明 輸入兩個詞典,直至end結束輸入 輸出說明 合併兩詞典,並根據key值字母由小到大排序輸出, 如有重複key值,後輸入的key值將覆蓋前一key值 輸入輸出範例 輸入與輸出會交雜如下,輸出的部份以粗體字表示 Create dict1: Key: a Value: apple Key: b Value: banana Key: d Value: durian Key: end Create dict2: Key: c Value: cat Key: e Value: elephant Key: end a: apple b: banana c: cat d: durian e: elephant """ """ 一個小範例 d1={} d1['gg'] = '@@' """ d1={} print('Create dict1:') while True: keyy=input('Key: ') if keyy=='end': break d1[keyy]=input('Value: ') d2={} print('Create dict2:') while True: keyy=input('Key: ') if keyy=='end': break d2[keyy]=input('Value: ') d1.update(d2) for i in sorted(d1.keys()): print(i,": ",d1[i],sep="") #%% """ TQC+ 程式語言Python 709 詞典排序 請撰寫一程式,輸入一顏色詞典color_dict (以輸入鍵值"end"作為輸入結束點,詞典中將不包含鍵值"end"), 再根據key值的字母由小到大排序並輸出。 輸入說明 輸入一個詞典,直至end結束輸入 輸出說明 根據key值字母由小到大排序輸出 輸入輸出範例 輸入與輸出會交雜如下,輸出的部份以粗體字表示 Key: Green Yellow Value: #ADFF2F Key: Snow Value: #FFFAFA Key: Gold Value: #FFD700 Key: Red Value: #FF0000 Key: White Value: #FFFFFF Key: Green Value: #008000 Key: Black Value: #000000 Key: end Black: #000000 Gold: #FFD700 Green: #008000 Green Yellow: #ADFF2F Red: #FF0000 Snow: #FFFAFA White: #FFFFFF """ dd={} while True: keyy=input('Key: ') if keyy=='end': break dd[keyy]=input('Value: ') for i in sorted(dd.keys()): print(i,": ",dd[i],sep="") #%% """ TQC+ 程式語言Python 710 詞典搜尋 請撰寫一程式,為一詞典輸入資料 (以輸入鍵值"end"作為輸入結束點,詞典中將不包含鍵值"end"), 再輸入一鍵值並檢視此鍵值是否存在於該詞典中。 輸入說明 先輸入一個詞典,直至end結束輸入,再輸入一個鍵值進行搜尋是否存在 輸出說明 鍵值是否存在詞典中 輸入輸出範例 輸入與輸出會交雜如下,輸出的部份以粗體字表示 Key: 123-4567-89 Value: Jennifer Key: 987-6543-21 Value: Tommy Key: 246-8246-82 Value: Kay Key: end Search key: 246-8246-82 True """ dd={} while True: keyy=input('Key: ') if keyy=='end': break dd[keyy]=input('Value: ') sc=input("Search key: ") print(sc in dd.keys())
""" The Zen of SymPy. """ s = """The Zen of SymPy Unevaluated is better than evaluated. The user interface matters. Printing matters. Pure Python can be fast enough. If it's too slow, it's (probably) your fault. Documentation matters. Correctness is more important than speed. Push it in now and improve upon it later. Coverage by testing matters. Smart tests are better than random tests. But random tests sometimes find what your smartest test missed. The Python way is probably the right way. Community is more important than code.""" print(s)
print('\033[1;4;35mGerador de PA\033[m') print('+='*15) p1 = int(input('Digite o primeiro termo: ')) raz = int(input('Digite a razão: ')) var = 0 while var != 10: print(p1, end=' - ') var = var + 1 p1 = p1 + raz print('Acabou!')
class PermissionBackend(object): supports_object_permissions = True supports_anonymous_user = True def authenticate(self, **kwargs): # always return a None user return None def has_perm(self, user, perm, obj=None): if user.is_anonymous(): return False if perm in ["forums.add_forumthread", "forums.add_forumreply"]: return True
#Şule Nur Yılmaz - 170401058 def oku(): #asallar.txt verileri oku - diziye ata - diziyi döndür f = open("asallar.txt","r") text = f.readlines() f.close() asallar = list() for i in text: asallar.append(int(i)) return asallar #Global Veriler 3. derece polinom yakınlaştırmasında kullanılacak xi = [0 for i in range(7)] #xi toplamları (n/xi/xi2/xi3/xi4/xi5/xi6) yi = [0 for i in range(4)] #yi toplamları (yi/yixi/yixi2/yixi3) #3. dereceden polinom yakınlaştırma (matris verilerinin hesaplanması, matris oluşturma, katsayıları bulma, katsayıları geriye döndürme) def ucuncu_der(i,veri): # i = satır sayısı veri = satırdaki veri if i != -1: for k in range(len(xi)): xi[k] += (i) ** k for l in range(len(yi)): yi[l] += veri * ((i) ** l) else: matris = [[0 for p in range(4)] for r in range(4)] for x in range(len(matris)): for y in range(len(matris[x])): matris[x][y] = xi[x+y] row = len(matris) col = len(matris[0]) for k in range(row): for l in range(k+1,row): a = - matris[l][k] / matris[k][k] for m in range(k,col): if m == k: matris[l][m] = 0.0 else: matris[l][m] += a * matris[k][m] yi[l] += a * yi[k] katsayilar = [0 for t in range(col)] for x in range(row-1,-1,-1): katsayilar[x] = yi[x] / matris[x][x] for y in range(x-1,-1,-1): yi[y] -= katsayilar[x] * matris[y][x] print("Katsayılar a0: {} a1: {} a2: {} a3: {}".format(katsayilar[0],katsayilar[1],katsayilar[2],katsayilar[3])) return katsayilar #Polinom yakınlaştırması için yardımcı fonksiyon (satır sayısı ve o satırdaki veriyi ilgili fonksiyona yolluyor) def yardimci(asallar): for i in range(len(asallar)): ucuncu_der(i+1, asallar[i]) q = ucuncu_der(-1, None) #veriler(satırlar) bittiğinde polinomun bulunması için fonksiyon son kez çağırılıyor. return q def f(i): # 3. dereceden polinomumuz return (katsayi[0]+katsayi[1]*i+katsayi[2]*(i**2)+katsayi[3]*(i**3)) #İleri Sonlu Farklar Yöntemi Kullanıldı (sayısal türev) #a=58 - 170401058 def turev_1(x=58): x0 = x h = 0.01 xprime = (f(x0+h)-f(x0))/h print("(POLİNOMLU) x={}'ken türev: ".format(x),xprime) def turev_2(x=58): x0 = x - 1 # dizi indeks 0'dan başladığından istenen veriyi elde etmek için bir eksiğini alıyoruz. h = 1 xprime = (asallar[x0+h]-asallar[x0])/h print("(POLİNOMSUZ) x={}'ken türev: ".format(x),xprime) def yorum(): f = open("yorum.txt","w",encoding="UTF-8") f.write(""" Şule Nur Yılmaz Polinomlu ve polinomsuz sayısal türev sonuçlarının farkının en büyük sebebi polinomlu sayısal türevde hesaplama yaparken aralığı istediğimiz ölçüde azaltarak gerçek sonuca çok daha yakın anlamlı bir sonuç bulabiliyor olmamız. Polinomsuz sayısal türevde en iyi ihtimalle aralığı (h=1) tutabilirken polinomlu sayısal türevde ara değerleri elimizde bulunan polinom ile hesaplayabileceğimizden aralığı çok daha küçük (örneğin h=0.1) tutabiliyoruz. Bir diğer sebep ise elimizdeki polinom var olan gerçek değerleri (asal sayıları) vermediğinden aynı aralık (h=1) için sayısal türev hesapladığımızda bile türev sonuçlarının aynı değere sahip olmamasına sebep oluyor. """) f.close() asallar = oku() #veriler katsayi = yardimci(asallar) #3. dereceden polinomun katsayıları turev_1() #polinomlu turev_2() #polinomsuz yorum()
class A: def m(): pass def f(): pass
# -*- encoding: utf-8 -*- class KlotskiBoardException(Exception): def __init__(self, piece, kind_message): message = "Wrong board configuration: {} '{}'".format(kind_message, piece) super().__init__(message) class WrongPieceValue(KlotskiBoardException): def __init__(self, x): super().__init__(x, "wrong piece value") class PieceAlreadyInPlace(KlotskiBoardException): def __init__(self, x): super().__init__(x, "piece already in place") class ProblematicPiece(KlotskiBoardException): def __init__(self, x): super().__init__(x, "check piece") class MissingPiece(KlotskiBoardException): def __init__(self, x): super().__init__(x, "missing piece, current pieces are:")
''' A curious problem that involves 'rotating' a number and solving a number of contraints Author: Daniel Haberstock Date: 05/26/2018 Sources used: https://stackoverflow.com/questions/19463556/string-contains-any-character-in-group ''' def rotate(x): # split up the integer into a list of single digit strings splitx = [i for i in str(x)] # reverse it since we are always doing 1/2 rotations splitx.reverse() # initialize the final solution string y = '' # loop through the list of digits # we only need to rotate 6/9 since they are the only number that will flip for digit in splitx: if digit == "6": y += "9" elif digit == "9": y +="6" else: y += digit return int(y) # now to solve the riddle # we need to define our rotate assumption which is to say that if the # number contains a letter 2,3,4,5,7 it is not allowed to be part of the solution # 1. 100 <= x <= 999 --> for x in range(100, 1000) # 2. rotate(x) + 129 = x --> if rotate(x) + 129 == x # 3. rotate(x - 9) = x - 9 --> rotate(x - 9) == x - 9 # we know if both 2. and 3. are true then we found a solution rotateAssumption = True for x in range(100, 1000): if rotateAssumption: if any(num in str(x) for num in "23457"): continue if rotate(x) + 129 == x and rotate(x - 9) == x - 9: print("I found the number: ", x)
def extractAlpenGlowTranslations(item): """ 'Alpen Glow Translations' """ vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol or frag) or 'preview' in item['title'].lower(): return None tagmap = { 'Shu Nv Minglan' : 'The Legend of the Concubine\'s Daughter Minglan', } for tag, sname in tagmap.items(): if tag in item['tags']: return buildReleaseMessageWithType(item, sname, vol, chp, frag=frag) return False
n1 = int(input('insira o 1 numero')) n2 = int(input('insira o 2 numero')) soma = n1 + n2 sub = n1 - n2 div = n1/n2 mul = n1 * n2 pot = n1 ** n2 divint = n1 // n2 res = n1 % n2 print('soma = ', soma) print('Sub = ', sub) print('Divisão = ', div) print('multiplicação', mul) print('potencia = ', pot) print('Divisão inteira = ', divint) print('resto da divisão = ', res)
S = input() ans = ( 'YES' if S.count('x') <= 7 else 'NO' ) print(ans)
{ "targets": [ { "target_name": "node-hide-console-window", "sources": [ "node-hide-console-window.cc" ] } ] }
# Escreva um programa que exiba uma lista de opções (menu): adição, subtração, divisão, multiplicação e sair # Imprima a tabuada da operação escolhida # Repita até que a opção saída seja escolhida def line(size): print('-' * size) while True: print() line(30) print('MENU' .center(30)) line(30) print(' 1 - Adição') print(' 2 - Subtração') print(' 3 - Divisão') print(' 4 - Multiplicação') print(' 5 - Sair') line(30) option = int(input('Escolha uma opção: ')) if option == 5: break elif 1 <= option < 5: n = int(input('Tabuada de: ')) x = 1 while x <= 10: if option == 1: print(f'{n} + {x:2} = {n + x}') elif option == 2: print(f'{n} - {x:2} = {n - x}') elif option == 3: print(f'{n} / {x:2} = {n / x:.2f}') elif option == 4: print(f'{n} x {x:2} = {n * x}') x += 1 else: print('Opção inválida!') print('\nFim da execução!')
class Node(): left = None right = None def __init__(self, element): self.element = element def __str__(self): return "\t\t{}\n{}\t\t{}".format(self.element, self.left, self.right) class BinaryTree(): head = None def __init__(self, head): self.head = Node(head) def __str__(self): return self.head.__str__() def insert(self, element, node=None): if not node: node = self.head if node.element > element: if node.left == None: node.left = Node(element) else: self.insert(element, node.left) else: if node.right == None: node.right = Node(element) else: self.insert(element, node.right) def find(self, element): node = self.head while node: if node.element == element: return node elif node.element > element: node = node.left else: node = node.right return None def min(self, node=None): if not node: node = self.head while node.left != None: node = node.left return node def max(self, node=None): if not node: node = self.head while node.right != None: node = node.right return node def remove(self, element, node=None): if not node: node = self.head def removeNode(node): if element > node.element: node.right = removeNode(node.right) return node elif element < node.element: node.left = removeNode(node.left) return node else: if node.left and node.right: minRightElement = self.min(node.right).element node.right = self.remove(minRightElement, node.right) node.element = minRightElement return node elif node.left: return node.left elif node.right: return node.right else: return None node = removeNode(node) return node def maxHeight(self): def nodeHeight(node): if not node: return 0 left = 1 + nodeHeight(node.left) right = 1 + nodeHeight(node.right) return max(left, right) return nodeHeight(self.head) def minHeight(self): def nodeHeight(node): if not node: return 0 left = 1 + nodeHeight(node.left) right = 1 + nodeHeight(node.right) return min(left, right) return nodeHeight(self.head) def preOrder(self): def traverse(node): result = [] if not node: return result result.append(node.element) result.extend(traverse(node.left)) result.extend(traverse(node.right)) return result return traverse(self.head) def inOrder(self): def traverse(node): result = [] if not node: return result result.extend(traverse(node.left)) result.append(node.element) result.extend(traverse(node.right)) return result return traverse(self.head) def postOrder(self): def traverse(node): result = [] if not node: return result result.extend(traverse(node.left)) result.extend(traverse(node.right)) result.append(node.element) return result return traverse(self.head) def levelOrder(self): queue = [] result = [] node = self.head while node: result.append(node.element) if node.left: queue.append(node.left) if node.right: queue.append(node.right) node = None if len(queue) > 0: node = queue.pop(0) return result bt = BinaryTree(25) nodes = [15,50,10,22,4,12,18,24,35,70,31,44,66,90] for node in nodes: bt.insert(node) print(bt.inOrder()) print("===") print(bt.preOrder()) print("===") print(bt.postOrder()) print("===") print(bt.levelOrder()) # print(bt.find(7)) # print(bt.find(5)) # print(bt.min()) # print(bt.max()) # bt.remove(2) # print(bt.find(2)) print(bt) bt.remove(4) print("===") print(bt)
# n=int(input()) # n2=input() # ar=str(n2) # ar=ar.split() # pair={} # total=0 # for i in ar: # if i not in pair: # pair[i]=1 # else: # pair[i]+=1 # for j in pair: # store=pair[j]//2 # total+=store # print (total) n=int(input("number of socks :")) ar=input("colors of socks :").split() pair={} total=0 for i in ar: if i not in pair: pair[i]=1 else: pair[i]+=1 for j in pair: store=pair[j]//2 total+=store print (total)
class Solution: def trap(self, height: List[int]) -> int: lmax,rmax = 0,0 l,r = 0,len(height)-1 ans = 0 while l<r: if height[l]<height[r]: if height[l]>=lmax: lmax = height[l] else: ans+=lmax-height[l] l+=1 else: if height[r]>=rmax: rmax= height[r] else: ans+=rmax-height[r] r-=1 return ans
lanjut = 'Y' kumpulan_luas_segitiga = [] while lanjut == 'Y': alas = float(input("Masukkan panjang alas (cm) : ")) tinggi = float(input("Masukkan tinggi segitiga (cm) : ")) luas = alas * tinggi * 0.5 # / 2 print("Luas segitiganya adalah :", luas) kumpulan_luas_segitiga.append(luas) lanjut = input("\nMau lanjut lagi?") if lanjut == 'Y': continue else: print("Terima kasih telah menggunakan program kami\n" + "Berikut adalah segitiga yang telah dihitung\n", kumpulan_luas_segitiga)
""" Создать текстовый файл (не программно), сохранить в нем несколько строк, выполнить подсчет количества строк, количества слов в каждой строке. """ def read_file(path): res = [] with open(path, "r") as f: res = f.readlines() return res def main(): file_name = "task2_data.txt" task2_data = read_file(file_name) line_count = len(task2_data) print(f"в файле {file_name} - {line_count} строк") for strn, line in enumerate(task2_data): strn += 1 # отсчет с 0 word_count = len(line.split()) print(f"в строке {strn} - {word_count} слов") print("Программа завершена") if __name__ == "__main__": main()
class StringFormatter(object): def __init__(self): pass def justify(self, text, width=21): ''' Inserts spaces between ':' and the remaining of the text to make sure 'text' is 'width' characters in length. ''' if len(text) < width: index = text.find(':') + 1 if index > 0: return text[:index] + (' ' * (width - len(text))) + text[index:] return text
input_str = "12233221" middle_size = int(round(len(input_str) / 2) ) print(f"middle_size: {middle_size}") end_index = -1 start_index = 0 while start_index < middle_size: char_from_start = input_str[start_index] char_from_end = input_str[end_index] end_index = end_index - 1 start_index = start_index + 1 if(char_from_end == char_from_start): continue else: print(f"input string {input_str} is not a palindrome") break else: print(f"input string {input_str} is a palindrome")
def main(self): def handler(message): if message["channel"] == "/service/player" and message.get("data") and message["data"].get("id") == 5: self._emit("GameReset") self.handlers["gameReset"] = handler