content
stringlengths 7
1.05M
|
|---|
people = int(input())
lift = [int(i) for i in input().split()]
available_space = 0
for index,cabin in enumerate(lift):
available_space = 4 - int(cabin)
if people < 4:
lift[index] += people
people -= available_space
break
lift[index] += available_space
people -= available_space
if people <= 0 and sum(lift) % 4 != 0:
lift = [str(i) for i in lift]
print(f"The lift has empty spots!")
print(' '.join(lift))
elif sum(lift) % 4 == 0 and people > 0:
lift = [str(i) for i in lift]
print(f"There isn't enough space! {people} people in a queue!")
print(' '.join(lift))
elif people <= 0 and sum(lift) == 0:
lift = [str(i) for i in lift]
print(f"The lift has empty spots!")
print(' '.join(lift))
elif sum(lift) % 4 == 0 and people <= 0:
lift = [str(i) for i in lift]
print(' '.join(lift))
|
global_default = {
'general_poll_interval': 3
}
incoming_default = {
'require_arrival_monitor': False,
'control_file_extension': 'stager-ctrl-bss',
'receipt_file_extension': 'stager-rcpt-bss',
'thankyou_file_extension': 'stager-thanks-bss',
'stop_file': '.stop'
}
outgoing_default = {
'target_uses_arrival_monitor': False,
'control_file_extension': 'stager-ctrl-bss',
'receipt_file_extension': 'stager-rcpt-bss',
'thankyou_file_extension': 'stager-thanks-bss',
'retry_count': 3,
'receipt_file_poll_count': 100,
'receipt_file_poll_interval': 5,
'stop_file': '.stop',
'stop_file_poll_interval': 600
}
|
"""
Given an unsorted array A of size N of non-negative integers, find a continuous sub-array which
adds to a given number.
Input:
The first line of input contains an integer T denoting the number of test cases. Then T test cases
follow. Each test case consists of two lines. The first line of each test case is N and S, where N
is the size of array and S is the sum. The second line of each test case contains N space
separated integers denoting the array elements.
Output:
For each testcase, in a new line, print the starting and ending positions(1 indexing)
of first such occuring subarray from the left if sum equals to subarray, else print -1.
"""
input = """2
5 12
1 2 3 7 5
10 15
1 2 3 4 5 6 7 8 9 10
5 8
1 9 3 3 2
"""
"""
'efficient' solution I found online that doesn't seem to work for my final test case
"""
def find_number(sum_to_find, list_size, num_list):
cur_sum = num_list[0]
start = 0
i = 1
while i < list_size:
while cur_sum > sum_to_find and start < i - 1:
cur_sum -= num_list[start]
start += 1
if cur_sum == sum_to_find:
print("better start: {} end: {}".format(start, i -1))
return
if i < list_size:
cur_sum += num_list[i]
i += 1
print("-1")
def naive_find_number(sum_to_find, list_size, num_list):
if num_list[0] == sum_to_find:
print("1 1")
return
cur_start = cur_end = 0
start_idx = end_idx = 0
for i in range(0, list_size):
cur_sum = 0
for j in range(i, list_size):
x = num_list[j]
cur_sum += x
if cur_sum == sum_to_find:
print("Naive start: {} end: {}".format(i + 1, j + 1))
print("set: {}".format(num_list[i:j + 1]))
return
elif cur_sum > sum_to_find:
break
print("-1")
if __name__ == "__main__":
lines = input.splitlines()
num_examples = int(lines[0])
for i in range(1, len(lines), 2):
size, sum_to_find = (int(x) for x in lines[i].split())
num_list = [int(x) for x in lines[i+1].split()]
print("Input array size: {} sum to find: {}".format(size, sum_to_find))
print("array: {}".format(num_list))
naive_find_number(sum_to_find, size, num_list)
find_number(sum_to_find, size, num_list)
print()
|
class WebOperationCollection:
def __init__(self):
self.id = None
self.opt_type = None
self.opt_name = None
self.opt_trans = None
self.opt_element = None
self.opt_data = None
self.opt_code = None
@staticmethod
def __parse(ui_data: dict, name):
if name not in ui_data:
return None
return ui_data.get(name)
def collect_id(self, ui_data):
self.id = WebOperationCollection.__parse(ui_data, "operationId")
def collect_opt_type(self, ui_data):
self.opt_type = WebOperationCollection.__parse(ui_data, "operationType")
def collect_opt_name(self, ui_data):
self.opt_name = WebOperationCollection.__parse(ui_data, "operationName")
def collect_opt_trans(self, ui_data):
self.opt_trans = WebOperationCollection.__parse(ui_data, "operationTrans")
def collect_opt_code(self, ui_data):
self.opt_code = WebOperationCollection.__parse(ui_data, "operationCode")
def collect_opt_element(self, ui_data):
opt_element = WebOperationCollection.__parse(ui_data, "operationElement")
if opt_element is None or len(opt_element) == 0:
self.opt_element = None
else:
for name, element in opt_element.items():
opt_element[name] = (element["by"].lower(), element["expression"])
self.opt_element = opt_element
def collect_opt_data(self, ui_data):
opt_data = WebOperationCollection.__parse(ui_data, "operationData")
if opt_data is None or len(opt_data) == 0:
self.opt_data = None
else:
self.opt_data = opt_data
def collect(self, ui_data):
self.collect_id(ui_data)
self.collect_opt_type(ui_data)
self.collect_opt_name(ui_data)
self.collect_opt_trans(ui_data)
self.collect_opt_element(ui_data)
self.collect_opt_data(ui_data)
self.collect_opt_code(ui_data)
|
#Write a function that computes cosine or sine by taking the first n terms of the appropriate series expansion
#To evaluate the value of sin and cos, we can make use of MacLaurin's Theorem
#f(x) = f(0) + f'(0)x+ f''(0)/2! x^2 + f'''0/3! x^3 ...
def cos(n):
result = 0.0
for i in range(31): #Performs series for up to 31 terms to give a more accurate result
dividend = ((-1)**i) * (n**(2*i))
divisor = fact(2*i)
result += dividend/divisor
return result
def sin(n):
result = 0.0
for i in range(31): #Performs series for up to 31 terms to give a more accurate result
dividend = ((-1)**i) * (n**((2*i)+1))
divisor = fact((2*i)+1)
result += dividend/divisor
return result
def fact(n):
if (n == 0):
return 1.0
else:
return n * fact(n-1)
print("%0.12f" %sin(2.68))
print("%0.12f" %sin(20))
print("%0.12f" %sin(90))
print("%0.12f" %cos(2.68))
print("%0.12f" %cos(20))
print("%0.12f" %cos(90))
|
class Solution:
def maximumDifference(self, nums: List[int]) -> int:
diff = -1
minValue = nums[0]+1
for i in range(len(nums)):
if nums[i] > minValue:
diff = max(diff, nums[i]- minValue)
minValue = min(minValue, nums[i]) #assigns the minimun value on every iteration
return diff
|
filename='pi_digits.txt'
with open(filename) as file_object:
lines=file_object.readlines()
pi_string=''
for line in lines:
pi_string +=line.strip()
print(pi_string)
print(len(pi_string))
|
#Dylan Creaven - G00354442
#Graph Theory Project 2020
# =The Shunting Yard algoritm for regex
def shunt(infix):
"""Return infix regex as postfix"""
#convert input to a stack list
infix=list(infix)[::-1]
#operator stack and output list as empty lists
opers,postfix =[],[]
#operator precedence
prec={'*':100,'.':90, '|':80, '/':80, '\\':80, ')':70, '(':60}
#loop through input one character at a time
while infix:
#pop a character from the input
c=infix.pop()
#decide what to do based on character
if c== '(':
#push an open bracket to opers stack
opers.append(c)
elif c==')':
#pop the operators stack until you find an open bracket
while opers[-1]!='(':
postfix.append(opers.pop())
#get rid of '('
opers.pop()
elif c in prec:
#push any operators on opers stack with hight prec to output
while opers and prec[c] < prec[opers[-1]]:
postfix.append(opers.pop())
opers.append(c)
else:
#typically we just push the character to the output
postfix.append(c)
#pop all operators to the output
while opers:
postfix.append(opers.pop())
#convert output list to string
return ''.join(postfix)
|
# shell sort
# 时间复杂度: 最优时间复杂度O(n^1.3)
# 最坏时间复杂度O(n^2)
# 平均时间复杂度O(nlogn) ~ O(n^2)
# 稳定性:不稳定
# 不需要额外空间 O(1)
def shell_sort(alist):
length = len(alist)
gap = length // 2
while gap > 0:
for i in range(gap, length):
j = i
while j >= gap and alist[j-gap] > alist[j]:
alist[j-gap], alist[j] = alist[j], alist[j-gap]
j -= gap
gap = gap // 2
return alist
# test
l1 = [3, 2, 1, 0, 7, 11, 56, 23]
l2 = [8, 4, 1, 8, 4, 9, 3, 2]
print(shell_sort(l1))
print(shell_sort(l2))
def gap_insertion_sort(alist, start, gap):
for i in range(start+gap, len(alist), gap):
current_value = alist[i]
j = i
while j >= gap and alist[j-gap] > current_value:
alist[j] = alist[j-gap]
j = j - gap
alist[j] = current_value
def shell_sort2(alist):
gap = len(alist) // 2
while gap > 0:
for i in range(gap):
gap_insertion_sort(alist, i, gap)
gap = gap // 2
return alist
# test
l3 = [3, 2, 1, 0, 7, 11, 56, 23]
l4 = [8, 4, 1, 8, 4, 9, 3, 2]
print(shell_sort2(l3))
print(shell_sort2(l4))
|
"""
{{cookiecutter.module_name}}
{{cookiecutter.short_description}}
"""
__version__ = "{{cookiecutter.version}}"
|
#Collections, Lists and Tubles - colecao de dados
familia = ["Hugo", "Louyse", "Julieta"] #listas podem ser feitas com qualquer tipo de dado, bool, int, float, string
print(familia[0]) #primeiro dado
print(familia[-1]) #ultimo dado
print(familia[0:2]) #intervalo de dado, sem exclui o ultimo dado do vetor, neste caso Julieta
print(familia[1])
print(familia)
familia[2] = "Juju " #modificando o valor de um vetor
print(familia)
familia.extend(["Seraaaaaa?","Na mao de Deus"]) #adicionando valor no vetor
print(familia)
familia.insert(1, "Spock") #inserindo um novo vetor e direcionando a sua posicao ( as outras vao para frente )
print(familia)
familia.pop() #remove o ultimo vetor
print(familia)
familia.remove("Spock") #remove vetor especifico
print(familia)
familia.clear() #limpa lista
print(familia)
familia = ["Hugo", "Hugo", "Louyse", "Julieta"]
print(familia.count("Hugo")) #Contar quantas vezes o valor se repete na lista de vetores
idade_familia = [33, 29, 6]
print(idade_familia)
idade_familia.sort() #ordena os valores dos vetores em ordem ascendente
print(idade_familia)
familia.sort()
print(familia)
idade_familia.reverse() #digita de tras para frente os vetores
print(idade_familia)
familia.reverse()
print(familia)
print("copia de vetores")
familia2 = familia.copy() #gerar uma nova variavel com uma copia de outra variavel
familia.remove("Julieta")
print(familia)
print(familia2)
#tople - nao pode ser alterado
coordenadas1 = [-49, -36]
coordenadas2 = (-49, -36) #toble
coordenadas1.pop
print(coordenadas1)
#coordenadas2.pop #### por ser tople, nao e possivel remover o vetor
print(coordenadas2)
|
#
# Unicode Mapping generated by uni2python.xsl
#
unicode_map = {
0x00100: r"\={A}", # LATIN CAPITAL LETTER A WITH MACRON
0x00101: r"\={a}", # LATIN SMALL LETTER A WITH MACRON
0x00102: r"\u{A}", # LATIN CAPITAL LETTER A WITH BREVE
0x00103: r"\u{a}", # LATIN SMALL LETTER A WITH BREVE
0x00104: r"\k{A}", # LATIN CAPITAL LETTER A WITH OGONEK
0x00105: r"\k{a}", # LATIN SMALL LETTER A WITH OGONEK
0x00106: r"\'{C}", # LATIN CAPITAL LETTER C WITH ACUTE
0x00107: r"\'{c}", # LATIN SMALL LETTER C WITH ACUTE
0x00108: r"\^{C}", # LATIN CAPITAL LETTER C WITH CIRCUMFLEX
0x00109: r"\^{c}", # LATIN SMALL LETTER C WITH CIRCUMFLEX
0x0010A: r"\.{C}", # LATIN CAPITAL LETTER C WITH DOT ABOVE
0x0010B: r"\.{c}", # LATIN SMALL LETTER C WITH DOT ABOVE
0x0010C: r"\v{C}", # LATIN CAPITAL LETTER C WITH CARON
0x0010D: r"\v{c}", # LATIN SMALL LETTER C WITH CARON
0x0010E: r"\v{D}", # LATIN CAPITAL LETTER D WITH CARON
0x0010F: r"\v{d}", # LATIN SMALL LETTER D WITH CARON
0x00110: r"\DJ{}", # LATIN CAPITAL LETTER D WITH STROKE
0x00111: r"\dj{}", # LATIN SMALL LETTER D WITH STROKE
0x00112: r"\={E}", # LATIN CAPITAL LETTER E WITH MACRON
0x00113: r"\={e}", # LATIN SMALL LETTER E WITH MACRON
0x00114: r"\u{E}", # LATIN CAPITAL LETTER E WITH BREVE
0x00115: r"\u{e}", # LATIN SMALL LETTER E WITH BREVE
0x00116: r"\.{E}", # LATIN CAPITAL LETTER E WITH DOT ABOVE
0x00117: r"\.{e}", # LATIN SMALL LETTER E WITH DOT ABOVE
0x00118: r"\k{E}", # LATIN CAPITAL LETTER E WITH OGONEK
0x00119: r"\k{e}", # LATIN SMALL LETTER E WITH OGONEK
0x0011A: r"\v{E}", # LATIN CAPITAL LETTER E WITH CARON
0x0011B: r"\v{e}", # LATIN SMALL LETTER E WITH CARON
0x0011C: r"\^{G}", # LATIN CAPITAL LETTER G WITH CIRCUMFLEX
0x0011D: r"\^{g}", # LATIN SMALL LETTER G WITH CIRCUMFLEX
0x0011E: r"\u{G}", # LATIN CAPITAL LETTER G WITH BREVE
0x0011F: r"\u{g}", # LATIN SMALL LETTER G WITH BREVE
0x00120: r"\.{G}", # LATIN CAPITAL LETTER G WITH DOT ABOVE
0x00121: r"\.{g}", # LATIN SMALL LETTER G WITH DOT ABOVE
0x00122: r"\c{G}", # LATIN CAPITAL LETTER G WITH CEDILLA
0x00123: r"\c{g}", # LATIN SMALL LETTER G WITH CEDILLA
0x00124: r"\^{H}", # LATIN CAPITAL LETTER H WITH CIRCUMFLEX
0x00125: r"\^{h}", # LATIN SMALL LETTER H WITH CIRCUMFLEX
0x00126: r"{\fontencoding{LELA}\selectfont\char40}", # LATIN CAPITAL LETTER H WITH STROKE
0x00128: r"\~{I}", # LATIN CAPITAL LETTER I WITH TILDE
0x00129: r"\~{\i}", # LATIN SMALL LETTER I WITH TILDE
0x0012A: r"\={I}", # LATIN CAPITAL LETTER I WITH MACRON
0x0012B: r"\={\i}", # LATIN SMALL LETTER I WITH MACRON
0x0012C: r"\u{I}", # LATIN CAPITAL LETTER I WITH BREVE
0x0012D: r"\u{\i}", # LATIN SMALL LETTER I WITH BREVE
0x0012E: r"\k{I}", # LATIN CAPITAL LETTER I WITH OGONEK
0x0012F: r"\k{i}", # LATIN SMALL LETTER I WITH OGONEK
0x00130: r"\.{I}", # LATIN CAPITAL LETTER I WITH DOT ABOVE
0x00131: r"\i{}", # LATIN SMALL LETTER DOTLESS I
0x00132: r"IJ", # LATIN CAPITAL LIGATURE IJ
0x00133: r"ij", # LATIN SMALL LIGATURE IJ
0x00134: r"\^{J}", # LATIN CAPITAL LETTER J WITH CIRCUMFLEX
0x00135: r"\^{\j}", # LATIN SMALL LETTER J WITH CIRCUMFLEX
0x00136: r"\c{K}", # LATIN CAPITAL LETTER K WITH CEDILLA
0x00137: r"\c{k}", # LATIN SMALL LETTER K WITH CEDILLA
0x00138: r"{\fontencoding{LELA}\selectfont\char91}", # LATIN SMALL LETTER KRA
0x00139: r"\'{L}", # LATIN CAPITAL LETTER L WITH ACUTE
0x0013A: r"\'{l}", # LATIN SMALL LETTER L WITH ACUTE
0x0013B: r"\c{L}", # LATIN CAPITAL LETTER L WITH CEDILLA
0x0013C: r"\c{l}", # LATIN SMALL LETTER L WITH CEDILLA
0x0013D: r"\v{L}", # LATIN CAPITAL LETTER L WITH CARON
0x0013E: r"\v{l}", # LATIN SMALL LETTER L WITH CARON
0x0013F: r"{\fontencoding{LELA}\selectfont\char201}", # LATIN CAPITAL LETTER L WITH MIDDLE DOT
0x00140: r"{\fontencoding{LELA}\selectfont\char202}", # LATIN SMALL LETTER L WITH MIDDLE DOT
0x00141: r"\L{}", # LATIN CAPITAL LETTER L WITH STROKE
0x00142: r"\l{}", # LATIN SMALL LETTER L WITH STROKE
0x00143: r"\'{N}", # LATIN CAPITAL LETTER N WITH ACUTE
0x00144: r"\'{n}", # LATIN SMALL LETTER N WITH ACUTE
0x00145: r"\c{N}", # LATIN CAPITAL LETTER N WITH CEDILLA
0x00146: r"\c{n}", # LATIN SMALL LETTER N WITH CEDILLA
0x00147: r"\v{N}", # LATIN CAPITAL LETTER N WITH CARON
0x00148: r"\v{n}", # LATIN SMALL LETTER N WITH CARON
0x00149: r"'n", # LATIN SMALL LETTER N PRECEDED BY APOSTROPHE
0x0014A: r"\NG{}", # LATIN CAPITAL LETTER ENG
0x0014B: r"\ng{}", # LATIN SMALL LETTER ENG
0x0014C: r"\={O}", # LATIN CAPITAL LETTER O WITH MACRON
0x0014D: r"\={o}", # LATIN SMALL LETTER O WITH MACRON
0x0014E: r"\u{O}", # LATIN CAPITAL LETTER O WITH BREVE
0x0014F: r"\u{o}", # LATIN SMALL LETTER O WITH BREVE
0x00150: r"\H{O}", # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE
0x00151: r"\H{o}", # LATIN SMALL LETTER O WITH DOUBLE ACUTE
0x00152: r"\OE{}", # LATIN CAPITAL LIGATURE OE
0x00153: r"\oe{}", # LATIN SMALL LIGATURE OE
0x00154: r"\'{R}", # LATIN CAPITAL LETTER R WITH ACUTE
0x00155: r"\'{r}", # LATIN SMALL LETTER R WITH ACUTE
0x00156: r"\c{R}", # LATIN CAPITAL LETTER R WITH CEDILLA
0x00157: r"\c{r}", # LATIN SMALL LETTER R WITH CEDILLA
0x00158: r"\v{R}", # LATIN CAPITAL LETTER R WITH CARON
0x00159: r"\v{r}", # LATIN SMALL LETTER R WITH CARON
0x0015A: r"\'{S}", # LATIN CAPITAL LETTER S WITH ACUTE
0x0015B: r"\'{s}", # LATIN SMALL LETTER S WITH ACUTE
0x0015C: r"\^{S}", # LATIN CAPITAL LETTER S WITH CIRCUMFLEX
0x0015D: r"\^{s}", # LATIN SMALL LETTER S WITH CIRCUMFLEX
0x0015E: r"\c{S}", # LATIN CAPITAL LETTER S WITH CEDILLA
0x0015F: r"\c{s}", # LATIN SMALL LETTER S WITH CEDILLA
0x00160: r"\v{S}", # LATIN CAPITAL LETTER S WITH CARON
0x00161: r"\v{s}", # LATIN SMALL LETTER S WITH CARON
0x00162: r"\c{T}", # LATIN CAPITAL LETTER T WITH CEDILLA
0x00163: r"\c{t}", # LATIN SMALL LETTER T WITH CEDILLA
0x00164: r"\v{T}", # LATIN CAPITAL LETTER T WITH CARON
0x00165: r"\v{t}", # LATIN SMALL LETTER T WITH CARON
0x00166: r"{\fontencoding{LELA}\selectfont\char47}", # LATIN CAPITAL LETTER T WITH STROKE
0x00167: r"{\fontencoding{LELA}\selectfont\char63}", # LATIN SMALL LETTER T WITH STROKE
0x00168: r"\~{U}", # LATIN CAPITAL LETTER U WITH TILDE
0x00169: r"\~{u}", # LATIN SMALL LETTER U WITH TILDE
0x0016A: r"\={U}", # LATIN CAPITAL LETTER U WITH MACRON
0x0016B: r"\={u}", # LATIN SMALL LETTER U WITH MACRON
0x0016C: r"\u{U}", # LATIN CAPITAL LETTER U WITH BREVE
0x0016D: r"\u{u}", # LATIN SMALL LETTER U WITH BREVE
0x0016E: r"\r{U}", # LATIN CAPITAL LETTER U WITH RING ABOVE
0x0016F: r"\r{u}", # LATIN SMALL LETTER U WITH RING ABOVE
0x00170: r"\H{U}", # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE
0x00171: r"\H{u}", # LATIN SMALL LETTER U WITH DOUBLE ACUTE
0x00172: r"\k{U}", # LATIN CAPITAL LETTER U WITH OGONEK
0x00173: r"\k{u}", # LATIN SMALL LETTER U WITH OGONEK
0x00174: r"\^{W}", # LATIN CAPITAL LETTER W WITH CIRCUMFLEX
0x00175: r"\^{w}", # LATIN SMALL LETTER W WITH CIRCUMFLEX
0x00176: r"\^{Y}", # LATIN CAPITAL LETTER Y WITH CIRCUMFLEX
0x00177: r"\^{y}", # LATIN SMALL LETTER Y WITH CIRCUMFLEX
0x00178: r'\"{Y}', # LATIN CAPITAL LETTER Y WITH DIAERESIS
0x00179: r"\'{Z}", # LATIN CAPITAL LETTER Z WITH ACUTE
0x0017A: r"\'{z}", # LATIN SMALL LETTER Z WITH ACUTE
0x0017B: r"\.{Z}", # LATIN CAPITAL LETTER Z WITH DOT ABOVE
0x0017C: r"\.{z}", # LATIN SMALL LETTER Z WITH DOT ABOVE
0x0017D: r"\v{Z}", # LATIN CAPITAL LETTER Z WITH CARON
0x0017E: r"\v{z}", # LATIN SMALL LETTER Z WITH CARON
0x00195: r"\texthvlig{}", # LATIN SMALL LETTER HV
0x0019E: r"\textnrleg{}", # LATIN SMALL LETTER N WITH LONG RIGHT LEG
0x001C2: r"\textdoublepipe{}", # LATIN LETTER ALVEOLAR CLICK
0x001F5: r"\'{g}", # LATIN SMALL LETTER G WITH ACUTE
0x00259: r"\ensuremath{\Elzschwa}", # LATIN SMALL LETTER SCHWA
0x00261: r"g", # LATIN SMALL LETTER SCRIPT G
0x00278: r"\textphi{}", # LATIN SMALL LETTER PHI
0x0029E: r"\textturnk{}", # LATIN SMALL LETTER TURNED K
0x002A4: r"\textdyoghlig{}", # LATIN SMALL LETTER DEZH DIGRAPH
0x0025B: r"\textvarepsilon{}", # LATIN SMALL LETTER OPEN E
0x002BC: r"'", # MODIFIER LETTER APOSTROPHE
0x002C7: r"\textasciicaron{}", # CARON
0x002C8: r"\ensuremath{\Elzverts}", # MODIFIER LETTER VERTICAL LINE
0x002D8: r"\textasciibreve{}", # BREVE
0x002D9: r"\textperiodcentered{}", # DOT ABOVE
0x002DA: r"\r{}", # RING ABOVE
0x002DB: r"\k{}", # OGONEK
0x002DC: r"\texttildelow{}", # SMALL TILDE
0x002DD: r"\H{}", # DOUBLE ACUTE ACCENT
0x002E5: r"\tone{55}", # MODIFIER LETTER EXTRA-HIGH TONE BAR
0x002E6: r"\tone{44}", # MODIFIER LETTER HIGH TONE BAR
0x002E7: r"\tone{33}", # MODIFIER LETTER MID TONE BAR
0x002E8: r"\tone{22}", # MODIFIER LETTER LOW TONE BAR
0x002E9: r"\tone{11}", # MODIFIER LETTER EXTRA-LOW TONE BAR
0x00300: r"\`", # COMBINING GRAVE ACCENT
0x00301: r"\'", # COMBINING ACUTE ACCENT
0x00302: r"\^", # COMBINING CIRCUMFLEX ACCENT
0x00303: r"\~", # COMBINING TILDE
0x00304: r"\=", # COMBINING MACRON
0x00306: r"\u", # COMBINING BREVE
0x00307: r"\.", # COMBINING DOT ABOVE
0x00308: r'\"', # COMBINING DIAERESIS
0x0030A: r"\r", # COMBINING RING ABOVE
0x0030B: r"\H", # COMBINING DOUBLE ACUTE ACCENT
0x0030C: r"\v", # COMBINING CARON
0x0030F: r"\cyrchar\C", # COMBINING DOUBLE GRAVE ACCENT
0x00327: r"\c", # COMBINING CEDILLA
0x00386: r"\'{A}", # GREEK CAPITAL LETTER ALPHA WITH TONOS
0x00388: r"\'{E}", # GREEK CAPITAL LETTER EPSILON WITH TONOS
0x00389: r"\'{H}", # GREEK CAPITAL LETTER ETA WITH TONOS
0x0038A: r"\'{}{I}", # GREEK CAPITAL LETTER IOTA WITH TONOS
0x0038C: r"\'{}O", # GREEK CAPITAL LETTER OMICRON WITH TONOS
0x00393: r"\ensuremath{\Gamma}", # GREEK CAPITAL LETTER GAMMA
0x00394: r"\ensuremath{\Delta}", # GREEK CAPITAL LETTER DELTA
0x00395: r"\ensuremath{\Epsilon}", # GREEK CAPITAL LETTER EPSILON
0x0039B: r"\ensuremath{\Lambda}", # GREEK CAPITAL LETTER LAMDA
0x003A0: r"\ensuremath{\Pi}", # GREEK CAPITAL LETTER PI
0x003A3: r"\ensuremath{\Sigma}", # GREEK CAPITAL LETTER SIGMA
0x003A4: r"\ensuremath{\Tau}", # GREEK CAPITAL LETTER TAU
0x003A5: r"\ensuremath{\Upsilon}", # GREEK CAPITAL LETTER UPSILON
0x003A6: r"\ensuremath{\Phi}", # GREEK CAPITAL LETTER PHI
0x003AC: r"\'{\ensuremath{\alpha}}", # GREEK SMALL LETTER ALPHA WITH TONOS
0x003AD: r"\ensuremath{\acute{\epsilon}}", # GREEK SMALL LETTER EPSILON WITH TONOS
0x003AE: r"\ensuremath{\acute{\eta}}", # GREEK SMALL LETTER ETA WITH TONOS
0x003AF: r"\ensuremath{\acute{\iota}}", # GREEK SMALL LETTER IOTA WITH TONOS
0x003B0: r"\ensuremath{\acute{\ddot{\upsilon}}}", # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS
0x003B1: r"\ensuremath{\alpha}", # GREEK SMALL LETTER ALPHA
0x003B2: r"\ensuremath{\beta}", # GREEK SMALL LETTER BETA
0x003B3: r"\ensuremath{\gamma}", # GREEK SMALL LETTER GAMMA
0x003B4: r"\ensuremath{\delta}", # GREEK SMALL LETTER DELTA
0x003B5: r"\ensuremath{\epsilon}", # GREEK SMALL LETTER EPSILON
0x003B6: r"\ensuremath{\zeta}", # GREEK SMALL LETTER ZETA
0x003B7: r"\ensuremath{\eta}", # GREEK SMALL LETTER ETA
0x003B8: r"\texttheta{}", # GREEK SMALL LETTER THETA
0x003B9: r"\ensuremath{\iota}", # GREEK SMALL LETTER IOTA
0x003BA: r"\ensuremath{\kappa}", # GREEK SMALL LETTER KAPPA
0x003BB: r"\ensuremath{\lambda}", # GREEK SMALL LETTER LAMDA
0x003BC: r"\ensuremath{\mu}", # GREEK SMALL LETTER MU
0x003BD: r"\ensuremath{\nu}", # GREEK SMALL LETTER NU
0x003BE: r"\ensuremath{\xi}", # GREEK SMALL LETTER XI
0x003BF: r"\ensuremath{o}", # GREEK SMALL LETTER OMICRON
0x003C0: r"\ensuremath{\pi}", # GREEK SMALL LETTER PI
0x003C1: r"\ensuremath{\rho}", # GREEK SMALL LETTER RHO
0x003C3: r"\ensuremath{\sigma}", # GREEK SMALL LETTER SIGMA
0x003C4: r"\ensuremath{\tau}", # GREEK SMALL LETTER TAU
0x003C5: r"\ensuremath{\upsilon}", # GREEK SMALL LETTER UPSILON
0x003C6: r"\ensuremath{\varphi}", # GREEK SMALL LETTER PHI
0x003C7: r"\ensuremath{\chi}", # GREEK SMALL LETTER CHI
0x003C8: r"\ensuremath{\psi}", # GREEK SMALL LETTER PSI
0x003C9: r"\ensuremath{\omega}", # GREEK SMALL LETTER OMEGA
0x003CA: r"\ensuremath{\ddot{\iota}}", # GREEK SMALL LETTER IOTA WITH DIALYTIKA
0x003CB: r"\ensuremath{\ddot{\upsilon}}", # GREEK SMALL LETTER UPSILON WITH DIALYTIKA
0x003CC: r"\'{o}", # GREEK SMALL LETTER OMICRON WITH TONOS
0x003D1: r"\textvartheta{}", # GREEK THETA SYMBOL
0x003D5: r"\ensuremath{\phi}", # GREEK PHI SYMBOL
0x00401: r"\cyrchar\CYRYO{}", # CYRILLIC CAPITAL LETTER IO
0x00402: r"\cyrchar\CYRDJE{}", # CYRILLIC CAPITAL LETTER DJE
0x00403: r"\cyrchar{\'\CYRG}", # CYRILLIC CAPITAL LETTER GJE
0x00404: r"\cyrchar\CYRIE{}", # CYRILLIC CAPITAL LETTER UKRAINIAN IE
0x00405: r"\cyrchar\CYRDZE{}", # CYRILLIC CAPITAL LETTER DZE
0x00406: r"\cyrchar\CYRII{}", # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I
0x00407: r"\cyrchar\CYRYI{}", # CYRILLIC CAPITAL LETTER YI
0x00408: r"\cyrchar\CYRJE{}", # CYRILLIC CAPITAL LETTER JE
0x00409: r"\cyrchar\CYRLJE{}", # CYRILLIC CAPITAL LETTER LJE
0x0040A: r"\cyrchar\CYRNJE{}", # CYRILLIC CAPITAL LETTER NJE
0x0040B: r"\cyrchar\CYRTSHE{}", # CYRILLIC CAPITAL LETTER TSHE
0x0040C: r"\cyrchar{\'\CYRK}", # CYRILLIC CAPITAL LETTER KJE
0x0040E: r"\cyrchar\CYRUSHRT{}", # CYRILLIC CAPITAL LETTER SHORT U
0x0040F: r"\cyrchar\CYRDZHE{}", # CYRILLIC CAPITAL LETTER DZHE
0x00410: r"\cyrchar\CYRA{}", # CYRILLIC CAPITAL LETTER A
0x00411: r"\cyrchar\CYRB{}", # CYRILLIC CAPITAL LETTER BE
0x00412: r"\cyrchar\CYRV{}", # CYRILLIC CAPITAL LETTER VE
0x00413: r"\cyrchar\CYRG{}", # CYRILLIC CAPITAL LETTER GHE
0x00414: r"\cyrchar\CYRD{}", # CYRILLIC CAPITAL LETTER DE
0x00415: r"\cyrchar\CYRE{}", # CYRILLIC CAPITAL LETTER IE
0x00416: r"\cyrchar\CYRZH{}", # CYRILLIC CAPITAL LETTER ZHE
0x00417: r"\cyrchar\CYRZ{}", # CYRILLIC CAPITAL LETTER ZE
0x00418: r"\cyrchar\CYRI{}", # CYRILLIC CAPITAL LETTER I
0x00419: r"\cyrchar\CYRISHRT{}", # CYRILLIC CAPITAL LETTER SHORT I
0x0041A: r"\cyrchar\CYRK{}", # CYRILLIC CAPITAL LETTER KA
0x0041B: r"\cyrchar\CYRL{}", # CYRILLIC CAPITAL LETTER EL
0x0041C: r"\cyrchar\CYRM{}", # CYRILLIC CAPITAL LETTER EM
0x0041D: r"\cyrchar\CYRN{}", # CYRILLIC CAPITAL LETTER EN
0x0041E: r"\cyrchar\CYRO{}", # CYRILLIC CAPITAL LETTER O
0x0041F: r"\cyrchar\CYRP{}", # CYRILLIC CAPITAL LETTER PE
0x00420: r"\cyrchar\CYRR{}", # CYRILLIC CAPITAL LETTER ER
0x00421: r"\cyrchar\CYRS{}", # CYRILLIC CAPITAL LETTER ES
0x00422: r"\cyrchar\CYRT{}", # CYRILLIC CAPITAL LETTER TE
0x00423: r"\cyrchar\CYRU{}", # CYRILLIC CAPITAL LETTER U
0x00424: r"\cyrchar\CYRF{}", # CYRILLIC CAPITAL LETTER EF
0x00425: r"\cyrchar\CYRH{}", # CYRILLIC CAPITAL LETTER HA
0x00426: r"\cyrchar\CYRC{}", # CYRILLIC CAPITAL LETTER TSE
0x00427: r"\cyrchar\CYRCH{}", # CYRILLIC CAPITAL LETTER CHE
0x00428: r"\cyrchar\CYRSH{}", # CYRILLIC CAPITAL LETTER SHA
0x00429: r"\cyrchar\CYRSHCH{}", # CYRILLIC CAPITAL LETTER SHCHA
0x0042A: r"\cyrchar\CYRHRDSN{}", # CYRILLIC CAPITAL LETTER HARD SIGN
0x0042B: r"\cyrchar\CYRERY{}", # CYRILLIC CAPITAL LETTER YERU
0x0042C: r"\cyrchar\CYRSFTSN{}", # CYRILLIC CAPITAL LETTER SOFT SIGN
0x0042D: r"\cyrchar\CYREREV{}", # CYRILLIC CAPITAL LETTER E
0x0042E: r"\cyrchar\CYRYU{}", # CYRILLIC CAPITAL LETTER YU
0x0042F: r"\cyrchar\CYRYA{}", # CYRILLIC CAPITAL LETTER YA
0x00430: r"\cyrchar\cyra{}", # CYRILLIC SMALL LETTER A
0x00431: r"\cyrchar\cyrb{}", # CYRILLIC SMALL LETTER BE
0x00432: r"\cyrchar\cyrv{}", # CYRILLIC SMALL LETTER VE
0x00433: r"\cyrchar\cyrg{}", # CYRILLIC SMALL LETTER GHE
0x00434: r"\cyrchar\cyrd{}", # CYRILLIC SMALL LETTER DE
0x00435: r"\cyrchar\cyre{}", # CYRILLIC SMALL LETTER IE
0x00436: r"\cyrchar\cyrzh{}", # CYRILLIC SMALL LETTER ZHE
0x00437: r"\cyrchar\cyrz{}", # CYRILLIC SMALL LETTER ZE
0x00438: r"\cyrchar\cyri{}", # CYRILLIC SMALL LETTER I
0x00439: r"\cyrchar\cyrishrt{}", # CYRILLIC SMALL LETTER SHORT I
0x0043A: r"\cyrchar\cyrk{}", # CYRILLIC SMALL LETTER KA
0x0043B: r"\cyrchar\cyrl{}", # CYRILLIC SMALL LETTER EL
0x0043C: r"\cyrchar\cyrm{}", # CYRILLIC SMALL LETTER EM
0x0043D: r"\cyrchar\cyrn{}", # CYRILLIC SMALL LETTER EN
0x0043E: r"\cyrchar\cyro{}", # CYRILLIC SMALL LETTER O
0x0043F: r"\cyrchar\cyrp{}", # CYRILLIC SMALL LETTER PE
0x00440: r"\cyrchar\cyrr{}", # CYRILLIC SMALL LETTER ER
0x00441: r"\cyrchar\cyrs{}", # CYRILLIC SMALL LETTER ES
0x00442: r"\cyrchar\cyrt{}", # CYRILLIC SMALL LETTER TE
0x00443: r"\cyrchar\cyru{}", # CYRILLIC SMALL LETTER U
0x00444: r"\cyrchar\cyrf{}", # CYRILLIC SMALL LETTER EF
0x00445: r"\cyrchar\cyrh{}", # CYRILLIC SMALL LETTER HA
0x00446: r"\cyrchar\cyrc{}", # CYRILLIC SMALL LETTER TSE
0x00447: r"\cyrchar\cyrch{}", # CYRILLIC SMALL LETTER CHE
0x00448: r"\cyrchar\cyrsh{}", # CYRILLIC SMALL LETTER SHA
0x00449: r"\cyrchar\cyrshch{}", # CYRILLIC SMALL LETTER SHCHA
0x0044A: r"\cyrchar\cyrhrdsn{}", # CYRILLIC SMALL LETTER HARD SIGN
0x0044B: r"\cyrchar\cyrery{}", # CYRILLIC SMALL LETTER YERU
0x0044C: r"\cyrchar\cyrsftsn{}", # CYRILLIC SMALL LETTER SOFT SIGN
0x0044D: r"\cyrchar\cyrerev{}", # CYRILLIC SMALL LETTER E
0x0044E: r"\cyrchar\cyryu{}", # CYRILLIC SMALL LETTER YU
0x0044F: r"\cyrchar\cyrya{}", # CYRILLIC SMALL LETTER YA
0x00451: r"\cyrchar\cyryo{}", # CYRILLIC SMALL LETTER IO
0x00452: r"\cyrchar\cyrdje{}", # CYRILLIC SMALL LETTER DJE
0x00453: r"\cyrchar{\'\cyrg}", # CYRILLIC SMALL LETTER GJE
0x00454: r"\cyrchar\cyrie{}", # CYRILLIC SMALL LETTER UKRAINIAN IE
0x00455: r"\cyrchar\cyrdze{}", # CYRILLIC SMALL LETTER DZE
0x00456: r"\cyrchar\cyrii{}", # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I
0x00457: r"\cyrchar\cyryi{}", # CYRILLIC SMALL LETTER YI
0x00458: r"\cyrchar\cyrje{}", # CYRILLIC SMALL LETTER JE
0x00459: r"\cyrchar\cyrlje{}", # CYRILLIC SMALL LETTER LJE
0x0045A: r"\cyrchar\cyrnje{}", # CYRILLIC SMALL LETTER NJE
0x0045B: r"\cyrchar\cyrtshe{}", # CYRILLIC SMALL LETTER TSHE
0x0045C: r"\cyrchar{\'\cyrk}", # CYRILLIC SMALL LETTER KJE
0x0045E: r"\cyrchar\cyrushrt{}", # CYRILLIC SMALL LETTER SHORT U
0x0045F: r"\cyrchar\cyrdzhe{}", # CYRILLIC SMALL LETTER DZHE
0x00460: r"\cyrchar\CYROMEGA{}", # CYRILLIC CAPITAL LETTER OMEGA
0x00461: r"\cyrchar\cyromega{}", # CYRILLIC SMALL LETTER OMEGA
0x00462: r"\cyrchar\CYRYAT{}", # CYRILLIC CAPITAL LETTER YAT
0x00464: r"\cyrchar\CYRIOTE{}", # CYRILLIC CAPITAL LETTER IOTIFIED E
0x00465: r"\cyrchar\cyriote{}", # CYRILLIC SMALL LETTER IOTIFIED E
0x00466: r"\cyrchar\CYRLYUS{}", # CYRILLIC CAPITAL LETTER LITTLE YUS
0x00467: r"\cyrchar\cyrlyus{}", # CYRILLIC SMALL LETTER LITTLE YUS
0x00468: r"\cyrchar\CYRIOTLYUS{}", # CYRILLIC CAPITAL LETTER IOTIFIED LITTLE YUS
0x00469: r"\cyrchar\cyriotlyus{}", # CYRILLIC SMALL LETTER IOTIFIED LITTLE YUS
0x0046A: r"\cyrchar\CYRBYUS{}", # CYRILLIC CAPITAL LETTER BIG YUS
0x0046C: r"\cyrchar\CYRIOTBYUS{}", # CYRILLIC CAPITAL LETTER IOTIFIED BIG YUS
0x0046D: r"\cyrchar\cyriotbyus{}", # CYRILLIC SMALL LETTER IOTIFIED BIG YUS
0x0046E: r"\cyrchar\CYRKSI{}", # CYRILLIC CAPITAL LETTER KSI
0x0046F: r"\cyrchar\cyrksi{}", # CYRILLIC SMALL LETTER KSI
0x00470: r"\cyrchar\CYRPSI{}", # CYRILLIC CAPITAL LETTER PSI
0x00471: r"\cyrchar\cyrpsi{}", # CYRILLIC SMALL LETTER PSI
0x00472: r"\cyrchar\CYRFITA{}", # CYRILLIC CAPITAL LETTER FITA
0x00474: r"\cyrchar\CYRIZH{}", # CYRILLIC CAPITAL LETTER IZHITSA
0x00478: r"\cyrchar\CYRUK{}", # CYRILLIC CAPITAL LETTER UK
0x00479: r"\cyrchar\cyruk{}", # CYRILLIC SMALL LETTER UK
0x0047A: r"\cyrchar\CYROMEGARND{}", # CYRILLIC CAPITAL LETTER ROUND OMEGA
0x0047B: r"\cyrchar\cyromegarnd{}", # CYRILLIC SMALL LETTER ROUND OMEGA
0x0047C: r"\cyrchar\CYROMEGATITLO{}", # CYRILLIC CAPITAL LETTER OMEGA WITH TITLO
0x0047D: r"\cyrchar\cyromegatitlo{}", # CYRILLIC SMALL LETTER OMEGA WITH TITLO
0x0047E: r"\cyrchar\CYROT{}", # CYRILLIC CAPITAL LETTER OT
0x0047F: r"\cyrchar\cyrot{}", # CYRILLIC SMALL LETTER OT
0x00480: r"\cyrchar\CYRKOPPA{}", # CYRILLIC CAPITAL LETTER KOPPA
0x00481: r"\cyrchar\cyrkoppa{}", # CYRILLIC SMALL LETTER KOPPA
0x00482: r"\cyrchar\cyrthousands{}", # CYRILLIC THOUSANDS SIGN
0x00488: r"\cyrchar\cyrhundredthousands{}", # COMBINING CYRILLIC HUNDRED THOUSANDS SIGN
0x00489: r"\cyrchar\cyrmillions{}", # COMBINING CYRILLIC MILLIONS SIGN
0x0048C: r"\cyrchar\CYRSEMISFTSN{}", # CYRILLIC CAPITAL LETTER SEMISOFT SIGN
0x0048D: r"\cyrchar\cyrsemisftsn{}", # CYRILLIC SMALL LETTER SEMISOFT SIGN
0x0048E: r"\cyrchar\CYRRTICK{}", # CYRILLIC CAPITAL LETTER ER WITH TICK
0x0048F: r"\cyrchar\cyrrtick{}", # CYRILLIC SMALL LETTER ER WITH TICK
0x00490: r"\cyrchar\CYRGUP{}", # CYRILLIC CAPITAL LETTER GHE WITH UPTURN
0x00491: r"\cyrchar\cyrgup{}", # CYRILLIC SMALL LETTER GHE WITH UPTURN
0x00492: r"\cyrchar\CYRGHCRS{}", # CYRILLIC CAPITAL LETTER GHE WITH STROKE
0x00493: r"\cyrchar\cyrghcrs{}", # CYRILLIC SMALL LETTER GHE WITH STROKE
0x00494: r"\cyrchar\CYRGHK{}", # CYRILLIC CAPITAL LETTER GHE WITH MIDDLE HOOK
0x00495: r"\cyrchar\cyrghk{}", # CYRILLIC SMALL LETTER GHE WITH MIDDLE HOOK
0x00496: r"\cyrchar\CYRZHDSC{}", # CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER
0x00497: r"\cyrchar\cyrzhdsc{}", # CYRILLIC SMALL LETTER ZHE WITH DESCENDER
0x00498: r"\cyrchar\CYRZDSC{}", # CYRILLIC CAPITAL LETTER ZE WITH DESCENDER
0x00499: r"\cyrchar\cyrzdsc{}", # CYRILLIC SMALL LETTER ZE WITH DESCENDER
0x0049A: r"\cyrchar\CYRKDSC{}", # CYRILLIC CAPITAL LETTER KA WITH DESCENDER
0x0049B: r"\cyrchar\cyrkdsc{}", # CYRILLIC SMALL LETTER KA WITH DESCENDER
0x0049C: r"\cyrchar\CYRKVCRS{}", # CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE
0x0049D: r"\cyrchar\cyrkvcrs{}", # CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE
0x0049E: r"\cyrchar\CYRKHCRS{}", # CYRILLIC CAPITAL LETTER KA WITH STROKE
0x0049F: r"\cyrchar\cyrkhcrs{}", # CYRILLIC SMALL LETTER KA WITH STROKE
0x004A0: r"\cyrchar\CYRKBEAK{}", # CYRILLIC CAPITAL LETTER BASHKIR KA
0x004A1: r"\cyrchar\cyrkbeak{}", # CYRILLIC SMALL LETTER BASHKIR KA
0x004A2: r"\cyrchar\CYRNDSC{}", # CYRILLIC CAPITAL LETTER EN WITH DESCENDER
0x004A3: r"\cyrchar\cyrndsc{}", # CYRILLIC SMALL LETTER EN WITH DESCENDER
0x004A4: r"\cyrchar\CYRNG{}", # CYRILLIC CAPITAL LIGATURE EN GHE
0x004A5: r"\cyrchar\cyrng{}", # CYRILLIC SMALL LIGATURE EN GHE
0x004A6: r"\cyrchar\CYRPHK{}", # CYRILLIC CAPITAL LETTER PE WITH MIDDLE HOOK
0x004A7: r"\cyrchar\cyrphk{}", # CYRILLIC SMALL LETTER PE WITH MIDDLE HOOK
0x004A8: r"\cyrchar\CYRABHHA{}", # CYRILLIC CAPITAL LETTER ABKHASIAN HA
0x004A9: r"\cyrchar\cyrabhha{}", # CYRILLIC SMALL LETTER ABKHASIAN HA
0x004AA: r"\cyrchar\CYRSDSC{}", # CYRILLIC CAPITAL LETTER ES WITH DESCENDER
0x004AB: r"\cyrchar\cyrsdsc{}", # CYRILLIC SMALL LETTER ES WITH DESCENDER
0x004AC: r"\cyrchar\CYRTDSC{}", # CYRILLIC CAPITAL LETTER TE WITH DESCENDER
0x004AD: r"\cyrchar\cyrtdsc{}", # CYRILLIC SMALL LETTER TE WITH DESCENDER
0x004AE: r"\cyrchar\CYRY{}", # CYRILLIC CAPITAL LETTER STRAIGHT U
0x004AF: r"\cyrchar\cyry{}", # CYRILLIC SMALL LETTER STRAIGHT U
0x004B0: r"\cyrchar\CYRYHCRS{}", # CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE
0x004B1: r"\cyrchar\cyryhcrs{}", # CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE
0x004B2: r"\cyrchar\CYRHDSC{}", # CYRILLIC CAPITAL LETTER HA WITH DESCENDER
0x004B3: r"\cyrchar\cyrhdsc{}", # CYRILLIC SMALL LETTER HA WITH DESCENDER
0x004B4: r"\cyrchar\CYRTETSE{}", # CYRILLIC CAPITAL LIGATURE TE TSE
0x004B5: r"\cyrchar\cyrtetse{}", # CYRILLIC SMALL LIGATURE TE TSE
0x004B6: r"\cyrchar\CYRCHRDSC{}", # CYRILLIC CAPITAL LETTER CHE WITH DESCENDER
0x004B7: r"\cyrchar\cyrchrdsc{}", # CYRILLIC SMALL LETTER CHE WITH DESCENDER
0x004B8: r"\cyrchar\CYRCHVCRS{}", # CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE
0x004B9: r"\cyrchar\cyrchvcrs{}", # CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE
0x004BA: r"\cyrchar\CYRSHHA{}", # CYRILLIC CAPITAL LETTER SHHA
0x004BB: r"\cyrchar\cyrshha{}", # CYRILLIC SMALL LETTER SHHA
0x004BC: r"\cyrchar\CYRABHCH{}", # CYRILLIC CAPITAL LETTER ABKHASIAN CHE
0x004BD: r"\cyrchar\cyrabhch{}", # CYRILLIC SMALL LETTER ABKHASIAN CHE
0x004BE: r"\cyrchar\CYRABHCHDSC{}", # CYRILLIC CAPITAL LETTER ABKHASIAN CHE WITH DESCENDER
0x004BF: r"\cyrchar\cyrabhchdsc{}", # CYRILLIC SMALL LETTER ABKHASIAN CHE WITH DESCENDER
0x004C0: r"\cyrchar\CYRpalochka{}", # CYRILLIC LETTER PALOCHKA
0x004C3: r"\cyrchar\CYRKHK{}", # CYRILLIC CAPITAL LETTER KA WITH HOOK
0x004C4: r"\cyrchar\cyrkhk{}", # CYRILLIC SMALL LETTER KA WITH HOOK
0x004C7: r"\cyrchar\CYRNHK{}", # CYRILLIC CAPITAL LETTER EN WITH HOOK
0x004C8: r"\cyrchar\cyrnhk{}", # CYRILLIC SMALL LETTER EN WITH HOOK
0x004CB: r"\cyrchar\CYRCHLDSC{}", # CYRILLIC CAPITAL LETTER KHAKASSIAN CHE
0x004CC: r"\cyrchar\cyrchldsc{}", # CYRILLIC SMALL LETTER KHAKASSIAN CHE
0x004D4: r"\cyrchar\CYRAE{}", # CYRILLIC CAPITAL LIGATURE A IE
0x004D5: r"\cyrchar\cyrae{}", # CYRILLIC SMALL LIGATURE A IE
0x004D8: r"\cyrchar\CYRSCHWA{}", # CYRILLIC CAPITAL LETTER SCHWA
0x004D9: r"\cyrchar\cyrschwa{}", # CYRILLIC SMALL LETTER SCHWA
0x004E0: r"\cyrchar\CYRABHDZE{}", # CYRILLIC CAPITAL LETTER ABKHASIAN DZE
0x004E1: r"\cyrchar\cyrabhdze{}", # CYRILLIC SMALL LETTER ABKHASIAN DZE
0x004E8: r"\cyrchar\CYROTLD{}", # CYRILLIC CAPITAL LETTER BARRED O
0x004E9: r"\cyrchar\cyrotld{}", # CYRILLIC SMALL LETTER BARRED O
0x02002: r"\hspace{0.6em}", # EN SPACE
0x02003: r"\hspace{1em}", # EM SPACE
0x02004: r"\hspace{0.33em}", # THREE-PER-EM SPACE
0x02005: r"\hspace{0.25em}", # FOUR-PER-EM SPACE
0x02006: r"\hspace{0.166em}", # SIX-PER-EM SPACE
0x02007: r"\hphantom{0}", # FIGURE SPACE
0x02008: r"\hphantom{,}", # PUNCTUATION SPACE
0x02009: r"\hspace{0.167em}", # THIN SPACE
0x0200B: r"\hspace{0em}", # ZERO WIDTH SPACE
0x02010: r"-", # HYPHEN
0x02013: r"\textendash{}", # EN DASH
0x02014: r"\textemdash{}", # EM DASH
0x02015: r"\rule{1em}{1pt}", # HORIZONTAL BAR
0x02018: r"`", # LEFT SINGLE QUOTATION MARK
0x02019: r"'", # RIGHT SINGLE QUOTATION MARK
0x0201A: r",", # SINGLE LOW-9 QUOTATION MARK
0x0201C: r"\textquotedblleft{}", # LEFT DOUBLE QUOTATION MARK
0x0201D: r"\textquotedblright{}", # RIGHT DOUBLE QUOTATION MARK
0x0201E: r",,", # DOUBLE LOW-9 QUOTATION MARK
0x02020: r"\textdagger{}", # DAGGER
0x02021: r"\textdaggerdbl{}", # DOUBLE DAGGER
0x02022: r"\textbullet{}", # BULLET
0x02024: r".", # ONE DOT LEADER
0x02025: r"..", # TWO DOT LEADER
0x02026: r"\ldots{}", # HORIZONTAL ELLIPSIS
0x02030: r"\textperthousand{}", # PER MILLE SIGN
0x02031: r"\textpertenthousand{}", # PER TEN THOUSAND SIGN
0x020AC: r"\texteuro{}", # EURO
0x02116: r"\cyrchar\textnumero{}", # NUMERO SIGN
0x02122: r"\texttrademark{}", # TRADE MARK SIGN
0x0212B: r"\AA{}", # ANGSTROM SIGN
0x02190: r"\ensuremath{\leftarrow}", # LEFTWARDS ARROW
0x02191: r"\ensuremath{\uparrow}", # UPWARDS ARROW
0x02192: r"\ensuremath{\rightarrow}", # RIGHTWARDS ARROW
0x02193: r"\ensuremath{\downarrow}", # DOWNWARDS ARROW
0x02194: r"\ensuremath{\leftrightarrow}", # LEFT RIGHT ARROW
0x02195: r"\ensuremath{\updownarrow}", # UP DOWN ARROW
0x02196: r"\ensuremath{\nwarrow}", # NORTH WEST ARROW
0x02197: r"\ensuremath{\nearrow}", # NORTH EAST ARROW
0x02198: r"\ensuremath{\searrow}", # SOUTH EAST ARROW
0x02199: r"\ensuremath{\swarrow}", # SOUTH WEST ARROW
0x0219A: r"\ensuremath{\nleftarrow}", # LEFTWARDS ARROW WITH STROKE
0x0219B: r"\ensuremath{\nrightarrow}", # RIGHTWARDS ARROW WITH STROKE
0x0219C: r"\ensuremath{\arrowwaveright}", # LEFTWARDS WAVE ARROW
0x0219D: r"\ensuremath{\arrowwaveright}", # RIGHTWARDS WAVE ARROW
0x0219E: r"\ensuremath{\twoheadleftarrow}", # LEFTWARDS TWO HEADED ARROW
0x021A0: r"\ensuremath{\twoheadrightarrow}", # RIGHTWARDS TWO HEADED ARROW
0x021A2: r"\ensuremath{\leftarrowtail}", # LEFTWARDS ARROW WITH TAIL
0x021A3: r"\ensuremath{\rightarrowtail}", # RIGHTWARDS ARROW WITH TAIL
0x021A6: r"\ensuremath{\mapsto}", # RIGHTWARDS ARROW FROM BAR
0x021A9: r"\ensuremath{\hookleftarrow}", # LEFTWARDS ARROW WITH HOOK
0x021AA: r"\ensuremath{\hookrightarrow}", # RIGHTWARDS ARROW WITH HOOK
0x021AB: r"\ensuremath{\looparrowleft}", # LEFTWARDS ARROW WITH LOOP
0x021AC: r"\ensuremath{\looparrowright}", # RIGHTWARDS ARROW WITH LOOP
0x021AD: r"\ensuremath{\leftrightsquigarrow}", # LEFT RIGHT WAVE ARROW
0x021AE: r"\ensuremath{\nleftrightarrow}", # LEFT RIGHT ARROW WITH STROKE
0x021B0: r"\ensuremath{\Lsh}", # UPWARDS ARROW WITH TIP LEFTWARDS
0x021B1: r"\ensuremath{\Rsh}", # UPWARDS ARROW WITH TIP RIGHTWARDS
0x021B3: r"\ensuremath{\ElsevierGlyph{21B3}}", # DOWNWARDS ARROW WITH TIP RIGHTWARDS
0x021B5: r"\ensuremath{\hookleftarrow}", # DOWNWARDS ARROW WITH CORNER LEFTWARDS
0x021B6: r"\ensuremath{\curvearrowleft}", # ANTICLOCKWISE TOP SEMICIRCLE ARROW
0x021B7: r"\ensuremath{\curvearrowright}", # CLOCKWISE TOP SEMICIRCLE ARROW
0x021BA: r"\ensuremath{\circlearrowleft}", # ANTICLOCKWISE OPEN CIRCLE ARROW
0x021BB: r"\ensuremath{\circlearrowright}", # CLOCKWISE OPEN CIRCLE ARROW
0x021BC: r"\ensuremath{\leftharpoonup}", # LEFTWARDS HARPOON WITH BARB UPWARDS
0x021BD: r"\ensuremath{\leftharpoondown}", # LEFTWARDS HARPOON WITH BARB DOWNWARDS
0x021BE: r"\ensuremath{\upharpoonright}", # UPWARDS HARPOON WITH BARB RIGHTWARDS
0x021BF: r"\ensuremath{\upharpoonleft}", # UPWARDS HARPOON WITH BARB LEFTWARDS
0x021C0: r"\ensuremath{\rightharpoonup}", # RIGHTWARDS HARPOON WITH BARB UPWARDS
0x021C1: r"\ensuremath{\rightharpoondown}", # RIGHTWARDS HARPOON WITH BARB DOWNWARDS
0x021C2: r"\ensuremath{\downharpoonright}", # DOWNWARDS HARPOON WITH BARB RIGHTWARDS
0x021C3: r"\ensuremath{\downharpoonleft}", # DOWNWARDS HARPOON WITH BARB LEFTWARDS
0x021C4: r"\ensuremath{\rightleftarrows}", # RIGHTWARDS ARROW OVER LEFTWARDS ARROW
0x021C5: r"\ensuremath{\dblarrowupdown}", # UPWARDS ARROW LEFTWARDS OF DOWNWARDS ARROW
0x021C6: r"\ensuremath{\leftrightarrows}", # LEFTWARDS ARROW OVER RIGHTWARDS ARROW
0x021C7: r"\ensuremath{\leftleftarrows}", # LEFTWARDS PAIRED ARROWS
0x021C8: r"\ensuremath{\upuparrows}", # UPWARDS PAIRED ARROWS
0x021C9: r"\ensuremath{\rightrightarrows}", # RIGHTWARDS PAIRED ARROWS
0x021CA: r"\ensuremath{\downdownarrows}", # DOWNWARDS PAIRED ARROWS
0x021CB: r"\ensuremath{\leftrightharpoons}", # LEFTWARDS HARPOON OVER RIGHTWARDS HARPOON
0x021CC: r"\ensuremath{\rightleftharpoons}", # RIGHTWARDS HARPOON OVER LEFTWARDS HARPOON
0x021CD: r"\ensuremath{\nLeftarrow}", # LEFTWARDS DOUBLE ARROW WITH STROKE
0x021CE: r"\ensuremath{\nLeftrightarrow}", # LEFT RIGHT DOUBLE ARROW WITH STROKE
0x021CF: r"\ensuremath{\nRightarrow}", # RIGHTWARDS DOUBLE ARROW WITH STROKE
0x021D0: r"\ensuremath{\Leftarrow}", # LEFTWARDS DOUBLE ARROW
0x021D1: r"\ensuremath{\Uparrow}", # UPWARDS DOUBLE ARROW
0x021D2: r"\ensuremath{\Rightarrow}", # RIGHTWARDS DOUBLE ARROW
0x021D3: r"\ensuremath{\Downarrow}", # DOWNWARDS DOUBLE ARROW
0x021D4: r"\ensuremath{\Leftrightarrow}", # LEFT RIGHT DOUBLE ARROW
0x021D5: r"\ensuremath{\Updownarrow}", # UP DOWN DOUBLE ARROW
0x021DA: r"\ensuremath{\Lleftarrow}", # LEFTWARDS TRIPLE ARROW
0x021DB: r"\ensuremath{\Rrightarrow}", # RIGHTWARDS TRIPLE ARROW
0x021DD: r"\ensuremath{\rightsquigarrow}", # RIGHTWARDS SQUIGGLE ARROW
0x021F5: r"\ensuremath{\DownArrowUpArrow}", # DOWNWARDS ARROW LEFTWARDS OF UPWARDS ARROW
0x02200: r"\ensuremath{\forall}", # FOR ALL
0x02201: r"\ensuremath{\complement}", # COMPLEMENT
0x02202: r"\ensuremath{\partial}", # PARTIAL DIFFERENTIAL
0x02203: r"\ensuremath{\exists}", # THERE EXISTS
0x02204: r"\ensuremath{\nexists}", # THERE DOES NOT EXIST
0x02205: r"\ensuremath{\varnothing}", # EMPTY SET
0x02207: r"\ensuremath{\nabla}", # NABLA
0x02208: r"\ensuremath{\in}", # ELEMENT OF
0x02209: r"\ensuremath{\not\in}", # NOT AN ELEMENT OF
0x0220B: r"\ensuremath{\ni}", # CONTAINS AS MEMBER
0x0220C: r"\ensuremath{\not\ni}", # DOES NOT CONTAIN AS MEMBER
0x0220F: r"\ensuremath{\prod}", # N-ARY PRODUCT
0x02210: r"\ensuremath{\coprod}", # N-ARY COPRODUCT
0x02211: r"\ensuremath{\sum}", # N-ARY SUMMATION
0x02212: r"-", # MINUS SIGN
0x02213: r"\ensuremath{\mp}", # MINUS-OR-PLUS SIGN
0x02214: r"\ensuremath{\dotplus}", # DOT PLUS
0x02216: r"\ensuremath{\setminus}", # SET MINUS
0x02217: r"\ensuremath{{_\ast}}", # ASTERISK OPERATOR
0x02218: r"\ensuremath{\circ}", # RING OPERATOR
0x02219: r"\ensuremath{\bullet}", # BULLET OPERATOR
0x0221A: r"\ensuremath{\surd}", # SQUARE ROOT
0x0221D: r"\ensuremath{\propto}", # PROPORTIONAL TO
0x0221E: r"\ensuremath{\infty}", # INFINITY
0x0221F: r"\ensuremath{\rightangle}", # RIGHT ANGLE
0x02220: r"\ensuremath{\angle}", # ANGLE
0x02221: r"\ensuremath{\measuredangle}", # MEASURED ANGLE
0x02222: r"\ensuremath{\sphericalangle}", # SPHERICAL ANGLE
0x02223: r"\ensuremath{\mid}", # DIVIDES
0x02224: r"\ensuremath{\nmid}", # DOES NOT DIVIDE
0x02225: r"\ensuremath{\parallel}", # PARALLEL TO
0x02226: r"\ensuremath{\nparallel}", # NOT PARALLEL TO
0x02227: r"\ensuremath{\wedge}", # LOGICAL AND
0x02228: r"\ensuremath{\vee}", # LOGICAL OR
0x02229: r"\ensuremath{\cap}", # INTERSECTION
0x0222A: r"\ensuremath{\cup}", # UNION
0x0222B: r"\ensuremath{\int}", # INTEGRAL
0x0222C: r"\ensuremath{\int\!\int}", # DOUBLE INTEGRAL
0x0222D: r"\ensuremath{\int\!\int\!\int}", # TRIPLE INTEGRAL
0x0222E: r"\ensuremath{\oint}", # CONTOUR INTEGRAL
0x0222F: r"\ensuremath{\surfintegral}", # SURFACE INTEGRAL
0x02230: r"\ensuremath{\volintegral}", # VOLUME INTEGRAL
0x02231: r"\ensuremath{\clwintegral}", # CLOCKWISE INTEGRAL
0x02232: r"\ensuremath{\ElsevierGlyph{2232}}", # CLOCKWISE CONTOUR INTEGRAL
0x02233: r"\ensuremath{\ElsevierGlyph{2233}}", # ANTICLOCKWISE CONTOUR INTEGRAL
0x02234: r"\ensuremath{\therefore}", # THEREFORE
0x02235: r"\ensuremath{\because}", # BECAUSE
0x02237: r"\ensuremath{\Colon}", # PROPORTION
0x02238: r"\ensuremath{\ElsevierGlyph{2238}}", # DOT MINUS
0x0223A: r"\ensuremath{\mathbin{{:}\!\!{-}\!\!{:}}}", # GEOMETRIC PROPORTION
0x0223B: r"\ensuremath{\homothetic}", # HOMOTHETIC
0x0223C: r"\ensuremath{\sim}", # TILDE OPERATOR
0x0223D: r"\ensuremath{\backsim}", # REVERSED TILDE
0x0223E: r"\ensuremath{\lazysinv}", # INVERTED LAZY S
0x02240: r"\ensuremath{\wr}", # WREATH PRODUCT
0x02241: r"\ensuremath{\not\sim}", # NOT TILDE
0x02242: r"\ensuremath{\ElsevierGlyph{2242}}", # MINUS TILDE
0x02243: r"\ensuremath{\simeq}", # ASYMPTOTICALLY EQUAL TO
0x02244: r"\ensuremath{\not\simeq}", # NOT ASYMPTOTICALLY EQUAL TO
0x02245: r"\ensuremath{\cong}", # APPROXIMATELY EQUAL TO
0x02246: r"\ensuremath{\approxnotequal}", # APPROXIMATELY BUT NOT ACTUALLY EQUAL TO
0x02247: r"\ensuremath{\not\cong}", # NEITHER APPROXIMATELY NOR ACTUALLY EQUAL TO
0x02248: r"\ensuremath{\approx}", # ALMOST EQUAL TO
0x02249: r"\ensuremath{\not\approx}", # NOT ALMOST EQUAL TO
0x0224A: r"\ensuremath{\approxeq}", # ALMOST EQUAL OR EQUAL TO
0x0224B: r"\ensuremath{\tildetrpl}", # TRIPLE TILDE
0x0224C: r"\ensuremath{\allequal}", # ALL EQUAL TO
0x0224D: r"\ensuremath{\asymp}", # EQUIVALENT TO
0x0224E: r"\ensuremath{\Bumpeq}", # GEOMETRICALLY EQUIVALENT TO
0x0224F: r"\ensuremath{\bumpeq}", # DIFFERENCE BETWEEN
0x02250: r"\ensuremath{\doteq}", # APPROACHES THE LIMIT
0x02251: r"\ensuremath{\doteqdot}", # GEOMETRICALLY EQUAL TO
0x02252: r"\ensuremath{\fallingdotseq}", # APPROXIMATELY EQUAL TO OR THE IMAGE OF
0x02253: r"\ensuremath{\risingdotseq}", # IMAGE OF OR APPROXIMATELY EQUAL TO
0x02254: r":=", # COLON EQUALS
0x02260: r"\ensuremath{\neq}", # NOT EQUAL TO
0x02261: r"\ensuremath{\equiv}", # IDENTICAL TO
0x02262: r"\ensuremath{\not\equiv}", # NOT IDENTICAL TO
0x02264: r"\ensuremath{\leq}", # LESS-THAN OR EQUAL TO
0x02265: r"\ensuremath{\geq}", # GREATER-THAN OR EQUAL TO
0x02266: r"\ensuremath{\leqq}", # LESS-THAN OVER EQUAL TO
0x02267: r"\ensuremath{\geqq}", # GREATER-THAN OVER EQUAL TO
0x02268: r"\ensuremath{\lneqq}", # LESS-THAN BUT NOT EQUAL TO
0x02269: r"\ensuremath{\gneqq}", # GREATER-THAN BUT NOT EQUAL TO
0x0226A: r"\ensuremath{\ll}", # MUCH LESS-THAN
0x0226B: r"\ensuremath{\gg}", # MUCH GREATER-THAN
0x0226C: r"\ensuremath{\between}", # BETWEEN
0x0226D: r"\ensuremath{\not\kern-0.3em\times}", # NOT EQUIVALENT TO
0x0226E: r"\ensuremath{\not<}", # NOT LESS-THAN
0x0226F: r"\ensuremath{\not>}", # NOT GREATER-THAN
0x02270: r"\ensuremath{\not\leq}", # NEITHER LESS-THAN NOR EQUAL TO
0x02271: r"\ensuremath{\not\geq}", # NEITHER GREATER-THAN NOR EQUAL TO
0x02272: r"\ensuremath{\lessequivlnt}", # LESS-THAN OR EQUIVALENT TO
0x02273: r"\ensuremath{\greaterequivlnt}", # GREATER-THAN OR EQUIVALENT TO
0x02274: r"\ensuremath{\ElsevierGlyph{2274}}", # NEITHER LESS-THAN NOR EQUIVALENT TO
0x02275: r"\ensuremath{\ElsevierGlyph{2275}}", # NEITHER GREATER-THAN NOR EQUIVALENT TO
0x02276: r"\ensuremath{\lessgtr}", # LESS-THAN OR GREATER-THAN
0x02277: r"\ensuremath{\gtrless}", # GREATER-THAN OR LESS-THAN
0x02278: r"\ensuremath{\notlessgreater}", # NEITHER LESS-THAN NOR GREATER-THAN
0x02279: r"\ensuremath{\notgreaterless}", # NEITHER GREATER-THAN NOR LESS-THAN
0x0227A: r"\ensuremath{\prec}", # PRECEDES
0x0227B: r"\ensuremath{\succ}", # SUCCEEDS
0x0227C: r"\ensuremath{\preccurlyeq}", # PRECEDES OR EQUAL TO
0x0227D: r"\ensuremath{\succcurlyeq}", # SUCCEEDS OR EQUAL TO
0x0227E: r"\ensuremath{\precapprox}", # PRECEDES OR EQUIVALENT TO
0x0227F: r"\ensuremath{\succapprox}", # SUCCEEDS OR EQUIVALENT TO
0x02280: r"\ensuremath{\not\prec}", # DOES NOT PRECEDE
0x02281: r"\ensuremath{\not\succ}", # DOES NOT SUCCEED
0x02282: r"\ensuremath{\subset}", # SUBSET OF
0x02283: r"\ensuremath{\supset}", # SUPERSET OF
0x02284: r"\ensuremath{\not\subset}", # NOT A SUBSET OF
0x02285: r"\ensuremath{\not\supset}", # NOT A SUPERSET OF
0x02286: r"\ensuremath{\subseteq}", # SUBSET OF OR EQUAL TO
0x02287: r"\ensuremath{\supseteq}", # SUPERSET OF OR EQUAL TO
0x02288: r"\ensuremath{\not\subseteq}", # NEITHER A SUBSET OF NOR EQUAL TO
0x02289: r"\ensuremath{\not\supseteq}", # NEITHER A SUPERSET OF NOR EQUAL TO
0x0228A: r"\ensuremath{\subsetneq}", # SUBSET OF WITH NOT EQUAL TO
0x0228B: r"\ensuremath{\supsetneq}", # SUPERSET OF WITH NOT EQUAL TO
0x0228E: r"\ensuremath{\uplus}", # MULTISET UNION
0x0228F: r"\ensuremath{\sqsubset}", # SQUARE IMAGE OF
0x02290: r"\ensuremath{\sqsupset}", # SQUARE ORIGINAL OF
0x02291: r"\ensuremath{\sqsubseteq}", # SQUARE IMAGE OF OR EQUAL TO
0x02292: r"\ensuremath{\sqsupseteq}", # SQUARE ORIGINAL OF OR EQUAL TO
0x02293: r"\ensuremath{\sqcap}", # SQUARE CAP
0x02294: r"\ensuremath{\sqcup}", # SQUARE CUP
0x02295: r"\ensuremath{\oplus}", # CIRCLED PLUS
0x02296: r"\ensuremath{\ominus}", # CIRCLED MINUS
0x02297: r"\ensuremath{\otimes}", # CIRCLED TIMES
0x02298: r"\ensuremath{\oslash}", # CIRCLED DIVISION SLASH
0x02299: r"\ensuremath{\odot}", # CIRCLED DOT OPERATOR
0x0229A: r"\ensuremath{\circledcirc}", # CIRCLED RING OPERATOR
0x0229B: r"\ensuremath{\circledast}", # CIRCLED ASTERISK OPERATOR
0x0229D: r"\ensuremath{\circleddash}", # CIRCLED DASH
0x0229E: r"\ensuremath{\boxplus}", # SQUARED PLUS
0x0229F: r"\ensuremath{\boxminus}", # SQUARED MINUS
0x022A0: r"\ensuremath{\boxtimes}", # SQUARED TIMES
0x022A1: r"\ensuremath{\boxdot}", # SQUARED DOT OPERATOR
0x022A2: r"\ensuremath{\vdash}", # RIGHT TACK
0x022A3: r"\ensuremath{\dashv}", # LEFT TACK
0x022A4: r"\ensuremath{\top}", # DOWN TACK
0x022A5: r"\ensuremath{\perp}", # UP TACK
0x022A7: r"\ensuremath{\truestate}", # MODELS
0x022A8: r"\ensuremath{\forcesextra}", # TRUE
0x022A9: r"\ensuremath{\Vdash}", # FORCES
0x022AA: r"\ensuremath{\Vvdash}", # TRIPLE VERTICAL BAR RIGHT TURNSTILE
0x022AB: r"\ensuremath{\VDash}", # DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
0x022AC: r"\ensuremath{\nvdash}", # DOES NOT PROVE
0x022AD: r"\ensuremath{\nvDash}", # NOT TRUE
0x022AE: r"\ensuremath{\nVdash}", # DOES NOT FORCE
0x022AF: r"\ensuremath{\nVDash}", # NEGATED DOUBLE VERTICAL BAR DOUBLE RIGHT TURNSTILE
0x022B2: r"\ensuremath{\vartriangleleft}", # NORMAL SUBGROUP OF
0x022B3: r"\ensuremath{\vartriangleright}", # CONTAINS AS NORMAL SUBGROUP
0x022B4: r"\ensuremath{\trianglelefteq}", # NORMAL SUBGROUP OF OR EQUAL TO
0x022B5: r"\ensuremath{\trianglerighteq}", # CONTAINS AS NORMAL SUBGROUP OR EQUAL TO
0x022B6: r"\ensuremath{\original}", # ORIGINAL OF
0x022B7: r"\ensuremath{\image}", # IMAGE OF
0x022B8: r"\ensuremath{\multimap}", # MULTIMAP
0x022B9: r"\ensuremath{\hermitconjmatrix}", # HERMITIAN CONJUGATE MATRIX
0x022BA: r"\ensuremath{\intercal}", # INTERCALATE
0x022BB: r"\ensuremath{\veebar}", # XOR
0x022BE: r"\ensuremath{\rightanglearc}", # RIGHT ANGLE WITH ARC
0x022C0: r"\ensuremath{\ElsevierGlyph{22C0}}", # N-ARY LOGICAL AND
0x022C1: r"\ensuremath{\ElsevierGlyph{22C1}}", # N-ARY LOGICAL OR
0x022C2: r"\ensuremath{\bigcap}", # N-ARY INTERSECTION
0x022C3: r"\ensuremath{\bigcup}", # N-ARY UNION
0x022C4: r"\ensuremath{\diamond}", # DIAMOND OPERATOR
0x022C5: r"\ensuremath{\cdot}", # DOT OPERATOR
0x022C6: r"\ensuremath{\star}", # STAR OPERATOR
0x022C7: r"\ensuremath{\divideontimes}", # DIVISION TIMES
0x022C8: r"\ensuremath{\bowtie}", # BOWTIE
0x022C9: r"\ensuremath{\ltimes}", # LEFT NORMAL FACTOR SEMIDIRECT PRODUCT
0x022CA: r"\ensuremath{\rtimes}", # RIGHT NORMAL FACTOR SEMIDIRECT PRODUCT
0x022CB: r"\ensuremath{\leftthreetimes}", # LEFT SEMIDIRECT PRODUCT
0x022CC: r"\ensuremath{\rightthreetimes}", # RIGHT SEMIDIRECT PRODUCT
0x022CD: r"\ensuremath{\backsimeq}", # REVERSED TILDE EQUALS
0x022CE: r"\ensuremath{\curlyvee}", # CURLY LOGICAL OR
0x022CF: r"\ensuremath{\curlywedge}", # CURLY LOGICAL AND
0x022D0: r"\ensuremath{\Subset}", # DOUBLE SUBSET
0x022D1: r"\ensuremath{\Supset}", # DOUBLE SUPERSET
0x022D2: r"\ensuremath{\Cap}", # DOUBLE INTERSECTION
0x022D3: r"\ensuremath{\Cup}", # DOUBLE UNION
0x022D4: r"\ensuremath{\pitchfork}", # PITCHFORK
0x022D6: r"\ensuremath{\lessdot}", # LESS-THAN WITH DOT
0x022D7: r"\ensuremath{\gtrdot}", # GREATER-THAN WITH DOT
0x022D8: r"\ensuremath{\verymuchless}", # VERY MUCH LESS-THAN
0x022D9: r"\ensuremath{\verymuchgreater}", # VERY MUCH GREATER-THAN
0x022DA: r"\ensuremath{\lesseqgtr}", # LESS-THAN EQUAL TO OR GREATER-THAN
0x022DB: r"\ensuremath{\gtreqless}", # GREATER-THAN EQUAL TO OR LESS-THAN
0x022DE: r"\ensuremath{\curlyeqprec}", # EQUAL TO OR PRECEDES
0x022DF: r"\ensuremath{\curlyeqsucc}", # EQUAL TO OR SUCCEEDS
0x022E2: r"\ensuremath{\not\sqsubseteq}", # NOT SQUARE IMAGE OF OR EQUAL TO
0x022E3: r"\ensuremath{\not\sqsupseteq}", # NOT SQUARE ORIGINAL OF OR EQUAL TO
0x022E5: r"\ensuremath{\Elzsqspne}", # SQUARE ORIGINAL OF OR NOT EQUAL TO
0x022E6: r"\ensuremath{\lnsim}", # LESS-THAN BUT NOT EQUIVALENT TO
0x022E7: r"\ensuremath{\gnsim}", # GREATER-THAN BUT NOT EQUIVALENT TO
0x022E8: r"\ensuremath{\precedesnotsimilar}", # PRECEDES BUT NOT EQUIVALENT TO
0x022E9: r"\ensuremath{\succnsim}", # SUCCEEDS BUT NOT EQUIVALENT TO
0x022EA: r"\ensuremath{\ntriangleleft}", # NOT NORMAL SUBGROUP OF
0x022EB: r"\ensuremath{\ntriangleright}", # DOES NOT CONTAIN AS NORMAL SUBGROUP
0x022EC: r"\ensuremath{\ntrianglelefteq}", # NOT NORMAL SUBGROUP OF OR EQUAL TO
0x022ED: r"\ensuremath{\ntrianglerighteq}", # DOES NOT CONTAIN AS NORMAL SUBGROUP OR EQUAL
0x022EE: r"\ensuremath{\vdots}", # VERTICAL ELLIPSIS
0x022EF: r"\ensuremath{\cdots}", # MIDLINE HORIZONTAL ELLIPSIS
0x022F0: r"\ensuremath{\upslopeellipsis}", # UP RIGHT DIAGONAL ELLIPSIS
0x022F1: r"\ensuremath{\downslopeellipsis}", # DOWN RIGHT DIAGONAL ELLIPSIS
0x02306: r"\ensuremath{\perspcorrespond}", # PERSPECTIVE
0x02308: r"\ensuremath{\lceil}", # LEFT CEILING
0x02309: r"\ensuremath{\rceil}", # RIGHT CEILING
0x0230A: r"\ensuremath{\lfloor}", # LEFT FLOOR
0x0230B: r"\ensuremath{\rfloor}", # RIGHT FLOOR
0x02315: r"\ensuremath{\recorder}", # TELEPHONE RECORDER
0x02316: r'\ensuremath{\mathchar"2208}', # POSITION INDICATOR
0x0231C: r"\ensuremath{\ulcorner}", # TOP LEFT CORNER
0x0231D: r"\ensuremath{\urcorner}", # TOP RIGHT CORNER
0x0231E: r"\ensuremath{\llcorner}", # BOTTOM LEFT CORNER
0x0231F: r"\ensuremath{\lrcorner}", # BOTTOM RIGHT CORNER
0x02322: r"\ensuremath{\frown}", # FROWN
0x02323: r"\ensuremath{\smile}", # SMILE
0x02329: r"\ensuremath{\langle}", # LEFT-POINTING ANGLE BRACKET
0x0232A: r"\ensuremath{\rangle}", # RIGHT-POINTING ANGLE BRACKET
0x0233D: r"\ensuremath{\ElsevierGlyph{E838}}", # APL FUNCTIONAL SYMBOL CIRCLE STILE
0x023A3: r"\ensuremath{\Elzdlcorn}", # LEFT SQUARE BRACKET LOWER CORNER
0x023B0: r"\ensuremath{\lmoustache}", # UPPER LEFT OR LOWER RIGHT CURLY BRACKET SECTION
0x023B1: r"\ensuremath{\rmoustache}", # UPPER RIGHT OR LOWER LEFT CURLY BRACKET SECTION
0x02423: r"\textvisiblespace{}", # OPEN BOX
0x02460: r"\ding{172}", # CIRCLED DIGIT ONE
0x02461: r"\ding{173}", # CIRCLED DIGIT TWO
0x02462: r"\ding{174}", # CIRCLED DIGIT THREE
0x02463: r"\ding{175}", # CIRCLED DIGIT FOUR
0x02464: r"\ding{176}", # CIRCLED DIGIT FIVE
0x02465: r"\ding{177}", # CIRCLED DIGIT SIX
0x02466: r"\ding{178}", # CIRCLED DIGIT SEVEN
0x02467: r"\ding{179}", # CIRCLED DIGIT EIGHT
0x02468: r"\ding{180}", # CIRCLED DIGIT NINE
0x02469: r"\ding{181}", # CIRCLED NUMBER TEN
0x025A0: r"\ding{110}", # BLACK SQUARE
0x025A1: r"\ensuremath{\square}", # WHITE SQUARE
0x025AA: r"\ensuremath{\blacksquare}", # BLACK SMALL SQUARE
0x025AD: r"\fbox{~~}", # WHITE RECTANGLE
0x025AF: r"\ensuremath{\Elzvrecto}", # WHITE VERTICAL RECTANGLE
0x025B1: r"\ensuremath{\ElsevierGlyph{E381}}", # WHITE PARALLELOGRAM
0x025B2: r"\ding{115}", # BLACK UP-POINTING TRIANGLE
0x025B3: r"\ensuremath{\bigtriangleup}", # WHITE UP-POINTING TRIANGLE
0x025B4: r"\ensuremath{\blacktriangle}", # BLACK UP-POINTING SMALL TRIANGLE
0x025B5: r"\ensuremath{\vartriangle}", # WHITE UP-POINTING SMALL TRIANGLE
0x025B8: r"\ensuremath{\blacktriangleright}", # BLACK RIGHT-POINTING SMALL TRIANGLE
0x025B9: r"\ensuremath{\triangleright}", # WHITE RIGHT-POINTING SMALL TRIANGLE
0x025BC: r"\ding{116}", # BLACK DOWN-POINTING TRIANGLE
0x025BD: r"\ensuremath{\bigtriangledown}", # WHITE DOWN-POINTING TRIANGLE
0x025BE: r"\ensuremath{\blacktriangledown}", # BLACK DOWN-POINTING SMALL TRIANGLE
0x025BF: r"\ensuremath{\triangledown}", # WHITE DOWN-POINTING SMALL TRIANGLE
0x025C2: r"\ensuremath{\blacktriangleleft}", # BLACK LEFT-POINTING SMALL TRIANGLE
0x025C3: r"\ensuremath{\triangleleft}", # WHITE LEFT-POINTING SMALL TRIANGLE
0x025C6: r"\ding{117}", # BLACK DIAMOND
0x025CA: r"\ensuremath{\lozenge}", # LOZENGE
0x025CB: r"\ensuremath{\bigcirc}", # WHITE CIRCLE
0x025CF: r"\ding{108}", # BLACK CIRCLE
0x025D7: r"\ding{119}", # RIGHT HALF BLACK CIRCLE
0x02605: r"\ding{72}", # BLACK STAR
0x0260E: r"\ding{37}", # BLACK TELEPHONE
0x0261B: r"\ding{42}", # BLACK RIGHT POINTING INDEX
0x0261E: r"\ding{43}", # WHITE RIGHT POINTING INDEX
0x02640: r"\venus{}", # FEMALE SIGN
0x02642: r"\male{}", # MALE SIGN
0x02647: r"\pluto{}", # PLUTO
0x02648: r"\aries{}", # ARIES
0x02649: r"\taurus{}", # TAURUS
0x0264A: r"\gemini{}", # GEMINI
0x0264B: r"\cancer{}", # CANCER
0x0264C: r"\leo{}", # LEO
0x0264D: r"\virgo{}", # VIRGO
0x0264E: r"\libra{}", # LIBRA
0x0264F: r"\scorpio{}", # SCORPIUS
0x02650: r"\sagittarius{}", # SAGITTARIUS
0x02651: r"\capricornus{}", # CAPRICORN
0x02652: r"\aquarius{}", # AQUARIUS
0x02653: r"\pisces{}", # PISCES
0x02660: r"\ding{171}", # BLACK SPADE SUIT
0x02663: r"\ding{168}", # BLACK CLUB SUIT
0x02665: r"\ding{170}", # BLACK HEART SUIT
0x02666: r"\ding{169}", # BLACK DIAMOND SUIT
0x02669: r"\quarternote{}", # QUARTER NOTE
0x0266A: r"\eighthnote{}", # EIGHTH NOTE
0x02701: r"\ding{33}", # UPPER BLADE SCISSORS
0x02702: r"\ding{34}", # BLACK SCISSORS
0x02703: r"\ding{35}", # LOWER BLADE SCISSORS
0x02704: r"\ding{36}", # WHITE SCISSORS
0x02706: r"\ding{38}", # TELEPHONE LOCATION SIGN
0x02707: r"\ding{39}", # TAPE DRIVE
0x02708: r"\ding{40}", # AIRPLANE
0x02709: r"\ding{41}", # ENVELOPE
0x0270C: r"\ding{44}", # VICTORY HAND
0x0270D: r"\ding{45}", # WRITING HAND
0x0270E: r"\ding{46}", # LOWER RIGHT PENCIL
0x0270F: r"\ding{47}", # PENCIL
0x02710: r"\ding{48}", # UPPER RIGHT PENCIL
0x02711: r"\ding{49}", # WHITE NIB
0x02712: r"\ding{50}", # BLACK NIB
0x02713: r"\ding{51}", # CHECK MARK
0x02714: r"\ding{52}", # HEAVY CHECK MARK
0x02715: r"\ding{53}", # MULTIPLICATION X
0x02716: r"\ding{54}", # HEAVY MULTIPLICATION X
0x02717: r"\ding{55}", # BALLOT X
0x02718: r"\ding{56}", # HEAVY BALLOT X
0x02719: r"\ding{57}", # OUTLINED GREEK CROSS
0x0271A: r"\ding{58}", # HEAVY GREEK CROSS
0x0271B: r"\ding{59}", # OPEN CENTRE CROSS
0x0271C: r"\ding{60}", # HEAVY OPEN CENTRE CROSS
0x0271D: r"\ding{61}", # LATIN CROSS
0x0271E: r"\ding{62}", # SHADOWED WHITE LATIN CROSS
0x0271F: r"\ding{63}", # OUTLINED LATIN CROSS
0x02720: r"\ding{64}", # MALTESE CROSS
0x02721: r"\ding{65}", # STAR OF DAVID
0x02722: r"\ding{66}", # FOUR TEARDROP-SPOKED ASTERISK
0x02723: r"\ding{67}", # FOUR BALLOON-SPOKED ASTERISK
0x02724: r"\ding{68}", # HEAVY FOUR BALLOON-SPOKED ASTERISK
0x02725: r"\ding{69}", # FOUR CLUB-SPOKED ASTERISK
0x02726: r"\ding{70}", # BLACK FOUR POINTED STAR
0x02727: r"\ding{71}", # WHITE FOUR POINTED STAR
0x02729: r"\ding{73}", # STRESS OUTLINED WHITE STAR
0x0272A: r"\ding{74}", # CIRCLED WHITE STAR
0x0272B: r"\ding{75}", # OPEN CENTRE BLACK STAR
0x0272C: r"\ding{76}", # BLACK CENTRE WHITE STAR
0x0272D: r"\ding{77}", # OUTLINED BLACK STAR
0x0272E: r"\ding{78}", # HEAVY OUTLINED BLACK STAR
0x0272F: r"\ding{79}", # PINWHEEL STAR
0x02730: r"\ding{80}", # SHADOWED WHITE STAR
0x02731: r"\ding{81}", # HEAVY ASTERISK
0x02732: r"\ding{82}", # OPEN CENTRE ASTERISK
0x02733: r"\ding{83}", # EIGHT SPOKED ASTERISK
0x02734: r"\ding{84}", # EIGHT POINTED BLACK STAR
0x02735: r"\ding{85}", # EIGHT POINTED PINWHEEL STAR
0x02736: r"\ding{86}", # SIX POINTED BLACK STAR
0x02737: r"\ding{87}", # EIGHT POINTED RECTILINEAR BLACK STAR
0x02738: r"\ding{88}", # HEAVY EIGHT POINTED RECTILINEAR BLACK STAR
0x02739: r"\ding{89}", # TWELVE POINTED BLACK STAR
0x0273A: r"\ding{90}", # SIXTEEN POINTED ASTERISK
0x0273B: r"\ding{91}", # TEARDROP-SPOKED ASTERISK
0x0273C: r"\ding{92}", # OPEN CENTRE TEARDROP-SPOKED ASTERISK
0x0273D: r"\ding{93}", # HEAVY TEARDROP-SPOKED ASTERISK
0x0273E: r"\ding{94}", # SIX PETALLED BLACK AND WHITE FLORETTE
0x0273F: r"\ding{95}", # BLACK FLORETTE
0x02740: r"\ding{96}", # WHITE FLORETTE
0x02741: r"\ding{97}", # EIGHT PETALLED OUTLINED BLACK FLORETTE
0x02742: r"\ding{98}", # CIRCLED OPEN CENTRE EIGHT POINTED STAR
0x02743: r"\ding{99}", # HEAVY TEARDROP-SPOKED PINWHEEL ASTERISK
0x02744: r"\ding{100}", # SNOWFLAKE
0x02745: r"\ding{101}", # TIGHT TRIFOLIATE SNOWFLAKE
0x02746: r"\ding{102}", # HEAVY CHEVRON SNOWFLAKE
0x02747: r"\ding{103}", # SPARKLE
0x02748: r"\ding{104}", # HEAVY SPARKLE
0x02749: r"\ding{105}", # BALLOON-SPOKED ASTERISK
0x0274A: r"\ding{106}", # EIGHT TEARDROP-SPOKED PROPELLER ASTERISK
0x0274B: r"\ding{107}", # HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK
0x0274D: r"\ding{109}", # SHADOWED WHITE CIRCLE
0x0274F: r"\ding{111}", # LOWER RIGHT DROP-SHADOWED WHITE SQUARE
0x02750: r"\ding{112}", # UPPER RIGHT DROP-SHADOWED WHITE SQUARE
0x02751: r"\ding{113}", # LOWER RIGHT SHADOWED WHITE SQUARE
0x02752: r"\ding{114}", # UPPER RIGHT SHADOWED WHITE SQUARE
0x02756: r"\ding{118}", # BLACK DIAMOND MINUS WHITE X
0x02758: r"\ding{120}", # LIGHT VERTICAL BAR
0x02759: r"\ding{121}", # MEDIUM VERTICAL BAR
0x0275A: r"\ding{122}", # HEAVY VERTICAL BAR
0x0275B: r"\ding{123}", # HEAVY SINGLE TURNED COMMA QUOTATION MARK ORNAMENT
0x0275C: r"\ding{124}", # HEAVY SINGLE COMMA QUOTATION MARK ORNAMENT
0x0275D: r"\ding{125}", # HEAVY DOUBLE TURNED COMMA QUOTATION MARK ORNAMENT
0x0275E: r"\ding{126}", # HEAVY DOUBLE COMMA QUOTATION MARK ORNAMENT
0x02761: r"\ding{161}", # CURVED STEM PARAGRAPH SIGN ORNAMENT
0x02762: r"\ding{162}", # HEAVY EXCLAMATION MARK ORNAMENT
0x02763: r"\ding{163}", # HEAVY HEART EXCLAMATION MARK ORNAMENT
0x02764: r"\ding{164}", # HEAVY BLACK HEART
0x02765: r"\ding{165}", # ROTATED HEAVY BLACK HEART BULLET
0x02766: r"\ding{166}", # FLORAL HEART
0x02767: r"\ding{167}", # ROTATED FLORAL HEART BULLET
0x02776: r"\ding{182}", # DINGBAT NEGATIVE CIRCLED DIGIT ONE
0x02777: r"\ding{183}", # DINGBAT NEGATIVE CIRCLED DIGIT TWO
0x02778: r"\ding{184}", # DINGBAT NEGATIVE CIRCLED DIGIT THREE
0x02779: r"\ding{185}", # DINGBAT NEGATIVE CIRCLED DIGIT FOUR
0x0277A: r"\ding{186}", # DINGBAT NEGATIVE CIRCLED DIGIT FIVE
0x0277B: r"\ding{187}", # DINGBAT NEGATIVE CIRCLED DIGIT SIX
0x0277C: r"\ding{188}", # DINGBAT NEGATIVE CIRCLED DIGIT SEVEN
0x0277D: r"\ding{189}", # DINGBAT NEGATIVE CIRCLED DIGIT EIGHT
0x0277E: r"\ding{190}", # DINGBAT NEGATIVE CIRCLED DIGIT NINE
0x0277F: r"\ding{191}", # DINGBAT NEGATIVE CIRCLED NUMBER TEN
0x02780: r"\ding{192}", # DINGBAT CIRCLED SANS-SERIF DIGIT ONE
0x02781: r"\ding{193}", # DINGBAT CIRCLED SANS-SERIF DIGIT TWO
0x02782: r"\ding{194}", # DINGBAT CIRCLED SANS-SERIF DIGIT THREE
0x02783: r"\ding{195}", # DINGBAT CIRCLED SANS-SERIF DIGIT FOUR
0x02784: r"\ding{196}", # DINGBAT CIRCLED SANS-SERIF DIGIT FIVE
0x02785: r"\ding{197}", # DINGBAT CIRCLED SANS-SERIF DIGIT SIX
0x02786: r"\ding{198}", # DINGBAT CIRCLED SANS-SERIF DIGIT SEVEN
0x02787: r"\ding{199}", # DINGBAT CIRCLED SANS-SERIF DIGIT EIGHT
0x02788: r"\ding{200}", # DINGBAT CIRCLED SANS-SERIF DIGIT NINE
0x02789: r"\ding{201}", # DINGBAT CIRCLED SANS-SERIF NUMBER TEN
0x0278A: r"\ding{202}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT ONE
0x0278B: r"\ding{203}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT TWO
0x0278C: r"\ding{204}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT THREE
0x0278D: r"\ding{205}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FOUR
0x0278E: r"\ding{206}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT FIVE
0x0278F: r"\ding{207}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SIX
0x02790: r"\ding{208}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT SEVEN
0x02791: r"\ding{209}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT EIGHT
0x02792: r"\ding{210}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF DIGIT NINE
0x02793: r"\ding{211}", # DINGBAT NEGATIVE CIRCLED SANS-SERIF NUMBER TEN
0x02794: r"\ding{212}", # HEAVY WIDE-HEADED RIGHTWARDS ARROW
0x02798: r"\ding{216}", # HEAVY SOUTH EAST ARROW
0x02799: r"\ding{217}", # HEAVY RIGHTWARDS ARROW
0x0279A: r"\ding{218}", # HEAVY NORTH EAST ARROW
0x0279B: r"\ding{219}", # DRAFTING POINT RIGHTWARDS ARROW
0x0279C: r"\ding{220}", # HEAVY ROUND-TIPPED RIGHTWARDS ARROW
0x0279D: r"\ding{221}", # TRIANGLE-HEADED RIGHTWARDS ARROW
0x0279E: r"\ding{222}", # HEAVY TRIANGLE-HEADED RIGHTWARDS ARROW
0x0279F: r"\ding{223}", # DASHED TRIANGLE-HEADED RIGHTWARDS ARROW
0x027A0: r"\ding{224}", # HEAVY DASHED TRIANGLE-HEADED RIGHTWARDS ARROW
0x027A1: r"\ding{225}", # BLACK RIGHTWARDS ARROW
0x027A2: r"\ding{226}", # THREE-D TOP-LIGHTED RIGHTWARDS ARROWHEAD
0x027A3: r"\ding{227}", # THREE-D BOTTOM-LIGHTED RIGHTWARDS ARROWHEAD
0x027A4: r"\ding{228}", # BLACK RIGHTWARDS ARROWHEAD
0x027A5: r"\ding{229}", # HEAVY BLACK CURVED DOWNWARDS AND RIGHTWARDS ARROW
0x027A6: r"\ding{230}", # HEAVY BLACK CURVED UPWARDS AND RIGHTWARDS ARROW
0x027A7: r"\ding{231}", # SQUAT BLACK RIGHTWARDS ARROW
0x027A8: r"\ding{232}", # HEAVY CONCAVE-POINTED BLACK RIGHTWARDS ARROW
0x027A9: r"\ding{233}", # RIGHT-SHADED WHITE RIGHTWARDS ARROW
0x027AA: r"\ding{234}", # LEFT-SHADED WHITE RIGHTWARDS ARROW
0x027AB: r"\ding{235}", # BACK-TILTED SHADOWED WHITE RIGHTWARDS ARROW
0x027AC: r"\ding{236}", # FRONT-TILTED SHADOWED WHITE RIGHTWARDS ARROW
0x027AD: r"\ding{237}", # HEAVY LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
0x027AE: r"\ding{238}", # HEAVY UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
0x027AF: r"\ding{239}", # NOTCHED LOWER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
0x027B1: r"\ding{241}", # NOTCHED UPPER RIGHT-SHADOWED WHITE RIGHTWARDS ARROW
0x027B2: r"\ding{242}", # CIRCLED HEAVY WHITE RIGHTWARDS ARROW
0x027B3: r"\ding{243}", # WHITE-FEATHERED RIGHTWARDS ARROW
0x027B4: r"\ding{244}", # BLACK-FEATHERED SOUTH EAST ARROW
0x027B5: r"\ding{245}", # BLACK-FEATHERED RIGHTWARDS ARROW
0x027B6: r"\ding{246}", # BLACK-FEATHERED NORTH EAST ARROW
0x027B7: r"\ding{247}", # HEAVY BLACK-FEATHERED SOUTH EAST ARROW
0x027B8: r"\ding{248}", # HEAVY BLACK-FEATHERED RIGHTWARDS ARROW
0x027B9: r"\ding{249}", # HEAVY BLACK-FEATHERED NORTH EAST ARROW
0x027BA: r"\ding{250}", # TEARDROP-BARBED RIGHTWARDS ARROW
0x027BB: r"\ding{251}", # HEAVY TEARDROP-SHANKED RIGHTWARDS ARROW
0x027BC: r"\ding{252}", # WEDGE-TAILED RIGHTWARDS ARROW
0x027BD: r"\ding{253}", # HEAVY WEDGE-TAILED RIGHTWARDS ARROW
0x027BE: r"\ding{254}", # OPEN-OUTLINED RIGHTWARDS ARROW
0x02A6E: r"\ensuremath{\stackrel{*}{=}}", # EQUALS WITH ASTERISK
0x02A75: r"\ensuremath{\Equal}", # TWO CONSECUTIVE EQUALS SIGNS
0x02A7D: r"\ensuremath{\leqslant}", # LESS-THAN OR SLANTED EQUAL TO
0x02A7E: r"\ensuremath{\geqslant}", # GREATER-THAN OR SLANTED EQUAL TO
0x02A85: r"\ensuremath{\lessapprox}", # LESS-THAN OR APPROXIMATE
0x02A86: r"\ensuremath{\gtrapprox}", # GREATER-THAN OR APPROXIMATE
0x02A87: r"\ensuremath{\lneq}", # LESS-THAN AND SINGLE-LINE NOT EQUAL TO
0x02A88: r"\ensuremath{\gneq}", # GREATER-THAN AND SINGLE-LINE NOT EQUAL TO
0x02A89: r"\ensuremath{\lnapprox}", # LESS-THAN AND NOT APPROXIMATE
0x02A8A: r"\ensuremath{\gnapprox}", # GREATER-THAN AND NOT APPROXIMATE
0x02A8B: r"\ensuremath{\lesseqqgtr}", # LESS-THAN ABOVE DOUBLE-LINE EQUAL ABOVE GREATER-THAN
0x02A8C: r"\ensuremath{\gtreqqless}", # GREATER-THAN ABOVE DOUBLE-LINE EQUAL ABOVE LESS-THAN
0x02A95: r"\ensuremath{\eqslantless}", # SLANTED EQUAL TO OR LESS-THAN
0x02A96: r"\ensuremath{\eqslantgtr}", # SLANTED EQUAL TO OR GREATER-THAN
0x02A9D: r"\ensuremath{\Pisymbol{ppi020}{117}}", # SIMILAR OR LESS-THAN
0x02A9E: r"\ensuremath{\Pisymbol{ppi020}{105}}", # SIMILAR OR GREATER-THAN
0x02AA1: r"\ensuremath{\NestedLessLess}", # DOUBLE NESTED LESS-THAN
0x02AA2: r"\ensuremath{\NestedGreaterGreater}", # DOUBLE NESTED GREATER-THAN
0x02AAF: r"\ensuremath{\preceq}", # PRECEDES ABOVE SINGLE-LINE EQUALS SIGN
0x02AB0: r"\ensuremath{\succeq}", # SUCCEEDS ABOVE SINGLE-LINE EQUALS SIGN
0x02AB5: r"\ensuremath{\precneqq}", # PRECEDES ABOVE NOT EQUAL TO
0x02AB6: r"\ensuremath{\succneqq}", # SUCCEEDS ABOVE NOT EQUAL TO
0x02AB7: r"\ensuremath{\precapprox}", # PRECEDES ABOVE ALMOST EQUAL TO
0x02AB8: r"\ensuremath{\succapprox}", # SUCCEEDS ABOVE ALMOST EQUAL TO
0x02AB9: r"\ensuremath{\precnapprox}", # PRECEDES ABOVE NOT ALMOST EQUAL TO
0x02ABA: r"\ensuremath{\succnapprox}", # SUCCEEDS ABOVE NOT ALMOST EQUAL TO
0x02AC5: r"\ensuremath{\subseteqq}", # SUBSET OF ABOVE EQUALS SIGN
0x02AC6: r"\ensuremath{\supseteqq}", # SUPERSET OF ABOVE EQUALS SIGN
0x02ACB: r"\ensuremath{\subsetneqq}", # SUBSET OF ABOVE NOT EQUAL TO
0x02ACC: r"\ensuremath{\supsetneqq}", # SUPERSET OF ABOVE NOT EQUAL TO
0x0FB00: r"ff", # LATIN SMALL LIGATURE FF
0x0FB01: r"fi", # LATIN SMALL LIGATURE FI
0x0FB02: r"fl", # LATIN SMALL LIGATURE FL
0x0FB03: r"ffi", # LATIN SMALL LIGATURE FFI
0x0FB04: r"ffl", # LATIN SMALL LIGATURE FFL
0x1D6B9: r"\mathbf{\vartheta}", # MATHEMATICAL BOLD CAPITAL THETA SYMBOL
0x1D6DD: r"\mathbf{\vartheta}", # MATHEMATICAL BOLD THETA SYMBOL
0x1D6DE: r"\mathbf{\varkappa}", # MATHEMATICAL BOLD KAPPA SYMBOL
0x1D6DF: r"\mathbf{\phi}", # MATHEMATICAL BOLD PHI SYMBOL
0x1D6E0: r"\mathbf{\varrho}", # MATHEMATICAL BOLD RHO SYMBOL
0x1D6E1: r"\mathbf{\varpi}", # MATHEMATICAL BOLD PI SYMBOL
0x1D6F3: r"\mathsl{\vartheta}", # MATHEMATICAL ITALIC CAPITAL THETA SYMBOL
0x1D6FD: r"\ensuremath{\beta}", # MATHEMATICAL ITALIC SMALL BETA
0x1D717: r"\mathsl{\vartheta}", # MATHEMATICAL ITALIC THETA SYMBOL
0x1D718: r"\mathsl{\varkappa}", # MATHEMATICAL ITALIC KAPPA SYMBOL
0x1D719: r"\mathsl{\phi}", # MATHEMATICAL ITALIC PHI SYMBOL
0x1D71A: r"\mathsl{\varrho}", # MATHEMATICAL ITALIC RHO SYMBOL
0x1D71B: r"\mathsl{\varpi}", # MATHEMATICAL ITALIC PI SYMBOL
0x1D72D: r"\mathbit{O}", # MATHEMATICAL BOLD ITALIC CAPITAL THETA SYMBOL
0x1D751: r"\mathbit{\vartheta}", # MATHEMATICAL BOLD ITALIC THETA SYMBOL
0x1D752: r"\mathbit{\varkappa}", # MATHEMATICAL BOLD ITALIC KAPPA SYMBOL
0x1D753: r"\mathbit{\phi}", # MATHEMATICAL BOLD ITALIC PHI SYMBOL
0x1D754: r"\mathbit{\varrho}", # MATHEMATICAL BOLD ITALIC RHO SYMBOL
0x1D755: r"\mathbit{\varpi}", # MATHEMATICAL BOLD ITALIC PI SYMBOL
0x1D767: r"\mathsfbf{\vartheta}", # MATHEMATICAL SANS-SERIF BOLD CAPITAL THETA SYMBOL
0x1D78B: r"\mathsfbf{\vartheta}", # MATHEMATICAL SANS-SERIF BOLD THETA SYMBOL
0x1D78C: r"\mathsfbf{\varkappa}", # MATHEMATICAL SANS-SERIF BOLD KAPPA SYMBOL
0x1D78D: r"\mathsfbf{\phi}", # MATHEMATICAL SANS-SERIF BOLD PHI SYMBOL
0x1D78E: r"\mathsfbf{\varrho}", # MATHEMATICAL SANS-SERIF BOLD RHO SYMBOL
0x1D78F: r"\mathsfbf{\varpi}", # MATHEMATICAL SANS-SERIF BOLD PI SYMBOL
0x1D7A1: r"\mathsfbfsl{\vartheta}", # MATHEMATICAL SANS-SERIF BOLD ITALIC CAPITAL THETA SYMBOL
0x1D7C5: r"\mathsfbfsl{\vartheta}", # MATHEMATICAL SANS-SERIF BOLD ITALIC THETA SYMBOL
0x1D7C6: r"\mathsfbfsl{\varkappa}", # MATHEMATICAL SANS-SERIF BOLD ITALIC KAPPA SYMBOL
0x1D7C7: r"\mathsfbfsl{\phi}", # MATHEMATICAL SANS-SERIF BOLD ITALIC PHI SYMBOL
0x1D7C8: r"\mathsfbfsl{\varrho}", # MATHEMATICAL SANS-SERIF BOLD ITALIC RHO SYMBOL
0x1D7C9: r"\mathsfbfsl{\varpi}", # MATHEMATICAL SANS-SERIF BOLD ITALIC PI SYMBOL
}
|
def main():
info('Jan unknown laser analysis')
#gosub('jan:PrepareForCO2Analysis')
if exp.analysis_type == 'blank':
info('is blank. not heating')
else:
info('move to position {}'.format(exp.position))
move_to_position(exp.position)
if exp.ramp_rate > 0:
'''
style 1.
'''
# begin_interval(duration)
# info('ramping to {} at {} {}/s'.format(extract_value, ramp_rate, extract_units)
# ramp(setpoint=extract_value, rate=ramp_rate)
# complete_interval()
'''
style 2.
'''
#elapsed=ramp(setpoint=extract_value, rate=ramp_rate)
#sleep(min(0, duration-elapsed))
pass
else:
info('set heat to {}'.format(exp.extract_value))
extract(exp.extract_value)
sleep(exp.duration)
if not exp.analysis_type == 'blank':
disable()
sleep(exp.cleanup)
|
## Exercício 17 do livro Python 3 - Conceitos e Aplicações - Uma Abordagem Didática
""" Escreva um programa que leia um número inteiro do teclado e diga se esse número é positivo ou negativo."""
try:
num_x = int(input("Digite um número inteiro: "))
if num_x < 0:
print("O número digitado é negativo")
else:
print("o número digitado é positivo")
except:
print("Você não digitou um número inteiro.")
|
"""
MailerSend Official Python DSK
@maintainer: Alexandros Orfanos (alexandros at remotecompany dot com)
"""
__version_info__ = ("0", "1", "3")
__version__ = ".".join(__version_info__)
|
c = float(input('Digite a temperatura em Celsius: '))
f = (c * 1.8) + 32
print(f'A temperatura de {c} Grau Celsius em fahrenheit equivale a {f}F')
|
# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT
# All rights reserved. This work is under a BSD license, see LICENSE.TXT.
class MCInvalidValue(object):
def __init__(self, name):
self.name = name
def __nonzero__(self):
return False
def __repr__(self):
return self.name
def json_equivalent(self):
return self.__repr__()
MC_REQUIRED = MCInvalidValue("MC_REQUIRED")
MC_TODO = MCInvalidValue("MC_TODO")
_MC_NO_VALUE = MCInvalidValue("_MC_NO_VALUE")
_mc_invalid_values = (MC_REQUIRED, MC_TODO, _MC_NO_VALUE)
|
"""
Represent classes found in European Medicines Agency (EMA) documents
"""
class SectionLeaflet:
"""
Class to represent individual section of a Package Leaflet
"""
def __init__(self, title, section_content, entity_recognition=None):
self.title = title
self.section_content = section_content
self.is_duplicate = False
self.entity_recognition = entity_recognition
self.generated_content = None
def print_original_info(self):
""" Display original information about a section """
print("The name of the section: \n", self.title, "\n===================\n")
print("Original content of the section: \n", self.section_content, "\n===================\n")
def print_entities(self):
""" Print entities of the current section with corresponding Category, Type and Confidence Score """
if self.entity_recognition is not None:
for entity in self.entity_recognition:
print("{0} ({1}, type: {2}, score:{3:.2f})".format(entity["Text"],
entity["Category"],
entity["Type"],
entity["Score"]))
def compare_contents(self):
""" Compare original content of a section to generated content """
print("Original Content: \n", self.section_content, "\n===================\n")
print("Generated Content: \n", self.generated_content, "\n===================\n")
def print_all_info(self):
""" Display all information about a section """
print("The name of the section: \n", self.title, "\n===================\n")
print("Original content of the section: \n", self.section_content, "\n===================\n")
print("Named entity recognition: \n", self.entity_recognition, "\n===================\n")
print("Generated content of the section: \n", self.generated_content, "\n===================\n")
class Leaflet:
"""
Class to represent Package Leaflet, containing 6 sections
"""
def __init__(self, product_name, product_url, product_id, product_content,
section1=None, section2=None, section3=None, section4=None, section5=None, section6=None):
# leaflet attributes
self.product_name = product_name
self.url = product_url
self.id = product_id
self.content = product_content
# extracted sections
self.section1 = section1
self.section2 = section2
self.section3 = section3
self.section4 = section4
self.section5 = section5
self.section6 = section6
def display_info(self, full_content=True):
""" Show information about a package leaflet"""
print("Product Name: \n", self.product_name, "\n===================\n")
print("Url: \n", self.url, "\n===================\n")
print("Product ID: \n", self.id, "\n===================\n")
if full_content == True:
print("Full Leaflet Content: \n", self.content, "\n===================\n")
def print_section(self, section_type=None):
""" Display a particular section of a package leaflet """
if section_type == "1" and self.section1 is not None:
self.section1.print_all_info()
else:
print("No section1 in the current leaflet - ", self.product_name)
if section_type == "2" and self.section2 is not None:
self.section2.print_all_info()
else:
print("No section2 in the current leaflet - ", self.product_name)
if section_type == "3" and self.section3 is not None:
self.section3.print_all_info()
else:
print("No section3 in the current leaflet - ", self.product_name)
if section_type == "4" and self.section4 is not None:
self.section4.print_all_info()
else:
print("No section4 in the current leaflet - ", self.product_name)
if section_type == "5" and self.section5 is not None:
self.section5.print_all_info()
else:
print("No section5 in the current leaflet - ", self.product_name)
if section_type == "6" and self.section6 is not None:
self.section6.print_all_info()
else:
print("No section6 in the current leaflet - ", self.product_name)
|
# seleção simples
nome_carros = tuple(['Jetta Variant', 'Passat', 'Crossfox', 'DS5'])
print(nome_carros[0]) # selecionando indice 0
print(nome_carros[1]) # selecionando indice 1
print(nome_carros[-1]) # selecionando indice -1 (ultimo)
print(nome_carros[1:3]) # slice do indice 1 ao 3-1(2)
# seleção interna
nome_carros_2 = ('Jetta Variant', 'Passat', 'Crossfox', 'DS5',('Fusca', 'Gol', 'C4'))
print(nome_carros_2[-1]) # tupla interna
print(nome_carros_2[-1][1]) # elemento 1 da tupla interna
print(nome_carros_2[-1][-1]) # ultimo elemento da tupla interna
|
"""doc
# leanai.data.transformer
> A transformer converts the data from a general format into what the neural network needs.
"""
class Transformer():
def __init__(self):
"""
A transformer must implement `__call__`.
A transformer is a callable that gets the data (usually a tuple of feature, label), transforms it and returns the data again (usually as a tuple of feature, label).
The last transformer must output a tuple of feature of type NetworkInput (namedtuple) and label of type NetworkOutput (namedtuple) to be able to pass it to the neural network.
Example:
```python
def __call__(self, sample: Tuple[DatasetInput, DatasetOutput]) -> Tuple[NetworkInput, NetworkTargets]:
```
"""
pass
def __call__(self, *args):
"""
This function gets the data from the previous transformer or dataset as input and should output the data again.
:param args: The input data.
:return: The output data.
"""
raise NotImplementedError
@property
def version(self):
"""
Defines the version of the transformer. The name can be also something descriptive of the method.
:return: The version number of the transformer.
"""
raise NotImplementedError
|
# Solution by Emma Neiss
L, N = map(int, input().split())
# initialisation
items = [0 for i in range(N)]
for i in range(N):
items[i] = int(input()) + 1 # ajout d'une personne fictive dans le groupe pour respecter les distances
# --- Implémentation du sac à dos classique sans répétition
# RQ : on fait +1 à la taille du sac initiale (longueur de la section de route) pour prendre
# en compte les distances nécessaires :
# comme on fait +1 à la taille de chacun des N groupes, mais qu'il faut laisser
# seulement N-1 espaces entre les groupes, on fait également +1 sur la taille du sac
# pour compenser
#
# Pour plus d'infos sur l'algorithme utilisé, voir "0-1 Knapsack Problem"
sac = [0 for i in range(L+2)] # "sac" de taille L+2 (cap. max de L+1, commence à 0)
sac[0] = 1 # initialisation du sac
for item in items:
for taille in range(L+1, -1, -1):
if sac[taille] > 0 and taille + item <= L+1:
sac[taille + item] = 1
if sac[L+1] == 1:
break
if sac[L+1] == 1:
print("OUI")
else:
print("NON")
|
# Longest Substring Without Repeating Characters
class Solution:
def lengthOfLongestSubstring(self, s):
longest = 0
start = 0
length = len(s)
while start < length - longest:
substr = s[start:start + longest + 1]
if len(set(substr)) == longest + 1:
longest += 1
else:
start += 1
return longest
if __name__ == "__main__":
sol = Solution()
inp = ""
print(sol.lengthOfLongestSubstring(inp))
|
workers = 2
errorlog = "/demo/mysite.gunicorn.error"
accesslog = "/demo/mysite.gunicorn.access"
loglevel = "debug"
|
# https://www.codechef.com/problems/LOSTMAX
for T in range(int(input())):
l=list(map(int,input().split()))
l.remove(len(l)-1)
print(max(l))
|
BOARD_SIZE = 8
class Queen(object):
def __init__(self, x, y):
if (
x < 0 or x >= BOARD_SIZE or
y < 0 or y >= BOARD_SIZE
):
raise ValueError('invalid board position')
self.p = (x, y)
def __eq__(self, other):
return self.p == other.p
def can_attack(self, other):
if self.p == other.p:
raise ValueError('cannot attack self')
return (
self.p[0] == other.p[0] or
self.p[1] == other.p[1] or
abs(self.p[0] - other.p[0]) == abs(self.p[1] - other.p[1])
)
|
numero = int(input('Insira um número: '))
unidade = numero // 1 % 10
dezena = numero // 10 % 10
centena = numero // 100 % 10
milhar = numero // 1000 % 10
print('O número analisado foi {}'.format(numero))
print('Unidade: {}'.format(unidade))
print('Dezena: {}'.format(dezena))
print('Centena: {}'.format(centena))
print('Milhar: {}'.format(milhar))
|
__name__ = "helpers"
def is_int(s):
""" return True if string is an int """
try:
int(s)
return True
except ValueError:
return False
def str2bool(s):
""" convert string to a python boolean """
return s.lower() in ("yes", "true", "t", "1")
def str2num(s):
""" convert string to an int or a float """
try:
return int(s)
except ValueError:
return float(s)
|
def plug_in(symbol_values):
structure = symbol_values['structure']
factor = structure.composition.get_reduced_formula_and_factor()[1]
uc_cv = symbol_values.get("uc_cv")
uc_cp = symbol_values.get("uc_cp")
molar_cv = symbol_values.get("molar_cv")
molar_cp = symbol_values.get("molar_cp")
if uc_cv is not None:
return {"molar_cv": uc_cv / factor * 6.022E23}
if uc_cp is not None:
return {"molar_cp": uc_cp / factor * 6.022E23}
if molar_cv is not None:
return {"uc_cv": molar_cv * factor / 6.022E23}
if molar_cp is not None:
return {"uc_cp": molar_cp * factor / 6.022E23}
DESCRIPTION = """
Properties of a crystal structure, such as the number of sites in its
unit cell and its space group, as calculated by pymatgen.
"""
config = {
"name": "heat_capacity_unit_cell_conversion",
"connections": [
{
"inputs": [
"structure",
"uc_cv"
],
"outputs": [
"molar_cv",
]
},
{
"inputs": [
"structure",
"uc_cp"
],
"outputs": [
"molar_cp",
]
},
{
"inputs": [
"structure",
"molar_cv"
],
"outputs": [
"uc_cv",
]
},
{
"inputs": [
"structure",
"molar_cp"
],
"outputs": [
"uc_cp",
]
}
],
"categories": [],
"variable_symbol_map": {
"structure": "structure",
"uc_cv": "unit_cell_heat_capacity_constant_volume",
"uc_cp": "unit_cell_heat_capacity_constant_pressure",
"molar_cv": "molar_heat_capacity_constant_volume",
"molar_cp": "molar_heat_capacity_constant_pressure"
},
"units_for_evaluation": {
"uc_cv": "joule / kelvin",
"uc_cp": "joule / kelvin",
"molar_cv": "joule / kelvin / mol",
"molar_cp": "joule / kelvin / mol"
},
"description": DESCRIPTION,
"references": ["doi:10.1016/j.commatsci.2012.10.028"],
"implemented_by": [
"dmrdjenovich"
],
"plug_in": plug_in
}
|
class Solution:
# @param A : tuple of integers
# @return a list of integers
def repeatedNumber(self, A):
n = len(A)
f_sum = sum(A) #false sum
actual_sum = 0
actual_sum_squares = 0
f_sum_square = 0 #false sum squares
for i in range(1,n+1):
actual_sum+= i
actual_sum_squares+=i*i
f_sum_square += A[i-1]*A[i-1]
A = (f_sum - actual_sum -((f_sum_square-actual_sum_squares)//(f_sum - actual_sum)))/2
B = -(f_sum - actual_sum)+A
return [int(-B),int(-A)]
|
class Solution:
def canPlaceFlowers(self, flowerbed: List[int], n: int) -> bool:
cnt, pre = 0, 0
length = len(flowerbed)
flowers = flowerbed + [0]
for idx, _ in enumerate(flowerbed):
next_ = flowers[idx]
if not _:
print(cnt, idx, pre, flowers[idx + 1])
if not pre and not flowers[idx + 1]:
cnt += 1
pre = 1
else:
pre = _
else:
pre = _
print(cnt)
return cnt >= n
|
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 15 11:59:54 2015
@author: ktritz
"""
def _postprocess(signal, data):
if signal._name in 'radius' and signal.units in 'cm':
data /= 100.
signal.units = 'm'
return data
|
# vim:tw=50
""""While" Loops
Recursion is powerful, but not always convenient
or efficient for processing sequences. That's why
Python has **loops**.
A _loop_ is just what it sounds like: you do
something, then you go round and do it again, like
a track: you run around, then you run around again.
Loops let you do repetitive things, like printing
all of the elements of a list, or adding them all
together, without using recursion.
Python supports two kinds. We'll start with
**while loops**.
A |while| statement is like an |if| statement, in
that it executes the indented block if its condition is
|True| (nonzero). But, unlike |if|, it *keeps on
doing it* until the condition becomes |False| or
it hits a |break| statement. Forever.
The code window shows a while loop that prints
every element of a list. There's another one that
adds all of the elements. It does this
without recursion. Check it out.
Exercises
- Look at |print_all|. Why does it eventually
stop? What is the value of |i| when it does?
- Why does |slicing_print_all| stop? How does it
work?
"""
__doc__ = """Use while loops to do things repetitively."""
def print_all(seq):
"""Print all elements of seq."""
i = 0
while i < len(seq):
print("item", i, seq[i])
i = i + 1 # This is also spelled 'i += 1'
def slicing_print_all(seq):
"""Another way of using while - less efficient."""
while seq:
print(seq[0])
seq = seq[1:]
def add_all(seq):
"""Add all of the elements of seq."""
i = 0
s = 0
while i < len(seq):
s += seq[i]
i += 1
return s
print("Using indices:")
print_all([1, 5, 8, "hello", 9])
print("Using slices:")
slicing_print_all(range(3))
print("Summing:")
print("sum of all:", add_all(range(1,12))) # Should be 66
|
"""Deserialization of incoming requests"""
class ASKRequest(dict):
"""Class to deserialize and access data for incoming requests
Allows access to request data via dot notation by dynamically
assigning attributes. Hopefully allows more graceful handling
of requests in the face of possible future request structure
changes. From the official Alexa Skills Kit documentation:
*Important: Future versions of the Alexa Skills Kit may add new
properties to the JSON request and response formats, while
maintaining backward compatibility for the existing properties.
Your code must be resilient to these types of changes. For example,
your code for deserializing a JSON request must not break when it
encounters a new, unknown property.*
"""
def __init__(self, **kwargs):
super().__init__(kwargs)
# Any value found to be another object/dict is
# created as another `ASKObject`, which follows
# the same initialization, recursvely converting
# all nested objects.
# Other value types are set normally.
for k, v in dict(kwargs).items():
if isinstance(v, dict):
v = ASKRequest(**v)
self[k] = v
def _dict(self):
"""Return this `ASKObject` as a `dict`
Removes any attribute whose value is `None`
Calls this same function on any attributes of
type `ASKObject` which recursively converts all
nested ASKObjects back into a dictionary
:return:
"""
d = dict(self)
for k, v in dict(d).items():
if isinstance(v, ASKRequest):
d[k] = v._dict()
elif v is None:
del d[k]
return d
def __setattr__(self, key, value):
self.__setitem__(key, value)
def __getattr__(self, attr):
return self.get(attr)
|
start = int(input())
end = int(input())
def is_divide(number):
return any(number % i == 0 for i in range(2, 11))
def get_divise_numbers(start, end):
return [s for s in range(start, end + 1) if is_divide(s)]
def print_result(numbers):
print(numbers)
numbers = get_divise_numbers(start, end)
print_result(numbers)
|
token = "1047594455:AAGGblu9FGRNgPkjMEcbX7I5BuwDHUBQqsI"
MODULE_NAME = "admin"
MESSAGE_AMOUNT = "People registered: "
MESSAGE_UNAUTHORIZED = "Unauthorized access attempt. Administrator was notified"
MESSAGE_SENT_EVERYBODY = "Message has been sent to everybody"
MESSAGE_SENT_PERSONAL = "Message has been sent"
MESSAGE_ABORTED = "Aborted"
MESSAGE_USER_NOT_FOUND = "User not found"
MESSAGE_EXCEPTION = "Exception occurred:\n"
MESSAGE_SCHEDULE_UPDATED = "Schedule is updated"
REQUEST_SPAM_MESSAGE = "With great power comes great responsibility!\nWhat do you want to spam everyone?"
REQUEST_PERSONAL_ALIAS = "Write telegram alias for personal message"
REQUEST_PERSONAL_MESSAGE = "Write your personal message to "
ADMIN_LIST = []
SUPERADMIN_LIST = []
|
class KikErrorException(Exception):
def __init__(self, xml_error, message=None):
self.message = message
self.xml_error = xml_error
def __str__(self):
return self.__repr__()
def __repr__(self):
if self.message is not None:
return self.message
else:
if "prettify" in dict(self.xml_error):
error_string = self.xml_error.prettify()
else:
error_string = self.xml_error
return "Kik error: \r\n" + error_string
class KikCaptchaException(KikErrorException):
def __init__(self, xml_error, message, captcha_url):
super().__init__(xml_error, message)
self.captcha_url = captcha_url
class KikLoginException(KikErrorException):
pass
class KikInvalidAckException(KikErrorException):
pass
class KikEmptyResponseException(KikErrorException):
pass
class KikApiException(Exception):
pass
class KikParsingException(Exception):
pass
class KikUploadError(Exception):
def __init__(self, status_code, reason=None):
self.status_code = reason
self.reason = reason
def __str__(self):
return self.__repr__()
def __repr__(self):
if self.reason is None:
return self.status_code
return f"[{self.status_code}] {self.reason}"
|
class Solution(object):
def runningSum(self, nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
for i in range(1, len(nums)):
nums[i] = nums[i] + nums[i-1]
return nums
if __name__ == '__main__':
nums = [1, 2, 3]
obj = Solution()
obj.runningSum(nums)
|
def getCourseList():
"""
Convert Dictionary list of course to a list
Returns:
list : a list for the types of courses in OSCAR
"""
courseDescription = []
for courseName, description in courseDict.items():
courseDescription.append(courseName + ": " + description)
return courseDescription
courseDict = {
'ACCT': 'Accounting',
'AE': 'Aerospace Engineering',
'AS': 'Air Force Aerospace Studies',
'APPH': 'Applied Physiology',
'ASE': 'Applied Systems Engineering',
'ARBC': 'Arabic',
'ARCH': 'Architecture',
'BIOS': 'Biological Science',
'BIOL': 'Biology',
'BMEJ': 'Biomedical Engineering Joint Emory PKU',
'BMED': 'Biomedical Engineering',
'BMEM': 'Biomedical Engineering Joint Emory',
'BC': 'Building Construction',
'BCP': 'Building Construction - Professional',
'CETL': 'Center Enhancement Teach/Learn',
'CHBE': 'Chemical & Biomolecular Engineering',
'CHEM': 'Chemistry',
'CHIN': 'Chinese',
'CP': 'City Planning',
'CEE': 'Civil and Environmental Engineering',
'COA': 'College of Architecture',
'COE': 'College of Engineering',
'COS': 'College of Sciences',
'CX': 'Computational Mod, Sim, & Data',
'CSE': 'Computational Science and Engineering',
'CS': 'Computer Science',
'COOP': 'Co-op',
'UCGA': 'Cross-enrollment',
'EAS': 'Earth and Atmospheric Sciences',
'ECON': 'Economics',
'ECEP': 'Elect & Comp Engr-Professional',
'ECE': 'Electrical and Computer Engineering',
'ENGL': 'English',
'FS': 'Foreign Studies',
'FREN': 'French',
'GT': 'Georgia Tech',
'GTL': 'Georgia Tech Lorraine',
'GRMN': 'German',
'HP': 'Health Physics',
'HS': 'Health Systems',
'HEBW': 'Hebrew',
'HIN': 'Hindi',
'HIST': 'History',
'HTS': 'History, Technology, and Society',
'ISYE': 'Industrial and Systems Engineering',
'ID': 'Industrial Design',
'INTA': 'International Affairs',
'IL': 'International Logistics',
'INTN': 'Internship',
'JAPN': 'Japanese',
'KOR': 'Korean',
'LATN': 'Latin',
'LS': 'Learning Support',
'LING': 'Linguistics',
'LMC': 'Literature, Media & Comm',
'MGT': 'Management',
'MOT': 'Management of Technology',
'MSE': 'Materials Science and Engineering',
'MATH': 'Mathematics',
'ME': 'Mechanical Engineering',
'MP': 'Medical Physics',
'MSL': 'Military Science and Leadership',
'MSR': 'Material Science & Engineering',
'ML': 'Modern Languages',
'MP': 'Medical Physics',
'MUSI': 'Music',
'NS': 'Naval Science',
'NEUR': 'Neuroscience',
'NRE': 'Nuclear and Radiological Engineering',
'PERS': 'Persian',
'PHIL': 'Philosophy',
'PHYS': 'Physics',
'POL': 'Political Science',
'PTFE': 'Polymer, Texture, and Fiber Engineering',
'DOPP': 'Professional Practice',
'PSYC': 'Psychology',
'PUBP': 'Public Policy',
'RUSS': 'Russian',
'SOC': 'Sociology',
'SPAN': 'Spanish',
'SWAH': 'Swahili'
}
|
"name & description of constants"
MONGODB_LOCAL = "mongodb://localhost:27017/"
DATABASE_NAME = "danmaku_db"
SERVER_INFO_NAME = "server_db"
DANMAKU_THRESHORD = 250
ROOM_DANMAKU_THRESHOLD = 10
MAINDB = "until_200220"
"""
information of every interpretation danmaku (without message)
{
message:[String]
message_length:[Int32],
roomid:[Int32],
mid:[Int32],
timestamp[Int64]
}
"""
MID_TABLE_OF = "zz_mid"
"""
danmaku data for a specific interpretation man
{
message_length:[Int32],
roomid:[Int32],
timestamp:[Int64],
message:[String]
}
"""
ROOM_TABLE_OF = "zz_room"
"""
danmaku data for a specific room
{
message_length:[Int32],
mid:[Int32],
timestamp:[Int64],
message:[String]
}
"""
MID_INFO = "mid_info"
"""
unique ID & nickname of bilibili user
{
_id:[Int32],
man_nick_name:[String]
danmaku_count:[Int32]
danmaku_len_count:[Int32]
danmaku_threshord:[Int32]
}
"""
ROOMID_INFO = "roomid_info"
"""
unique ID & nickname of live room
{
_id:[Int32],
room_nick_name:[String]
}
"""
RANKING = "rank_top300"
WORKING_THRESHOLD = 10
|
"""ScriptRunner custom exceptions."""
class ScriptRunnerException(BaseException):
"""Base ScriptRunner exception."""
class FailuresException(ScriptRunnerException):
"""Failures parent exception."""
class StopKeywordFailures(FailuresException):
"""ScriptRunner `"stop"` keyword exception."""
class UnknownKeywordFailures(FailuresException):
"""ScriptRunner unknown keyword exception."""
|
class Script(object):
START_MSG = """🌐[Share and Support](https://t.me/share/url?url=https://t.me/Tamil_RockersGroup)🌐
"""
HELP_MSG = """
NO GONNE HELP U BRO/SIS
"""
ABOUT_MSG = """⭕️<b>My Name : MT Unlimited Filter Bot</b>
⭕️<b>Creater :</b> <b>@geronimo1234</b>
⭕️<b>Language :</b> <code>Python3</code>
⭕️<b>Library :</b> <a href='https://docs.pyrogram.org/'>Pyrogram 1.0.7</a>
"""
|
def anonymous_allowed(fn):
fn.authenticated = False
return fn
def authentication_required(fn):
fn.authenticated = True
return fn
|
class ansi: pass
ansi.red = '\x1b[41m'
ansi.orange = '\x1b[48;5;130m'
ansi.green = '\x1b[42m'
ansi.yellow = '\x1b[43m'
ansi.blue = '\x1b[44m'
ansi.magenta = '\x1b[45m'
ansi.cyan = '\x1b[46m'
ansi.white = '\x1b[47m'
ansi.reset = '\x1b[49m'
fill = {
'O': ansi.orange+' '+ansi.reset,
'G': ansi.green+' '+ansi.reset,
'Y': ansi.yellow+' '+ansi.reset,
'R': ansi.red+' '+ansi.reset,
'B': ansi.cyan+' '+ansi.reset,
'W': ansi.white+' '+ansi.reset,
}
|
class Pessoa:
# Atributos de classe/default
olhos = 2
def __init__(self, *filhos, nome = None, idade = 26):
# Atributos de instancia
self.nome = nome
self.idade = idade
self.filhos = list(filhos)
# Método da instância
def cumprimentar(self):
return f'Olá, meu nome é {self.nome}'
# Método da classe(usando decorator)
@staticmethod
def metodo_estatico():
return 42
# Usado para acessar dados da própria classe
@classmethod
def nome_e_atributos_de_classe(cls):
return f'{cls} - olhos {cls.olhos}'
class Homem(Pessoa):
def cumprimentar(self):
cumprimentar_da_classe = super().cumprimentar()
return f'{cumprimentar_da_classe}. Aperto de mão'
class Mutante(Pessoa):
olhos = 3
if __name__ == '__main__':
biel = Mutante(nome='Gabriel')
rogerin = Homem(biel, nome='Rogério')
print(Pessoa.cumprimentar(rogerin))
print(id(rogerin))
print(rogerin.cumprimentar())
print(rogerin.nome)
print(rogerin.idade)
for filho in rogerin.filhos:
print(filho.nome)
rogerin.sobrenome = 'Costa'
del rogerin.filhos
rogerin.olhos = 1
del rogerin.olhos
print(rogerin.__dict__)
print(biel.__dict__)
print(Pessoa.olhos)
print(rogerin.olhos)
print(biel.olhos)
print(id(Pessoa.olhos), id(rogerin.olhos), id(biel.olhos))
print(Pessoa.metodo_estatico(), rogerin.metodo_estatico())
print(Pessoa.nome_e_atributos_de_classe(), rogerin.nome_e_atributos_de_classe())
pessoa = Pessoa('Anonimo')
print(isinstance(pessoa, Pessoa))
print(isinstance(pessoa, Homem))
print(isinstance(biel, Homem))
print(isinstance(biel, Pessoa))
print(biel.olhos)
print(rogerin.cumprimentar())
print(biel.cumprimentar())
|
# ----------------------------------------------------------------------
# TTSystem errors
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020, The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
class TTError(Exception):
"""
Base class for TT Errors
"""
class TemporaryTTError(TTError):
"""
TTSystem can raise TemporaryTTError for calls that can be restarted
later
"""
|
class MNIST_v4(torch.nn.Module):
training_losses = [] #for plotting purposes
validation_losses = [] #for plotting purposes
training_accuracy = [] #for plotting purposes
validation_accuracy = [] #for plotting purposes
criterion = None #for criterion check
optim = None #for optim check
nonlinear = False #as a switch between linear and nonlinear outputs
def __init__(self,
in_features,
out_features,
layers=None,
optim=None,
criterion=None,
dropout=0.2):
super().__init__()
if optim is not None:
set_optim(optim)
if criterion is not None:
set_criterion(criterion)
# define the architecture if layers argument provided
if layers:
assert isinstance(layers,list) or isinstance(layers, tuple), \
"layers argument must be list or tuple"
layerlist = []
for neurons_in_layer in layers:
layerlist.append(torch.nn.Linear(in_features,neurons_in_layer))
layerlist.append(torch.nn.ReLU(inplace=True))
#layerlist.append(torch.nn.BatchNorm1d(i))
layerlist.append(torch.nn.Dropout(dropout))
in_features = neurons_in_layer
layerlist.append(torch.nn.Linear(layers[-1],out_features))
# the final architecture
self.layers = torch.nn.Sequential(*layerlist)
def set_optim(self, optim, lr):
'''Sets optimiser. Must be called separately'''
self.optim = optim(self.parameters(), lr=lr)
def set_criterion(self, criterion):
'''Sets the loss function. Must be called separately'''
self.criterion = criterion
def get_accuracy(self, preds, labels):
'''
Calculated accuracy using torch.max by comparing the predicted
and the final labels, and taking its mean.
'''
value, predicted_class = torch.max(preds, dim=1)
return (predicted_class == labels).float().mean()*100
def is_problem_linear(self, check=True, activation=None):
'''
Currently buggy. Needs further testing.
Used to tranform the architecture from a linear to a nonlinear model.
This function is used in the self.forward function.
'''
if not check and not activation:
raise ValueError("Activation function undefined for nonlinear problem")
if check:
self.nonlinear = True #used as a switch in forward
self.final_activation = activation
def _get_mean_(self, listOfTensors):
'''
Used to first converst the list of tensors into tensors, and then
take its mean.
'''
return torch.stack(listOfTensors).mean()
def forward(self, images):
'''
This function matrix multiplies inputs with weights and biases and
returns linear or non-linear outputs.
'''
images = images.view(-1,28*28)
preds = self.layers(images)
if self.nonlinear:
return self.final_activation(preds, dim=-1)
return preds
def calculate_loss(self, preds, labels):
if self.criterion is None:
raise ValueError("Loss Function not set. Call set_criterion to set a loss function")
return self.criterion(preds, labels)
def learn_weights(self, preds, labels):
'''
Only to be used internally in the class, this function calculates
the loss, gradients and accordingly updates the weights.
Loss is returned for printing purposes.
'''
loss = self.calculate_loss(preds, labels)
loss.backward()
if self.optim is None:
raise ValueError("Optimizer not set. Call set_optim to set an optimizer function")
self.optim.step()
self.optim.zero_grad()
return loss
def train(self,
epochs,
train_loader,
validation_loader=None,
verbose=True):
'''
The main workhorse function that trains the model weights and biases.
'''
for epoch in range(epochs):
for batch_no, (images, labels) in enumerate(train_loader):
preds = self.forward(images)
loss = self.learn_weights(preds, labels)
# gets training accuracy and loss for the whole epoch
train_accuracy = self.get_accuracy(preds, labels).mean()
# already a tensor hence not used _get_mean_
self.training_accuracy.append(train_accuracy)
# append training (last loss) loss
self.training_losses.append(loss)
# if printing is opted for while training.
if verbose:
print(f"epoch no: [{epoch+1}] ===> loss :: {loss:4f} and " \
f"accuracy :: {train_accuracy}")
# executed only if the validation set is passed
if validation_loader:
mean_loss, mean_accuracy = self.check_model_sanity(validation_loader)
print(f"epoch no [{epoch+1}] ======> mean_loss_val = {mean_loss:4f}," \
f" mean_accuracy_val = {mean_accuracy:4f}")
def check_model_sanity(self, data_loader):
'''
Contains the logic for running accuracy and loss on the validation set,
and the test set.
'''
validation_accuracy = []
with torch.no_grad():
# get a list of predictions, labels, losses of the validation set
val_preds = [self.forward(images) for images, _ in data_loader]
val_labels = [ labels for _, labels in data_loader]
val_losses = [self.calculate_loss(pred, labels)
for pred, labels in zip(val_preds, val_labels)]
# mean validation loss
val_mean_loss = self._get_mean_(val_losses)
# used for plotting
self.validation_losses.append(val_mean_loss)
# calculation of validation accuracy
val_accuracy = [self.get_accuracy(pred, label)
for pred, label in zip(val_preds, val_labels)]
# mean validation accuracy
val_mean_accuracy = self._get_mean_(val_accuracy)
# for plotting purposes
self.validation_accuracy.append(val_mean_accuracy)
return val_mean_loss, val_mean_accuracy #returns test/val mean metrics
def predict(self, dataloader_object):
'''
User interface for making predictions on the test set.
'''
mean_loss, mean_accuracy = self.check_model_sanity()
print(f"mean_loss_val = {mean_loss:4f}, mean_accuracy_val = {mean_accuracy:4f}")
def plot_losses(self, train=False):
if not train and not self.validation_accuracy:
return "Validation loss"
if not train:
self._plot(self.validation_losses)
else: self._plot(self.training_losses)
def plot_accuracies(self, train=False):
if not train and not self.validation_accuracy:
return "Validation losses not computed"
if not train:
self._plot(self.validation_accuracy)
else: self._plot(self.training_accuracy)
def _plot(self,x):
plt.plot(x, '-x')
plt.xlabel('epoch')
plt.ylabel('accuracy')
plt.title('Accuracy vs. No. of epochs');
|
input()
l = [*map(int, input().split())]
l.sort()
print(max(l[0]*l[1], l[0]*l[1]*l[-1], l[-1]*l[-2]*l[-3], l[-1]*l[-2]))
|
'''
MIT License
Copyright (c) 2020 Jimeno Fonseca
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.
'''
MODEL_NAME = "HBLM-USA 1.0"
samples = 100
response_variable = "LOG_SITE_ENERGY_kWh_yr"
predictor_variables = ["LOG_THERMAL_ENERGY_kWh_yr", "CLUSTER_LOG_SITE_EUI_kWh_m2yr"]
random_state = 170
n_clusters = 5
storey_height_m = 3
air_density_kgm3 = 1.202
hours_of_day = 24
COP_cooling = 3.3
COP_heating = 3.0
RH_base_cooling_perc = 60
RH_base_heating_perc = 30
T_base_cooling_C = 18.5
T_base_heating_C = 18.5
ACH_Commercial = 6.0
ACH_Residential = 4.0
ZONE_NAMES = {"Hot-humid": ["1A", "2A", "3A"],
"Hot-dry": ["2B", "3B"],
"Hot-marine": ["3C"],
"Mixed-humid": ["4A"],
"Mixed-dry": ["4B"],
"Mixed-marine": ["4C"],
"Cold-humid": ["5A", "6A"],
"Cold-dry": ["5B", "6B", "7"]}
|
pkgname = "python-pyyaml"
pkgver = "6.0"
pkgrel = 0
build_style = "python_module"
hostmakedepends = ["python-setuptools", "python-cython"]
makedepends = ["libyaml-devel", "python-devel"]
pkgdesc = "YAML parser and emitter for Python"
maintainer = "q66 <q66@chimera-linux.org>"
license = "MIT"
url = "http://pyyaml.org/wiki/PyYAML"
source = f"$(PYPI_SITE)/P/PyYAML/PyYAML-{pkgver}.tar.gz"
sha256 = "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"
def post_install(self):
self.install_license("LICENSE")
|
# -*- coding: utf-8 -*-
class Root(object):
def __init__(self, request):
self.request = request
|
# https://codeforces.com/problemset/problem/510/A
n, m = [int(x) for x in input().split()]
counter = 0
for row in range(1, n + 1):
if row % 2 == 1:
print(m * '#')
else:
counter += 1
if counter % 2 == 1:
print((m - 1) * '.' + '#')
else:
print('#' + (m - 1) * '.')
|
def calc_bmi(x,y):
ans = y/(x*x)
return ans
x = 2
y = 80
if ans < 18:
print("痩せ気味")
elif 18 <= ans < 25:
print("普通")
elif ans >= 25:
print("太り気味")
|
roll = [1, 2, 3]
names = ['Ayush', 'Joe', 'Rob']
pair = zip(roll, names)
print(dict(pair))
bob2 = dict(zip(['names', 'job', 'age'], ['Bob', 'dev', 40]))
print(bob2)
# Nested dictionaties
record = {
'emp1' :
{ 'name' : {'first' : 'Ayush', 'last' : 'Dutta' },
'job' : 'Software Dev',
'age' : 17
}
}
dict1 = record['emp1']['name']
print(dict1)
full_name = " ".join([dict1[i] for i in dict1]) # Print the Full Name
print(full_name)
|
# areas list
areas = [11.25, 18.0, 20.0, 10.75, 9.50]
# Code the for loop
for areas in areas :
print(areas)
# areas list
areas = [11.25, 18.0, 20.0, 10.75, 9.50]
# Change for loop to use enumerate() and update print()
for index, area in enumerate(areas) :
print("room " + str(index) + ": " + str(area))
# areas list
areas = [11.25, 18.0, 20.0, 10.75, 9.50]
# Code the for loop
for index, area in enumerate(areas) :
print("room " + str(index+1) + ": " + str(area))
# house list of lists
house = [["hallway", 11.25],
["kitchen", 18.0],
["living room", 20.0],
["bedroom", 10.75],
["bathroom", 9.50]]
# Build a for loop from scratch
for room in house :
print("the " + room[0] + " is " + str(room[1]) + " sqm")
|
class Node:
def __init__(self,initdata):
self.data = initdata
self.next = None
def getData(self):
return self.data
def getNext(self):
return self.next
def setData(self,newdata):
self.data = newdata
def setNext(self,newnext):
self.next = newnext
class OrderedList:
def __init__(self):
self.head = None
def search(self,item):
current = self.head
found = False
stop = False
while current != None and not found and not stop:
if current.getData() == item:
found = True
else:
if current.getData() > item:
stop = True
else:
current = current.getNext()
return found
def add(self,item):
current = self.head
previous = None
stop = False
while current != None and not stop:
if current.getData() > item:
stop = True
else:
previous = current
current = current.getNext()
temp = Node(item)
if previous == None:
temp.setNext(self.head)
self.head = temp
else:
temp.setNext(current)
previous.setNext(temp)
def isEmpty(self):
return self.head == None
def length(self):
current = self.head
count = 0
while current != None:
count = count + 1
current = current.getNext()
return count
def traverse(self):
current = self.head
while current != None:
print(current.getData())
current = current.getNext()
mylist = OrderedList()
mylist.add(31)
mylist.add(77)
mylist.add(17)
mylist.add(93)
mylist.add(26)
mylist.add(54)
print(mylist.length())
print(mylist.search(93))
print(mylist.search(100))
mylist.traverse()
|
# Arithmetic
# +, -, *, /, %, all work with numbers and variables holding numbers
# +=, -=, *=, /=, i.e x += 1 is the same as x = x + 1
x = 1 + 1 # assign 1 + 1 to x
y = 0
y += x # add x to y
|
def best_stock(data):
max = 0 # max price
best = '' # best stock
for s in data:
if data[s] > max:
max = data[s]
best = s
return best
if __name__ == '__main__':
print("Example:")
print(best_stock({
'CAC': 10.0,
'ATX': 390.2,
'WIG': 1.2
}))
# These "asserts" are used for self-checking and not for an auto-testing
assert best_stock({
'CAC': 10.0,
'ATX': 390.2,
'WIG': 1.2
}) == 'ATX', "First"
assert best_stock({
'CAC': 91.1,
'ATX': 1.01,
'TASI': 120.9
}) == 'TASI', "Second"
print("Coding complete? Click 'Check' to earn cool rewards!")
|
#字符串
#字符串的驻留机制
a='hello'
b="hello"
c='''hello'''
print(a,id(a))
print(b,id(b))
print(c,id(c))#地址相同
#驻留,字符串只在编译时进行驻留,而非运行时
a="abc"
b="ab"+"c"
c="".join(["ab","c"])
print(a is b)
print(a is c)#is可以判断是否相等,严格相等id和值
print(id(a))
print(id(b))
print(id(c))#c的id与ab并不相同
#字符串的常用操作
s="hello,hello"
#正向索引
print(s.index("lo"))
print(s.find("lo"))#find优先用,元素找不到的时候不会抛出异常会返回-1
#以上查看lo出现的第一个位置
print(s.rindex("lo"))
print(s.rfind("lo"))#rfind优先用,元素找不到的时候不会抛出异常会返回-1
#以上查看lo出现的最后一个位置
#字符串的大小转化
s1="hello,python"
s2=s1.upper()#转成大写后,会产生一个新的对象
s3=s1.lower()#同样会产生一个新的对象
print(s1,id(s1))
print(s2,id(s2))
print(s3,id(s3))
print(s1==s3)#值相等
print(s1 is s3)#值和id均相等
s4="heLLO,world"
s5=s4.swapcase()
print(s5)#将字母大小写转化
s6=s4.title()
print(s6)#将每个单词的首字母大写
#字符串内容对齐
s1="hello,Python"
print(s1.center(20,"*"))#20指的是一共20个字,用center居中对齐,剩下的用*补充,如果不写就用 空格补充
print(s1.ljust(20,"*"))#左对齐
print(s1.rjust(20,"*"))#右对齐
print(s1.zfill(20))#右对齐,只指定长度,剩下的用0补充
print("-8910".zfill(8))#0加在了-右边
#字符串的劈分操作
s1="hello world python"
#split默认是从左开始分割
s2=s1.split()#默认以空格为分割
print(s2)
s3="hello|world|python"
print(s3.split(sep="|"))#指定劈分的字符串
print(s3.split(sep="|",maxsplit=1))#最大分1段
#rsplit()从右开始分割
print(s1.rsplit())
print(s3.rsplit("|"))#这里不需要写sep=
print(s3.rsplit(sep="|",maxsplit=1))
#
s="hello ,python"
print("1",s.isidentifier())#判断s是不是合法的标识符(只包含字母数字下划线 )
print("2","heloo".isidentifier())
print("3","zhangsan_".isidentifier())
print("4","zhangsan_21".isidentifier())
print("5","\t".isspace())#是否全部由空白字符组成
print("6","abc".isalpha())#是否全部由字母组成
print("7","张三".isalpha())#单纯文字也算字母
print("8","张三1".isalpha())#1不是字符
print("9","123".isdecimal())#判断是否全部由十进制(阿拉伯)数字组成
print("10","123四".isdecimal())#四不是
print("11","123".isnumeric())#判断是否全部由数字组成
print("12","123四".isnumeric())#这里四就是数字,也包含I,II,
print("13","123abc".isalnum())#是否全部由字母和数字组成
print("14","123".isalnum())#范围会大
print("15","123abc!".isalnum())#有叹号就返回false
#字符串的替换replace()
s="hello,python"
print(s.replace("python","java"))#用逗号后面的取代逗号前面的
s1="hello,python,python,python"
print(s1.replace("python","java",2))#换两次,2:最大替换次数
#字符串的合并join()
#列表的合并
lst=["hello","java","python"]
print(",".join(lst))#使用,逗号连接
#元组的合并
s=("hello","world","java")
print(",".join(s))
print("*".join("hello"))
#字符串的比较操作
print("apple" > "app")
print("apple" > "banana")#比较的是从一开始就比较如果向灯,则下一个直到不同,然后比较原始值
print(ord("a"),ord("b"))#这里明显看到a的原始值是97,b的原始值是98,所以b大于a
print(chr(97),chr(98))#这里输出的是97,98对应的字母
'''==与is的区别
==比较的是value
is比较的是id是否相等
'''
a=b="hello"
c="hello"
print(a==b)
print(a is b)
print(a==c)
print(a is c)
#字符串的的切片操作
s="hello,python"
s1=s[:5]#由于没有起始位置所以从0开始
s2=s[6:]#由于没有终止位置所以到结束截至
s3="!"
s4=s1+s3+s2
print(s4)#他们每一个新的字符串的id均不同
"""完整的写法"""
print(s[0:5:1])#相当于s[:5]。1:步长
print(s[::-1])#可以是负数相当于倒着切,默认从字符串结尾开始,开始结束
print(s[-6::1])
#格式化字符串:按照一定格式输出的字符串,相当于一个模板,填充部分
#第一种方式,使用%进行占位
name="张三"
age=20
print("我叫%s,今年%d岁" %(name,age))
#第二种方法:
print("我叫{0},今年{1}岁".format(name,age))#0的是name,1的是age
#第三种方法
print(f"我叫{name},今年{age}岁")#前面要加上f
#表示精度和宽度
print("%10d"% 99)#10指的是宽度
print("%.2f"%3.1415926)#保留两位小数
#同时表示宽度和精度
print("%10.3f"%3.1415926)#总宽度为10,表六小数点后3位
print("{0}".format(3.1415926))#0索引,0可以不写
print("{0:.3}".format(3.1415926))#.3表示一共是三位数
print("{0:.3f}".format(3.1415926))#.3f表示小数点后三位数
print("{0:10.3f}".format(3.1415926))#宽度为10,小数点后两位
#字符串的编码转化
#编码过程
s="天涯共此时"
print(s.encode(encoding="GBK"))#在GBK这种编码中一个中文占两个字节
print(s.encode(encoding="UTF-8"))#在UTF这种编码中一个中文占三个字节
#解码操作
byte=s.encode(encoding="GBK")
print(byte.decode(encoding="GBK"))#byte代表就是一个二进制数据(字节类型的数据)
byte=s.encode(encoding="UTF-8")
print(byte.decode(encoding="UTF-8"))
|
# This file is automatically generated during the release process
# Do not edit manually
"""Version module for github_actions_test."""
__version__ = "0.2.0"
|
# Adicionando listas dentro de listas
dados = []
dados.append('pedro')
dados.append('35')
pessoas = []
pessoas.append(dados[:]) #Observe a estrutura "[:]" , está gera uma cópia exata da lista, a ser adicionada.
#Exemplo de lista dentro de lista
pessoas = [['pedro',25],['maria',19],['joao',32]]
# Selecioando item dentro de uma lista dentro de otra lista:
''' print(pessoas[0][0]) => pedro
print(pessoas[1][1]) => 19
print(pessoas[2][0]) => joao
print(pessoas[1]) => ['maria',19] '''
#Deste modo o primeiro colchetes selecionará o item na lista principal, e o segundo selecionara
# o da lista secundária, caso nao haja o segundo , ira trazer o conteudo total da sublista.
|
"""
Write a program to compute the frequency of the words from the input. The output should output after sorting the key alphanumerically.
"""
"""Question 22
Level 3
Question:
Write a program to compute the frequency of the words from the input. The output should output after sorting the key alphanumerically.
Suppose the following input is supplied to the program:
New to Python or choosing between Python 2 and Python 3? Read Python 2 or Python 3.
Then, the output should be:
2:2
3.:1
3?:1
New:1
Python:5
Read:1
and:1
between:1
choosing:1
or:2
to:1
Hints
In case of input data being supplied to the question, it should be assumed to be a console input.
"""
|
class HTTPError(Exception):
def __init__(self, status_code, message=""):
"""
Raise this exception to return an http response indicating an error.
This is a boilerplate exception that was originally from Crane project.
:param status_code: HTTP status code. It's a good idea to get this straight
from httplib, such as httplib.NOT_FOUND
:type status_code: int
:param message: optional error message to be put in the response
body. If not supplied, the default message for the
status code will be used.
"""
super(HTTPError, self).__init__()
self.message = message
self.status_code = status_code
class ItemNotReturned(Exception):
def __init__(self, message):
"""
Raise this exception if an item was not returned by inventory service
"""
super(ItemNotReturned, self).__init__()
self.message = message
class ServiceError(Exception):
def __init__(self, message):
"""
Raise this exception if the inventory service is not reachable or does
not provide a valid response
"""
super(ServiceError, self).__init__()
self.message = message
class RBACDenied(Exception):
def __init__(self, message):
"""
Raise this exception if the inventory service reports that you do not
have rbac permission to access the service
"""
super(RBACDenied, self).__init__()
self.message = message
class UnparsableNEVRAError(RuntimeError):
def __init__(self, message):
"""
Raise this exception if we cannot parse a nevra
"""
super(RuntimeError, self).__init__()
self.message = message
|
# https://leetcode.com/problems/sort-characters-by-frequency/
class Solution:
def frequencySort(self, s: str) -> str:
char_frequencies = dict()
for char in s:
char_frequencies[char] = char_frequencies.get(char, 0) + 1
char_frequencies = list(char_frequencies.items())
char_frequencies.sort(reverse=True, key=lambda x: x[1])
return ''.join([char * freq for char, freq in char_frequencies])
|
def solution(nums):
n = len(nums)
dp = [1]*n
for i in range(n):
if i == 0:
dp[0] = nums[0]
else:
dp[i] = max(dp[i-1]*nums[i], nums[i])
return max(dp)
def main():
n = int(input())
nums = []
for _ in range(n):
nums.append(float(input()))
nums = tuple(nums)
print("%.3f" % (solution(nums)))
if __name__ == '__main__':
main()
|
n1 = int(input('Digite o preço do primeiro produto: '))
n2 = int(input('Digite o preço do segundo número: '))
desconto1= ((n1 * 8) / 100) - n1
desconto2= ((n2 * 11) / 100) - n2
total = (desconto1 + desconto2) *-1
print ('Com o desconto no primeiro produto de 8% e de 11% no segundo produt, o total vai ser de {}'.format (total))
|
#
# PySNMP MIB module Q-IN-Q-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/Q-IN-Q-MIB
# Produced by pysmi-0.3.4 at Wed May 1 14:43:18 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15)
#
OctetString, Integer, ObjectIdentifier = mibBuilder.importSymbols("ASN1", "OctetString", "Integer", "ObjectIdentifier")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, SingleValueConstraint, ValueSizeConstraint, ValueRangeConstraint, ConstraintsIntersection = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "SingleValueConstraint", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsIntersection")
dlink_common_mgmt, = mibBuilder.importSymbols("DLINK-ID-REC-MIB", "dlink-common-mgmt")
NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "NotificationGroup", "ModuleCompliance")
NotificationType, Counter64, TimeTicks, ModuleIdentity, Bits, Counter32, Gauge32, IpAddress, Unsigned32, iso, MibScalar, MibTable, MibTableRow, MibTableColumn, Integer32, ObjectIdentity, MibIdentifier = mibBuilder.importSymbols("SNMPv2-SMI", "NotificationType", "Counter64", "TimeTicks", "ModuleIdentity", "Bits", "Counter32", "Gauge32", "IpAddress", "Unsigned32", "iso", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Integer32", "ObjectIdentity", "MibIdentifier")
MacAddress, DisplayString, RowStatus, TextualConvention = mibBuilder.importSymbols("SNMPv2-TC", "MacAddress", "DisplayString", "RowStatus", "TextualConvention")
swQinQMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 171, 12, 57))
if mibBuilder.loadTexts: swQinQMIB.setLastUpdated('0804080000Z')
if mibBuilder.loadTexts: swQinQMIB.setOrganization('D-Link Corp.')
if mibBuilder.loadTexts: swQinQMIB.setContactInfo('http://support.dlink.com')
if mibBuilder.loadTexts: swQinQMIB.setDescription('The structure of Q-in-Q information for the proprietary enterprise.')
class VlanId(Integer32):
subtypeSpec = Integer32.subtypeSpec + ValueRangeConstraint(1, 4094)
swQinQCtrl = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 57, 1))
swQinQInfo = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 57, 2))
swQinQPortMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 57, 3))
swQinQMgmt = MibIdentifier((1, 3, 6, 1, 4, 1, 171, 12, 57, 4))
swQinQState = MibScalar((1, 3, 6, 1, 4, 1, 171, 12, 57, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("enabled", 1), ("disabled", 2))).clone('disabled')).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swQinQState.setStatus('current')
if mibBuilder.loadTexts: swQinQState.setDescription('This object is used to enable/disable the Q-in-Q status.')
swQinQPortTable = MibTable((1, 3, 6, 1, 4, 1, 171, 12, 57, 3, 1), )
if mibBuilder.loadTexts: swQinQPortTable.setStatus('current')
if mibBuilder.loadTexts: swQinQPortTable.setDescription('A table that contains Q-in-Q VLAN mode information about each port.')
swQinQPortEntry = MibTableRow((1, 3, 6, 1, 4, 1, 171, 12, 57, 3, 1, 1), ).setIndexNames((0, "Q-IN-Q-MIB", "swQinQPortIndex"))
if mibBuilder.loadTexts: swQinQPortEntry.setStatus('current')
if mibBuilder.loadTexts: swQinQPortEntry.setDescription('A list of Q-in-Q VLAN mode information for each port.')
swQinQPortIndex = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 57, 3, 1, 1, 1), Integer32().subtype(subtypeSpec=ValueRangeConstraint(1, 65535))).setMaxAccess("readonly")
if mibBuilder.loadTexts: swQinQPortIndex.setStatus('current')
if mibBuilder.loadTexts: swQinQPortIndex.setDescription("This object indicates the module's port number.")
swQinQPortRole = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 57, 3, 1, 1, 2), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("nni", 1), ("uni", 2)))).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swQinQPortRole.setStatus('current')
if mibBuilder.loadTexts: swQinQPortRole.setDescription('This object sets the port role in Q-in-Q mode. It can be UNI port or NNI port.')
swQinQPortTpid = MibTableColumn((1, 3, 6, 1, 4, 1, 171, 12, 57, 3, 1, 1, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(2, 2)).setFixedLength(2)).setMaxAccess("readwrite")
if mibBuilder.loadTexts: swQinQPortTpid.setStatus('current')
if mibBuilder.loadTexts: swQinQPortTpid.setDescription('Specifies the outer TPID for each port.')
mibBuilder.exportSymbols("Q-IN-Q-MIB", swQinQMIB=swQinQMIB, swQinQPortTable=swQinQPortTable, swQinQInfo=swQinQInfo, swQinQState=swQinQState, swQinQPortTpid=swQinQPortTpid, swQinQPortEntry=swQinQPortEntry, swQinQCtrl=swQinQCtrl, swQinQMgmt=swQinQMgmt, swQinQPortIndex=swQinQPortIndex, swQinQPortRole=swQinQPortRole, VlanId=VlanId, PYSNMP_MODULE_ID=swQinQMIB, swQinQPortMgmt=swQinQPortMgmt)
|
def handler(connection, event):
if event.arguments and event.arguments[0].startswith("!r"):
connection.privmsg(event.target, "\x02\x034 Rule one: \x035 No Banninating!")
connection.privmsg(event.target, "\x02\x034 Rule two: \x035 See rule one")
connection.privmsg(
event.target,
"\x02\x034 Rule three: \x035 It's against the rules to enforce em"
)
def get_handlers():
return (("pubmsg", handler),)
|
previous_scores = [0] * 301
def solve(num_stairs, points):
if num_stairs < 3:
print(previous_scores[num_stairs])
return
else:
return points[num_stairs - 1] + solve(num_stairs - 1)
if __name__ == '__main__':
num_stairs = int(input())
points = [int(input()) for _ in range(num_stairs)]
previous_scores[1] = points[0]
if num_stairs > 1:
previous_scores[2] = points[0] + points[1]
print()
print(points)
solve(num_stairs, points)
|
# AUTOGENERATED! DO NOT EDIT! File to edit: 21_multi_attributes.ipynb (unless otherwise specified).
__all__ = ['are_recurrent', 'get_summary_statistic', 'get_routine_scores', 'get_synchrony', 'get_sequence_frequencies']
# Cell
def are_recurrent(sequences):
"Returns true if any of the sequences in a given collection are recurrant, false otherwise."
for sequence in sequences:
if pysan_core.is_recurrent(sequence):
return True
return False
# Cell
def get_summary_statistic(sequence, function):
"Computes a summary statistic (e.g. entropy, complexity, or turbulence) for each sequence in a collection, returning the results as a list."
pass
# Cell
def get_routine_scores(sequences, duration):
"Returns a list containing the routine scores for each sequence in a collection using :meth:`get_routine() <pysan.core.get_routine>`."
pass
# Cell
def get_synchrony(sequences):
"Computes the normalised synchrony between a two or more sequences. Synchrony here refers to positions with identical elements, e.g. two identical sequences have a synchrony of 1, two completely different sequences have a synchrony of 0. The value is normalised by dividing by the number of positions compared. This computation is defined in Cornwell's 2015 book on social sequence analysis, page 230."
shortest_sequence = min([len(s) for s in sequences])
same_elements = []
for position in range(shortest_sequence):
elements_at_this_position = []
for sequence in sequences:
elements_at_this_position.append(sequence[position])
same_elements.append(elements_at_this_position.count(elements_at_this_position[0]) == len(elements_at_this_position))
return same_elements.count(True) / shortest_sequence
# Cell
def get_sequence_frequencies(sequences):
"Computes the frequencies of different sequences in a collection, returning a dictionary of their string representations and counts."
# converting to strings makes comparison easy
sequences_as_strings = [str(s) for s in sequences]
sequence_frequencies = {}
for sequence in set(sequences_as_strings):
sequence_frequencies[sequence] = sequences_as_strings.count(sequence)
sequence_frequencies = {k: v for k, v in sorted(sequence_frequencies.items(), key=lambda item: item[1], reverse=True)}
return sequence_frequencies
|
""" Various utility methods for `taskweb` """
def parse_undo(data):
""" Return a list of dictionaries representing the passed in
`taskwarrior` undo data.
"""
undo_list = []
for segment in data.split('---'):
parsed = {}
undo = [line for line in segment.splitlines() if line.strip()]
if not undo:
continue
parsed['time'] = undo[0].split(' ', 1)[1]
if undo[1].startswith('old'):
parsed['old'] = undo[1].split(' ', 1)[1] + "\n"
parsed['new'] = undo[2].split(' ', 1)[1] + "\n"
else:
parsed['new'] = undo[1].split(' ', 1)[1] + "\n"
undo_list.append(parsed)
return undo_list
|
class Paginator:
"""Class hold Pagination for sqlalchemy query"""
def __init__(self, sqlalchemy_query, offset, limit):
"""
:param sqlalchemy_query: sqlalchemy query
:param offset: int offset of query
:param limit: int limit of query
"""
self.offset = offset if offset else 0
self.limit = limit if limit else 10
self.total = sqlalchemy_query.count()
self.result = sqlalchemy_query.limit(self.limit).offset(self.offset)
|
class Speed:
def __init__(self):
self._cache = {}
def get_value(self, entity):
value = 0
if entity in self._cache:
value = self._cache[entity]
return value
def update(self, entity, value):
self._cache[entity] = value
# speed.py
|
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def inorderTraversal(self, root: TreeNode) -> List[int]:
# Recursion ([left, mid, right])
'''
if root is None:
return []
return self.inorderTraversal(root.left) + [root.val] + self.inorderTraversal(root.right)
'''
# Stack ([left, mid, right])
if root is None:
return []
result = []
stack = []
curr = root
while stack or curr:
while curr:
stack.append(curr)
curr = curr.left
node = stack.pop() # must set a new pointer
result.append(node.val)
if node.right:
curr = node.right
return result
|
def main():
for x in range(4):
if x == 5:
break
else:
print("Well of course that didn't happen")
for x in range(7):
if x == 5:
break
else:
print("H-hey wait!")
if __name__ == '__main__':
main()
|
lista = []
while True:
lista.append(int(input('Digite um valor:')))
cont = str(input('Quer continuar? S/N ')).upper()
if cont == 'N':
break
print(f'Você digitou {len(lista)} elementos')
lista.sort(reverse=True)
print(f'Os valores em ordem decrescentesão {lista}')
if 5 in lista:
print('O valor 5 faz parte da lista')
else:
print('O valor 5 não foi adicionado na lista')
print(sorted(lista))
|
class Sourcefile(Dashboard.Module):
"""Show the program source code, if available."""
def __init__(self):
self.file_name = None
def label(self):
return 'Sourcefile'
def lines(self, term_width, style_changed):
if self.output_path is None:
return []
# skip if the current thread is not stopped
if not gdb.selected_thread().is_stopped():
return []
# try to fetch the current line (skip if no line information)
frame = gdb.selected_frame()
if not frame.is_valid():
return []
sal = frame.find_sal()
current_line = sal.line
if current_line == 0:
if os.path.islink(self.output_path):
os.unlink(self.output_path)
if os.path.exists(self.output_path):
os.remove(self.output_path)
os.symlink(self.output_path + '.none', self.output_path)
with open(self.output_path + '.data', 'w') as file:
file.write("1\n")
return []
# reload the source file if changed
file_name = sal.symtab.fullname()
bps = filter(lambda x: x.is_valid(), gdb.breakpoints())
bps = map(lambda x: gdb.decode_line(x.location)[1], list(bps)[1:])
bps = [x for y in bps for x in y if x.is_valid()]
bps = ["%d" % x.line for x in bps if x.symtab.fullname() == file_name]
if not os.path.exists(self.output_path + '.none'):
with open(self.output_path + '.none', 'w') as file:
file.write("/* Source file unavailable... */")
with open(self.output_path + '.data', 'w') as file:
if len(bps) > 0:
file.write("%d\n" % current_line + '\n'.join(bps))
else:
file.write("%d\n" % current_line)
if (file_name != self.file_name):
self.file_name = file_name
if os.path.islink(self.output_path):
os.unlink(self.output_path)
if os.path.exists(self.output_path):
os.remove(self.output_path)
if os.path.exists(file_name):
os.symlink(self.file_name, self.output_path)
else:
os.symlink(self.output_path + '.none', self.output_path)
return []
def attributes(self):
return {
'output_path': {
'doc': 'Path for setting source file link.',
'default': None,
'type': str,
},
}
|
'''
@author: Sergio Rojas
@contact: rr.sergio@gmail.com
--------------------------
Contenido bajo
Atribución-NoComercial-CompartirIgual 3.0 Venezuela (CC BY-NC-SA 3.0 VE)
http://creativecommons.org/licenses/by-nc-sa/3.0/ve/
Creado en abril 21, 2016
'''
def f(x):
if (type(x)==int or type(x)==float or type(x)==complex):
res = x*x
else:
res = x
return res
a = [1, 2.4, 1 + 1j, 'abgdfr', 4]
print(f(a[0]))
print(f(a[1]))
print(f(a[2]))
print(f(a[3]))
print(f(a[4]))
b = map(f, a)
print(b)
print(type(a))
print(type(b))
try:
print(map(f,203))
except TypeError:
print("TypeError: argument 2 to map() must support iteration")
print("Ejecutar el siguiente comando en la consola Ipython")
print("\t map(f,203)")
print(map(f,'ab34gh'))
print(len(a))
print(a[-1])
print(a[len(a)-1])
|
FILENAMES = ("adjectives.txt", "adverbs.txt", "alliterations.txt",
"compoundwords.txt", "conjunctions.txt",# "duos.txt",
"interjections.txt", "nouns.txt", "occupations.txt",
"pronouns.txt", "verbs.txt")
def _extract_words_from_raw_data(filenames=FILENAMES):
""" usage: _extract_words_from_raw_data(filenames=FILENAMES) => None
Parse the raw files and extract suitable entries.
Hard coded to work with the files present in ./raw/
- Have to roll your own if you want to parse other raw sources. """
wordlist = []
for filename in filenames:
with open("./raw/" + filename, "r") as _file:
data = _file.read()
data = data.replace("<div class=wordlist-item>", '')
data = data.replace("</div>", '\n').split('\n')
# remove non-words, empty lines, duplicates
# only take the first word from entries with spaces
# WARNING:
# failing to remove/truncate the entries with spaces could result in
# easily guessable pass phrases when used with the shortcut solution.
# e.g. `H(shortcut).update(last_n_words)`
# if the last few entries are all multi-word entries, then the
# last_n_words is less than n entries worth of information
data = [word.split(' ')[0] for word in data if
("<div" not in word) and word.strip()]
wordlist.extend(set(data))
data = '\n'.join(wordlist)
with open("wordlist.txt", 'w') as _file:
_file.truncate(0)
_file.write(data)
_file.flush()
if __name__ == "__main__":
_extract_words_from_raw_data()
|
# Section 5.3 snippets
# Creating Tuples
student_tuple = ()
student_tuple
len(student_tuple)
student_tuple = 'John', 'Green', 3.3
student_tuple
len(student_tuple)
another_student_tuple = ('Mary', 'Red', 3.3)
another_student_tuple
a_singleton_tuple = ('red',) # note the comma
a_singleton_tuple
# Accessing Tuple Elements
time_tuple = (9, 16, 1)
time_tuple
time_tuple[0] * 3600 + time_tuple[1] * 60 + time_tuple[2]
# Adding Items to a String or Tuple
tuple1 = (10, 20, 30)
tuple2 = tuple1
tuple2
tuple1 += (40, 50)
tuple1
tuple2
# Appending Tuples to Lists
numbers = [1, 2, 3, 4, 5]
numbers += (6, 7)
numbers
# Tuples May Contain Mutable Objects
student_tuple = ('Amanda', 'Blue', [98, 75, 87])
student_tuple[2][1] = 85
student_tuple
##########################################################################
# (C) Copyright 2019 by Deitel & Associates, Inc. and #
# Pearson Education, Inc. All Rights Reserved. #
# #
# DISCLAIMER: The authors and publisher of this book have used their #
# best efforts in preparing the book. These efforts include the #
# development, research, and testing of the theories and programs #
# to determine their effectiveness. The authors and publisher make #
# no warranty of any kind, expressed or implied, with regard to these #
# programs or to the documentation contained in these books. The authors #
# and publisher shall not be liable in any event for incidental or #
# consequential damages in connection with, or arising out of, the #
# furnishing, performance, or use of these programs. #
##########################################################################
|
nome = input("Digite o nome do vendedor: ")
salario = float(input("Digite o salário fixo: "))
vendas = float(input("Digite o total de vendas:"))
comissao = salario * (15/100)
salario_final = salario + comissao
print(nome, " o seu salário fixo é de R$", salario, "e seu salário com a comissão é de R$" , salario_final)
|
#Ejercicio 4
'''
Complejidad temporal/algorítmica: O(n^2)
'''
def find_needle(needle, haystack):
#Esta función recorrerá cada caracter del haystack para compararlo con el needle, 1er caracter
#Si hay equivalencia, se entra al 2do for para comparar con los caracteres de needle
if(len(needle) <= len(haystack)):
#Verifica que el needle sea del mismo tamaño o menor que el haystack
for i in range(len(haystack)):
if haystack[i] == needle[0]:
for j in range(len(needle)):
if haystack[j+i] == needle[j]:
#print("Caracter igual\n")
if(j == len(needle)-1):
return True
else:
#print("Caracter diferente\n")
break
continue
return False
return False
'''
Caso prueba
'''
print(find_needle("fgh", "abcdefgh"))
|
# Plugin author
__author__ = 'John Maguire'
# Plugin homepage
__url__ = 'https://github.com/JohnMaguire2013/Cardinal/'
|
x = False
y = True
# a. Write an expression that produces True iff both variables are True.
print((x and not y) or (y and not x))
# b. Write an expression that produces True iff x is False.
print(not x)
# c. Write an expression that produces True iff at least one of the variables is True.
print(x or y)
|
"""Group Model"""
class CBWGroup:
"""Group Model"""
def __init__(self,
id="", # pylint: disable=redefined-builtin
color="",
name="",
description="",
**kwargs): # pylint: disable=unused-argument
self.id = id # pylint: disable=invalid-name
self.color = color
self.name = name
self.description = description
|
class Tokenizer(object):
"""The root class for tokenizers.
Args:
return_set (boolean): A flag to indicate whether to return a set of
tokens instead of a bag of tokens (defaults to False).
Attributes:
return_set (boolean): An attribute to store the flag return_set.
"""
def __init__(self, return_set=False):
self.return_set = return_set
def get_return_set(self):
"""Gets the value of the return_set flag.
Returns:
The boolean value of the return_set flag.
"""
return self.return_set
def set_return_set(self, return_set):
"""Sets the value of the return_set flag.
Args:
return_set (boolean): a flag to indicate whether to return a set of tokens instead of a bag of tokens.
"""
self.return_set = return_set
return True
|
n,m,a,x,r = [int(i) for i in input().split()]
s = input()
for i in range(m):
t = input()
for i in range(a):
p = input()
if(n<10**6 and r<=x):
print(1)
print(3,1,10**6-n)
else:
print(0)
|
def get_pk_type(schema, pk_field) -> type:
try:
return schema.__fields__[pk_field].type_
except KeyError:
return int
|
load("@bazel_skylib//lib:paths.bzl", "paths")
load("//:def.bzl", "project")
def _start_drone_runner_impl(ctx):
template_name = paths.basename(ctx.file._script_template.short_path)
script = ctx.actions.declare_file("rendered_{}".format(template_name))
ctx.actions.expand_template(
template = ctx.file._script_template,
output = script,
substitutions = {
"{network_name}": ctx.attr._network_name,
"{rpc_host}": ctx.attr._rpc_host,
"{rpc_proto}": ctx.attr._rpc_proto,
"{runner_capacity}": ctx.attr._runner_capacity,
"{runner_image_version}": ctx.attr._runner_image_version,
"{runner_image_sha256}": ctx.attr._runner_image_sha256,
},
is_executable = True,
)
return [DefaultInfo(executable = script)]
start_drone_runner = rule(
implementation = _start_drone_runner_impl,
attrs = {
"_network_name": attr.string(
default = project.drone.runner.network.name,
),
"_rpc_host": attr.string(
default = project.drone.runner.rpc.host,
),
"_rpc_proto": attr.string(
default = project.drone.runner.rpc.proto,
),
"_runner_capacity": attr.string(
default = str(project.drone.runner.capacity),
),
"_runner_image_version": attr.string(
default = str(project.drone.runner.image.version),
),
"_runner_image_sha256": attr.string(
default = project.drone.runner.image.sha256,
),
"_script_template": attr.label(
allow_single_file = True,
default = "//.drone/deploy/runner:start.sh",
),
},
executable = True,
)
|
table = {'1985': 'Test movie' , '1983': 'Test Movie2' , '2000': 'Test Movie 3'}
year = '1983'
movie = table[year]
print(movie)
for year in table:
print(year + '\t' + movie + '\t')
|
km = float(input('Quantos Km foram percorridos? '))
dias = int(input('Quantos dias alugados? '))
print('O valor a pagar pelo aluguel de {} dias e {} Km percorridos é R${:0.2f}'.format(dias, km, (60*dias)+(0.15*km)))
|
"""
Test `rlmusician.utils` package.
Author: Nikolay Lysenko
"""
|
class Router:
def __init__(
self,
databricks_url: str,
routes: dict,
):
self.__databricks_url = databricks_url
self.__routes = routes
def generate_url(self, route_name: str, **kwargs):
if route_name not in self.__routes:
raise Exception(f"Route not defined: {route_name}")
databricks_url = self.__databricks_url if self.__databricks_url[-1] != "/" else self.__databricks_url[:-1]
return databricks_url + self.__routes[route_name].format(**kwargs)
|
exception_messages = {
"InvalidSelectionStrategy": lambda selection_strategy, allowed_selection_strategies: f"{selection_strategy} is not a valid selection strategy. "
f"Available options are {', '.join(allowed_selection_strategies)}.",
"InvalidPopulationSize": "The population size must be larger than 2",
"InvalidExcludedGenes": lambda excluded_genes: f"{excluded_genes} is not a valid input for excluded_genes",
"StartingPopulationNotAList": "starting_population must be a list even if it only contains one element",
"ConflictedRandomStoned": "starting_random is not compatible with starting_stoned",
"ConflictedStonedStarting": "there must be exactly one item in starting_selfies for starting_stoned to work",
"AlphabetIsEmpty": "at least one element is required in the alphabet for mutation and randomization purposes",
"AlphabetDimensions": "the input alphabet seems to be a nested list, from which an alphabet list for each gene is expected",
"EquivalenceDimensions": "the input equivalences define more subgroups than genes per chromosome, which is wrong",
"MultiDictExcluded": "multiple dictionaries and excluded genes are not compatible. Set up one element dictionaries for exclusion",
"TooManyCrossoverPoints": "n_crossover_points must be smaller than n_genes",
"TooFewCrossoverPoints": "n_crossover_points must be at least 1 for the genetic algorithm to work",
}
|
x = 25
epsilon = 0.01
numGuesses = 0
low = 1.0
high = x
guess = (high + low ) / 2.0
while abs(guess**2 - x) >= epsilon:
print ('low = ' + str(low) + 'high =' + str(high) + 'Guess = ' + str(guess))
numGuesses += 1
if guess**2 < x:
low = guess
else:
high = guess
guess = (high + low) / 2.0
print ('numGuesses = ' + str(numGuesses))
print (str(ans) + ' is close to the square root of ' + str(x))
|
# programme to input student details and view them
# this is a modification of students.py but using a dict for choices/options
# helen o'shea
# 20210218
# function to show the menu - same as students.py
def show_menu():
print("What would you like to do? \n\
\t(a) Add new student\n\
\t(v) View students\n\
\t(q) Quit")
option = input("Type one letter (a/v/q): ").strip() # takes input from user
return option
# function to add student first name last name and modules - same as students.py
def do_add(students):
myStudent = {} # initalise the dict
myStudent['firstname'] = input("Enter your first name: ").strip()
myStudent['lastname'] = input("Enter your last name: ").strip()
myStudent['modules'] = read_modules() # modules are entered via another function and called here
students.append(myStudent) # add dict entries to the student list
#print(type(students))
return students
# function to add courses and grades - same as students.py
def read_modules():
myCourses = {'course':[], 'grade':[]} # initalise dict with empty list for values for courses and grades
course = input("Enter the Module name:" ).strip() # get entry for module name
while course !="": # do while course is entered i.e. it will stop if no info added
grade = float(input("Enter the grade: ").strip()) # get entry for grade (as a float)
myCourses['course'].append(course) # add entry to myCourses with key 'course' and value of course entry
myCourses['grade'].append(grade) # add entry to myCourses with key grade and value of grade entry
course = input("Enter the Module name:" ).strip() # ask for more input - if this is blank the function will return
return myCourses
# funtion to view the entries - same as students.py
def do_view(students):
print("\n") # leave a gap between this function call and the show_menu function
if len(students)<1: # if this is true then there are no entries to show
print("your student list is empty")
for index in range(len(students)): # iterate over the number of students added
for fname in students[index]['firstname'].split('\n'): # get the first name - .split('\n') added to prevent item being displayed vertically
print( "First Name: ", fname.capitalize() ) # show capitalised first name
for lname in students[index]['lastname'].split('\n'): # get the last name - .split('\n') added to prevent item being displayed vertically
print("Last Name: ", lname.capitalize() ) # show capitalised last name
keys = {"course", "grade"} # this is to tidy the course grade dict so that it can be displayed inline
coursesAndGrades = {k: students[index]['modules'][k] for k in keys } # used to put course and grade together
for i in range(len(coursesAndGrades['course']) ):
print("Module: {} with Grade {:.0f}%".format (coursesAndGrades['course'][i], coursesAndGrades['grade'][i])) # display module name and grade for each student
print("\n")
return students
# option for q
def do_nothing(dummy):
pass
# option to call various functions depending on input
choiceMap = {
'a': do_add,
'v': do_view,
'q': do_nothing
}
# this function is the main function that calls the other functions
def main():
students = [] # initalise student list
option = show_menu() # show the menu and sets the option
while(option != 'q'): # while q has not been selected
if option in choiceMap: # look at the choiceMap and select function based on input
choiceMap[option](students)
else: # catch for a non valid entry
print("\n\nplease select either a,v or q")
option=show_menu() # show the menu again for more choices if q is not selected
# this calls the main function
if __name__ == "__main__":
main()
|
'''cidades = ['Rio de Janeiro', 'sao paulo', 'salvador']
cidades[0] = 'brasilia'
cidades.append('santa catarina')
cidades.remove('salvador')
cidades.insert(1, 'salvador')
cidades.pop(1)
cidades.sort()
print(cidades)'''
'''numeros = [2, 3, 4, 5]
letras = ['a', 'b','c', 'd']
final = numeros + letras
print(final)
numeros = [2, 3, 4, 5]
letras = ['a', 'b','c', 'd']
numeros.extend(letras)
print(numeros)'''
'''itens = [['item1','item2'], ['item3','item4']]
print(itens[0])
print(itens[0][0])
print(itens[0][1])
print(itens[1])
print(itens[1][0])
print(itens[1][1])'''
"""produtos = ['arroz', 'feijao', 'laranja','banana']
item1, item2, item3, item4 = produtos
'''item1 = produtos[0]
item2 = produtos[1]
item3 = produtos[2]
item4 = produtos[3]'''
print(item1)
print(item2)
print(item3)
print(item4)"""
'''produtos = ['arroz', 'feijao', 'laranja','banana', 5, 6, 7, 8]
item1, item2, *outros, item8 = produtos
print(item1)
print(item2)
print(outros)
print(item8)'''
'''valores = [50, 80, 110, 150, 170]
for x in valores:
print(f'o valor final do produto é de R${x}')'''
'''cor_cliente = input('digite a cor desejada: ')
cores = ['amarelo', 'verde', 'azul', 'vermelho']
if cor_cliente.lower() in cores:
print('cor em estoque')
else:
print('nao temos essa cor em estoque')'''
'''cores = ['amarelo', 'verde', 'azul', 'vermelho']
valores = [10, 20, 30, 40]
x = zip(cores, valores)
print(list(x))'''
'''frutas_usuario = input('digite o nome das frutas separadas por virgula: ')
frutas_lista = frutas_usuario.split(', ')
print(frutas_lista)'''
cores_lista = ['amarelo', 'verde', 'azul', 'vermelho']
cores_tupla = ('amarelo', 'verde', 'azul', 'vermelho')
|
def tomadas():
reguas = list(map(int, input().split()))
t1 = reguas[0]
t2 = reguas[1]
t3 = reguas[2]
t4 = reguas[3]
numeros_de_aparelhos = t1 + t2 + t3 - 3 + t4
print(numeros_de_aparelhos)
tomadas()
|
#!/usr/bin/env python3
"""Solves problem 021 from the Project Euler website"""
first_twenty_amicable_numbers = [(220, 284), (1184, 1210), (2620, 2924), (5020, 5564), (6232, 6368), (10744, 10856),
(12285, 14595), (17296, 18416), (63020, 76084), (66928, 66992), (67095, 71145),
(69615, 87633), (79750, 88730), (100485, 124155), (122265, 139815), (122368, 123152),
(141664, 153176), (142310, 168730)]
def solve():
"""Solve the problem and return the result"""
result = 0
for n in first_twenty_amicable_numbers:
if n[0] < 10000:
result += n[0]
result += n[1]
else:
break
return result
if __name__ == '__main__':
print(solve())
|
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
},
'targets': [
{
# GN version: //cc
'target_name': 'cc',
'type': '<(component)',
'dependencies': [
'cc_proto',
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/gpu/gpu.gyp:gpu',
'<(DEPTH)/media/media.gyp:media',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/third_party/protobuf/protobuf.gyp:protobuf_lite',
'<(DEPTH)/ui/events/events.gyp:events_base',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry',
'<(DEPTH)/ui/gl/gl.gyp:gl',
],
'variables': {
'optimize': 'max',
},
'export_dependent_settings': [
'<(DEPTH)/skia/skia.gyp:skia',
],
'defines': [
'CC_IMPLEMENTATION=1',
],
'sources': [
# Note: file list duplicated in GN build.
'animation/animation.cc',
'animation/animation.h',
'animation/animation_curve.cc',
'animation/animation_curve.h',
'animation/animation_delegate.h',
'animation/animation_events.cc',
'animation/animation_events.h',
'animation/animation_host.cc',
'animation/animation_host.h',
'animation/animation_id_provider.cc',
'animation/animation_id_provider.h',
'animation/animation_player.cc',
'animation/animation_player.h',
'animation/animation_timeline.cc',
'animation/animation_timeline.h',
'animation/element_animations.cc',
'animation/element_animations.h',
'animation/element_id.cc',
'animation/element_id.h',
'animation/keyframed_animation_curve.cc',
'animation/keyframed_animation_curve.h',
'animation/scroll_offset_animation_curve.cc',
'animation/scroll_offset_animation_curve.h',
'animation/scroll_offset_animations_impl.cc',
'animation/scroll_offset_animations_impl.h',
'animation/scroll_offset_animations.cc',
'animation/scroll_offset_animations.h',
'animation/target_property.cc',
'animation/target_property.h',
'animation/timing_function.cc',
'animation/timing_function.h',
'animation/transform_operation.cc',
'animation/transform_operation.h',
'animation/transform_operations.cc',
'animation/transform_operations.h',
'base/completion_event.h',
'base/container_util.h',
'base/contiguous_container.cc',
'base/contiguous_container.h',
'base/delayed_unique_notifier.cc',
'base/delayed_unique_notifier.h',
'base/histograms.cc',
'base/histograms.h',
'base/invalidation_region.cc',
'base/invalidation_region.h',
'base/list_container.h',
'base/list_container_helper.cc',
'base/list_container_helper.h',
'base/math_util.cc',
'base/math_util.h',
'base/random_access_list_container.h',
'base/region.cc',
'base/region.h',
'base/resource_id.h',
'base/rolling_time_delta_history.cc',
'base/rolling_time_delta_history.h',
'base/rtree.cc',
'base/rtree.h',
'base/simple_enclosed_region.cc',
'base/simple_enclosed_region.h',
'base/switches.cc',
'base/switches.h',
'base/synced_property.h',
'base/tiling_data.cc',
'base/tiling_data.h',
'base/time_util.h',
'base/unique_notifier.cc',
'base/unique_notifier.h',
'blimp/client_picture_cache.h',
'blimp/engine_picture_cache.h',
'blimp/image_serialization_processor.h',
'blimp/picture_data.cc',
'blimp/picture_data.h',
'blimp/picture_data_conversions.cc',
'blimp/picture_data_conversions.h',
'debug/benchmark_instrumentation.cc',
'debug/benchmark_instrumentation.h',
'debug/debug_colors.cc',
'debug/debug_colors.h',
'debug/debug_rect_history.cc',
'debug/debug_rect_history.h',
'debug/devtools_instrumentation.h',
'debug/frame_rate_counter.cc',
'debug/frame_rate_counter.h',
'debug/frame_viewer_instrumentation.cc',
'debug/frame_viewer_instrumentation.h',
'debug/invalidation_benchmark.cc',
'debug/invalidation_benchmark.h',
'debug/lap_timer.cc',
'debug/lap_timer.h',
'debug/layer_tree_debug_state.cc',
'debug/layer_tree_debug_state.h',
'debug/micro_benchmark.cc',
'debug/micro_benchmark.h',
'debug/micro_benchmark_controller.cc',
'debug/micro_benchmark_controller.h',
'debug/micro_benchmark_controller_impl.cc',
'debug/micro_benchmark_controller_impl.h',
'debug/micro_benchmark_impl.cc',
'debug/micro_benchmark_impl.h',
'debug/picture_debug_util.cc',
'debug/picture_debug_util.h',
'debug/rasterize_and_record_benchmark.cc',
'debug/rasterize_and_record_benchmark.h',
'debug/rasterize_and_record_benchmark_impl.cc',
'debug/rasterize_and_record_benchmark_impl.h',
'debug/rendering_stats.cc',
'debug/rendering_stats.h',
'debug/rendering_stats_instrumentation.cc',
'debug/rendering_stats_instrumentation.h',
'debug/ring_buffer.h',
'debug/traced_display_item_list.cc',
'debug/traced_display_item_list.h',
'debug/traced_value.cc',
'debug/traced_value.h',
'debug/unittest_only_benchmark.cc',
'debug/unittest_only_benchmark.h',
'debug/unittest_only_benchmark_impl.cc',
'debug/unittest_only_benchmark_impl.h',
'input/input_handler.cc',
'input/input_handler.h',
'input/layer_selection_bound.cc',
'input/layer_selection_bound.h',
'input/page_scale_animation.cc',
'input/page_scale_animation.h',
'input/scroll_elasticity_helper.cc',
'input/scroll_elasticity_helper.h',
'input/scroll_state.cc',
'input/scroll_state.h',
'input/scroll_state_data.cc',
'input/scroll_state_data.h',
'input/scrollbar_animation_controller.cc',
'input/scrollbar_animation_controller.h',
'input/scrollbar_animation_controller_linear_fade.cc',
'input/scrollbar_animation_controller_linear_fade.h',
'input/scrollbar_animation_controller_thinning.cc',
'input/scrollbar_animation_controller_thinning.h',
'input/selection.h',
'input/top_controls_manager.cc',
'input/top_controls_manager.h',
'input/top_controls_manager_client.h',
'layers/append_quads_data.h',
'layers/content_layer_client.h',
'layers/draw_properties.cc',
'layers/draw_properties.h',
'layers/empty_content_layer_client.cc',
'layers/empty_content_layer_client.h',
'layers/heads_up_display_layer.cc',
'layers/heads_up_display_layer.h',
'layers/heads_up_display_layer_impl.cc',
'layers/heads_up_display_layer_impl.h',
'layers/layer.cc',
'layers/layer_client.h',
'layers/layer_collections.h',
'layers/layer.h',
'layers/layer_impl.cc',
'layers/layer_impl.h',
"layers/layer_impl_test_properties.cc",
"layers/layer_impl_test_properties.h",
'layers/layer_iterator.h',
'layers/layer_list_iterator.cc',
'layers/layer_list_iterator.h',
'layers/layer_position_constraint.cc',
'layers/layer_position_constraint.h',
'layers/layer_proto_converter.cc',
'layers/layer_proto_converter.h',
'layers/layer_utils.cc',
'layers/layer_utils.h',
'layers/nine_patch_layer.cc',
'layers/nine_patch_layer.h',
'layers/nine_patch_layer_impl.cc',
'layers/nine_patch_layer_impl.h',
'layers/paint_properties.h',
'layers/painted_scrollbar_layer.cc',
'layers/painted_scrollbar_layer.h',
'layers/painted_scrollbar_layer_impl.cc',
'layers/painted_scrollbar_layer_impl.h',
'layers/picture_image_layer.cc',
'layers/picture_image_layer.h',
'layers/picture_layer.cc',
'layers/picture_layer.h',
'layers/picture_layer_impl.cc',
'layers/picture_layer_impl.h',
'layers/render_pass_sink.h',
'layers/render_surface_impl.cc',
'layers/render_surface_impl.h',
'layers/scrollbar_layer_impl_base.cc',
'layers/scrollbar_layer_impl_base.h',
'layers/scrollbar_layer_interface.h',
'layers/solid_color_layer.cc',
'layers/solid_color_layer.h',
'layers/solid_color_layer_impl.cc',
'layers/solid_color_layer_impl.h',
'layers/solid_color_scrollbar_layer.cc',
'layers/solid_color_scrollbar_layer.h',
'layers/solid_color_scrollbar_layer_impl.cc',
'layers/solid_color_scrollbar_layer_impl.h',
'layers/surface_layer.cc',
'layers/surface_layer.h',
'layers/surface_layer_impl.cc',
'layers/surface_layer_impl.h',
'layers/texture_layer.cc',
'layers/texture_layer.h',
'layers/texture_layer_client.h',
'layers/texture_layer_impl.cc',
'layers/texture_layer_impl.h',
'layers/ui_resource_layer.cc',
'layers/ui_resource_layer.h',
'layers/ui_resource_layer_impl.cc',
'layers/ui_resource_layer_impl.h',
'layers/video_frame_provider.h',
'layers/video_frame_provider_client_impl.cc',
'layers/video_frame_provider_client_impl.h',
'layers/video_layer.cc',
'layers/video_layer.h',
'layers/video_layer_impl.cc',
'layers/video_layer_impl.h',
'layers/viewport.cc',
'layers/viewport.h',
'output/begin_frame_args.cc',
'output/begin_frame_args.h',
'output/bsp_tree.cc',
'output/bsp_tree.h',
'output/bsp_walk_action.cc',
'output/bsp_walk_action.h',
'output/ca_layer_overlay.cc',
'output/ca_layer_overlay.h',
'output/compositor_frame.cc',
'output/compositor_frame.h',
'output/compositor_frame_ack.cc',
'output/compositor_frame_ack.h',
'output/compositor_frame_metadata.cc',
'output/compositor_frame_metadata.h',
'output/context_provider.h',
'output/copy_output_request.cc',
'output/copy_output_request.h',
'output/copy_output_result.cc',
'output/copy_output_result.h',
'output/delegated_frame_data.cc',
'output/delegated_frame_data.h',
'output/delegating_renderer.cc',
'output/delegating_renderer.h',
'output/direct_renderer.cc',
'output/direct_renderer.h',
'output/dynamic_geometry_binding.cc',
'output/dynamic_geometry_binding.h',
'output/filter_operation.cc',
'output/filter_operation.h',
'output/filter_operations.cc',
'output/filter_operations.h',
'output/geometry_binding.cc',
'output/geometry_binding.h',
'output/gl_frame_data.cc',
'output/gl_frame_data.h',
'output/gl_renderer.cc',
'output/gl_renderer.h',
'output/gl_renderer_draw_cache.cc',
'output/gl_renderer_draw_cache.h',
'output/latency_info_swap_promise.cc',
'output/latency_info_swap_promise.h',
'output/layer_quad.cc',
'output/layer_quad.h',
'output/managed_memory_policy.cc',
'output/managed_memory_policy.h',
'output/output_surface.cc',
'output/output_surface.h',
'output/output_surface_client.h',
'output/overlay_candidate.cc',
'output/overlay_candidate.h',
'output/overlay_candidate_validator.h',
'output/overlay_processor.cc',
'output/overlay_processor.h',
'output/overlay_strategy_single_on_top.cc',
'output/overlay_strategy_single_on_top.h',
'output/overlay_strategy_underlay.cc',
'output/overlay_strategy_underlay.h',
'output/program_binding.cc',
'output/program_binding.h',
'output/render_surface_filters.cc',
'output/render_surface_filters.h',
'output/renderer.cc',
'output/renderer.h',
'output/renderer_capabilities.cc',
'output/renderer_capabilities.h',
'output/renderer_settings.cc',
'output/renderer_settings.h',
'output/shader.cc',
'output/shader.h',
'output/software_output_device.cc',
'output/software_output_device.h',
'output/software_renderer.cc',
'output/software_renderer.h',
'output/static_geometry_binding.cc',
'output/static_geometry_binding.h',
'output/swap_promise.h',
'output/texture_mailbox_deleter.cc',
'output/texture_mailbox_deleter.h',
'output/vulkan_context_provider.h',
'output/vulkan_in_process_context_provider.h',
'output/vulkan_in_process_context_provider.cc',
'playback/clip_display_item.cc',
'playback/clip_display_item.h',
'playback/clip_path_display_item.cc',
'playback/clip_path_display_item.h',
'playback/compositing_display_item.cc',
'playback/compositing_display_item.h',
'playback/decoded_draw_image.cc',
'playback/decoded_draw_image.h',
'playback/discardable_image_map.cc',
'playback/discardable_image_map.h',
'playback/display_item.cc',
'playback/display_item.h',
'playback/display_item_list.cc',
'playback/display_item_list.h',
'playback/display_item_list_settings.cc',
'playback/display_item_list_settings.h',
'playback/display_item_proto_factory.cc',
'playback/display_item_proto_factory.h',
'playback/draw_image.cc',
'playback/draw_image.h',
'playback/drawing_display_item.cc',
'playback/drawing_display_item.h',
'playback/filter_display_item.cc',
'playback/filter_display_item.h',
'playback/float_clip_display_item.cc',
'playback/float_clip_display_item.h',
'playback/image_hijack_canvas.cc',
'playback/image_hijack_canvas.h',
'playback/largest_display_item.cc',
'playback/largest_display_item.h',
'playback/raster_source.cc',
'playback/raster_source.h',
'playback/recording_source.cc',
'playback/recording_source.h',
'playback/skip_image_canvas.cc',
'playback/skip_image_canvas.h',
'playback/transform_display_item.cc',
'playback/transform_display_item.h',
'proto/base_conversions.cc',
'proto/base_conversions.h',
'proto/cc_conversions.cc',
'proto/cc_conversions.h',
'proto/gfx_conversions.cc',
'proto/gfx_conversions.h',
'proto/gpu_conversions.cc',
'proto/gpu_conversions.h',
'proto/skia_conversions.cc',
'proto/skia_conversions.h',
'proto/synced_property_conversions.cc',
'proto/synced_property_conversions.h',
'quads/content_draw_quad_base.cc',
'quads/content_draw_quad_base.h',
'quads/debug_border_draw_quad.cc',
'quads/debug_border_draw_quad.h',
'quads/draw_polygon.cc',
'quads/draw_polygon.h',
'quads/draw_quad.cc',
'quads/draw_quad.h',
'quads/largest_draw_quad.cc',
'quads/largest_draw_quad.h',
'quads/picture_draw_quad.cc',
'quads/picture_draw_quad.h',
'quads/render_pass.cc',
'quads/render_pass.h',
'quads/render_pass_draw_quad.cc',
'quads/render_pass_draw_quad.h',
'quads/render_pass_id.cc',
'quads/render_pass_id.h',
'quads/shared_quad_state.cc',
'quads/shared_quad_state.h',
'quads/solid_color_draw_quad.cc',
'quads/solid_color_draw_quad.h',
'quads/stream_video_draw_quad.cc',
'quads/stream_video_draw_quad.h',
'quads/surface_draw_quad.cc',
'quads/surface_draw_quad.h',
'quads/texture_draw_quad.cc',
'quads/texture_draw_quad.h',
'quads/tile_draw_quad.cc',
'quads/tile_draw_quad.h',
'quads/yuv_video_draw_quad.cc',
'quads/yuv_video_draw_quad.h',
'raster/bitmap_raster_buffer_provider.cc',
'raster/bitmap_raster_buffer_provider.h',
'raster/gpu_raster_buffer_provider.cc',
'raster/gpu_raster_buffer_provider.h',
'raster/one_copy_raster_buffer_provider.cc',
'raster/one_copy_raster_buffer_provider.h',
'raster/raster_buffer.cc',
'raster/raster_buffer.h',
'raster/raster_buffer_provider.cc',
'raster/raster_buffer_provider.h',
'raster/scoped_gpu_raster.cc',
'raster/scoped_gpu_raster.h',
'raster/single_thread_task_graph_runner.cc',
'raster/single_thread_task_graph_runner.h',
'raster/staging_buffer_pool.cc',
'raster/staging_buffer_pool.h',
'raster/synchronous_task_graph_runner.cc',
'raster/synchronous_task_graph_runner.h',
'raster/task.cc',
'raster/task.h',
'raster/task_category.h',
'raster/task_graph_runner.h',
'raster/task_graph_work_queue.cc',
'raster/task_graph_work_queue.h',
'raster/texture_compressor.cc',
'raster/texture_compressor.h',
'raster/texture_compressor_etc1.cc',
'raster/texture_compressor_etc1.h',
'raster/tile_task.cc',
'raster/tile_task.h',
'raster/zero_copy_raster_buffer_provider.cc',
'raster/zero_copy_raster_buffer_provider.h',
'resources/memory_history.cc',
'resources/memory_history.h',
'resources/platform_color.h',
'resources/release_callback.h',
'resources/resource.h',
'resources/resource_format.cc',
'resources/resource_format.h',
'resources/resource_format_utils.cc',
'resources/resource_format_utils.h',
'resources/resource_pool.cc',
'resources/resource_pool.h',
'resources/resource_provider.cc',
'resources/resource_provider.h',
'resources/resource_util.h',
'resources/returned_resource.h',
'resources/scoped_resource.cc',
'resources/scoped_resource.h',
'resources/scoped_ui_resource.cc',
'resources/scoped_ui_resource.h',
'resources/shared_bitmap.cc',
'resources/shared_bitmap.h',
'resources/shared_bitmap_manager.h',
'resources/single_release_callback.cc',
'resources/single_release_callback.h',
'resources/single_release_callback_impl.cc',
'resources/single_release_callback_impl.h',
'resources/texture_mailbox.cc',
'resources/texture_mailbox.h',
'resources/transferable_resource.cc',
'resources/transferable_resource.h',
'resources/ui_resource_bitmap.cc',
'resources/ui_resource_bitmap.h',
'resources/ui_resource_client.h',
'resources/ui_resource_request.cc',
'resources/ui_resource_request.h',
'resources/video_resource_updater.cc',
'resources/video_resource_updater.h',
'scheduler/begin_frame_source.cc',
'scheduler/begin_frame_source.h',
'scheduler/begin_frame_tracker.cc',
'scheduler/begin_frame_tracker.h',
'scheduler/commit_earlyout_reason.cc',
'scheduler/commit_earlyout_reason.h',
'scheduler/compositor_timing_history.cc',
'scheduler/compositor_timing_history.h',
'scheduler/delay_based_time_source.cc',
'scheduler/delay_based_time_source.h',
'scheduler/draw_result.h',
'scheduler/scheduler.cc',
'scheduler/scheduler.h',
'scheduler/scheduler_settings.cc',
'scheduler/scheduler_settings.h',
'scheduler/scheduler_state_machine.cc',
'scheduler/scheduler_state_machine.h',
'scheduler/video_frame_controller.h',
'tiles/eviction_tile_priority_queue.cc',
'tiles/eviction_tile_priority_queue.h',
'tiles/gpu_image_decode_controller.cc',
'tiles/gpu_image_decode_controller.h',
'tiles/image_decode_controller.h',
'tiles/mipmap_util.cc',
'tiles/mipmap_util.h',
'tiles/picture_layer_tiling.cc',
'tiles/picture_layer_tiling.h',
'tiles/picture_layer_tiling_set.cc',
'tiles/picture_layer_tiling_set.h',
'tiles/prioritized_tile.cc',
'tiles/prioritized_tile.h',
'tiles/raster_tile_priority_queue_all.cc',
'tiles/raster_tile_priority_queue_all.h',
'tiles/raster_tile_priority_queue.cc',
'tiles/raster_tile_priority_queue.h',
'tiles/raster_tile_priority_queue_required.cc',
'tiles/raster_tile_priority_queue_required.h',
'tiles/software_image_decode_controller.cc',
'tiles/software_image_decode_controller.h',
'tiles/tile.cc',
'tiles/tile_draw_info.cc',
'tiles/tile_draw_info.h',
'tiles/tile.h',
'tiles/tile_manager.cc',
'tiles/tile_manager.h',
'tiles/tile_priority.cc',
'tiles/tile_priority.h',
'tiles/tile_task_manager.cc',
'tiles/tile_task_manager.h',
'tiles/tiling_set_eviction_queue.cc',
'tiles/tiling_set_eviction_queue.h',
'tiles/tiling_set_raster_queue_all.cc',
'tiles/tiling_set_raster_queue_all.h',
'tiles/tiling_set_raster_queue_required.cc',
'tiles/tiling_set_raster_queue_required.h',
'trees/blocking_task_runner.cc',
'trees/blocking_task_runner.h',
'trees/channel_impl.h',
'trees/channel_main.h',
'trees/compositor_mode.h',
'trees/damage_tracker.cc',
'trees/damage_tracker.h',
'trees/draw_property_utils.cc',
'trees/draw_property_utils.h',
'trees/latency_info_swap_promise_monitor.cc',
'trees/latency_info_swap_promise_monitor.h',
'trees/layer_tree_host.cc',
'trees/layer_tree_host.h',
'trees/layer_tree_host_client.h',
'trees/layer_tree_host_common.cc',
'trees/layer_tree_host_common.h',
'trees/layer_tree_host_impl.cc',
'trees/layer_tree_host_impl.h',
'trees/layer_tree_host_single_thread_client.h',
'trees/layer_tree_impl.cc',
'trees/layer_tree_impl.h',
'trees/layer_tree_settings.cc',
'trees/layer_tree_settings.h',
'trees/mutator_host_client.h',
'trees/occlusion.cc',
'trees/occlusion.h',
'trees/occlusion_tracker.cc',
'trees/occlusion_tracker.h',
'trees/property_tree.cc',
'trees/property_tree.h',
'trees/property_tree_builder.cc',
'trees/property_tree_builder.h',
'trees/proxy.h',
'trees/proxy_common.cc',
'trees/proxy_common.h',
'trees/proxy_impl.cc',
'trees/proxy_impl.h',
'trees/proxy_main.cc',
'trees/proxy_main.h',
'trees/remote_channel_impl.cc',
'trees/remote_channel_impl.h',
'trees/remote_channel_main.cc',
'trees/remote_channel_main.h',
'trees/remote_proto_channel.h',
'trees/scoped_abort_remaining_swap_promises.h',
'trees/single_thread_proxy.cc',
'trees/single_thread_proxy.h',
'trees/swap_promise_monitor.cc',
'trees/swap_promise_monitor.h',
'trees/task_runner_provider.cc',
'trees/task_runner_provider.h',
'trees/threaded_channel.cc',
'trees/threaded_channel.h',
'trees/tree_synchronizer.cc',
'trees/tree_synchronizer.h',
],
'includes': [
'../build/android/increase_size_for_speed.gypi',
],
'conditions': [
['target_arch == "ia32" or target_arch == "x64"', {
'sources': [
'raster/texture_compressor_etc1_sse.cc',
'raster/texture_compressor_etc1_sse.h',
],
}],
],
},
{
# GN version: "//cc/proto"
'target_name': 'cc_proto',
'type': '<(component)',
'sources': [
'proto/begin_main_frame_and_commit_state.proto',
'proto/commit_earlyout_reason.proto',
'proto/compositor_message.proto',
'proto/compositor_message_to_impl.proto',
'proto/compositor_message_to_main.proto',
'proto/display_item.proto',
'proto/element_id.proto',
'proto/layer.proto',
'proto/layer_position_constraint.proto',
'proto/layer_tree_debug_state.proto',
'proto/layer_tree_host.proto',
'proto/layer_tree_settings.proto',
'proto/layer_selection_bound.proto',
'proto/managed_memory_policy.proto',
'proto/memory_allocation.proto',
'proto/point.proto',
'proto/point3f.proto',
'proto/pointf.proto',
'proto/property_tree.proto',
'proto/recording_source.proto',
'proto/rect.proto',
'proto/rectf.proto',
'proto/region.proto',
'proto/renderer_settings.proto',
'proto/scroll_offset.proto',
'proto/size.proto',
'proto/sizef.proto',
'proto/skregion.proto',
'proto/skrrect.proto',
'proto/skxfermode.proto',
'proto/synced_property.proto',
'proto/transform.proto',
'proto/vector2d.proto',
'proto/vector2df.proto',
],
'defines': [
'CC_PROTO_IMPLEMENTATION=1',
],
'variables': {
# Warn if clang creates exit destructors.
'enable_wexit_time_destructors': 1,
'proto_in_dir': 'proto',
'proto_out_dir': 'cc/proto',
'cc_generator_options': 'dllexport_decl=CC_PROTO_EXPORT:',
'cc_include': 'cc/proto/cc_proto_export.h',
},
'includes': [ '../build/protoc.gypi' ]
},
{
# GN version: //cc/surfaces
'target_name': 'cc_surfaces',
'type': '<(component)',
'dependencies': [
'cc',
'<(DEPTH)/base/base.gyp:base',
'<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
'<(DEPTH)/gpu/gpu.gyp:gpu',
'<(DEPTH)/skia/skia.gyp:skia',
'<(DEPTH)/ui/events/events.gyp:events_base',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx',
'<(DEPTH)/ui/gfx/gfx.gyp:gfx_geometry',
],
'defines': [
'CC_SURFACES_IMPLEMENTATION=1',
],
'sources': [
# Note: file list duplicated in GN build.
'surfaces/display.cc',
'surfaces/display.h',
'surfaces/display_client.h',
'surfaces/display_scheduler.cc',
'surfaces/display_scheduler.h',
'surfaces/surface.cc',
'surfaces/surface.h',
'surfaces/surface_aggregator.cc',
'surfaces/surface_aggregator.h',
'surfaces/surface_display_output_surface.cc',
'surfaces/surface_display_output_surface.h',
'surfaces/surface_factory.cc',
'surfaces/surface_factory.h',
'surfaces/surface_factory_client.h',
'surfaces/surface_hittest.cc',
'surfaces/surface_hittest.h',
'surfaces/surface_id.h',
'surfaces/surface_id_allocator.cc',
'surfaces/surface_id_allocator.h',
'surfaces/surface_manager.cc',
'surfaces/surface_manager.h',
'surfaces/surface_resource_holder.cc',
'surfaces/surface_resource_holder.h',
'surfaces/surface_sequence.h',
'surfaces/surfaces_export.h',
],
'includes': [
'../build/android/increase_size_for_speed.gypi',
],
},
],
}
|
max_size = 10
print(
"(a)" + " " * (max_size) +
"(b)" + " " * (max_size) +
"(c)" + " " * (max_size) +
"(d)" + " " * (max_size)
)
for i in range(1, max_size + 1):
print("*" * i, end = " " * (max_size - i + 3))
print("*" * (max_size - i + 1), end = " " * (i - 1 + 3))
print(" " * (i - 1) + "*" * (max_size - i + 1), end = " " * 3)
print(" " * (max_size - i) + "*" * i)
Print("test was successful")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.