content
stringlengths 7
1.05M
|
|---|
# From: http://wiki.python.org/moin/SimplePrograms, with permission from the author, Steve Howell
BOARD_SIZE = 8
def under_attack(col, queens):
return col in queens or \
any(abs(col - x) == len(queens)-i for i,x in enumerate(queens))
def solve(n):
solutions = [[]]
for row in range(n):
solutions = [solution+[i+1]
for solution in solutions
for i in range(BOARD_SIZE)
if not under_attack(i+1, solution)]
return solutions
for answer in solve(BOARD_SIZE): print(list(enumerate(answer, start=1)))
|
# -*- coding: utf-8 -*-
""" VITA Person Registry, Controllers
@author: nursix
@see: U{http://eden.sahanafoundation.org/wiki/BluePrintVITA}
"""
prefix = request.controller
resourcename = request.function
# -----------------------------------------------------------------------------
# Options Menu (available in all Functions' Views)
def shn_menu():
response.menu_options = [
[T("Home"), False, URL(r=request, f="index")],
[T("Search for a Person"), False, URL(r=request, f="person", args="search")],
[T("Persons"), False, URL(r=request, f="person"), [
[T("List"), False, URL(r=request, f="person")],
[T("Add"), False, URL(r=request, f="person", args="create")],
]],
[T("Groups"), False, URL(r=request, f="group"), [
[T("List"), False, URL(r=request, f="group")],
[T("Add"), False, URL(r=request, f="group", args="create")],
]]]
#De-activating until fixed:
#if s3_has_role(1):
#response.menu_options.append([T("De-duplicator"), False, URL(r=request, f="person_duplicates")])
menu_selected = []
if session.rcvars and "pr_group" in session.rcvars:
group = db.pr_group
query = (group.id == session.rcvars["pr_group"])
record = db(query).select(group.id, group.name, limitby=(0, 1)).first()
if record:
name = record.name
menu_selected.append(["%s: %s" % (T("Group"), name), False,
URL(r=request, f="group", args=[record.id])])
if session.rcvars and "pr_person" in session.rcvars:
person = db.pr_person
query = (person.id == session.rcvars["pr_person"])
record = db(query).select(person.id, limitby=(0, 1)).first()
if record:
name = shn_pr_person_represent(record.id)
menu_selected.append(["%s: %s" % (T("Person"), name), False,
URL(r=request, f="person", args=[record.id])])
if menu_selected:
menu_selected = [T("Open recent"), True, None, menu_selected]
response.menu_options.append(menu_selected)
shn_menu()
# -----------------------------------------------------------------------------
def index():
""" Module's Home Page """
try:
module_name = deployment_settings.modules[prefix].name_nice
except:
module_name = T("Person Registry")
def prep(r):
if r.representation == "html":
if not r.id:
r.method = "search"
else:
redirect(URL(r=request, f="person", args=[r.id]))
return True
response.s3.prep = prep
def postp(r, output):
if isinstance(output, dict):
gender = []
for g_opt in pr_gender_opts:
count = db((db.pr_person.deleted == False) & \
(db.pr_person.gender == g_opt)).count()
gender.append([str(pr_gender_opts[g_opt]), int(count)])
age = []
for a_opt in pr_age_group_opts:
count = db((db.pr_person.deleted == False) & \
(db.pr_person.age_group == a_opt)).count()
age.append([str(pr_age_group_opts[a_opt]), int(count)])
total = int(db(db.pr_person.deleted == False).count())
output.update(module_name=module_name, gender=gender, age=age, total=total)
if r.representation in shn_interactive_view_formats:
if not r.component:
label = READ
else:
label = UPDATE
linkto = r.resource.crud._linkto(r)("[id]")
response.s3.actions = [
dict(label=str(label), _class="action-btn", url=str(linkto))
]
r.next = None
return output
response.s3.postp = postp
if auth.s3_logged_in():
add_btn = A(T("Add Person"),
_class="action-btn",
_href=URL(r=request, f="person", args="create"))
else:
add_btn = None
output = s3_rest_controller("pr", "person",
add_btn=add_btn)
response.view = "pr/index.html"
response.title = module_name
shn_menu()
return output
# -----------------------------------------------------------------------------
def person():
""" RESTful CRUD controller """
def prep(r):
if r.component_name == "config":
_config = db.gis_config
defaults = db(_config.id == 1).select(limitby=(0, 1)).first()
for key in defaults.keys():
if key not in ["id", "uuid", "mci", "update_record", "delete_record"]:
_config[key].default = defaults[key]
if r.representation == "popup":
# Hide "pe_label" and "missing" fields in person popups
r.table.pe_label.readable = False
r.table.pe_label.writable = False
r.table.missing.readable = False
r.table.missing.writable = False
return True
response.s3.prep = prep
s3xrc.model.configure(db.pr_group_membership,
list_fields=["id",
"group_id",
"group_head",
"description"])
table = db.pr_person
s3xrc.model.configure(table, listadd = False, insertable = True)
output = s3_rest_controller(prefix, resourcename,
main="first_name",
extra="last_name",
rheader=lambda r: shn_pr_rheader(r,
tabs = [(T("Basic Details"), None),
(T("Images"), "image"),
(T("Identity"), "identity"),
(T("Address"), "address"),
(T("Contact Data"), "pe_contact"),
(T("Memberships"), "group_membership"),
(T("Presence Log"), "presence"),
(T("Subscriptions"), "pe_subscription"),
(T("Map Settings"), "config")
]))
shn_menu()
return output
# -----------------------------------------------------------------------------
def group():
""" RESTful CRUD controller """
tablename = "%s_%s" % (prefix, resourcename)
table = db[tablename]
response.s3.filter = (db.pr_group.system == False) # do not show system groups
s3xrc.model.configure(db.pr_group_membership,
list_fields=["id",
"person_id",
"group_head",
"description"])
output = s3_rest_controller(prefix, resourcename,
rheader=lambda r: shn_pr_rheader(r,
tabs = [(T("Group Details"), None),
(T("Address"), "address"),
(T("Contact Data"), "pe_contact"),
(T("Members"), "group_membership")]))
shn_menu()
return output
# -----------------------------------------------------------------------------
def image():
""" RESTful CRUD controller """
return s3_rest_controller(prefix, resourcename)
# -----------------------------------------------------------------------------
def pe_contact():
""" RESTful CRUD controller """
table = db.pr_pe_contact
table.pe_id.label = T("Person/Group")
table.pe_id.readable = True
table.pe_id.writable = True
return s3_rest_controller(prefix, resourcename)
# -----------------------------------------------------------------------------
#def group_membership():
#""" RESTful CRUD controller """
#return s3_rest_controller(prefix, resourcename)
# -----------------------------------------------------------------------------
def pentity():
""" RESTful CRUD controller """
return s3_rest_controller(prefix, resourcename)
# -----------------------------------------------------------------------------
def download():
""" Download a file.
@todo: deprecate? (individual download handler probably not needed)
"""
return response.download(request, db)
# -----------------------------------------------------------------------------
def tooltip():
""" Ajax tooltips """
if "formfield" in request.vars:
response.view = "pr/ajaxtips/%s.html" % request.vars.formfield
return dict()
#------------------------------------------------------------------------------------------------------------------
def person_duplicates():
""" Handle De-duplication of People
@todo: permissions, audit, update super entity, PEP8, optimization?
@todo: check for component data!
@todo: user accounts, subscriptions?
"""
# Shortcut
persons = db.pr_person
table_header = THEAD(TR(TH(T("Person 1")),
TH(T("Person 2")),
TH(T("Match Percentage")),
TH(T("Resolve"))))
# Calculate max possible combinations of records
# To handle the AJAX requests by the dataTables jQuery plugin.
totalRecords = db(persons.id > 0).count()
item_list = []
if request.vars.iDisplayStart:
end = int(request.vars.iDisplayLength) + int(request.vars.iDisplayStart)
records = db((persons.id > 0) & \
(persons.deleted == False) & \
(persons.first_name != None)).select(persons.id, # Should this be persons.ALL?
persons.pe_label,
persons.missing,
persons.first_name,
persons.middle_name,
persons.last_name,
persons.preferred_name,
persons.local_name,
persons.age_group,
persons.gender,
persons.date_of_birth,
persons.nationality,
persons.country,
persons.religion,
persons.marital_status,
persons.occupation,
persons.tags,
persons.comments)
# Calculate the match percentage using Jaro wrinkler Algorithm
count = 1
i = 0
for onePerson in records: #[:len(records)/2]:
soundex1= soundex(onePerson.first_name)
array1 = []
array1.append(onePerson.pe_label)
array1.append(str(onePerson.missing))
array1.append(onePerson.first_name)
array1.append(onePerson.middle_name)
array1.append(onePerson.last_name)
array1.append(onePerson.preferred_name)
array1.append(onePerson.local_name)
array1.append(pr_age_group_opts.get(onePerson.age_group, T("None")))
array1.append(pr_gender_opts.get(onePerson.gender, T("None")))
array1.append(str(onePerson.date_of_birth))
array1.append(pr_nations.get(onePerson.nationality, T("None")))
array1.append(pr_nations.get(onePerson.country, T("None")))
array1.append(pr_religion_opts.get(onePerson.religion, T("None")))
array1.append(pr_marital_status_opts.get(onePerson.marital_status, T("None")))
array1.append(onePerson.occupation)
# Format tags into an array
if onePerson.tags != None:
tagname = []
for item in onePerson.tags:
tagname.append(pr_impact_tags.get(item, T("None")))
array1.append(tagname)
else:
array1.append(onePerson.tags)
array1.append(onePerson.comments)
i = i + 1
j = 0
for anotherPerson in records: #[len(records)/2:]:
soundex2 = soundex(anotherPerson.first_name)
if j >= i:
array2 =[]
array2.append(anotherPerson.pe_label)
array2.append(str(anotherPerson.missing))
array2.append(anotherPerson.first_name)
array2.append(anotherPerson.middle_name)
array2.append(anotherPerson.last_name)
array2.append(anotherPerson.preferred_name)
array2.append(anotherPerson.local_name)
array2.append(pr_age_group_opts.get(anotherPerson.age_group, T("None")))
array2.append(pr_gender_opts.get(anotherPerson.gender, T("None")))
array2.append(str(anotherPerson.date_of_birth))
array2.append(pr_nations.get(anotherPerson.nationality, T("None")))
array2.append(pr_nations.get(anotherPerson.country, T("None")))
array2.append(pr_religion_opts.get(anotherPerson.religion, T("None")))
array2.append(pr_marital_status_opts.get(anotherPerson.marital_status, T("None")))
array2.append(anotherPerson.occupation)
# Format tags into an array
if anotherPerson.tags != None:
tagname = []
for item in anotherPerson.tags:
tagname.append(pr_impact_tags.get(item, T("None")))
array2.append(tagname)
else:
array2.append(anotherPerson.tags)
array2.append(anotherPerson.comments)
if count > end and request.vars.max != "undefined":
count = int(request.vars.max)
break;
if onePerson.id == anotherPerson.id:
continue
else:
mpercent = jaro_winkler_distance_row(array1, array2)
# Pick all records with match percentage is >50 or whose soundex values of first name are equal
if int(mpercent) > 50 or (soundex1 == soundex2):
count = count + 1
item_list.append([onePerson.first_name,
anotherPerson.first_name,
mpercent,
"<a href=\"../pr/person_resolve?perID1=%i&perID2=%i\", class=\"action-btn\">Resolve</a>" % (onePerson.id, anotherPerson.id)
])
else:
continue
j = j + 1
item_list = item_list[int(request.vars.iDisplayStart):end]
# Convert data to JSON
result = []
result.append({
"sEcho" : request.vars.sEcho,
"iTotalRecords" : count,
"iTotalDisplayRecords" : count,
"aaData" : item_list
})
output = json.dumps(result)
# Remove unwanted brackets
output = output[1:]
output = output[:-1]
return output
else:
# Don't load records except via dataTables (saves duplicate loading & less confusing for user)
items = DIV((TABLE(table_header, TBODY(), _id="list", _class="display")))
return(dict(items=items))
#----------------------------------------------------------------------------------------------------------
def delete_person():
""" To delete references to the old record and replace it with the new one.
@todo: components??? cannot simply be re-linked!
@todo: user accounts?
@todo: super entity not updated!
"""
# @ToDo: Error gracefully if conditions not satisfied
old = request.vars.old
new = request.vars.new
# Find all tables which link to the pr_person table
tables = shn_table_links("pr_person")
for table in tables:
for count in range(len(tables[table])):
field = tables[str(db[table])][count]
query = db[table][field] == old
db(query).update(**{field:new})
# Remove the record
db(db.pr_person.id == old).update(deleted=True)
return "Other Record Deleted, Linked Records Updated Successfully"
#------------------------------------------------------------------------------------------------------------------
def person_resolve():
""" This opens a popup screen where the de-duplication process takes place.
@todo: components??? cannot simply re-link!
@todo: user accounts linked to these records?
@todo: update the super entity!
@todo: use S3Resources, implement this as a method handler
"""
# @ToDo: Error gracefully if conditions not satisfied
perID1 = request.vars.perID1
perID2 = request.vars.perID2
# Shortcut
persons = db.pr_person
count = 0
for field in persons:
id1 = str(count) + "Right" # Gives a unique number to each of the arrow keys
id2 = str(count) + "Left"
count = count + 1;
# Comment field filled with buttons
field.comment = DIV(TABLE(TR(TD(INPUT(_type="button", _id=id1, _class="rightArrows", _value="-->")),
TD(INPUT(_type="button", _id=id2, _class="leftArrows", _value="<--")))))
record = persons[perID1]
myUrl = URL(r=request, c="pr", f="person")
form1 = SQLFORM(persons, record, _id="form1", _action=("%s/%s" % (myUrl, perID1)))
# For the second record remove all the comments to save space.
for field in persons:
field.comment = None
record = persons[perID2]
form2 = SQLFORM(persons, record, _id="form2", _action=("%s/%s" % (myUrl, perID2)))
return dict(form1=form1, form2=form2, perID1=perID1, perID2=perID2)
# -----------------------------------------------------------------------------
|
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
INITIAL_DATA_TO_COMPLETE = [
'valid_0',
'valid_1',
'valid_10',
'valid_100',
'valid_101',
'valid_102',
'valid_103',
'valid_105',
'valid_106',
'valid_107',
'valid_108',
'valid_109',
'valid_11',
'valid_110',
'valid_111',
'valid_112',
'valid_115',
'valid_116',
'valid_117',
'valid_119',
'valid_12',
'valid_120',
'valid_121',
'valid_122',
'valid_123',
'valid_124',
'valid_125',
'valid_13',
'valid_130',
'valid_131',
'valid_133',
'valid_136',
'valid_138',
'valid_139',
'valid_14',
'valid_140',
'valid_141',
'valid_143',
'valid_144',
'valid_145',
'valid_146',
'valid_147',
'valid_148',
'valid_15',
'valid_152',
'valid_153',
'valid_154',
'valid_155',
'valid_156',
'valid_158',
'valid_160',
'valid_162',
'valid_163',
'valid_166',
'valid_169',
'valid_17',
'valid_171',
'valid_172',
'valid_174',
'valid_175',
'valid_176',
'valid_177',
'valid_178',
'valid_18',
'valid_181',
'valid_182',
'valid_184',
'valid_187',
'valid_19',
'valid_190',
'valid_191',
'valid_192',
'valid_193',
'valid_194',
'valid_196',
'valid_2',
'valid_20',
'valid_202',
'valid_203',
'valid_205',
'valid_206',
'valid_207',
'valid_208',
'valid_212',
'valid_214',
'valid_215',
'valid_216',
'valid_217',
'valid_219',
'valid_223',
'valid_225',
'valid_227',
'valid_228',
'valid_23',
'valid_230',
'valid_231',
'valid_232',
'valid_233',
'valid_234',
'valid_236',
]
COMMON_CONFIG = {
'task': 'msc:SessionBaseMsc',
'num_examples': -1,
'label_speaker_id': 'their',
'session_id': 4,
'datatype': 'valid',
}
MODEL_OPT = {
'BST90M': {
'previous_persona_type': 'none',
'num_previous_sessions_msg': 10,
'include_time_gap': False,
}
}
UI_OPT = {'BST90M': {'previous_persona_type': 'both', 'include_time_gap': False}}
|
#フロイドワーシャル法
INF=1<<60
N,M=6,9
dp=[[INF]*N for _ in range(N)]#N×Nの2次元リスト
#初期化
#dp[a][b]=w
dp[0][1]=3
dp[0][2]=5
dp[1][2]=4
dp[1][3]=12
dp[2][3]=9
dp[2][4]=4
dp[4][3]=7
dp[3][5]=2
dp[4][5]=8
for v in range(N):
dp[v][v]=0
#更新
for k in range(N):
for i in range(N):
for j in range(N):
dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j])
#負閉路の存在確認
exist_negative_cycle=False
for v in range(N):
if dp[v][v]<0:
exist_negative_cycle=True
if exist_negative_cycle:
print('Negative cycle!')
else:
for i in range(N):
for j in range(N):
if dp[i][j]<INF/2:
print(dp[i][j], end=' ')
else:
print('INF', end=' ')
print(' ')
|
"""
Question:
Distinct ways to climb a n step staircase where
each time you can either climb 1 or 2 steps.
"""
"""
Solution 1:
We can easily find recursive nature in above problem.
The person can reach n’th stair from either (n-1)’th stair or from (n-2)’th stair.
Let the total number of ways to reach n’t stair be ‘ways(n)’.
The value of ‘ways(n)’ can be written as following.
ways(n)=ways(n-1)+ways(n-2)
The above expression is actually the expression for Fibonacci numbers, but there is one thing to notice, the value of ways(n) is equal to fibonacci(n+1).
ways(1) = fib(2) = 1
ways(2) = fib(3) = 2
ways(3) = fib(4) = 3
"""
def fibo(n:int) -> int:
return n if n<=1 else fibo(n-1)+fibo(n-2)
def ways(n:int) -> int:
fmt = "n needs to be positive integer, your input {}"
assert isinstance(n, int) and n > 0, fmt.format(n)
return fibo(n+1)
# print(ways(4))
"""
Solution 2:
This uses bottom to top approach , in tabular method ,
We use table to store the previous values in list.
"""
def climb_stairs(n: int) -> int:
"""
Args:
n: number of steps of staircase
Returns:
Distinct ways to climb a n step staircase
Raises:
AssertionError: n not positive integer
"""
fmt = "n needs to be positive integer, your input {}"
assert isinstance(n, int) and n > 0, fmt.format(n)
if n == 1:
return 1
dp = [0] * (n + 1)
dp[0], dp[1] = (1, 1)
for i in range(2, n + 1):
dp[i] = dp[i - 1] + dp[i - 2]
return dp[n]
# climb_stairs(3)
# 3
# climb_stairs(1)
# 1
# climb_stairs(-7)
# Traceback (most recent call last):
# ...
# AssertionError: n needs to be positive integer, your input -7
|
def inicio():
print ("--PRINCIPAL--")
print("1. AGREGAR")
print("2. ELIMINAR")
print("3. VER")
opc = input ("------> ")
return opc
|
n, m = map(int, input().strip().split())
matrix = [list(map(int, input().strip().split())) for _ in range(n)]
k = int(input().strip())
for lst in sorted(matrix, key=lambda l: l[k]):
print(*lst)
|
Nsweeps = 100
size = 32
for beta in [0.1, 0.8, 1.6]:
g = Grid(size, beta)
m = g.do_sweeps(0, Nsweeps)
grid = g.cells
mag = g.magnetisation(grid)
e_plus = np.zeros((size, size))
e_minus = np.zeros((size, size))
for i in np.arange(size):
for j in np.arange(size):
e_plus[i,j], e_minus[i,j] = g.energy(i, j, beta, grid)
if not os.path.exists(filename):
filename = 'test_data_beta_%0.1f_2.pickle'%beta
f = open(filename, 'wb')
pickle.dump((grid, mag, e_plus, e_minus, beta), f)
f.close()
if not os.path.exists(filename):
filename = 'test_data_beta_%0.1f_grid_only_2.pickle'%beta
f = open(filename, 'wb')
pickle.dump((grid, beta), f)
f.close()
|
class Listing:
def extrem(self, nvar1="", nvar2="", ninc="", **kwargs):
"""Lists the extreme values for variables.
APDL Command: EXTREM
Parameters
----------
nvar1, nvar2, ninc
List extremes for variables NVAR1 through NVAR2 in steps of NINC.
Variable range defaults to its maximum. NINC defaults to 1.
Notes
-----
Lists the extreme values (and the corresponding times) for stored and
calculated variables. Extremes for stored variables are automatically
listed as they are stored. Only the real part of a complex number is
used. Extreme values may also be assigned to parameters [*GET].
"""
command = f"EXTREM,{nvar1},{nvar2},{ninc}"
return self.run(command, **kwargs)
def lines(self, n="", **kwargs):
"""Specifies the length of a printed page.
APDL Command: LINES
Parameters
----------
n
Number of lines per page (defaults to 20). (Minimum allowed = 11).
Notes
-----
Specifies the length of a printed page (for use in reports, etc.).
"""
command = f"LINES,{n}"
return self.run(command, **kwargs)
def nprint(self, n="", **kwargs):
"""Defines which time points stored are to be listed.
APDL Command: NPRINT
Parameters
----------
n
List data associated with every N time (or frequency) point(s),
beginning with the first point stored (defaults to 1).
Notes
-----
Defines which time (or frequency) points within the range stored are to
be listed.
"""
command = f"NPRINT,{n}"
return self.run(command, **kwargs)
def prcplx(self, key="", **kwargs):
"""Defines the output form for complex variables.
APDL Command: PRCPLX
Parameters
----------
key
Output form key:
0 - Real and imaginary parts.
1 - Amplitude and phase angle. Stored real and imaginary data are converted to
amplitude and phase angle upon output. Data remain stored as
real and imaginary parts.
Notes
-----
Defines the output form for complex variables. Used only with harmonic
analyses (ANTYPE,HARMIC).
All results data are stored in the form of real and imaginary
components and converted to amplitude and/or phase angle as specified
via the PRCPLX command. The conversion is not valid for derived
results (such as principal stress/strain, equivalent stress/strain and
USUM).
"""
command = f"PRCPLX,{key}"
return self.run(command, **kwargs)
def prtime(self, tmin="", tmax="", **kwargs):
"""Defines the time range for which data are to be listed.
APDL Command: PRTIME
Parameters
----------
tmin
Minimum time (defaults to the first point stored).
tmax
Maximum time (defaults to the last point stored).
Notes
-----
Defines the time (or frequency) range (within the range stored) for
which data are to be listed.
"""
command = f"PRTIME,{tmin},{tmax}"
return self.run(command, **kwargs)
def prvar(self, nvar1="", nvar2="", nvar3="", nvar4="", nvar5="", nvar6="",
**kwargs):
"""Lists variables vs. time (or frequency).
APDL Command: PRVAR
Parameters
----------
nvar1, nvar2, nvar3, . . . , nvar6
Variables to be displayed, defined either by the reference number
or a unique thirty-two character name. If duplicate names are used
the command will print the data for the lowest-numbered variable
with that name.
Notes
-----
Lists variables vs. time (or frequency). Up to six variables may be
listed across the line. Time column output format can be changed using
the /FORMAT command arguments Ftype, NWIDTH, and DSIGNF.
"""
command = f"PRVAR,{nvar1},{nvar2},{nvar3},{nvar4},{nvar5},{nvar6}"
return self.run(command, **kwargs)
|
load("@rules_maven_third_party//:import_external.bzl", import_external = "import_external")
def dependencies():
import_external(
name = "org_apache_maven_resolver_maven_resolver_api",
artifact = "org.apache.maven.resolver:maven-resolver-api:1.4.0",
artifact_sha256 = "85aac254240e8bf387d737acf5fcd18f07163ae55a0223b107c7e2af1dfdc6e6",
srcjar_sha256 = "be7f42679a5485fbe30c475afa05c12dd9a2beb83bbcebbb3d2e79eb8aeff9c4",
)
import_external(
name = "org_apache_maven_resolver_maven_resolver_connector_basic",
artifact = "org.apache.maven.resolver:maven-resolver-connector-basic:1.4.0",
artifact_sha256 = "4283db771d9265136615637bd22d02929cfd548c8d351f76ecb88a3006b5faf7",
srcjar_sha256 = "556163b53b1f98df263adf1d26b269cd45316a827f169e0ede514ca5fca0c5d1",
deps = [
"@org_apache_maven_resolver_maven_resolver_api",
"@org_apache_maven_resolver_maven_resolver_spi",
"@org_apache_maven_resolver_maven_resolver_util",
"@org_slf4j_slf4j_api",
],
)
import_external(
name = "org_apache_maven_resolver_maven_resolver_impl",
artifact = "org.apache.maven.resolver:maven-resolver-impl:1.4.0",
artifact_sha256 = "004662079feeed66251480ad76fedbcabff96ee53db29c59f6aa564647c5bfe6",
srcjar_sha256 = "b544f134261f813b1a44ffcc97590236d3d6e2519722d55dea395a96fef18206",
deps = [
"@org_apache_maven_resolver_maven_resolver_api",
"@org_apache_maven_resolver_maven_resolver_spi",
"@org_apache_maven_resolver_maven_resolver_util",
"@org_slf4j_slf4j_api",
],
)
import_external(
name = "org_apache_maven_resolver_maven_resolver_spi",
artifact = "org.apache.maven.resolver:maven-resolver-spi:1.4.0",
artifact_sha256 = "8a2985eb28135eae4c40db446081b1533c1813c251bb370756777697e0b7114e",
srcjar_sha256 = "89099a02006b6ce46096d89f021675bf000e96300bcdc0ff439a86d6e322c761",
deps = [
"@org_apache_maven_resolver_maven_resolver_api",
],
)
import_external(
name = "org_apache_maven_resolver_maven_resolver_transport_file",
artifact = "org.apache.maven.resolver:maven-resolver-transport-file:1.4.0",
artifact_sha256 = "94eb9bcc073ac1591002b26a4cf558324b12d8f76b6d5628151d7f87733436f6",
srcjar_sha256 = "17abd750063fa74cbf754e803ba27ca0216b0bebc8e45e1872cd9ed5a1e5e719",
deps = [
"@org_apache_maven_resolver_maven_resolver_api",
"@org_apache_maven_resolver_maven_resolver_spi",
"@org_slf4j_slf4j_api",
],
)
import_external(
name = "org_apache_maven_resolver_maven_resolver_transport_http",
artifact = "org.apache.maven.resolver:maven-resolver-transport-http:1.4.0",
artifact_sha256 = "8dddd83ec6244bde5ef63ae679a0ce5d7e8fc566369d7391c8814206e2a7114f",
srcjar_sha256 = "5af0150a1ab714b164763d1daca4b8fdd1ab6dd445ec3c57e7ec916ccbdf7e4e",
deps = [
"@org_apache_httpcomponents_httpclient",
"@org_apache_httpcomponents_httpcore",
"@org_apache_maven_resolver_maven_resolver_api",
"@org_apache_maven_resolver_maven_resolver_spi",
"@org_apache_maven_resolver_maven_resolver_util",
"@org_slf4j_jcl_over_slf4j",
"@org_slf4j_slf4j_api",
],
)
import_external(
name = "org_apache_maven_resolver_maven_resolver_util",
artifact = "org.apache.maven.resolver:maven-resolver-util:1.4.0",
artifact_sha256 = "e83b6c2de4b8b8d99d3c226f5e447f70df808834824336c360aa615fc4d7beac",
srcjar_sha256 = "74dd3696e2df175db39b944079f7b49941e39e57f98e469f942635a2ba1cae57",
deps = [
"@org_apache_maven_resolver_maven_resolver_api",
],
)
|
# Generic uwsgi_param headers
CONTENT_LENGTH = 'CONTENT_LENGTH'
CONTENT_TYPE = 'CONTENT_TYPE'
DOCUMENT_ROOT = 'DOCUMENT_ROOT'
QUERY_STRING = 'QUERY_STRING'
PATH_INFO = 'PATH_INFO'
REMOTE_ADDR = 'REMOTE_ADDR'
REMOTE_PORT = 'REMOTE_PORT'
REQUEST_METHOD = 'REQUEST_METHOD'
REQUEST_URI = 'REQUEST_URI'
SERVER_ADDR = 'SERVER_ADDR'
SERVER_NAME = 'SERVER_NAME'
SERVER_PORT = 'SERVER_PORT'
SERVER_PROTOCOL = 'SERVER_PROTOCOL'
# SSL uwsgi_param headers
CLIENT_SSL_CERT = 'CLIENT_SSL_CERT'
|
class MachineDetails:
"""
Class to represent the HTB machine details
"""
def __init__(self, identifier, name, operating_system, ip, avatar, avatar_thumb, points, release, retired_date,
maker, maker2, ratings_pro, ratings_sucks, user_blood, root_blood, user_owns, root_owns):
self.identifier = identifier
self.name = name
self.operating_system = operating_system
self.ip = ip
self.avatar = avatar
self.avatar_thumb = avatar_thumb
self.points = points
self.release = release
self.retired_date = retired_date
self.maker = maker
self.maker2 = maker2
self.ratings_pro = ratings_pro
self.ratings_sucks = ratings_sucks
self.user_blood = user_blood
self.root_blood = root_blood
self.user_owns = user_owns
self.root_owns = root_owns
@staticmethod
def json_to_machinedetails(json_dict):
md = MachineDetails(
json_dict['id'],
json_dict['name'],
json_dict['os'],
json_dict['ip'],
json_dict['avatar'],
json_dict['avatar_thumb'],
json_dict['points'],
json_dict['release'],
json_dict['retired_date'],
json_dict['maker'],
json_dict['maker2'],
json_dict['ratings_pro'],
json_dict['ratings_sucks'],
json_dict['user_blood'],
json_dict['root_blood'],
json_dict['user_owns'],
json_dict['root_owns'],
)
return md
def __str__(self):
return self.name
def __repr__(self):
return self.name
|
file1 = ""
file2 = ""
with open('Hello.txt') as f:
file1 = f.read()
with open('Hi.txt') as f:
file2 = f.read()
file1 += "\n"
file1 += file2
with open('file3.txt', 'w') as f:
f.write(file1)
|
ix.enable_command_history()
ix.api.SdkHelpers.enable_disable_items_selected(ix.application, False)
ix.disable_command_history()
|
# -*- coding: utf-8 -*-
"""
pepipost
This file was automatically generated by APIMATIC v2.0 ( https://apimatic.io ).
"""
class TimeperiodEnum(object):
"""Implementation of the 'Timeperiod' enum.
The periodic \n\nAllowed values \"daily\", \"weekly\", \"monhtly\"
Attributes:
DAILY: TODO: type description here.
WEEKLY: TODO: type description here.
MONHTLY: TODO: type description here.
"""
DAILY = 'daily'
WEEKLY = 'weekly'
MONHTLY = 'monhtly'
|
#!/usr/bin/env python
######################################
# Installation module for King Phisher
######################################
# AUTHOR OF MODULE NAME
AUTHOR="Spencer McIntyre (@zeroSteiner)"
# DESCRIPTION OF THE MODULE
DESCRIPTION="This module will install/update the King Phisher phishing campaign toolkit"
# INSTALL TYPE GIT, SVN, FILE DOWNLOAD
# OPTIONS = GIT, SVN, FILE
INSTALL_TYPE="GIT"
# LOCATION OF THE FILE OR GIT/SVN REPOSITORY
REPOSITORY_LOCATION="https://github.com/securestate/king-phisher/"
# WHERE DO YOU WANT TO INSTALL IT
INSTALL_LOCATION="king-phisher"
# DEPENDS FOR DEBIAN INSTALLS
DEBIAN="git"
# DEPENDS FOR FEDORA INSTALLS
FEDORA="git"
# COMMANDS TO RUN AFTER
AFTER_COMMANDS="cd {INSTALL_LOCATION},yes | tools/install.sh"
|
num = int(input())
for i in range(1, num+1):
s = ''
for j in range(1, i):
s += str(j)
for j in range(i, 0, -1):
s += str(j)
print(s)
|
def replace_spaces_dashes(line):
return "-".join(line.split())
def last_five_lowercase(line):
return line[-5:].lower()
def backwards_skipped(line):
return line[::-2]
if __name__ == '__main__':
line = input("Enter a string: ")
print(replace_spaces_dashes(line))
print(last_five_lowercase(line))
print(backwards_skipped(line))
|
# TODO: refactor nested_dict into common library with ATen
class nested_dict(object):
"""
A nested dict is a dictionary with a parent. If key lookup fails,
it recursively continues into the parent. Writes always happen to
the top level dict.
"""
def __init__(self, base, parent):
self.base, self.parent = base, parent
def __contains__(self, item):
return item in self.base or item in self.parent
def __getitem__(self, x):
r = self.base.get(x)
if r is not None:
return r
return self.parent[x]
|
"""
This is the 'country_names' module.
The country_names module consists of one dictionary which provides corrected or
shortened versions of country names.
"""
names = {'Bolivia (Plurinational State of)':'Bolivia',
'Democratic People\'s Republic of Korea':'North Korea',
'Dem. People\'s Republic of Korea':'North Korea',
'Falkland Islands (Malvinas)':'Falkland Islands',
'Iran (Islamic Republic of)':'Iran',
'Kosovo[1]':'Kosovo',
'Lao People\'s Democratic Republic':'Lao',
'Micronesia (Federated States of)':'Micronesia',
'Micronesia (Fed. States of)':'Micronesia',
'Northern Mariana Islands (Commonwealth of the)':'Northern Mariana Islands',
'Republic of Korea':'South Korea',
'Syrian Arab Republic':'Syria',
'Venezuela (Bolivarian Republic of)':'Venezuela',
'occupied Palestinian territory, including east Jerusalem':'Palestine',
'State of Palestine':'Palestine',
'Saint Martin (French part)':'Saint Martin',
'Sint Maarten (Dutch part)':'Sint Maarten',
'The United Kingdom':'United Kingdom',
'Wallis and Futuna Islands':'Wallis and Futuna',
'Côte d\'Ivoire':'Côte d’Ivoire',
'United States of America':'United States',
'Russian Federation':'Russia',
'Democratic Republic of the Congo':'Democratic Republic of Congo',
'Republic of Moldova':'Moldova'}
|
beggars_jobs = [int(x) for x in input().split(", ")]
count_of_beggars = int(input())
final_list = []
for num in range(count_of_beggars):
jobs = 0
for index in range(num, len(beggars_jobs), count_of_beggars):
jobs += beggars_jobs[index]
final_list.append(jobs)
print(final_list)
|
# for xxx in で2次元リストを作る
# 0 で初期化したリストを作成する
# for ... in の末尾に:を置かない場合、 forの前に書かれた処理を実行する
# range(i) は、0からi未満の整数を持つリストを返すので、forの前に書かれた処理をi回繰り返すことができる
# このような記法を、Pythonではリスト内方表記と呼ぶ
# 参考URL: https://note.nkmk.me/python-list-comprehension/
numbers = [0 for i in range(10)]
print(numbers)
print()
# 2n+1の等比数列をのリストを作成する
geometric_progression = [2*n+1 for n in range(10)]
print("-------- print 2n+1 geometric progression --------")
print(geometric_progression)
print()
# 2次元配列を生成する
# for xxx in を配列に入れ子にする
# [[for j in range(m)] for i in range(n)]
# 処理が右から進むのでわかりづらいが…
# 外側のiのforループで、配列の中に配列をn個作る
# iのforループで作られた配列の中に、jのforループの処理結果が格納される
# 8*8のオセロの盤面を作る想定
othello_board = [[0 for j in range(8)] for i in range(8)]
print()
# ドット絵を表示する
enemy_img = [[0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0],
[1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1],
[1,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1],
[1,1,0,0,0,0,1,1,0,0,0,0,0,0,1,1],
[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0],
[0,0,0,1,1,1,0,0,0,0,0,1,1,1,0,0],
[0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1]]
print("-------- print enemy_image --------")
for line in enemy_img:
for dot in line:
if dot:
print("#", end="")
else:
print(" ", end="")
print()
print()
# enumrate() 関数:リストやタプルなどのイテラブルオブジェクトの要素と同時にインデックス番号(カウント、順番)を取得できる
# 参考URL: https://note.nkmk.me/python-enumerate-start/
landmap = [["森" for i in range(20)] for j in range(10)]
landmap[0][0] = "城"
landmap[0][19] = "町"
landmap[9][19] = "町"
# i, line in enumerate(landmap) は
# enumerate() で取り出されたインデックス番号と値をそれぞれiとlineに格納し、
# for ループの中で利用することができる
# dict だと、 dict.items() のメンバメソッドが使えるが、listにはない
# for ループの中でlistのインデックスを使いたい場合、組み込み関数enumerate()を利用する
print("-------- print landmap --------")
for i, line in enumerate(landmap):
print(str(i) + ":", end="")
for j, area in enumerate(line): # lineの内部のインデックス番号をjで取り出す
if (i % 2 == 0 or j % 3 == 0) and area == "森":
print("+", end="")
else:
print(area, end="")
print()
# dict と list で利用可能な関数が違うのちょっとわかりづらいな…慣れの問題かな…
|
""" --- geometry parameters for simple geometry of cylindrical tube with spherical particle inside, 2D --- """
# length scale
nm = 1e-0
# tolerance for coordinate comparisons
tolc = 1e-9*nm
dim = 2
# cylinder radius
R = 40*nm
# cylinder length
l = 80*nm
# particle position (z-axis)
z0 = 0*nm
# particle radius
r = 6*nm
|
try:
raise
except:
pass
try:
raise NotImplementedError('User Defined Error Message.')
except NotImplementedError as err:
print('NotImplementedError')
except:
print('Error :')
try:
raise KeyError('missing key')
except KeyError as ex:
print('KeyError')
except:
print('Error :')
try:
1 // 0
except ZeroDivisionError as ex:
print('ZeroDivisionError')
except:
print('Error :')
try:
raise RuntimeError("runtime!")
except RuntimeError as ex:
print('RuntimeError :', ex)
except:
print('Error :')
|
# Copyright (c) 2020-2021 Matematyka dla Ciekawych Świata (http://ciekawi.icm.edu.pl/)
# Copyright (c) 2020-2021 Robert Ryszard Paciorek <rrp@opcode.eu.org>
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
try: clipData
except NameError: clipData = []
clipData += [
{ 'comment': 'podstawy elektroniki - Prawo Ohma, Praw Kirchhoffa' },
{
'image': [
[0.0, eduMovie.convertFile('prawoOhma.tex', margins=12, viaCairo=True, negate=True)],
],
'text' : [
'Na ekranie mamy wyświetloną zależność nazywaną prawem Ohma, <m> którą powinniście kojarzyć z zajęć fizyki w szkole. <m>'
'Zachodzi ona dla elementów liniowych, czyli na przykład <m> (w dobrym przybliżeniu) dla zwykłego kawałka drutu. <m>'
'Polega ona na proporcjonalności natężenia płynącego prądu <m> do napięcia pomiędzy końcami takiego przewodnika. <m>'
'Im większe napięcie tym większy prąd będzie płynął, <m> im bardziej oporny przewodnik przy danym napięciu <m> tym mniejszy prąd popłynie i tak dalej. <m>'
'Ten stosunek napięcia i prądu nazywany jest właśnie <m> oporem elektrycznym i oznaczany symbolem R. <m>'
'Prawo Ohma jest jednak bardziej regułą empiryczną, <m> niż takim prawdziwym prawem przyrody <m>'
'(jak na przykład prawo zachowania energii czy też inne prawa <m> związane z elektrycznością o których będziemy jeszcze mówili). <m>'
'Prawo Ohma stosuje się wyłącznie do pewnej grupy <m> materiałów i w pewnym zakresie warunków. <m>'
'Nawet zwykła, klasyczna żarówka również po części łamie prawo Ohma, <m>'
'ponieważ opór w momencie kiedy żarnik jest nie rozgrzany ma <m> zupełnie inną wartość niż po jego rozgrzaniu (zmienia się on <m> bardzo szybko w momencie podłączenia do żarówki odpowiedniego napięcia). <m>'
'Opór wielu materiałów zależy od ich temperatury i moglibyśmy <m> dodać uzupełnienie na ten temat do prawa Ohma, <m> natomiast to niczego nie rozwiązuje. <m>'
'Mamy także elementy których opór zależy od przyłożonego napięcia, <m> albo elementy które niezależnie od prądu jaki przez nie płynie <m> charakteryzują się praktycznie stałym spadkiem napięcia. <m>'
'Mimo tych ograniczeń prawo Ohma pozostaje bardzo przydatne. <m>'
]
},
{
'image': [
[0.0, eduMovie.convertFile("Kirchhoff_1.sch", negate=True)],
["kirchhoff2", eduMovie.convertFile("Kirchhoff_2.sch", negate=True)],
["kirchhoff_szeregowe", eduMovie.convertFile("Kirchhoff_szeregowe.sch", negate=True)]
],
'text' : [
"Kolejnymi prawami które się przydają i na dodatek są dość <fundamentalnymi>[fundament'alnymi] <m> prawami przyrody są prawa Kirchhoffa. <m>"
"Są także dosyć intuicyjne. <m>"
'Pierwsze prawo Kirchhoffa mówi że jeżeli mamy węzeł, czyli np. punkt połączenia <m> kilku przewodów, to suma prądów do niego wpływających jest równa <m> sumie prądów wypływających <–>[.] prąd nie bierze się znikąd i nie znika. <m>'
'Jeżeli wiemy, że prąd to przepływ ładunku, to prawo to powinno wydawać się <m> dość oczywiste - węzeł nie jest w stanie wytwarzać ani pochłaniać ładunków, <m> zatem to co do niego wpływa musi być tym co z niego wypływa. <m>'
'W rzeczywistości możemy spotkać się z jakimiś zjawiskami pasożytniczymi w węźle, <m> pozwalającymi na gromadzenie się tam jakiegoś niewielkiego zapasu ładunku, <m>'
'ale na ogół jest on tak niewielki że nie zmienia nam działania tego prawa. <m> Tym bardziej w stanie ustalonym gdzie już np. zgromadził się w maksymalnej ilości. <m>'
'Jednak jeżeli zjawiska te byłyby istotne, dla naszej analizy, to należałoby <m> zaznaczyć je jako odpowiednie elementy dołączone do idealnego węzła. <mark name="kirchhoff2" />'
'Drugie prawo Kirchhoffa mówi że jeżeli przejdziemy po dowolnej pętli w układzie <m> to suma spadków i wzrostów napięć <m> (z uwzględnieniem znaków) musi być równa zero. <m>'
'Jako że napięcia to są różnice potencjałów, <m> to przechodząc po takiej pętli suma napięć musi być równa zero, <m>'
'aby potencjał w punkcie A z którego wychodzimy, <m> był równy potencjałowi w tym samym punkcie A do którego dochodzimy <m> – również wydaje się dość oczywiste. <m>'
'Najtrudniejsze w stosowaniu praw Kirchhoffa jest pamiętanie o <m> znakach napięcia na poszczególnych elementach, <m> czy też kierunku prądu wpływającego, wypływającego z węzła. <m>'
'Zwłaszcza w bardziej skomplikowanych obwodach. <mark name="kirchhoff_szeregowe" />'
'Warto zauważyć że z praw Kirchhoffa <m> (oraz charakterystyki danego elementu, wynikającej np. z prawa Ohma) <m>'
'wynikają reguły dotyczące obliczeń dla <m> połączeń równoległych i szeregowych różnych elementów (np. oporników). <m>'
]
},
]
|
"""
Given a string s and an integer array indices of the same length.
The string s will be shuffled such that the character at the ith position
moves to indices[i] in the shuffled string.
Return the shuffled string.
Example:
Input: s = "codeleet", indices = [4,5,6,7,0,2,1,3]
Output: "leetcode"
Explanation: As shown, "codeleet" becomes "leetcode" after shuffling.
Constraints:
- s.length == indices.length == n
- 1 <= n <= 100
- s contains only lower-case English letters.
- 0 <= indices[i] < n
- All values of indices are unique (i.e. indices is a permutation of
the integers from 0 to n - 1).
"""
#Difficulty: Easy
#399 / 399 test cases passed.
#Runtime: 72 ms
#Memory Usage: 13.8 MB
#Runtime: 72 ms, faster than 69.20% of Python3 online submissions for Shuffle String.
#Memory Usage: 13.8 MB, less than 100.00% of Python3 online submissions for Shuffle String.
class Solution:
def restoreString(self, s: str, indices: List[int]) -> str:
l = len(s)
shuffle = "_" * l
for i in range(l):
shuffle = shuffle[:indices[i]] + s[i] + shuffle[indices[i]+1:]
return shuffle
|
def extractBersekerTranslations(item):
"""
"""
vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title'])
if 'Because the world has changed into a death game is funny' in item['tags'] and (chp or vol or 'Prologue' in postfix):
return buildReleaseMessageWithType(item, 'Sekai ga death game ni natta no de tanoshii desu', vol, chp, frag=frag, postfix=postfix)
return False
|
N = int(input())
combined_length = 0
for _ in range(N):
length = int(input())
combined_length += length
print(combined_length - (N-1))
|
class Resort:
def __init__(self):
self._mysql = False
self._postgres = False
self._borg = False
def name(self, name):
self._name = name
return self
def appendName(self, text):
return text+self._name
return self
def storage(self, storage):
self._storage = storage
return self
def withMySQL(self, mysql):
self._mysql = mysql
return self
def withPostgres(self):
self._postgres = True
return self
def passAdapters(self, receiver):
try:
receiver.setBorg(self._borg)
except AttributeError:
pass
try:
receiver.setMySQL(self._mysql)
except AttributeError:
pass
try:
receiver.setPostgres(self._postgres)
except AttributeError:
pass
def initMySQL(self):
try:
self._storage.resort(self._name).createAdapter('mysql')
except OSError:
print("MySQL already exists. Ignoring")
self._storage.rebuildResort(self)
def initBorg(self, copies):
try:
self._storage.resort(self._name).createAdapter('files')
except OSError:
print("Files already exists. Ignoring")
self._storage.rebuildResort(self)
self._borg.init(copies)
def withBorg(self, borg):
borg.resort(self)
self._borg = borg
return self
def createFolder(self, folderName):
self._storage.resort(self._name).adapter(self._currentAdapter).createFolder(folderName)
return self
def listFolders(self, path=None):
return self._storage.resort(self._name).adapter(self._currentAdapter).listFolder(path)
def fileContent(self, path):
return self._storage.resort(self._name).adapter(self._currentAdapter).fileContent(path)
def remove(self, remotePath):
self._storage.resort(self._name).adapter(self._currentAdapter) \
.remove(remotePath, True)
def upload(self, localPath, remotePath):
self._storage.resort(self._name).adapter(self._currentAdapter) \
.upload(localPath, remotePath, True)
def download(self, remotePath, localPath):
self._storage.resort(self._name).adapter(self._currentAdapter) \
.download(remotePath, localPath, True)
def adapter(self, adapater):
self._currentAdapter = adapater
return self
def print(self):
print("- "+self._name)
if self._borg:
print(" - borg filebackup")
if self._mysql:
print(" - mysql")
if self._postgres:
print(" - postgres")
class Error(Exception):
pass
class NoSuchResortError(Error):
def __init__(self, resortName):
self.resortName = resortName
|
# -*- coding: utf8 -*-
# Copyright (c) 2017-2021 THL A29 Limited, a Tencent company. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# CAM签名/鉴权错误。
AUTHFAILURE = 'AuthFailure'
# 用户没有权限进行此查询操作。
AUTHFAILURE_CHECKRESOURCERESPONSECODEERROR = 'AuthFailure.CheckResourceResponseCodeError'
# 未授权操作。
AUTHFAILURE_UNAUTHORIZEDOPERATION = 'AuthFailure.UnauthorizedOperation'
# 操作失败。
FAILEDOPERATION = 'FailedOperation'
# 下载音频文件失败。
FAILEDOPERATION_ERRORDOWNFILE = 'FailedOperation.ErrorDownFile'
# 识别失败。
FAILEDOPERATION_ERRORRECOGNIZE = 'FailedOperation.ErrorRecognize'
# 错误的TaskId。
FAILEDOPERATION_NOSUCHTASK = 'FailedOperation.NoSuchTask'
# 账号因为欠费停止服务,请在腾讯云账户充值。
FAILEDOPERATION_SERVICEISOLATE = 'FailedOperation.ServiceIsolate'
# 账号本月免费额度已用完。
FAILEDOPERATION_USERHASNOFREEAMOUNT = 'FailedOperation.UserHasNoFreeAmount'
# 服务未开通,请在腾讯云官网语音识别控制台开通服务。
FAILEDOPERATION_USERNOTREGISTERED = 'FailedOperation.UserNotRegistered'
# 内部错误。
INTERNALERROR = 'InternalError'
# 初始化配置失败。
INTERNALERROR_ERRORCONFIGURE = 'InternalError.ErrorConfigure'
# 创建日志失败。
INTERNALERROR_ERRORCREATELOG = 'InternalError.ErrorCreateLog'
# 下载音频文件失败。
INTERNALERROR_ERRORDOWNFILE = 'InternalError.ErrorDownFile'
# 新建数组失败。
INTERNALERROR_ERRORFAILNEWPREQUEST = 'InternalError.ErrorFailNewprequest'
# 写入数据库失败。
INTERNALERROR_ERRORFAILWRITETODB = 'InternalError.ErrorFailWritetodb'
# 文件无法打开。
INTERNALERROR_ERRORFILECANNOTOPEN = 'InternalError.ErrorFileCannotopen'
# 获取路由失败。
INTERNALERROR_ERRORGETROUTE = 'InternalError.ErrorGetRoute'
# 创建日志路径失败。
INTERNALERROR_ERRORMAKELOGPATH = 'InternalError.ErrorMakeLogpath'
# 识别失败。
INTERNALERROR_ERRORRECOGNIZE = 'InternalError.ErrorRecognize'
# 访问数据库失败。
INTERNALERROR_FAILACCESSDATABASE = 'InternalError.FailAccessDatabase'
# 访问Redis失败。
INTERNALERROR_FAILACCESSREDIS = 'InternalError.FailAccessRedis'
# 参数错误。
INVALIDPARAMETER = 'InvalidParameter'
# 请求数据长度无效。
INVALIDPARAMETER_ERRORCONTENTLENGTH = 'InvalidParameter.ErrorContentlength'
# 参数不全。
INVALIDPARAMETER_ERRORPARAMSMISSING = 'InvalidParameter.ErrorParamsMissing'
# 解析请求数据失败。
INVALIDPARAMETER_ERRORPARSEQUEST = 'InvalidParameter.ErrorParsequest'
# 文件编码错误。
INVALIDPARAMETER_FILEENCODE = 'InvalidParameter.FileEncode'
# 非法的词表状态。
INVALIDPARAMETER_INVALIDVOCABSTATE = 'InvalidParameter.InvalidVocabState'
# 该模型状态不允许删除。
INVALIDPARAMETER_MODELSTATE = 'InvalidParameter.ModelState'
# 参数取值错误。
INVALIDPARAMETERVALUE = 'InvalidParameterValue'
# AppId无效。
INVALIDPARAMETERVALUE_ERRORINVALIDAPPID = 'InvalidParameterValue.ErrorInvalidAppid'
# ClientIp无效。
INVALIDPARAMETERVALUE_ERRORINVALIDCLIENTIP = 'InvalidParameterValue.ErrorInvalidClientip'
# EngSerViceType无效。
INVALIDPARAMETERVALUE_ERRORINVALIDENGSERVICE = 'InvalidParameterValue.ErrorInvalidEngservice'
# ProjectId无效。
INVALIDPARAMETERVALUE_ERRORINVALIDPROJECTID = 'InvalidParameterValue.ErrorInvalidProjectid'
# RequestId无效。
INVALIDPARAMETERVALUE_ERRORINVALIDREQUESTID = 'InvalidParameterValue.ErrorInvalidRequestid'
# SourceType无效。
INVALIDPARAMETERVALUE_ERRORINVALIDSOURCETYPE = 'InvalidParameterValue.ErrorInvalidSourcetype'
# SubserviceType无效。
INVALIDPARAMETERVALUE_ERRORINVALIDSUBSERVICETYPE = 'InvalidParameterValue.ErrorInvalidSubservicetype'
# Url无效。
INVALIDPARAMETERVALUE_ERRORINVALIDURL = 'InvalidParameterValue.ErrorInvalidUrl'
# UsrAudioKey无效。
INVALIDPARAMETERVALUE_ERRORINVALIDUSERAUDIOKEY = 'InvalidParameterValue.ErrorInvalidUseraudiokey'
# 音频编码格式不支持。
INVALIDPARAMETERVALUE_ERRORINVALIDVOICEFORMAT = 'InvalidParameterValue.ErrorInvalidVoiceFormat'
# 音频数据无效。
INVALIDPARAMETERVALUE_ERRORINVALIDVOICEDATA = 'InvalidParameterValue.ErrorInvalidVoicedata'
# 音频时长超过限制。
INVALIDPARAMETERVALUE_ERRORVOICEDATATOOLONG = 'InvalidParameterValue.ErrorVoicedataTooLong'
# 非法的参数长度。
INVALIDPARAMETERVALUE_INVALIDPARAMETERLENGTH = 'InvalidParameterValue.InvalidParameterLength'
# 非法的VocabId。
INVALIDPARAMETERVALUE_INVALIDVOCABID = 'InvalidParameterValue.InvalidVocabId'
# 非法的词表状态。
INVALIDPARAMETERVALUE_INVALIDVOCABSTATE = 'InvalidParameterValue.InvalidVocabState'
# 词权重不合法。
INVALIDPARAMETERVALUE_INVALIDWORDWEIGHT = 'InvalidParameterValue.InvalidWordWeight'
# 非法的WordWeightStr。
INVALIDPARAMETERVALUE_INVALIDWORDWEIGHTSTR = 'InvalidParameterValue.InvalidWordWeightStr'
# 模型不存在。
INVALIDPARAMETERVALUE_MODELID = 'InvalidParameterValue.ModelId'
# 非法的模型状态。
INVALIDPARAMETERVALUE_TOSTATE = 'InvalidParameterValue.ToState'
# 超过配额限制。
LIMITEXCEEDED = 'LimitExceeded'
# 自学习模型创建个数已到限制。
LIMITEXCEEDED_CUSTOMIZATIONFULL = 'LimitExceeded.CustomizationFull'
# 上线模型个数已到限制。
LIMITEXCEEDED_ONLINEFULL = 'LimitExceeded.OnlineFull'
# 热词表数量已到账号限制。
LIMITEXCEEDED_VOCABFULL = 'LimitExceeded.VocabFull'
# 缺少参数错误。
MISSINGPARAMETER = 'MissingParameter'
# 请求的次数超过了频率限制。
REQUESTLIMITEXCEEDED = 'RequestLimitExceeded'
# 未知参数错误。
UNKNOWNPARAMETER = 'UnknownParameter'
|
#! python3
# -*- coding: utf-8 -*-
def method(args1='sample2'):
print(args1 + " is runned")
print("")
|
def extract_author(simple_author_1):
list_tokenize_name=simple_author_1.split("and")
if len(list_tokenize_name)>1:
authors_list = []
for tokenize_name in list_tokenize_name:
splitted=tokenize_name.split(",")
authors_list.append((splitted[0].strip(),splitted[1].strip()))
return authors_list
tokenize_name= simple_author_1.split(",")
if len(tokenize_name)>1:
return (tokenize_name[0],tokenize_name[1].strip())
tokenize_name=simple_author_1.split(" ")
length_tokenize_name=len(tokenize_name)
if length_tokenize_name==1:
return simple_author_1, ""
elif length_tokenize_name==2:
return (tokenize_name[1],tokenize_name[0])
else:
return (tokenize_name[2],tokenize_name[0]+" "+tokenize_name[1])
|
class SwaggerYaml:
def __init__(self, swagger, info, schemes, basePath, produces, paths, definitions):
self.swagger = swagger
self.info = info
self.schemes = schemes
self.basePath = basePath
self.produces = produces
self.paths = paths
self.definitions = definitions
|
# ------------------------------
# 401. Binary Watch
#
# Description:
# A binary watch has 4 LEDs on the top which represent the hours (0-11), and the 6 LEDs on the bottom represent the minutes (0-59).
# Each LED represents a zero or one, with the least significant bit on the right.
#
# Given a non-negative integer n which represents the number of LEDs that are currently on, return all possible times the watch could represent.
# Example:
# Input: n = 1
# Return: ["1:00", "2:00", "4:00", "8:00", "0:01", "0:02", "0:04", "0:08", "0:16", "0:32"]
#
# Note:
# The order of output does not matter.
# The hour must not contain a leading zero, for example "01:00" is not valid, it should be "1:00".
# The minute must be consist of two digits and may contain a leading zero, for example "10:2" is not valid, it should be "10:02".
#
# Version: 1.0
# 06/28/18 by Jianfa
# ------------------------------
class Solution(object):
def readBinaryWatch(self, num):
"""
:type num: int
:rtype: List[str]
"""
res = []
for h in range(12):
for m in range(60):
if (bin(h) + bin(m)).count('1') == num:
if m < 10:
res.append(str(h) + ':0' + str(m))
else:
res.append(str(h) + ':' + str(m))
return res
# Used for testing
if __name__ == "__main__":
test = Solution()
# ------------------------------
# Summary:
# Brute force search.
#
# A very brief solution from: https://leetcode.com/problems/binary-watch/discuss/88458/Simple-Python+Java
# def readBinaryWatch(self, num):
# return ['%d:%02d' % (h, m)
# for h in range(12) for m in range(60)
# if (bin(h) + bin(m)).count('1') == num]
|
"""
Question:
Implement Queue using Stacks
Implement the following operations of a queue using stacks.
push(x) -- Push element x to the back of queue.
pop() -- Removes the element from in front of queue.
peek() -- Get the front element.
empty() -- Return whether the queue is empty.
Notes:
You must use only standard operations of a stack -- which means only push to top, peek/pop from top, size, and is empty operations are valid.
Depending on your language, stack may not be supported natively. You may simulate a stack by using a list or deque (double-ended queue), as long as you use only standard operations of a stack.
You may assume that all operations are valid (for example, no pop or peek operations will be called on an empty queue).
Performance:
1. Total Accepted: 18785 Total Submissions: 55431 Difficulty: Easy
2. Your runtime beats 21.35% of python submissions.
Design note:
At first time, it's hard to think that Queue and Stack are absolutely two different thing.
How to get the first element in a stack?
Well, we must use another storage to store the poped items, Yes, add another stack!
Of course, it's weird. After check discussion of leetcode, it's valid.
"""
class Stack(object):
def __init__(self):
self.stack = list()
def push(self, x):
return self.stack.append(x)
def pop(self):
return self.stack.pop()
def size(self):
return len(self.stack)
def empty(self):
return self.size() == 0
class Queue(object):
def __init__(self):
"""
initialize your data structure here.
"""
self.left_stack = Stack() # master
self.right_stack = Stack() # slave
def push(self, x):
"""
:type x: int
:rtype: nothing
"""
self.left_stack.push(x)
def pop(self):
"""
:rtype: nothing
"""
return self.pop_peek_common(True)
def peek(self):
"""
:rtype: int
"""
return self.pop_peek_common(False)
def empty(self):
"""
:rtype: bool
"""
return self.left_stack.empty()
def pop_peek_common(self, should_delete):
while self.left_stack.size() > 0:
item = self.left_stack.pop()
self.right_stack.push(item)
the_item = self.right_stack.pop()
if not should_delete:
self.left_stack.push(item)
while not self.right_stack.empty():
item = self.right_stack.pop()
self.left_stack.push(item)
return the_item
q = Queue()
assert q.empty() is True
q.push(1)
assert q.peek() == 1
assert q.empty() is False
assert q.pop() == 1
assert q.empty() is True
q.push(2)
q.push(3)
q.push(4)
assert q.empty() is False
assert q.peek() == 2
|
#Tuplas são imutavéis
lanche = ('hamburguer','suco','pizza','pudim', 'batata frita')
print(sorted(lanche))
print(len(lanche))
print(lanche)
print(lanche[2])
for comida in lanche:
print('Eu vou comer {}'.format(comida))
print('Comi pra caramba')
for cont in range(0, len(lanche)):
print (lanche[cont])
print('Comi pra caramba')
|
print("Sum > ")
num1 = input("First number : ")
num2 = input("second number : ")
print(int(num1) + int(num2))
# 빼기, 곱하기, 나누기, 나머지
print(int(num1) - int(num2))
print(int(num1) * int(num2))
print(int(num1) / int(num2))
print(int(num1) % int(num2))
if(int(num1)%2 == 0):
print("num1 is even")
else:
print("num1 is odd")
|
# Temperature of an oven setting by reading from a pressure meter
r = int(input("Enter the reading:- "))
if( (r == 2) or (r == 3) ):
print("Temperature set to 500 degrees.")
elif( r==4):
print("Temperature set to 600 degrees.")
elif((r==5)or(r==6)or(r==7)):
print("Temperature set to 700 degrees.")
elif((r<2) or (r>7)):
print("DEFAULT:- The temperature setting is 300 degrees.")
|
# tested
def Main():
a = 1
b = 10
c = 20
d = add(a, b, 10)
d2 = add(d, d, d)
return d2
def add(a, b, c):
result = a + b + c
return result
|
#
# @lc app=leetcode id=779 lang=python3
#
# [779] K-th Symbol in Grammar
#
# @lc code=start
class Solution(object):
def kthGrammar(self, N, K):
"""
:type N: int
:type K: int
:rtype: int
"""
if N == 1: return 0
if K == 2: return 1
if K <= 1 << N - 2: return self.kthGrammar(N - 1, K)
K -= 1 << N - 2
return 1 - self.kthGrammar(N - 1, K)
# @lc code=end
|
#!/usr/bin/env python
#########################################################################################
#
# Test function sct_documentation
#
# ---------------------------------------------------------------------------------------
# Copyright (c) 2014 Polytechnique Montreal <www.neuro.polymtl.ca>
# Author: Augustin Roux
# modified: 2014/10/30
#
# About the license: see the file LICENSE.TXT
#########################################################################################
#import sct_utils as sct
def test(data_path):
# define command
cmd = 'sct_propseg'
# return
#return sct.run(cmd, 0)
return sct.run(cmd)
if __name__ == "__main__":
# call main function
test()
|
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.062853,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.252056,
'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.335673,
'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.295198,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage': 0.017004,
'Execution Unit/Instruction Scheduler/FP Instruction Window/Subthreshold Leakage with power gating': 0.00962066,
'Execution Unit/Instruction Scheduler/Gate Leakage': 0.00730101,
'Execution Unit/Instruction Scheduler/Instruction Window/Area': 1.00996,
'Execution Unit/Instruction Scheduler/Instruction Window/Gate Leakage': 0.00529112,
'Execution Unit/Instruction Scheduler/Instruction Window/Peak Dynamic': 2.07911,
'Execution Unit/Instruction Scheduler/Instruction Window/Runtime Dynamic': 0.511177,
'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.293174,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage': 0.0178624,
'Execution Unit/Instruction Scheduler/ROB/Subthreshold Leakage with power gating': 0.00897339,
'Execution Unit/Instruction Scheduler/Runtime Dynamic': 1.09955,
'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.240329,
'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.94532,
'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.0634158,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.0107012,
'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.101067,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0791417,
'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.164483,
'Execution Unit/Register Files/Runtime Dynamic': 0.0898429,
'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.261438,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.661469,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.0920413,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0345155,
'Execution Unit/Runtime Dynamic': 2.50829,
'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.00178474,
'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.00178474,
'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.00155913,
'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.00060609,
'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.00113688,
'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.00626549,
'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.0169469,
'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.0760809,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 4.8394,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.225952,
'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.258405,
'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.29637,
'Instruction Fetch Unit/Runtime Dynamic': 0.583651,
'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.0910578,
'L2/Runtime Dynamic': 0.0149119,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80969,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 3.9597,
'Load Store Unit/Data Cache/Runtime Dynamic': 1.32955,
'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.0880819,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0880819,
'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.37734,
'Load Store Unit/Runtime Dynamic': 1.85203,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.217195,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.43439,
'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.0770832,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0783381,
'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.300896,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0373754,
'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.592657,
'Memory Management Unit/Runtime Dynamic': 0.115713,
'Memory Management Unit/Subthreshold Leakage': 0.0769113,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0399462,
'Peak Dynamic': 22.8644,
'Renaming Unit/Area': 0.369768,
'Renaming Unit/FP Front End RAT/Area': 0.168486,
'Renaming Unit/FP Front End RAT/Gate Leakage': 0.00489731,
'Renaming Unit/FP Front End RAT/Peak Dynamic': 3.33511,
'Renaming Unit/FP Front End RAT/Runtime Dynamic': 0.221243,
'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.0177571,
'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.14974,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage': 0.00611897,
'Renaming Unit/Int Front End RAT/Subthreshold Leakage with power gating': 0.00348781,
'Renaming Unit/Peak Dynamic': 4.56169,
'Renaming Unit/Runtime Dynamic': 0.388741,
'Renaming Unit/Subthreshold Leakage': 0.070483,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0362779,
'Runtime Dynamic': 5.46334,
'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.025722,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.222892,
'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.136926,
'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.123069,
'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.198506,
'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.100199,
'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.421774,
'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.119763,
'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344,
'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222,
'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833,
'Execution Unit/Peak Dynamic': 4.29954,
'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.0258682,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00516207,
'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.0470388,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0381767,
'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.072907,
'Execution Unit/Register Files/Runtime Dynamic': 0.0433388,
'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.105529,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.270699,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543,
'Execution Unit/Runtime Dynamic': 1.36408,
'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.000937183,
'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.000937183,
'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.000842201,
'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.000340203,
'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.000548411,
'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.00326498,
'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.00805973,
'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.0367002,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 2.33445,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.104961,
'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.124651,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104,
'Instruction Fetch Unit/Peak Dynamic': 4.66626,
'Instruction Fetch Unit/Runtime Dynamic': 0.277637,
'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.041946,
'L2/Runtime Dynamic': 0.00699192,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80901,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 2.57227,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.652076,
'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.0431954,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0431955,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 2.77625,
'Load Store Unit/Runtime Dynamic': 0.908297,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.106513,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.213025,
'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.0378017,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0383785,
'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.145148,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0173641,
'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.366193,
'Memory Management Unit/Runtime Dynamic': 0.0557427,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 15.7397,
'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.0680471,
'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.00638066,
'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.0617779,
'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.136206,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 2.74895,
'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.0146946,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.214231,
'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.0762249,
'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.103621,
'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.167136,
'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.0843647,
'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.355122,
'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.106825,
'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344,
'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222,
'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833,
'Execution Unit/Peak Dynamic': 4.1679,
'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.0144005,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00434631,
'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.037058,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0321437,
'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.0514585,
'Execution Unit/Register Files/Runtime Dynamic': 0.03649,
'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.0817452,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.21952,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543,
'Execution Unit/Runtime Dynamic': 1.23074,
'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.000780825,
'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.000780825,
'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.000696157,
'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.000278277,
'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.000461746,
'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.00271955,
'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.00691271,
'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.0309005,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 1.96554,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0891683,
'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.104952,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage': 0.442943,
'Instruction Fetch Unit/Instruction Decoder/Subthreshold Leakage with power gating': 0.166104,
'Instruction Fetch Unit/Peak Dynamic': 4.27945,
'Instruction Fetch Unit/Runtime Dynamic': 0.234653,
'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.0410605,
'L2/Runtime Dynamic': 0.0105044,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80901,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 2.34204,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.54846,
'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.0357467,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0357467,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 2.51084,
'Load Store Unit/Runtime Dynamic': 0.760498,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.0881454,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.176291,
'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.0312831,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.0318681,
'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.12221,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.0147115,
'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.332058,
'Memory Management Unit/Runtime Dynamic': 0.0465796,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 14.9208,
'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.0378811,
'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.00513608,
'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.0527002,
'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.0957174,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 2.37869,
'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.0112371,
'Execution Unit/Complex ALUs/Runtime Dynamic': 0.211515,
'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.057366,
'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.070632,
'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.113927,
'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.0575064,
'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.242065,
'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.0719872,
'Execution Unit/Integer ALUs/Runtime Dynamic': 0.101344,
'Execution Unit/Integer ALUs/Subthreshold Leakage': 0.40222,
'Execution Unit/Integer ALUs/Subthreshold Leakage with power gating': 0.150833,
'Execution Unit/Peak Dynamic': 4.06656,
'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.0108377,
'Execution Unit/Register Files/Floating Point RF/Runtime Dynamic': 0.00296262,
'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.0257653,
'Execution Unit/Register Files/Integer RF/Runtime Dynamic': 0.0219104,
'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.036603,
'Execution Unit/Register Files/Runtime Dynamic': 0.024873,
'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.0570901,
'Execution Unit/Results Broadcast Bus/Runtime Dynamic': 0.157404,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage': 0.081478,
'Execution Unit/Results Broadcast Bus/Subthreshold Leakage with power gating': 0.0305543,
'Execution Unit/Runtime Dynamic': 1.04123,
'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.00036335,
'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.00036335,
'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.000322085,
'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.000127752,
'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.000314745,
'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.00136353,
'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.00328341,
'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.021063,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage': 0.00151885,
'Instruction Fetch Unit/Instruction Buffer/Subthreshold Leakage with power gating': 0.000701682,
'Instruction Fetch Unit/Instruction Cache/Area': 3.14635,
'Instruction Fetch Unit/Instruction Cache/Gate Leakage': 0.029931,
'Instruction Fetch Unit/Instruction Cache/Peak Dynamic': 1.33979,
'Instruction Fetch Unit/Instruction Cache/Runtime Dynamic': 0.0509907,
'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.0715396,
'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': 3.62333,
'Instruction Fetch Unit/Runtime Dynamic': 0.14824,
'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.0372791,
'L2/Runtime Dynamic': 0.00906734,
'L2/Subthreshold Leakage': 0.834142,
'L2/Subthreshold Leakage with power gating': 0.401066,
'Load Store Unit/Area': 8.80901,
'Load Store Unit/Data Cache/Area': 6.84535,
'Load Store Unit/Data Cache/Gate Leakage': 0.0279261,
'Load Store Unit/Data Cache/Peak Dynamic': 2.03791,
'Load Store Unit/Data Cache/Runtime Dynamic': 0.399234,
'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.0259074,
'Load Store Unit/LoadQ/Runtime Dynamic': 0.0259075,
'Load Store Unit/LoadQ/Subthreshold Leakage': 0.00941961,
'Load Store Unit/LoadQ/Subthreshold Leakage with power gating': 0.00536918,
'Load Store Unit/Peak Dynamic': 2.16025,
'Load Store Unit/Runtime Dynamic': 0.552909,
'Load Store Unit/StoreQ/Area': 0.322079,
'Load Store Unit/StoreQ/Gate Leakage': 0.00329971,
'Load Store Unit/StoreQ/Peak Dynamic': 0.0638833,
'Load Store Unit/StoreQ/Runtime Dynamic': 0.127767,
'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.0226724,
'Memory Management Unit/Dtlb/Runtime Dynamic': 0.023226,
'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.0833033,
'Memory Management Unit/Itlb/Runtime Dynamic': 0.00837784,
'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.278359,
'Memory Management Unit/Runtime Dynamic': 0.0316039,
'Memory Management Unit/Subthreshold Leakage': 0.0766103,
'Memory Management Unit/Subthreshold Leakage with power gating': 0.0398333,
'Peak Dynamic': 13.7552,
'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.0285093,
'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.00353367,
'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.0361967,
'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.0682397,
'Renaming Unit/Subthreshold Leakage': 0.0552466,
'Renaming Unit/Subthreshold Leakage with power gating': 0.0276461,
'Runtime Dynamic': 1.85129,
'Subthreshold Leakage': 6.16288,
'Subthreshold Leakage with power gating': 2.55328}],
'DRAM': {'Area': 0,
'Gate Leakage': 0,
'Peak Dynamic': 6.695877235603369,
'Runtime Dynamic': 6.695877235603369,
'Subthreshold Leakage': 4.252,
'Subthreshold Leakage with power gating': 4.252},
'L3': [{'Area': 61.9075,
'Gate Leakage': 0.0484137,
'Peak Dynamic': 0.334595,
'Runtime Dynamic': 0.085356,
'Subthreshold Leakage': 6.80085,
'Subthreshold Leakage with power gating': 3.32364}],
'Processor': {'Area': 191.908,
'Gate Leakage': 1.53485,
'Peak Dynamic': 67.6147,
'Peak Power': 100.727,
'Runtime Dynamic': 12.5276,
'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': 67.2801,
'Total Cores/Runtime Dynamic': 12.4423,
'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.334595,
'Total L3s/Runtime Dynamic': 0.085356,
'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}}
|
# encoding: utf-8
# module Tekla.Structures.Geometry3d calls itself Geometry3d
# from Tekla.Structures,Version=2017.0.0.0,Culture=neutral,PublicKeyToken=2f04dbe497b71114
# by generator 1.145
# no doc
# no imports
# no functions
# classes
class AABB(object):
"""
AABB()
AABB(MinPoint: Point,MaxPoint: Point)
AABB(AABB: AABB)
"""
def Collide(self, Other):
""" Collide(self: AABB,Other: AABB) -> bool """
pass
def GetCenterPoint(self):
""" GetCenterPoint(self: AABB) -> Point """
pass
def IsInside(self, *__args):
"""
IsInside(self: AABB,LineSegment: LineSegment) -> bool
IsInside(self: AABB,Point: Point) -> bool
"""
pass
def __add__(self, *args):
""" x.__add__(y) <==> x+yx.__add__(y) <==> x+y """
pass
@staticmethod
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type,MinPoint: Point,MaxPoint: Point)
__new__(cls: type,AABB: AABB)
"""
pass
def __radd__(self, *args):
"""
__radd__(Point: Point,AABB: AABB) -> AABB
__radd__(AABB1: AABB,AABB2: AABB) -> AABB
"""
pass
MaxPoint = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: MaxPoint(self: AABB) -> Point
Set: MaxPoint(self: AABB)=value
"""
MinPoint = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: MinPoint(self: AABB) -> Point
Set: MinPoint(self: AABB)=value
"""
class CoordinateSystem(object):
"""
CoordinateSystem()
CoordinateSystem(Origin: Point,AxisX: Vector,AxisY: Vector)
"""
@staticmethod
def __new__(self, Origin=None, AxisX=None, AxisY=None):
"""
__new__(cls: type)
__new__(cls: type,Origin: Point,AxisX: Vector,AxisY: Vector)
"""
pass
AxisX = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: AxisX(self: CoordinateSystem) -> Vector
Set: AxisX(self: CoordinateSystem)=value
"""
AxisY = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: AxisY(self: CoordinateSystem) -> Vector
Set: AxisY(self: CoordinateSystem)=value
"""
Origin = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Origin(self: CoordinateSystem) -> Point
Set: Origin(self: CoordinateSystem)=value
"""
class Distance(object):
# no doc
@staticmethod
def PointToLine(Point, Line):
""" PointToLine(Point: Point,Line: Line) -> float """
pass
@staticmethod
def PointToLineSegment(Point, LineSegment):
""" PointToLineSegment(Point: Point,LineSegment: LineSegment) -> float """
pass
@staticmethod
def PointToPlane(Point, Plane):
""" PointToPlane(Point: Point,Plane: GeometricPlane) -> float """
pass
@staticmethod
def PointToPoint(Point1, Point2):
""" PointToPoint(Point1: Point,Point2: Point) -> float """
pass
__all__ = [
"__reduce_ex__",
"PointToLine",
"PointToLineSegment",
"PointToPlane",
"PointToPoint",
]
class FacetedBrep(object):
"""
FacetedBrep(vertices: Array[Vector],outerWires: Array[Array[int]],innerWires: IDictionary[int,Array[Array[int]]])
FacetedBrep(vertices: Array[Vector],outerWires: Array[Array[int]],innerWires: IDictionary[int,Array[Array[int]]],edges: IList[IndirectPolymeshEdge])
"""
def CheckForTwoManifold(self):
""" CheckForTwoManifold(self: FacetedBrep) -> bool """
pass
def GetInnerFace(self, faceIndex):
""" GetInnerFace(self: FacetedBrep,faceIndex: int) -> Array[int] """
pass
def GetInnerFaceCount(self, faceIndex):
""" GetInnerFaceCount(self: FacetedBrep,faceIndex: int) -> int """
pass
def GetOuterFace(self, faceIndex):
""" GetOuterFace(self: FacetedBrep,faceIndex: int) -> Array[int] """
pass
@staticmethod
def __new__(self, vertices, outerWires, innerWires, edges=None):
"""
__new__(cls: type,vertices: Array[Vector],outerWires: Array[Array[int]],innerWires: IDictionary[int,Array[Array[int]]])
__new__(cls: type,vertices: Array[Vector],outerWires: Array[Array[int]],innerWires: IDictionary[int,Array[Array[int]]],edges: IList[IndirectPolymeshEdge])
"""
pass
Faces = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Faces(self: FacetedBrep) -> ICollection[FacetedBrepFace]
"""
GetEdges = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: GetEdges(self: FacetedBrep) -> IList[IndirectPolymeshEdge]
"""
InnerWires = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Get: InnerWires(self: FacetedBrep) -> IDictionary[int,Array[Array[int]]]
"""
OuterWires = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Get: OuterWires(self: FacetedBrep) -> Array[Array[int]]
"""
Vertices = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Vertices(self: FacetedBrep) -> IList[Vector]
"""
class FacetedBrepFace(object):
# no doc
HasHoles = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: HasHoles(self: FacetedBrepFace) -> bool
"""
Holes = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Holes(self: FacetedBrepFace) -> IList[FacetedBrepFaceHole]
"""
IsReadOnly = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Get: IsReadOnly(self: FacetedBrepFace) -> bool
"""
VerticeIndexes = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Get: VerticeIndexes(self: FacetedBrepFace) -> IList[int]
"""
Vertices = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Vertices(self: FacetedBrepFace) -> IList[Vector]
"""
class FacetedBrepFaceHole(object):
# no doc
Count = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Count(self: FacetedBrepFaceHole) -> int
"""
IsReadOnly = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Get: IsReadOnly(self: FacetedBrepFaceHole) -> bool
"""
VerticeIndexes = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Get: VerticeIndexes(self: FacetedBrepFaceHole) -> IList[int]
"""
Vertices = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Vertices(self: FacetedBrepFaceHole) -> IList[Vector]
"""
class GeometricPlane(object):
"""
GeometricPlane()
GeometricPlane(Origin: Point,Normal: Vector)
GeometricPlane(Origin: Point,Xaxis: Vector,Yaxis: Vector)
GeometricPlane(CoordSys: CoordinateSystem)
"""
def GetNormal(self):
""" GetNormal(self: GeometricPlane) -> Vector """
pass
@staticmethod
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type,Origin: Point,Normal: Vector)
__new__(cls: type,Origin: Point,Xaxis: Vector,Yaxis: Vector)
__new__(cls: type,CoordSys: CoordinateSystem)
"""
pass
Normal = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Normal(self: GeometricPlane) -> Vector
Set: Normal(self: GeometricPlane)=value
"""
Origin = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Origin(self: GeometricPlane) -> Point
Set: Origin(self: GeometricPlane)=value
"""
class GeometryConstants(object):
""" GeometryConstants() """
ANGULAR_EPSILON = 0.0017453292519943296
DISTANCE_EPSILON = 0.00010000000000000001
SCALAR_EPSILON = 1e-13
class IBoundingVolume:
# no doc
def __init__(self, *args):
""" x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """
pass
class IndirectPolymeshEdge(object):
""" IndirectPolymeshEdge() """
EdgeType = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: EdgeType(self: IndirectPolymeshEdge) -> PolymeshEdgeTypeEnum
Set: EdgeType(self: IndirectPolymeshEdge)=value
"""
EndPoint = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: EndPoint(self: IndirectPolymeshEdge) -> int
Set: EndPoint(self: IndirectPolymeshEdge)=value
"""
ShellIndex = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Get: ShellIndex(self: IndirectPolymeshEdge) -> int
Set: ShellIndex(self: IndirectPolymeshEdge)=value
"""
StartPoint = property(
lambda self: object(), lambda self, v: None, lambda self: None
)
"""Get: StartPoint(self: IndirectPolymeshEdge) -> int
Set: StartPoint(self: IndirectPolymeshEdge)=value
"""
class Intersection(object):
# no doc
@staticmethod
def LineSegmentToObb(lineSegment, obb):
""" LineSegmentToObb(lineSegment: LineSegment,obb: OBB) -> LineSegment """
pass
@staticmethod
def LineSegmentToPlane(lineSegment, plane):
""" LineSegmentToPlane(lineSegment: LineSegment,plane: GeometricPlane) -> Point """
pass
@staticmethod
def LineToLine(line1, line2):
""" LineToLine(line1: Line,line2: Line) -> LineSegment """
pass
@staticmethod
def LineToObb(line, obb):
""" LineToObb(line: Line,obb: OBB) -> LineSegment """
pass
@staticmethod
def LineToPlane(line, plane):
""" LineToPlane(line: Line,plane: GeometricPlane) -> Point """
pass
@staticmethod
def PlaneToPlane(plane1, plane2):
""" PlaneToPlane(plane1: GeometricPlane,plane2: GeometricPlane) -> Line """
pass
__all__ = [
"__reduce_ex__",
"LineSegmentToObb",
"LineSegmentToPlane",
"LineToLine",
"LineToObb",
"LineToPlane",
"PlaneToPlane",
]
class Line(object):
"""
Line()
Line(p1: Point,p2: Point)
Line(Point: Point,Direction: Vector)
Line(LineSegment: LineSegment)
"""
@staticmethod
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type,p1: Point,p2: Point)
__new__(cls: type,Point: Point,Direction: Vector)
__new__(cls: type,LineSegment: LineSegment)
"""
pass
Direction = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Direction(self: Line) -> Vector
Set: Direction(self: Line)=value
"""
Origin = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Origin(self: Line) -> Point
Set: Origin(self: Line)=value
"""
class LineSegment(object):
"""
LineSegment()
LineSegment(Point1: Point,Point2: Point)
"""
def Equals(self, o):
""" Equals(self: LineSegment,o: object) -> bool """
pass
def GetDirectionVector(self):
""" GetDirectionVector(self: LineSegment) -> Vector """
pass
def GetHashCode(self):
""" GetHashCode(self: LineSegment) -> int """
pass
def Length(self):
""" Length(self: LineSegment) -> float """
pass
def __eq__(self, *args):
""" x.__eq__(y) <==> x==y """
pass
@staticmethod
def __new__(self, Point1=None, Point2=None):
"""
__new__(cls: type)
__new__(cls: type,Point1: Point,Point2: Point)
"""
pass
def __ne__(self, *args):
pass
Point1 = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Point1(self: LineSegment) -> Point
Set: Point1(self: LineSegment)=value
"""
Point2 = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Point2(self: LineSegment) -> Point
Set: Point2(self: LineSegment)=value
"""
class Matrix(object):
"""
Matrix()
Matrix(m: Matrix)
"""
def GetTranspose(self):
""" GetTranspose(self: Matrix) -> Matrix """
pass
def ToString(self):
""" ToString(self: Matrix) -> str """
pass
def Transform(self, p):
""" Transform(self: Matrix,p: Point) -> Point """
pass
def Transpose(self):
""" Transpose(self: Matrix) """
pass
def __getitem__(self, *args):
""" x.__getitem__(y) <==> x[y] """
pass
def __mul__(self, *args):
""" x.__mul__(y) <==> x*yx.__mul__(y) <==> x*y """
pass
@staticmethod
def __new__(self, m=None):
"""
__new__(cls: type)
__new__(cls: type,m: Matrix)
"""
pass
def __rmul__(self, *args):
""" __rmul__(B: Matrix,A: Matrix) -> Matrix """
pass
def __setitem__(self, *args):
""" x.__setitem__(i,y) <==> x[i]= """
pass
class MatrixFactory(object):
# no doc
@staticmethod
def ByCoordinateSystems(CoordSys1, CoordSys2):
""" ByCoordinateSystems(CoordSys1: CoordinateSystem,CoordSys2: CoordinateSystem) -> Matrix """
pass
@staticmethod
def FromCoordinateSystem(CoordSys):
""" FromCoordinateSystem(CoordSys: CoordinateSystem) -> Matrix """
pass
@staticmethod
def Rotate(Angle, Axis):
""" Rotate(Angle: float,Axis: Vector) -> Matrix """
pass
@staticmethod
def ToCoordinateSystem(CoordSys):
""" ToCoordinateSystem(CoordSys: CoordinateSystem) -> Matrix """
pass
__all__ = [
"__reduce_ex__",
"ByCoordinateSystems",
"FromCoordinateSystem",
"Rotate",
"ToCoordinateSystem",
]
class OBB(object):
"""
OBB()
OBB(center: Point,axis0: Vector,axis1: Vector,axis2: Vector,extent0: float,extent1: float,extent2: float)
OBB(center: Point,axis: Array[Vector],extent: Array[float])
OBB(obb: OBB)
"""
def ClosestPointTo(self, *__args):
"""
ClosestPointTo(self: OBB,lineSegment: LineSegment) -> Point
ClosestPointTo(self: OBB,line: Line) -> Point
ClosestPointTo(self: OBB,point: Point) -> Point
"""
pass
def ComputeVertices(self):
""" ComputeVertices(self: OBB) -> Array[Point] """
pass
def DistanceTo(self, *__args):
"""
DistanceTo(self: OBB,lineSegment: LineSegment) -> float
DistanceTo(self: OBB,line: Line) -> float
DistanceTo(self: OBB,point: Point) -> float
"""
pass
def Equals(self, *__args):
"""
Equals(self: OBB,other: OBB) -> bool
Equals(self: OBB,obj: object) -> bool
"""
pass
def GetHashCode(self):
""" GetHashCode(self: OBB) -> int """
pass
def IntersectionPointsWith(self, *__args):
"""
IntersectionPointsWith(self: OBB,lineSegment: LineSegment) -> Array[Point]
IntersectionPointsWith(self: OBB,line: Line) -> Array[Point]
"""
pass
def IntersectionWith(self, *__args):
"""
IntersectionWith(self: OBB,lineSegment: LineSegment) -> LineSegment
IntersectionWith(self: OBB,line: Line) -> LineSegment
"""
pass
def Intersects(self, *__args):
"""
Intersects(self: OBB,lineSegment: LineSegment) -> bool
Intersects(self: OBB,geometricPlane: GeometricPlane) -> bool
Intersects(self: OBB,obb: OBB) -> bool
Intersects(self: OBB,line: Line) -> bool
"""
pass
def SetAxis(self, *__args):
""" SetAxis(self: OBB,axis: Array[Vector])SetAxis(self: OBB,axis0: Vector,axis1: Vector,axis2: Vector) """
pass
def SetExtent(self, *__args):
""" SetExtent(self: OBB,extent: Array[float])SetExtent(self: OBB,extent0: float,extent1: float,extent2: float) """
pass
def ShortestSegmentTo(self, *__args):
"""
ShortestSegmentTo(self: OBB,point: Point) -> LineSegment
ShortestSegmentTo(self: OBB,lineSegment: LineSegment) -> LineSegment
ShortestSegmentTo(self: OBB,line: Line) -> LineSegment
"""
pass
def __eq__(self, *args):
""" x.__eq__(y) <==> x==yx.__eq__(y) <==> x==y """
pass
@staticmethod
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type,center: Point,axis0: Vector,axis1: Vector,axis2: Vector,extent0: float,extent1: float,extent2: float)
__new__(cls: type,center: Point,axis: Array[Vector],extent: Array[float])
__new__(cls: type,obb: OBB)
"""
pass
def __ne__(self, *args):
pass
Axis0 = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Axis0(self: OBB) -> Vector
"""
Axis1 = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Axis1(self: OBB) -> Vector
"""
Axis2 = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Axis2(self: OBB) -> Vector
"""
Center = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Center(self: OBB) -> Point
Set: Center(self: OBB)=value
"""
Extent0 = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Extent0(self: OBB) -> float
Set: Extent0(self: OBB)=value
"""
Extent1 = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Extent1(self: OBB) -> float
Set: Extent1(self: OBB)=value
"""
Extent2 = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Extent2(self: OBB) -> float
Set: Extent2(self: OBB)=value
"""
class Parallel(object):
# no doc
@staticmethod
def LineSegmentToLineSegment(LineSegment1, LineSegment2, Tolerance=None):
"""
LineSegmentToLineSegment(LineSegment1: LineSegment,LineSegment2: LineSegment,Tolerance: float) -> bool
LineSegmentToLineSegment(LineSegment1: LineSegment,LineSegment2: LineSegment) -> bool
"""
pass
@staticmethod
def LineSegmentToPlane(LineSegment, Plane, Tolerance=None):
"""
LineSegmentToPlane(LineSegment: LineSegment,Plane: GeometricPlane,Tolerance: float) -> bool
LineSegmentToPlane(LineSegment: LineSegment,Plane: GeometricPlane) -> bool
"""
pass
@staticmethod
def LineToLine(Line1, Line2, Tolerance=None):
"""
LineToLine(Line1: Line,Line2: Line,Tolerance: float) -> bool
LineToLine(Line1: Line,Line2: Line) -> bool
"""
pass
@staticmethod
def LineToPlane(Line, Plane, Tolerance=None):
"""
LineToPlane(Line: Line,Plane: GeometricPlane,Tolerance: float) -> bool
LineToPlane(Line: Line,Plane: GeometricPlane) -> bool
"""
pass
@staticmethod
def PlaneToPlane(Plane1, Plane2, Tolerance=None):
"""
PlaneToPlane(Plane1: GeometricPlane,Plane2: GeometricPlane,Tolerance: float) -> bool
PlaneToPlane(Plane1: GeometricPlane,Plane2: GeometricPlane) -> bool
"""
pass
@staticmethod
def VectorToPlane(Vector, Plane, Tolerance=None):
"""
VectorToPlane(Vector: Vector,Plane: GeometricPlane,Tolerance: float) -> bool
VectorToPlane(Vector: Vector,Plane: GeometricPlane) -> bool
"""
pass
@staticmethod
def VectorToVector(Vector1, Vector2, Tolerance=None):
"""
VectorToVector(Vector1: Vector,Vector2: Vector,Tolerance: float) -> bool
VectorToVector(Vector1: Vector,Vector2: Vector) -> bool
"""
pass
__all__ = [
"__reduce_ex__",
"LineSegmentToLineSegment",
"LineSegmentToPlane",
"LineToLine",
"LineToPlane",
"PlaneToPlane",
"VectorToPlane",
"VectorToVector",
]
class Point(object):
"""
Point()
Point(X: float,Y: float,Z: float)
Point(X: float,Y: float)
Point(Point: Point)
"""
@staticmethod
def AreEqual(Point1, Point2):
""" AreEqual(Point1: Point,Point2: Point) -> bool """
pass
def CompareTo(self, obj):
""" CompareTo(self: Point,obj: object) -> int """
pass
def Equals(self, obj):
""" Equals(self: Point,obj: object) -> bool """
pass
def GetHashCode(self):
""" GetHashCode(self: Point) -> int """
pass
def ToString(self):
""" ToString(self: Point) -> str """
pass
def Translate(self, X, Y, Z):
""" Translate(self: Point,X: float,Y: float,Z: float) """
pass
def Zero(self):
""" Zero(self: Point) """
pass
def __add__(self, *args):
""" x.__add__(y) <==> x+y """
pass
def __eq__(self, *args):
""" x.__eq__(y) <==> x==y """
pass
def __ge__(self, *args):
pass
def __gt__(self, *args):
pass
def __le__(self, *args):
pass
def __lt__(self, *args):
pass
@staticmethod
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type,X: float,Y: float,Z: float)
__new__(cls: type,X: float,Y: float)
__new__(cls: type,Point: Point)
"""
pass
def __ne__(self, *args):
pass
def __radd__(self, *args):
""" __radd__(p1: Point,p2: Point) -> Point """
pass
def __rsub__(self, *args):
""" __rsub__(p1: Point,p2: Point) -> Point """
pass
def __sub__(self, *args):
""" x.__sub__(y) <==> x-y """
pass
EPSILON_SQUARED = 0.00010000000000000001
HASH_SEED = 69069
X = None
Y = None
Z = None
class PolyLine(object):
""" PolyLine(Points: IEnumerable) """
def Equals(self, O):
""" Equals(self: PolyLine,O: object) -> bool """
pass
def GetHashCode(self):
""" GetHashCode(self: PolyLine) -> int """
pass
def Length(self):
""" Length(self: PolyLine) -> float """
pass
def __eq__(self, *args):
""" x.__eq__(y) <==> x==y """
pass
@staticmethod
def __new__(self, Points):
""" __new__(cls: type,Points: IEnumerable) """
pass
def __ne__(self, *args):
pass
Points = property(lambda self: object(), lambda self, v: None, lambda self: None)
"""Get: Points(self: PolyLine) -> ArrayList
Set: Points(self: PolyLine)=value
"""
class PolymeshEdgeTypeEnum(Enum):
""" enum PolymeshEdgeTypeEnum,values: INVISIBLE_EDGE (2),VISIBLE_EDGE (1) """
INVISIBLE_EDGE = None
value__ = None
VISIBLE_EDGE = None
class Projection(object):
# no doc
@staticmethod
def LineSegmentToPlane(LineSegment, Plane):
""" LineSegmentToPlane(LineSegment: LineSegment,Plane: GeometricPlane) -> LineSegment """
pass
@staticmethod
def LineToPlane(Line, Plane):
""" LineToPlane(Line: Line,Plane: GeometricPlane) -> Line """
pass
@staticmethod
def PointToLine(Point, Line):
""" PointToLine(Point: Point,Line: Line) -> Point """
pass
@staticmethod
def PointToPlane(Point, Plane):
""" PointToPlane(Point: Point,Plane: GeometricPlane) -> Point """
pass
__all__ = [
"__reduce_ex__",
"LineSegmentToPlane",
"LineToPlane",
"PointToLine",
"PointToPlane",
]
class Vector(Point):
"""
Vector()
Vector(X: float,Y: float,Z: float)
Vector(Point: Point)
"""
def Cross(self, *__args):
"""
Cross(Vector1: Vector,Vector2: Vector) -> Vector
Cross(self: Vector,Vector: Vector) -> Vector
"""
pass
def Dot(self, *__args):
"""
Dot(Vector1: Vector,Vector2: Vector) -> float
Dot(self: Vector,Vector: Vector) -> float
"""
pass
def GetAngleBetween(self, Vector):
""" GetAngleBetween(self: Vector,Vector: Vector) -> float """
pass
def GetLength(self):
""" GetLength(self: Vector) -> float """
pass
def GetNormal(self):
""" GetNormal(self: Vector) -> Vector """
pass
def Normalize(self, NewLength=None):
"""
Normalize(self: Vector,NewLength: float) -> float
Normalize(self: Vector) -> float
"""
pass
def ToString(self):
""" ToString(self: Vector) -> str """
pass
def __mul__(self, *args):
""" x.__mul__(y) <==> x*y """
pass
@staticmethod
def __new__(self, *__args):
"""
__new__(cls: type)
__new__(cls: type,X: float,Y: float,Z: float)
__new__(cls: type,Point: Point)
"""
pass
def __rmul__(self, *args):
""" __rmul__(Multiplier: float,Vector: Vector) -> Vector """
pass
|
a=2
b=3
#三目运算符
str='a>b'if a>b else 'a<b'
print(str)
|
nilai = 9
if (nilai > 7):
print ("Selamat Anda Jadi programmer")
if (nilai > 10):
print ("Selamat Anda Jadi programmer handal")
|
# list all array connections
res = client.get_array_connections()
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# list all array connections with remote name "otherarray"
res = client.get_array_connections(remote_names=["otherarray"])
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# list all array connections with remote id '10314f42-020d-7080-8013-000ddt400090'
res = client.get_array_connections(remote_ids=['10314f42-020d-7080-8013-000ddt400090'])
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# list first five array connections and sort by source in descendant order
res = client.get_array_connections(limit=5, sort="version-")
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# list all remaining array connections
res = client.get_array_connections(continuation_token=res.continuation_token)
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# list with filter to see only array connections on a specified version
res = client.get_array_connections(filter='version=\'3.*\'')
print(res)
if type(res) == pypureclient.responses.ValidResponse:
print(list(res.items))
# Other valid fields: ids, offset
# See section "Common Fields" for examples
|
#num=[2,5,9,1]
#num[2]=3 #na posiçao 2 vai mudar de 9 para virar 3
#num.append(7) #estou adicionando o valor 7
#num.sort(reverse=True) #ordem reversa
#num.insert(2,0) #inseri um valor e reordena automaticamente o resto, na posição 2, vai inserir o valor 0
#num.pop(2) #vai tirar o valor que tem na posição 2
#num.insert(2,2) #na posição 2 vou adicionar o valor 2
#num.remove(2) #vai remover o primeiro 2
#if 4 in num:
# num.remove(4)
#else:
# print('Não achei o número 4')
#print(num)
#print(f'Essa lista tem {len(num)} elementos.')
valores=list()
for cont in range (0,5):
valores.append(int(input('Digite um valor: ')))
for c, v in enumerate (valores):
print(f'Na posição {c} encontrei o valor {v}!')
print('Chegei ao final da lista')
|
kanto, johto, hoenn = input().split()
catch_kanto, catch_johto, catch_hoenn = input().split()
total_kanto = int(kanto) + int(catch_kanto)
total_johto = int(johto) + int(catch_johto)
total_hoenn = int(hoenn) + int(catch_hoenn)
print(f"{total_kanto} {total_johto} {total_hoenn}")
|
{
'variables':
{
'external_libmediaserver%' : '<!(echo $LIBMEDIASERVER)',
'external_libmediaserver_include_dirs%' : '<!(echo $LIBMEDIASERVER_INCLUDE)',
},
"targets":
[
{
"target_name": "medooze-fake-h264-encoder",
"cflags":
[
"-march=native",
"-fexceptions",
"-O3",
"-g",
"-Wno-unused-function -Wno-comment",
#"-O0",
#"-fsanitize=address"
],
"cflags_cc":
[
"-fexceptions",
"-std=c++17",
"-O3",
"-g",
"-Wno-unused-function",
"-faligned-new",
"-Wall"
#"-O0",
#"-fsanitize=address,leak"
],
"include_dirs" :
[
'/usr/include/nodejs/',
"<!(node -e \"require('nan')\")"
],
"ldflags" : [" -lpthread -lresolv"],
"link_settings":
{
'libraries': ["-lpthread -lpthread -lresolv"]
},
"sources":
[
"src/fake-h264-encoder_wrap.cxx",
"src/FakeH264VideoEncoderWorker.cpp",
],
"conditions":
[
[
"external_libmediaserver == ''",
{
"include_dirs" :
[
'media-server/include',
'media-server/src',
'media-server/ext/crc32c/include',
'media-server/ext/libdatachannels/src',
'media-server/ext/libdatachannels/src/internal',
],
"sources":
[
"media-server/src/EventLoop.cpp",
"media-server/src/MediaFrameListenerBridge.cpp",
"media-server/src/rtp/DependencyDescriptor.cpp",
"media-server/src/rtp/RTPPacket.cpp",
"media-server/src/rtp/RTPPayload.cpp",
"media-server/src/rtp/RTPHeader.cpp",
"media-server/src/rtp/RTPHeaderExtension.cpp",
"media-server/src/rtp/LayerInfo.cpp",
"media-server/src/VideoLayerSelector.cpp",
"media-server/src/DependencyDescriptorLayerSelector.cpp",
"media-server/src/h264/h264depacketizer.cpp",
"media-server/src/vp8/vp8depacketizer.cpp",
"media-server/src/h264/H264LayerSelector.cpp",
"media-server/src/vp8/VP8LayerSelector.cpp",
"media-server/src/vp9/VP9PayloadDescription.cpp",
"media-server/src/vp9/VP9LayerSelector.cpp",
"media-server/src/vp9/VP9Depacketizer.cpp",
"media-server/src/av1/AV1Depacketizer.cpp",
],
"conditions" : [
['OS=="mac"', {
"xcode_settings": {
"CLANG_CXX_LIBRARY": "libc++",
"CLANG_CXX_LANGUAGE_STANDARD": "c++17",
"OTHER_CFLAGS": [ "-Wno-aligned-allocation-unavailable","-march=native"]
},
}]
]
},
{
"libraries" : [ "<(external_libmediaserver)" ],
"include_dirs" : [ "<@(external_libmediaserver_include_dirs)" ],
'conditions':
[
['OS=="linux"', {
"ldflags" : [" -Wl,-Bsymbolic "],
}],
['OS=="mac"', {
"xcode_settings": {
"CLANG_CXX_LIBRARY": "libc++",
"CLANG_CXX_LANGUAGE_STANDARD": "c++17",
"OTHER_CFLAGS": [ "-Wno-aligned-allocation-unavailable","-march=native"]
},
}],
]
}
]
]
}
]
}
|
class Solution:
def reverseVowels(self, s: str) -> str:
vowels = {"a", "e", "i", "o", "u", "A", "E", "I", "O", "U"}
ns = [e for e in s]
left, right = 0, len(s) - 1
while right > left:
while s[left] not in vowels and left < right:
left += 1
while s[right] not in vowels and left < right:
right -= 1
ns[left], ns[right] = ns[right], ns[left]
left += 1
right -= 1
return "".join(ns)
if __name__ == '__main__':
print(Solution().reverseVowels("hello"))
print(Solution().reverseVowels("leetcode"))
print(Solution().reverseVowels("aA"))
|
def reverse(string):
return string[::-1]
print('Gimmie some word')
s = input()
print(reverse(s))
|
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# 集合
basket = {'apple', 'orange', 'apple', 'pear', 'orange', 'banana'}
print(basket)
# 判断是否在集合中
print('orange' in basket)
# 初始化
a = set('abracadabra')
print(a)
|
"""
External repositories used in this workspace.
"""
load("@bazel_gazelle//:deps.bzl", "go_repository")
def go_repositories():
go_repository(
name = "co_honnef_go_tools",
importpath = "honnef.co/go/tools",
sum = "h1:/hemPrYIhOhy8zYrNj+069zDB68us2sMGsfkFJO0iZs=",
version = "v0.0.0-20190523083050-ea95bdfd59fc",
)
go_repository(
name = "com_github_burntsushi_toml",
importpath = "github.com/BurntSushi/toml",
sum = "h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=",
version = "v0.3.1",
)
go_repository(
name = "com_github_census_instrumentation_opencensus_proto",
importpath = "github.com/census-instrumentation/opencensus-proto",
sum = "h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk=",
version = "v0.2.1",
)
go_repository(
name = "com_github_client9_misspell",
importpath = "github.com/client9/misspell",
sum = "h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI=",
version = "v0.3.4",
)
go_repository(
name = "com_github_cncf_udpa_go",
importpath = "github.com/cncf/udpa/go",
sum = "h1:WBZRG4aNOuI15bLRrCgN8fCq8E5Xuty6jGbmSNEvSsU=",
version = "v0.0.0-20191209042840-269d4d468f6f",
)
go_repository(
name = "com_github_envoyproxy_go_control_plane",
importpath = "github.com/envoyproxy/go-control-plane",
sum = "h1:rEvIZUSZ3fx39WIi3JkQqQBitGwpELBIYWeBVh6wn+E=",
version = "v0.9.4",
)
go_repository(
name = "com_github_envoyproxy_protoc_gen_validate",
importpath = "github.com/envoyproxy/protoc-gen-validate",
sum = "h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A=",
version = "v0.1.0",
)
go_repository(
name = "com_github_golang_glog",
importpath = "github.com/golang/glog",
sum = "h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=",
version = "v0.0.0-20160126235308-23def4e6c14b",
)
go_repository(
name = "com_github_golang_mock",
importpath = "github.com/golang/mock",
sum = "h1:G5FRp8JnTd7RQH5kemVNlMeyXQAztQ3mOWV95KxsXH8=",
version = "v1.1.1",
)
go_repository(
name = "com_github_golang_protobuf",
importpath = "github.com/golang/protobuf",
sum = "h1:ZFgWrT+bLgsYPirOnRfKLYJLvssAegOj/hgyMFdJZe0=",
version = "v1.4.1",
)
go_repository(
name = "com_github_google_go_cmp",
importpath = "github.com/google/go-cmp",
sum = "h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=",
version = "v0.5.0",
)
go_repository(
name = "com_github_google_uuid",
importpath = "github.com/google/uuid",
sum = "h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=",
version = "v1.1.2",
)
go_repository(
name = "com_github_prometheus_client_model",
importpath = "github.com/prometheus/client_model",
sum = "h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM=",
version = "v0.0.0-20190812154241-14fe0d1b01d4",
)
go_repository(
name = "com_google_cloud_go",
importpath = "cloud.google.com/go",
sum = "h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ=",
version = "v0.26.0",
)
go_repository(
name = "org_golang_google_appengine",
importpath = "google.golang.org/appengine",
sum = "h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508=",
version = "v1.4.0",
)
go_repository(
name = "org_golang_google_genproto",
importpath = "google.golang.org/genproto",
sum = "h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY=",
version = "v0.0.0-20200526211855-cb27e3aa2013",
)
go_repository(
name = "org_golang_google_grpc",
importpath = "google.golang.org/grpc",
sum = "h1:SfXqXS5hkufcdZ/mHtYCh53P2b+92WQq/DZcKLgsFRs=",
version = "v1.31.1",
)
go_repository(
name = "org_golang_google_protobuf",
importpath = "google.golang.org/protobuf",
sum = "h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c=",
version = "v1.25.0",
)
go_repository(
name = "org_golang_x_crypto",
importpath = "golang.org/x/crypto",
sum = "h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=",
version = "v0.0.0-20200622213623-75b288015ac9",
)
go_repository(
name = "org_golang_x_exp",
importpath = "golang.org/x/exp",
sum = "h1:c2HOrn5iMezYjSlGPncknSEr/8x5LELb/ilJbXi9DEA=",
version = "v0.0.0-20190121172915-509febef88a4",
)
go_repository(
name = "org_golang_x_lint",
importpath = "golang.org/x/lint",
sum = "h1:XQyxROzUlZH+WIQwySDgnISgOivlhjIEwaQaJEJrrN0=",
version = "v0.0.0-20190313153728-d0100b6bd8b3",
)
go_repository(
name = "org_golang_x_net",
importpath = "golang.org/x/net",
sum = "h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA=",
version = "v0.0.0-20200822124328-c89045814202",
)
go_repository(
name = "org_golang_x_oauth2",
importpath = "golang.org/x/oauth2",
sum = "h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=",
version = "v0.0.0-20180821212333-d2e6202438be",
)
go_repository(
name = "org_golang_x_sync",
importpath = "golang.org/x/sync",
sum = "h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=",
version = "v0.0.0-20190423024810-112230192c58",
)
go_repository(
name = "org_golang_x_sys",
importpath = "golang.org/x/sys",
sum = "h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=",
version = "v0.0.0-20200323222414-85ca7c5b95cd",
)
go_repository(
name = "org_golang_x_text",
importpath = "golang.org/x/text",
sum = "h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=",
version = "v0.3.0",
)
go_repository(
name = "org_golang_x_tools",
importpath = "golang.org/x/tools",
sum = "h1:5Beo0mZN8dRzgrMMkDp0jc8YXQKx9DiJ2k1dkvGsn5A=",
version = "v0.0.0-20190524140312-2c0ae7006135",
)
go_repository(
name = "org_golang_x_xerrors",
importpath = "golang.org/x/xerrors",
sum = "h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=",
version = "v0.0.0-20191204190536-9bdfabe68543",
)
|
"""Load dependencies needed to compile and test the grpc library as a 3rd-party consumer."""
def grpc_deps():
"""Loads dependencies need to compile and test the grpc library."""
pass
|
# Roman Ramirez, rr8rk@virginia.edu
# Advent of Code 2021, Day 14: Extended Polymerization
#%% LONG INPUT
my_input = []
with open('input.txt', 'r') as f:
for line in f:
my_input.append(line.strip('\n'))
#%% EXAMPLE INPUT
my_input = [
'NNCB',
'',
'CH -> B',
'HH -> N',
'CB -> H',
'NH -> C',
'HB -> C',
'HC -> B',
'HN -> C',
'NN -> C',
'BH -> H',
'NC -> B',
'NB -> B',
'BN -> B',
'BB -> N',
'BC -> B',
'CC -> N',
'CN -> C'
]
#%% PART 1 CODE
# initialization
polymer = my_input[0]
rules = dict()
for line in my_input[2:]:
pair, insert = line.split(' -> ')
rules[pair] = insert
# setps / algorithm
steps = 10
for i in range(steps):
polymer_synth = polymer[0]
for x in range(1, len(polymer)):
polymer_synth += rules[polymer[x-1]+polymer[x]]
polymer_synth += polymer[x]
polymer = polymer_synth
# solve for number
freq = dict()
for char in polymer:
if char in freq:
freq[char] += 1
else:
freq[char] = 1
mce = max(freq.values())
lce = min(freq.values())
# print(freq)
print(mce - lce)
#%% PART 2 CODE: DON'T MAKE THE STRING BUT COUNT THE NUMBERS
# initialization
polymer = my_input[0]
rules = dict()
for line in my_input[2:]:
pair, insert = line.split(' -> ')
rules[pair] = insert
# steps / algorithm : don't make the string just count the numbers
steps = 40
pairs = {symbol: 0 for symbol in rules}
def inc_dict(d):
d_inc = {symbol: 0 for symbol in rules}
for symbol in d:
mid = rules[symbol]
d_inc[symbol[0]+mid] += d[symbol]
d_inc[mid+symbol[1]] += d[symbol]
return d_inc
for x in range(1, len(polymer)):
pairs[polymer[x-1]+polymer[x]] += 1
for i in range(steps):
pairs = inc_dict(pairs)
# convert total pairs to total elements
elements = dict()
for k, v in pairs.items():
if k[0] not in elements.keys():
elements[k[0]] = v / 2
else:
elements[k[0]] += v / 2
if k[1] not in elements.keys():
elements[k[1]] = v / 2
else:
elements[k[1]] += v / 2
elements[polymer[0]] += 0.5
elements[polymer[-1]] += 0.5
elements = {k: int(v) for k, v in elements.items()}
mce = max(elements.values())
lce = min(elements.values())
# print(elements)
print(mce - lce)
|
board = sum([list(input()) for _ in range(3)], [])
assert(board[4] == '1')
rest = list(range(2, 10))
clock = [1, 2, 5, 0, -1, 8, 3, 6, 7]
cclock = [3, 0, 1, 6, -1, 2, 7, 8, 5]
for start in [1, 3, 5, 7]:
for next_idx in [clock, cclock]:
now = start
ans = board[:]
for i in rest:
if board[now] != '?' and board[now] != str(i):
break
ans[now] = str(i)
now = next_idx[now]
else:
assert(all(x != '?' for x in ans))
assert(len(set(ans)) == 9)
ans = ''.join(map(str, ans))
print(*[ans[:3], ans[3:6], ans[6:]], sep='\n')
quit(0)
|
class UnmodifiableModeError(Exception):
"""Raised when file-like object has indeterminate open mode."""
def __init__(self, target, *args, **kwargs):
super().__init__(target, *args, **kwargs)
self.target = target
def __repr__(self):
return '{}: {}'.format(self.__class__.__name__, self.target)
class UnmodifiableAttributeError(AttributeError):
"""Raised when file-like object attribute cannot be modified."""
def __init__(self, target, *args, **kwargs):
super().__init__(target, *args, **kwargs)
self.target = target
def __repr__(self):
return '{}: {}'.format(self.__class__.__name__, self.target)
|
# -*- coding: utf-8 -*-
'''
Created on 1983. 08. 09.
@author: Hye-Churn Jang, CMBU Specialist in Korea, VMware [jangh@vmware.com]
'''
name = 'Project' # custom resource name
sdk = 'vra' # imported SDK at common directory
inputs = {
'create': {
'VraManager': 'constant'
},
'read': {
},
'update': {
'VraManager': 'constant'
},
'delete': {
'VraManager': 'constant'
}
}
properties = {
'name': {
'type': 'string',
'title': 'name',
'description': 'Unique name of project'
},
'description': {
'type': 'string',
'title': 'description',
'default': '',
'description': 'Project descriptions'
},
'sharedResources': {
'type': 'boolean',
'title': 'sharedResources',
'default': True,
'description': 'Deployments are shared between all users in the project'
},
'administrators': {
'type': 'array',
'title': 'administrators',
'default': [],
'items': {
'type': 'string'
},
'description': 'Accounts of administrator user'
},
'members': {
'type': 'array',
'title': 'members',
'default': [],
'items': {
'type': 'string'
},
'description': 'Accounts of member user'
},
'viewers': {
'type': 'array',
'title': 'viewers',
'default': [],
'items': {
'type': 'string'
},
'description': 'Accounts of viewer user'
},
'zones': {
'type': 'array',
'title': 'viewers',
'default': [],
'items': {
'type': 'string'
},
'description': 'Specify the zones ID that can be used when users provision deployments in this project'
},
'placementPolicy': {
'type': 'string',
'title': 'placementPolicy',
'default': 'default',
'enum': [
'default',
'spread'
],
'description': 'Specify the placement policy that will be applied when selecting a cloud zone for provisioning'
},
'customProperties': {
'type': 'object',
'title': 'customProperties',
'default': {},
'description': 'Specify the custom properties that should be added to all requests in this project'
},
'machineNamingTemplate': {
'type': 'string',
'title': 'machineNamingTemplate',
'default': '',
'description': 'Specify the naming template to be used for machines, networks, security groups and disks provisioned in this project'
},
'operationTimeout': {
'type': 'integer',
'title': 'operationTimeout',
'default': 0,
'description': 'Request timeout seconds'
}
}
|
# coding=utf-8
class DictProxy(object):
store = None
def __init__(self, d):
self.Dict = d
super(DictProxy, self).__init__()
if self.store not in self.Dict or not self.Dict[self.store]:
self.Dict[self.store] = self.setup_defaults()
self.save()
self.__initialized = True
def __getattr__(self, name):
if name in self.Dict[self.store]:
return self.Dict[self.store][name]
return getattr(super(DictProxy, self), name)
def __setattr__(self, name, value):
if not self.__dict__.has_key(
'_DictProxy__initialized'): # this test allows attributes to be set in the __init__ method
return object.__setattr__(self, name, value)
elif self.__dict__.has_key(name): # any normal attributes are handled normally
object.__setattr__(self, name, value)
else:
if name in self.Dict[self.store]:
self.Dict[self.store][name] = value
return
object.__setattr__(self, name, value)
def __cmp__(self, d):
return cmp(self.Dict[self.store], d)
def __contains__(self, item):
return item in self.Dict[self.store]
def __setitem__(self, key, item):
self.Dict[self.store][key] = item
self.Dict.Save()
def __iter__(self):
return iter(self.Dict[self.store])
def __getitem__(self, key):
if key in self.Dict[self.store]:
return self.Dict[self.store][key]
def __repr__(self):
return repr(self.Dict[self.store])
def __str__(self):
return str(self.Dict[self.store])
def __len__(self):
return len(self.Dict[self.store].keys())
def __delitem__(self, key):
del self.Dict[self.store][key]
def save(self):
self.Dict.Save()
def clear(self):
del self.Dict[self.store]
return None
def copy(self):
return self.Dict[self.store].copy()
def has_key(self, k):
return k in self.Dict[self.store]
def pop(self, k, d=None):
return self.Dict[self.store].pop(k, d)
def update(self, *args, **kwargs):
return self.Dict[self.store].update(*args, **kwargs)
def keys(self):
return self.Dict[self.store].keys()
def values(self):
return self.Dict[self.store].values()
def items(self):
return self.Dict[self.store].items()
def __unicode__(self):
return unicode(repr(self.Dict[self.store]))
def setup_defaults(self):
raise NotImplementedError
class Dicked(object):
"""
mirrors a dictionary; readonly
"""
_entries = None
def __init__(self, **entries):
self._entries = entries or None
for key, value in entries.iteritems():
self.__dict__[key] = (Dicked(**value) if isinstance(value, dict) else value)
def __repr__(self):
return str(self)
def __unicode__(self):
return unicode(self.__digged__)
def __str__(self):
return str(self.__digged__)
def __lt__(self, d):
return self._entries < d
def __le__(self, d):
return self._entries <= d
def __eq__(self, d):
if d is None and not self._entries:
return True
return self._entries == d
def __ne__(self, d):
return self._entries != d
def __gt__(self, d):
return self._entries > d
def __ge__(self, d):
return self._entries >= d
def __getattr__(self, name):
# fixme: this might be wildly stupid; maybe implement stuff like .iteritems() directly
return getattr(self._entries, name, Dicked())
@property
def __digged__(self):
return {key: value for key, value in self.__dict__.iteritems() if key != "_entries"}
def __len__(self):
return len(self.__digged__)
def __nonzero__(self):
return bool(self.__digged__)
def __iter__(self):
return iter(self.__digged__)
def __hash__(self):
return hash(self.__digged__)
def __getitem__(self, name):
if name in self._entries:
return getattr(self, name)
raise KeyError(name)
|
class TextBoxBase(FocusWidget):
def getCursorPos(self):
try :
elem = self.getElement()
tr = elem.document.selection.createRange()
if tr.parentElement().uniqueID != elem.uniqueID:
return -1
return -tr.move("character", -65535)
except:
return 0
def getSelectionLength(self):
try :
elem = self.getElement()
tr = elem.document.selection.createRange()
if tr.parentElement().uniqueID != elem.uniqueID:
return 0
return tr.text and len(tr.text) or 0
except:
return 0
def setSelectionRange(self, pos, length):
try :
elem = self.getElement()
tr = elem.createTextRange()
tr.collapse(True)
tr.moveStart('character', pos)
tr.moveEnd('character', length)
tr.select()
except :
pass
def getText(self):
return DOM.getAttribute(self.getElement(), "value") or ""
def setText(self, text):
DOM.setAttribute(self.getElement(), "value", text)
|
strategies = {}
def strategy(strategy_name: str):
"""Register a strategy name and strategy Class.
Use as a decorator.
Example:
@strategy('id')
class FindById:
...
Strategy Classes are used to build Elements Objects.
Arguments:
strategy_name (str): Name of the strategy to be registered.
"""
def wrapper(finder_class):
global strategies
strategies[strategy_name] = finder_class
return finder_class
return wrapper
|
def shape(A):
num_rows = len(A)
num_cols=len(A[0]) if A else 0
return num_rows, num_cols
A=[
[1,2,3],
[3,4,5],
[4,5,6],
[6,7,8]
]
print(shape(A))
|
class ContentUnavailable(Exception):
"""Raises when fetching content fails or type is invalid."""
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
class ClosedSessionError(Exception):
"""Raises when attempting to interact with a closed client instance."""
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
class InvalidEndpointError(Exception):
"""Raises when attempting to access a non-existent endpoint."""
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
|
INT_LITTLE_ENDIAN = '<i' # little-endian with 4 bytes
INT_BIG_ENDIAN = '>i' # big-endian with 4 bytes
SHORT_LITTLE_ENDIAN = '<h' # little-endian with 2 bytes
SHORT_BIG_ENDIAN = '<h' # big-endian with 2 bytes
|
'''
lab2
'''
#3.1
my_name = 'Tom'
print(my_name.upper())
#3.
my_id = 123
print(my_id)
#3.3
#123=my_id
my_id=your_id=123
print(my_id)
print(your_id)
#3.4
my_id_str = '123'
print(my_id_str)
#3.5
#print(my_name=my_id)
#3.6
print(my_name+my_id_str)
#3.7
print(my_name*3)
#3.8
print('hello, world. This is my first python string.'.split('.'))
#3.9
message = "Tom's id is 123"
print(message)
|
# list-comp = list comprenhension
symbols = "$¢£¥€¤"
# List comprenhensions and readability
# Example 2-1. Build a list of Unicode codepoints from a string.
codes = []
for symbol in symbols:
codes.append(ord(symbol)) # ord(): char to int
print(f"good old for loop: {codes}")
# Example 2-2. Build a list of Unicode codepoints from a string, take two.
codes = [ord(symbol) for symbol in symbols] # list-comp
print(f"listcomp: {codes}")
# Example 2-3: filter+map vs list-comp
codes = list(filter(lambda c: c > 127, map(ord, symbols)))
print(f"filter+map: {codes}")
codes = [ord(s) for s in symbols if ord(s) > 127]
print(f"listcomp: {codes}")
# Example 2-4: Cartesian product
colors = ["black", "white"]
sizes = ["S", "M", "L"]
tshirts = []
for c in colors:
for s in sizes:
tshirts.append((c, s))
print(f"Cartesian product - Nested for: {tshirts}")
tshirts = [(c, s) for c in colors for s in sizes]
print(f"Cartesian product - listcomp: {tshirts}")
|
def sqrt(x):
"""for x>=0, return non-negative y such that y^2 = x"""
estimate = x/2.0
while True:
newestimate = ((estimate+(x/estimate))/2.0)
if newestimate == estimate:
break
estimate = newestimate
return estimate
print("The answer is ", sqrt(2.0))
print("That answer squared is ", sqrt(2.0) * sqrt(2.0))
|
"""Folder structure of the platform."""
class Folders:
"""Class containing the relevant folders of the platforms.
The members without underscore at the beginning are the exported (useful)
ones. The tests folders are omitted.
"""
_ROOT = "/opt/dike/"
_CODEBASE = _ROOT + "codebase/"
_DATA = _ROOT + "data/"
_DATA_USER_CONFIGURATION = _DATA + "configuration/"
_DATA_DATASET = _DATA + "dataset/"
_DATA_DATASET_FILES = _DATA_DATASET + "files/"
_DATA_DATASET_LABELS = _DATA_DATASET + "labels/"
_DATA_DATASET_OTHERS = _DATA_DATASET + "others/"
_DATA_KEYSTORE = _DATA + "keystore/"
_DATA_SUBORDINATE = _DATA + "subordinate/"
_DATA_SUBORDINATE_QILING = _DATA_SUBORDINATE + "qiling/"
_SCRIPTS = _CODEBASE + "scripts/"
BENIGN_FILES = _DATA_DATASET_FILES + "benign/"
MALICIOUS_FILES = _DATA_DATASET_FILES + "malware/"
COLLECTED_FILES = _DATA_DATASET_FILES + "collected/"
CUSTOM_DATASETS = _DATA_DATASET_LABELS + "custom/"
MODELS = _DATA + "models/"
MODEL_FMT = MODELS + "{}/"
MODEL_PREPROCESSORS_FMT = MODEL_FMT + "preprocessors/"
QILING_LOGS = _DATA_SUBORDINATE_QILING + "logs/"
QILING_ROOTS = _DATA_SUBORDINATE_QILING + "rootfs/"
GHIDRA = "/opt/ghidra/"
GHIDRA_PROJECT = _DATA_SUBORDINATE + "ghidra/"
class Files:
"""Class containing the relevant files of the platform.
The members without underscore at the beginning are the exported (useful)
ones. The tests files are omitted.
"""
# Access of the private members only in the scope of this class, that is in
# the same configuration module. pylint: disable=protected-access
API_CATEGORIZATION = Folders._DATA_USER_CONFIGURATION + "_apis.yaml"
USER_CONFIGURATION = Folders._DATA_USER_CONFIGURATION + "configuration.yaml"
SSL_CERTIFICATE = Folders._DATA_KEYSTORE + "certificate.pem"
SSL_PRIVATE_KEY = Folders._DATA_KEYSTORE + "key.pem"
MALWARE_LABELS = Folders._DATA_DATASET_LABELS + "malware.csv"
BENIGN_LABELS = Folders._DATA_DATASET_LABELS + "benign.csv"
MALWARE_HASHES = Folders._DATA_DATASET_OTHERS + "malware_hashes.txt"
VT_DATA_FILE = Folders._DATA_DATASET_OTHERS + "vt_data.csv"
MODEL_DATASET_FMT = Folders.MODEL_FMT + "dataset.csv"
MODEL_PREPROCESSED_FEATURES_FMT = (Folders.MODEL_FMT
+ "preprocessed_features.csv")
MODEL_REDUCED_FEATURES_FMT = Folders.MODEL_FMT + "reduced_features.csv"
MODEL_REDUCTION_MODEL_FMT = Folders.MODEL_FMT + "reduction.model"
MODEL_PREPROCESSOR_MODEL_FMT = Folders.MODEL_PREPROCESSORS_FMT + "{}.model"
MODEL_ML_MODEL_FMT = Folders.MODEL_FMT + "ml.model"
MODEL_TRAINING_CONFIGURATION_FMT = (Folders.MODEL_FMT
+ "training_configuration.yml")
MODEL_EVALUATION_FMT = Folders.MODEL_FMT + "evaluation.json"
MODEL_PREDICTION_CONFIGURATION_FMT = (Folders.MODEL_FMT
+ "prediction_configuration.json")
GHIDRA_HEADLESS_ANALYZER = Folders.GHIDRA + "support/analyzeHeadless"
GHIDRA_EXTRACTION_SCRIPT = Folders._SCRIPTS + "delegate_ghidra.py"
|
def vampire_test(x, y):
product = x * y
if len(str(x) + str(y)) != len(str(product)):
return False
for i in str(x) + str(y):
if i in str(product):
return True
else:
return False
|
"""
8393 : 합
URL : https://www.acmicpc.net/problem/8393
Input :
3
Output :
6
"""
n = int(input())
sum = 0
for i in range(1, n + 1):
sum += i
print(sum)
|
# -*- coding: utf-8 -*-
'''
월간 코딩 챌린지 시즌 2
- 두개 뺴서 더하기
'''
def solution(numbers):
answer = set()
num_len = len(numbers)
for i in range(num_len):
for j in range(num_len):
if i != j:
answer.add(numbers[i] + numbers[j])
answer = list(answer)
answer.sort()
return answer
if __name__ == '__main__':
numbers = [2,1,3,4,1]
result = solution(numbers)
print(result)
|
#!/usr/bin/env python
class Config(object):
GABRIEL_IP='128.2.213.107'
RECEIVE_FRAME=True
VIDEO_STREAM_PORT = 9098
RESULT_RECEIVING_PORT = 9101
TOKEN=1
|
# October 2018
'''
cifero.sheets
Modules syll and translit use cifero.sheets.sheetsdict in their functions.
'''
################################################################################
# default cipher sheets
# better not change these
# these aren't linked to the main program.
ipa_sheet = {
'title': 'IPA',
'consonants':
[
'p','b','',
't','d','',
'k','g','',
'θ','ð','',
'f','v','',
's','z','ʦ',
'ʃ','ʒ','',
'ʧ','ʤ','',
'h','x','ɲ',
'n','m','ŋ',
'l','ɹ','r',
'ʔ','j','w'
],
'vowels':
[
'ɑ','a','',
'ɪ','i','',
'ʊ','u','',
'ɛ','e','',
'o','ɔ','',
'ə','ʌ','',
'æ','',''
]
}
key_sheet = {
'title' : 'Key',
'consonants':
[
'9','b','',
'1','d','',
'7','g','',
'f','t','',
'8','v','',
'0','z','c',
'q','p','',
'6','j','',
'h','k','m',
'2','3','n',
'5','4','r',
'l','y','w'
],
'vowels':
[
'a','&','',
'i','#','',
'u','$','',
'e','%','',
'o','@','',
'x','=','',
's','',''
]
}
base_sheet = {
'title' : 'Base',
'consonants':
[
'p','b','',
't','d','',
'k','g','',
'(th)','(dth)','',
'f','v','',
's','z','(ts)',
'(sh)','(jh)','',
'(ch)','j','',
'h','(kh)','(ny)',
'n','m','(ng)',
'l','r','(rr)',
'(-)','y','w'
],
'vowels':
[
'a','(aa)','',
'i','(ii)','',
'u','(oo)','',
'e','(ee)','',
'o','(aw)','',
'(uh)','(ah)','',
'(ea)','',''
]
}
cipher_sheet = {
'title' : 'Cipher',
'consonants':
[
'b','bf','',
'd','df','',
'g','gf','',
't','tf','',
'p','pf','',
'c','cf','cn',
'k','kf','',
'q','qf','',
'h','hf','hn',
'm','mf','mn',
'r','rf','rn',
'w','wf','wn'
],
'vowels' :
[
'l','lf','',
'j','jf','',
'y','yf','',
'z','zf','',
'v','vf','',
'x','xf','',
's','',''
]
}
# note that 'marks' and 'symbols' are somewhat arbitrarily classified by their
# relative position in a word. This is strict and inputs often don't conform
# To be safe, just strip punctuation before transliterating.
# list of punctuation marks. These must be attached to the end of a word
# \ undefined
marks = (
':', ';', ',', '.', '!', '?',
'[', ']', '(', ')', '{', '}',
'"',"'",'<','>'
)
# list of symbols. These must stand alone in a sentence
# _ ^ | undefined
# Edit Oct '18: &#$%@= are now used for default key (capitalization problems)
symbols = (
'*','+','-','/','~'
)
def fl(list1):
'''remove empty strings from list'''
list1 = list(filter(None, list1))
return list1
# cons in IPA, 'class t'
reg1_c = fl(ipa_sheet['consonants'][:15] + ipa_sheet['consonants'][21:24])
# cons in IPA, 'class s'
reg2_c = fl(ipa_sheet['consonants'][15:17] + ipa_sheet['consonants'][18:21])
# cons in IPA, 'class h'
irreg1_c = fl(ipa_sheet['consonants'][24:26])
# cons in IPA, 'class n'
irreg2_c = fl(ipa_sheet['consonants'][26:30])
# cons in IPA, 'class r'
irreg3_c = fl(ipa_sheet['consonants'][30:33])
# pseudo-vowels in IPA
pseudo_v = fl(ipa_sheet['consonants'][34:])
other_c = fl([ipa_sheet['consonants'][17]] + [ipa_sheet['consonants'][33]])
def init_vcc():
'''cons clusters by their "classes"'''
vcc_st = [s + t for s in reg2_c for t in reg1_c]
vcc_sn = [s + n for s in reg2_c for n in irreg2_c]
vcc_sr = [s + r for s in reg2_c for r in irreg3_c]
vcc_tr = [t + r for t in reg1_c for r in irreg3_c]
return vcc_st + vcc_sn + vcc_sr + vcc_tr
# valid consonant clusters in IPA
vcc = init_vcc()
################################################################################
sheetsdict = {ipa_sheet['title'] : ipa_sheet,
key_sheet['title']: key_sheet,
base_sheet['title'] : base_sheet,
cipher_sheet['title'] : cipher_sheet}
################################################################################
|
"""
link: https://leetcode-cn.com/problems/sequence-reconstruction
problem: 给数组 org,与数组集合seqs,问能否满足 seqs 中的数组均为 org 的子序列,
且不存在另一个不同的 org' 满足 seqs 中元素也均为其子序列
solution: 拓扑排序。根据 seqs 中每个数组 seq,构建 seq[i] --> seq[i+1] 的图m,若该图的唯一拓扑序为 org,则满题意。
"""
class Solution:
def sequenceReconstruction(self, org: List[int], seqs: List[List[int]]) -> bool:
n, visit = len(org), set()
m, in_edge = {i: set() for i in range(1, n + 1)}, [0] * (n + 1)
for seq in seqs:
visit = visit.union(set(seq))
if visit != set(range(1, n + 1)):
return False
for seq in seqs:
for i in range(len(seq) - 1):
a, b = seq[i], seq[i + 1]
if b in m[a]:
continue
in_edge[b] += 1
m[a].add(b)
q, res = [], []
for i in range(1, n + 1):
if in_edge[i] == 0:
q.append(i)
while len(q) == 1:
k = q.pop()
res.append(k)
for x in m[k]:
in_edge[x] -= 1
if in_edge[x] == 0:
q.append(x)
return res == org
|
c = 0
n = (int(input('Digite um valor: ')), int(input('Digite outro valor: ')),
int(input('Digite mais um valor: ')), int(input('Digite o último valor: ')))
print(f'Os valores digitados foram: {n}')
print(f'O número 9 apareceu {n.count(9)} veze(s)')
if 3 in n:
print(f'O número 3 apareceu pela primeira vez na {n.index(3) + 1}° posição!')
else:
print('O número 3 não foi inserido na tupla!')
#NúmerosPares
for i in n:
if i % 2 == 0:
print('Os número pares são: ', end = '')
break
if i % 2 == 1:
c = c + 1
for i in n:
if i % 2 == 0:
print(f'{i}', end = ' ')
if c == 4:
print('Não foram inseridos números pares!')
|
"""The prime factors of 13195 are 5, 7, 13 and 29.
What is the largest prime factor of the number 600851475143 ?"""
# from math import sqrt, ceil
NUMB = 600851475143
FACTOR = 2
PRIME_ARY = []
DIVIDER_ARY = []
while FACTOR <= NUMB:
for i in PRIME_ARY:
if FACTOR % i == 0:
break
else:
PRIME_ARY.append(FACTOR)
if NUMB % FACTOR == 0:
DIVIDER_ARY.append(FACTOR)
NUMB = NUMB / FACTOR
FACTOR += 1
print(f"Max divider = {max(PRIME_ARY)}")
|
def isEvilNumber(n):
count = 0
for char in str(bin(n)[2:]):
if char == '1':
count += 1
if count % 2 == 0:
return True
else:
return False
print(isEvilNumber(4))
|
b1 >> fuzz([0, 2, 3, 5], dur=1/2, amp=0.8, lpf=linvar([100, 1000], 12), lpr=0.4, oct=3).every(16, "shuffle").every(8, "bubble")
d1 >> play("x o [xx] oxx o [xx] {oO} ", room=0.4).every(16, "shuffle")
d2 >> play("[--]", amp=[1.3, 0.5, 0.5, 0.5], hpf=linvar([6000, 10000], 8), hpr=0.4, spin=4)
p1 >> pasha([0, 2, 3, 5], dur=4, oct=4, amp=0.65, pan=[-0.5, 0.5], striate=16).every(9, "bubble")
m1 >> karp([0, 2, 3, 7, 9], dur=[1/2, 1, 1/2, 1, 1, 1/2]).every(12, "shuffle").every(7, "bubble")
p1.every(4, "stutter", 4)
b1.every(8, "rotate")
|
class Dog:
def __init__(self, age, name, is_male, weight):
self.age = age
self.name = name
self.is_male = is_male # Boolean. True if Male, False if Female.
self.weight = weight
# Create your instance below this line
my_dog = Dog(5, "Yogi", True, 15)
|
class TimetableException(Exception):
"""Base class exception."""
class TimetableNotFound(TimetableException):
def __init__(self, timetable_set):
self.timetable_set = timetable_set
super().__init__(f'timetable set not found: \'{timetable_set}\'')
class RequestedDayNotSupported(TimetableException):
def __init__(self, week_day):
self.week_day = week_day
super().__init__(f'day of the week invalid or not supported: \'{week_day}\'')
class TimetableNotAvailable(TimetableException):
"""The timetable.ait.ie website returned unexpected content or
is unavailable."""
|
"""
Takes in a fasta file and creates a javascript variable containing protein accession number --> protein sequence objects
----------------------------------------------------------------
Industrial Microbes C 2017 All Rights Reserved
Contact: J Paris Morgan (jparismorgan@gmail.com) or Derek Greenfield (derek@imicrobes.com)
"""
def convertFastaToJs(save_folder_protein, save_folder):
"""
Takes in a fasta file and creates a javascript variable containing protein accession number --> protein sequence objects
The accession number is based on however the fasta file is formatted
I.e. >P22869|UniRef90_P22869 --> P22869 is the accession number
"""
with open(save_folder_protein + ".fasta", "r") as fasta_file, open(save_folder + "fasta_js_map.js", "w") as js_file:
id = ""
seq = ""
js_file.write('var uniref_protein_map = [\n {id: "", sequence:"')
for l in fasta_file:
l = l.strip()
if l[0] == '>':
js_file.write('"},\n')
split_line = l[1:].split('|')
if len(split_line) == 1:
id = split_line[0].split(" ")[0]
else:
id = split_line[0] if len(split_line[0]) >= 3 else split_line[1].split(' ')[0]
js_file.write('{id: "' + id + '", sequence: "')
else:
js_file.write(l.strip())
js_file.write('"}]')
return
def main():
save_folder_protein = "/Users/parismorgan/Desktop/iMicrobes/network_builder/files/11Aug17_mmox_01_analysis_01/mmox_nodes_temp"
save_folder = "/Users/parismorgan/Desktop/iMicrobes/network_builder/files/11Aug17_mmox_01_analysis_01/"
convertFastaToJs(save_folder_protein, save_folder)
if __name__ == '__main__':
main()
|
# https://www.codechef.com/viewsolution/36973732
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
count = 0
for i in range(n):
for j in range(i + 1, n):
if a[i] & a[j] == a[i]:
count += 1
print(count)
|
"""
Lambda functions
Functions without names, kind of similar to arrow functions in JavaScript.
"""
square = lambda num: num * num
print(square(9)) # 81
add = lambda a,b: a + b
print(add(3,10)) # 13
|
"""
428. Pow(x, n)
https://www.lintcode.com/problem/powx-n/description?_from=ladder&&fromId=152
"""
class Solution:
"""
@param x {float}: the base number
@param n {int}: the power number
@return {float}: the result
"""
def myPow(self, x, n):
# write your code here
if n == 0:
return 1
ans = myPow (x, n // 2)
if n % 2 == 0:
return ans * ans
return ans * ans * x
|
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
__project__ = 'leetcode'
__file__ = '__init__.py'
__author__ = 'king'
__time__ = '2020/1/31 20:25'
_ooOoo_
o8888888o
88" . "88
(| -_- |)
O\ = /O
____/`---'\____
.' \\| |// `.
/ \\||| : |||// \
/ _||||| -:- |||||- \
| | \\\ - /// | |
| \_| ''\---/'' | |
\ .-\__ `-` ___/-. /
___`. .' /--.--\ `. . __
."" '< `.___\_<|>_/___.' >'"".
| | : `- \`.;`\ _ /`;.`/ - ` : | |
\ \ `-. \_ __\ /__ _/ .-` / /
======`-.____`-.___\_____/___.-`____.-'======
`=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
佛祖保佑 永无BUG
"""
"""
难度:简单
给定两个数组,编写一个函数来计算它们的交集。
示例 1:
输入: nums1 = [1,2,2,1], nums2 = [2,2]
输出: [2]
示例 2:
输入: nums1 = [4,9,5], nums2 = [9,4,9,8,4]
输出: [9,4]
说明:
输出结果中的每个元素一定是唯一的。
我们可以不考虑输出结果的顺序。
"""
class Solution(object):
def intersection(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: List[int]
"""
return list(set(nums1) & set(nums2))
print(Solution().intersection([4, 9, 5], [9, 4, 9, 8, 4]))
|
# This should be an enum once we make our own buildkite AMI with py3
class SupportedPython:
V3_8 = "3.8.1"
V3_7 = "3.7.6"
V3_6 = "3.6.10"
V3_5 = "3.5.8"
V2_7 = "2.7.17"
SupportedPythons = [
SupportedPython.V2_7,
SupportedPython.V3_5,
SupportedPython.V3_6,
SupportedPython.V3_7,
SupportedPython.V3_8,
]
# See: https://github.com/dagster-io/dagster/issues/1960
SupportedPythonsNo38 = [
SupportedPython.V2_7,
SupportedPython.V3_5,
SupportedPython.V3_6,
SupportedPython.V3_7,
]
# See: https://github.com/dagster-io/dagster/issues/1960
SupportedPython3sNo38 = [SupportedPython.V3_7, SupportedPython.V3_6, SupportedPython.V3_5]
SupportedPython3s = [
SupportedPython.V3_5,
SupportedPython.V3_6,
SupportedPython.V3_7,
SupportedPython.V3_8,
]
TOX_MAP = {
SupportedPython.V3_8: "py38",
SupportedPython.V3_7: "py37",
SupportedPython.V3_6: "py36",
SupportedPython.V3_5: "py35",
SupportedPython.V2_7: "py27",
}
|
#!/usr/bin/env python3
"""Basic utilities for nova"""
class _superpass(object):
"""Simple object to be a placeholder"""
def __getattr__(self, name):
return self
def __setattr__(self, name, value):
return
def __delattr__(self, name):
return
def __getitem__(self, name):
return self
def __setitem__(self, name, value):
return
def __delitem__(self, name):
return
def __repr__(self):
return "superpass"
def __eq__(self, other):
return True
def __call__(self, *args, **kwargs):
return self
superpass = _superpass()
|
print(
3 + 4,
3 - 4,
3 * 4,
3 / 4,
3 ** 4,
3 // 4,
3 % 4) # 2
|
print ('\n\nSistema de Cadastro Pessoal')
print ('______________________________________')
nome = input('\nESCREVA SEU NOME COMPLETO.: ')
idade = int(input('\nDIGA QUANTOS ANOS VOCÊ TEM?.: '))
peso = input('\nDIGITE SEU PESO !.: ')
print('========================================================\n')
print ('Seu nome é {}\nE você tem {} Anos\nE pesa {} Quilos'.format(nome,idade,peso))
print('\n========================================================\n')
|
#Project Euler Problem 14
y=True
i=1
maxz=0
while i <= 1000000:
i=i+1
c=0
y=True
n=i
while y:
if n % 2 == 0:
n=n/2
else :
n=3 * n + 1
c=c+1
if c > maxz:
maxz=c
x=i
if n == 1:
y=False
print("max: ",maxz)
print("max no: ",x)
|
# -*- coding: utf-8 -*-
TESTING = True
SECURITY_PASSWORD_HASH = 'plaintext'
SQLALCHEMY_DATABASE_URI = 'sqlite://'
SLIM_FILE_LOGGING_LEVEL = None
# LOGIN_DISABLED = True
# PRESERVE_CONTEXT_ON_EXCEPTION = False
|
#REPRODUZIR ARQUIVO DE ÁUDIO
"""import pygame
pygame.init()
pygame.mixer.music.load('ex021.ogg')
pygame.mixer.music.play()
pygame.event.wait()"""
#NÃO DEU CERTO
|
# File: atbash_cipher.py
# Purpose: Create an implementation of the atbash cipher, an ancient encryption system created in the Middle East.
# Programmer: Amal Shehu
# Course: Exercism
# Date: Thursday 3rd September 2016, 09:15 PM
alpha = "abcdefghijklmnopqrstuvwxyz"
rev = list(alpha)[::-1]
store = dict(zip(alpha, rev))
def decode(string):
dec = ''
for x in string:
dec += str(store[x])
return dec
def encode(string):
enc = ''
for x in string:
enc += str(store.keys[x])
return enc
|
# Copyright (C) 2017 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"Exceptions definition."
class ElementNotFound(Exception):
"""Raised when an element is not found. Selenium has it's own exception but
when we're iterating through multiple elements and expect one, we raise our
own.
"""
class DocstringsMissing(Exception):
"""Since we require for certain classes to have docstrings, we raise this
exception in case methods are missing them.
"""
class ElementMovingTimeout(Exception):
"""When trying to detect if an element stopped moving so it receives
click, we usually have timeout for that. If timeout is reached, this
exception is raised.
"""
class RedirectTimeout(Exception):
"""When detecting if redirect has occurred, we usually check that
loop isn't infinite and raise this exception if timeout is reached.
"""
class NoClassFound(Exception):
"""Raised in factory in case no class has been found"""
|
def _root_path(f):
if f.is_source:
return f.owner.workspace_root
return "/".join([f.root.path, f.owner.workspace_root])
def _colon_paths(data):
return ":".join([
f.path
for f in sorted(data)
])
def encode_named_generators(named_generators):
return ",".join([k + "=" + v for (k, v) in sorted(named_generators.items())])
def proto_to_scala_src(ctx, label, code_generator, compile_proto, include_proto, transitive_proto_paths, flags, jar_output, named_generators, extra_generator_jars):
worker_content = "{output}\n{included_proto}\n{flags_arg}\n{transitive_proto_paths}\n{inputs}\n{protoc}\n{extra_generator_pairs}\n{extra_cp_entries}".format(
output = jar_output.path,
included_proto = "-" + ":".join(sorted(["%s,%s" % (f.root.path, f.path) for f in include_proto])),
# Command line args to worker cannot be empty so using padding
flags_arg = "-" + ",".join(flags),
transitive_proto_paths = "-" + ":".join(sorted(transitive_proto_paths)),
# Command line args to worker cannot be empty so using padding
# Pass inputs seprately because they doesn't always match to imports (ie blacklisted protos are excluded)
inputs = _colon_paths(compile_proto),
protoc = ctx.executable._protoc.path,
extra_generator_pairs = "-" + encode_named_generators(named_generators),
extra_cp_entries = "-" + _colon_paths(extra_generator_jars),
)
toolchain = ctx.toolchains["@io_bazel_rules_scala//scala_proto:toolchain_type"]
argfile = ctx.actions.declare_file(
"%s_worker_input" % label.name,
sibling = jar_output,
)
ctx.actions.write(output = argfile, content = worker_content)
ctx.actions.run(
executable = code_generator.files_to_run,
inputs = compile_proto + include_proto + [argfile, ctx.executable._protoc] + extra_generator_jars,
tools = compile_proto,
outputs = [jar_output],
mnemonic = "ProtoScalaPBRule",
progress_message = "creating scalapb files %s" % ctx.label,
execution_requirements = {"supports-workers": "1"},
env = {"MAIN_GENERATOR": toolchain.main_generator},
arguments = ["@" + argfile.path],
)
|
'''
pegue o preco dos produto e some usando compreeção de lista
'''
carrinho = []
carrinho.append(('Produto 1', 40))
carrinho.append(('Produto 2', 10))
carrinho.append(('Produto 3', 50))
carrinho.append(('Produto 4', 20))
carrinho.append(('Produto 5', 10))
valor = sum([float(val) for prod, val in carrinho])
print(valor)
|
## Дано координати двох точок на площині, потрібно визначити, чи лежать вони в одній координатної чверті чи ні (всі координати відмінні від нуля).
##
## формат введення
##
## Вводяться 4 числа: координати першої точки (x1, y1) і координати другої точки (x2, y2).
##
## формат виведення
##
## Програма повинна вивести слово YES, якщо точки знаходяться в одній координатної чверті, в іншому випадку вивести слово NO.
x1 = int(input())
y1 = int(input())
x2 = int(input())
y2 = int(input())
if (x1 > 0 and x2 > 0) and (y1 > 0 and y2 > 0):
print("YES")
elif (x1 < 0 and x2 < 0) and (y1 > 0 and y2 > 0):
print("YES")
elif (x1 < 0 and x2 < 0) and (y1 < 0 and y2 < 0):
print("YES")
elif (x1 > 0 and x2 > 0) and (y1 < 0 and y2 < 0):
print("YES")
else:
print("NO")
|
__author__ = "Marten Scheuck"
"""This runs the Linux Version of the AWC"""
def main():
"""Main function to run all the code"""
...
if __name__ == "__main__":
...
|
class DBRouter(object):
def db_for_read(self, model, **hints):
if model._meta.app_label == 'panglao':
return 'panglao'
if model._meta.app_label == 'cheapcdn':
return 'cheapcdn'
if model._meta.app_label == 'lifecycle':
return 'lifecycle'
return 'default'
def db_for_write(self, model, **hints):
if model._meta.app_label == 'panglao':
return 'panglao'
if model._meta.app_label == 'cheapcdn':
return 'cheapcdn'
if model._meta.app_label == 'lifecycle':
return 'lifecycle'
return 'default'
def allow_relation(self, obj1, obj2, **hints):
if obj1._meta.app_label == 'panglao':
if obj2._meta.app_label != 'panglao':
return False
if obj1._meta.app_label == 'cheapcdn':
if obj2._meta.app_label != 'cheapcdn':
return False
if obj1._meta.app_label == 'lifecycle':
if obj2._meta.app_label != 'lifecycle':
return False
def allow_migrate(self, db, app_label, **hints):
if db == 'cheapcdn' and app_label == 'cheapcdn':
return True
if db == 'lifecycle' and app_label == 'lifecycle':
return True
return False
|
# -*- coding: utf-8 -*-
def echofilter():
print("OK, 'echofilter()' function executed!")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.