content
stringlengths
7
1.05M
# # Problem: Given an array of ints representing a graph, where: # - the position of the array indicates the node value # - the value of the array at that position indicates the node value that this node is attached to # - the beginning of the graph will be the item whose value is equal to the index it is in # Write a function that returns a list (size = n-1) of ints where each index is equal to the number of nodes at that # distance away from the beginning of the graph. # Example: # Input: [9, 1, 4, 9, 0, 4, 8, 9, 0, 1] # Beginning of graph is "1" (value 1 at index 1) # - One item (node/index 9) is next to node 1 # - 3 items (0, 3, 7) is next to node 9 # - so on and so forth # Solution: [1, 3, 2, 3, 0, 0, 0, 0, 0] class GraphNode: def __init__(self, label): self.label = label self.neighbors = set() def __repr__(self): return f'{self.label}: {self.neighbors}' def solution(T): nodes = [GraphNode(i) for i in range(len(T))] capital = -1 # Create graph representation of our data for idx, item in enumerate(T): if idx == item: capital = idx else: nodes[idx].neighbors.add(item) nodes[item].neighbors.add(idx) # Track which nodes have been and need to be evaluated at each step nodes_evaluated = set() nodes_to_eval = [capital] # print(nodes) # Our resulting list result = [] while len(nodes_to_eval) > 0: num_neighbors = 0 next_nodes = set() for node_to_eval in nodes_to_eval: nodes_evaluated.add(node_to_eval) num_neighbors += len(nodes[node_to_eval].neighbors) - 1 if node_to_eval == capital: num_neighbors += 1 for node in nodes[node_to_eval].neighbors: if node not in nodes_evaluated: next_nodes.add(node) result.append(num_neighbors) nodes_to_eval.clear() nodes_to_eval.extend(next_nodes) # Extend our result array with 0s for each distance we did not get to zeroes = len(T) - 1 - len(result) result.extend([0 for i in range(zeroes)]) return result
NEW_RANKING_RULES = ['typo', 'exactness'] DEFAULT_RANKING_RULES = [ 'words', 'typo', 'proximity', 'attribute', 'sort', 'exactness' ] def test_get_ranking_rules_default(empty_index): """Tests getting the default ranking rules.""" response = empty_index().get_ranking_rules() assert isinstance(response, list) for rule in DEFAULT_RANKING_RULES: assert rule in response def test_update_ranking_rules(empty_index): """Tests changing the ranking rules.""" index = empty_index() response = index.update_ranking_rules(NEW_RANKING_RULES) assert isinstance(response, dict) assert 'updateId' in response index.wait_for_pending_update(response['updateId']) response = index.get_ranking_rules() assert isinstance(response, list) for rule in NEW_RANKING_RULES: assert rule in response def test_update_ranking_rules_none(empty_index): """Tests updating the ranking rules at null.""" index = empty_index() # Update the settings first response = index.update_ranking_rules(NEW_RANKING_RULES) update = index.wait_for_pending_update(response['updateId']) assert update['status'] == 'processed' # Check the settings have been correctly updated response = index.get_ranking_rules() for rule in NEW_RANKING_RULES: assert rule in response # Launch test to update at null the setting response = index.update_ranking_rules(None) assert isinstance(response, dict) assert 'updateId' in response index.wait_for_pending_update(response['updateId']) response = index.get_ranking_rules() assert isinstance(response, list) for rule in DEFAULT_RANKING_RULES: assert rule in response def test_reset_ranking_rules(empty_index): """Tests resetting the ranking rules setting to its default value.""" index = empty_index() # Update the settings first response = index.update_ranking_rules(NEW_RANKING_RULES) update = index.wait_for_pending_update(response['updateId']) assert update['status'] == 'processed' # Check the settings have been correctly updated response = index.get_ranking_rules() assert isinstance(response, list) for rule in NEW_RANKING_RULES: assert rule in response # Check the reset of the settings response = index.reset_ranking_rules() assert isinstance(response, dict) assert 'updateId' in response index.wait_for_pending_update(response['updateId']) response = index.get_ranking_rules() for rule in DEFAULT_RANKING_RULES: assert rule in response
def distinct(collection: list) -> int: """ Checks for the distinct values in a collection and returns the count Performs operation in nO(nlogn) time :param collection: Collection of values :returns number of distinct values in the collection """ length = len(collection) if length == 0: return 0 # performs operation in O(nlogn) collection.sort() result = 1 for x in range(1, length): if collection[x - 1] != collection[x]: result += 1 return result
# V0 # V1 # https://blog.csdn.net/fuxuemingzhu/article/details/83511833 # IDEA : DP # STATUS EQ : dp[i] = [b | A[i] for b in dp[i - 1]] + A[i] class Solution(object): def subarrayBitwiseORs(self, A): """ :type A: List[int] :rtype: int """ res = set() cur = set() for a in A: cur = {n | a for n in cur} | {a} res |= cur return len(res) # V2 # Time: O(32 * n) # Space: O(1) class Solution(object): def subarrayBitwiseORs(self, A): """ :type A: List[int] :rtype: int """ result, curr = set(), {0} for i in A: curr = {i} | {i | j for j in curr} result |= curr return len(result)
pt = int(input("Qual o primeiro termo? ")) r = int(input("Qual a razão? ")) soma = pt + (10-1)*r for c in range(pt, soma + r, r): print(c, end=" ")
#!/usr/bin/python # ============================================================================== # Author: Tao Li ([email protected]) # Date: Jun 11, 2015 # Question: 225-Implement-Stack-using-Queues # Link: https://leetcode.com/problems/implement-stack-using-queues/ # ============================================================================== # Implement the following operations of a stack using queues. # # push(x) -- Push element x onto stack. # pop() -- Removes the element on top of the stack. # top() -- Get the top element. # empty() -- Return whether the stack is empty. # # Notes: # # 1. You must use only standard operations of a queue -- which means only push # to back, peek/pop from front, size, and is empty operations are valid. # # 2. Depending on your language, queue may not be supported natively. You may # simulate a queue by using a list or deque (double-ended queue), as long # as you use only standard operations of a queue. # # 3. You may assume that all operations are valid (for example, no pop or top # operations will be called on an empty stack). # ============================================================================== # Method: Naive method # ============================================================================== class Stack: # initialize your data structure here. def __init__(self): self.items = [] # @param x, an integer # @return nothing def push(self, x): self.items.append(x) # @return nothing def pop(self): self.items.pop() # @return an integer def top(self): return self.items[-1] # @return an boolean def empty(self): return len(self.items) == 0
""" Кобзарь О.С. Водопьян А.О. Хабибуллин Р.А. 09.08.2019 Модуль-интерфейс-инструмент для извлечения данных из расчетных классов """ # TODO обеспечить хранение внутренних классов на любом уровне вложенности, пока сохраняется только верхний # TODO использоавать встроенную библиотеку collection.defaultdict # TODO после полной проработки сохарнения изменить примеры и удалить старые методы # TODO пока не сделано, сохранять явно каждый класс # TODO обеспечить возможность сохранения данных в pandas.dataframe # TODO обеспечить возможность сохранения данных в .csv на лету (чтобы оставались расчеты при ошибке в середине большого расчета) class Data(): def __init__(self): self.saved_dicts = [] # список словарей атрибутов класса self.lists = [] # списки для хранения self.h_list = [] self.p_list = [] self.t_list = [] self.distance_list = [] self.amounts_of_param_in_one_banch = None def get_data(self, method_or_correlation): """ Получение атрибутов (всех данных) из расчетного класса """ this_data = method_or_correlation.__dict__ self.saved_dicts.append(this_data) for key, value in this_data.items(): # преобразование словаря в итерируемый список temp = [key, value] self.lists.append(temp) self.amounts_of_param_in_one_banch = len(self.saved_dicts[0]) def clear_data(self): """ Очистка данных """ self.saved_dicts = [] self.lists = [] self.h_list = [] self.p_list = [] self.t_list = [] def get_values(self, number): """ Старый метод: использовать save_data_from_class_to_storage Получение массива определенного параметра по его номеру """ self.amounts_of_param_in_one_banch = len(self.saved_dicts[0]) amounts_of_banches = len(self.lists) / self.amounts_of_param_in_one_banch one_parametr = [] k = number for i in range(int(amounts_of_banches)): one = self.lists[k] k = k + self.amounts_of_param_in_one_banch one_parametr.append(one) values = [] for i in one_parametr: values.append(float(i[-1])) return values def get_name(self, number): """ Старый метод: использовать get_saved_parameter_name_by_number Получение названия параметра по его номеру """ return self.lists[number][0] def print_all_names(self): """ Старый метод: использовать print_all_names_of_saved_parameters print всех параметров их их номеров для получения """ for i in range(self.amounts_of_param_in_one_banch): print('Номер ' + str(i) + ' для получения параметра ' + self.get_name(i)) def save_data_from_class_to_storage(self, class_obj): """ Получение всех атрибутов расчетного класса в форме словаря. Словари хранятся в списке. :param class_obj: расчетный класс :return: None """ this_data = class_obj.__dict__.copy() self.saved_dicts.append(this_data) self.amounts_of_param_in_one_banch = len(self.saved_dicts[0]) def print_all_names_of_saved_parameters(self): """ Получение названий атрибутов и соответствующих им номеров (индексов) для обращения :return: print номеров всех атрибутов(сохраненных параметров) """ for number_of_key, key_str in enumerate(self.saved_dicts[0].keys()): print('Номер ' + str(number_of_key) + ' для получения параметра ' + key_str) def get_saved_parameter_name_by_number(self, parameter_number): """ Получение имени (ключа) параметра по его номеру(индексу) :param parameter_number: номер параметра(атрибута), int :return: имя параметра (ключа), str """ dict_keys = self.saved_dicts[0].keys() keys_list = list(dict_keys) parameter_name = keys_list[parameter_number] return parameter_name def get_saved_values_by_number(self, parameter_number): """ Получение списка значений только для одного параметра. Спискок значений формируется из словарей, сохраненных при расчете :param parameter_number: номер параметра(атрибута), int :return: список значений параметра, list """ parameter_name = self.get_saved_parameter_name_by_number(parameter_number) values = [] for one_dict in self.saved_dicts: one_parameter_value = one_dict[parameter_name] values.append(float(one_parameter_value)) return values
#!/usr/bin/env python3 def color_translator(color): if color == "red": hex_color = "#ff0000" elif color == "green": hex_color = "#00ff00" elif color == "blue": hex_color = "#0000ff" return hex_color print(color_translator("blue")) #Should be #0000fff print(color_translator("yellow")) # should be unknown print(color_translator("red")) #should be #ff0000 print(color_translator("black")) #shouldbe #00ff00 print(color_translator("green")) #should be #00ff00 print(color_translator("")) #should be unknown
"""[if文について] もし〜だったら、こうして """ # 条件によって処理を変えたい場合などに使います distance = 3403
def create_multi_graph(edges): graph = dict() for x, y in edges: graph[x] = [] graph[y] = [] for x, y in edges: graph[x].append(y) return graph def is_eulerian(multi_graph): number_enter = dict() number_exit = dict() for vertex in multi_graph: number_enter[vertex] = 0 number_exit[vertex] = 0 for vertex in multi_graph: for neighbor in multi_graph[vertex]: number_exit[vertex] += 1 number_enter[neighbor] += 1 for vertex in multi_graph: if number_enter[vertex] != number_exit[vertex]: return False return True def circuit_from_eulerian(multi_graph): current = None for vertex in multi_graph: if len(multi_graph[vertex]) > 0: current = vertex if current is None: return [] circuit = [current] is_possible = True while is_possible: is_possible = False for next in multi_graph[circuit[-1]]: if next not in circuit: circuit.append(next) is_possible = True else: pos = circuit.index(next) return circuit[pos:] + circuit[:pos] return None def copy_multi_graph(multi_graph): return {x: list(y) for x, y in multi_graph.items()} def delete_circuit(circuit, multi_graph): new = copy_multi_graph(multi_graph) x = circuit[0] for y in circuit[1:] + [circuit[0]]: new[x].remove(y) x = y return new def list_of_circuits(multi_graph): circuits = [] next_circuit = circuit_from_eulerian(multi_graph) while next_circuit: circuits.append(next_circuit) multi_graph = delete_circuit(next_circuit, multi_graph) next_circuit = circuit_from_eulerian(multi_graph) return circuits def raboutage(circuit1, circuit2): if circuit1 == []: return list(circuit2) elif circuit2 == []: return list(circuit1) intersection = set(circuit1).intersection(circuit2) if not intersection: return None x = intersection.pop() pos_x_1 = circuit1.index(x) pos_x_2 = circuit2.index(x) return circuit1[:pos_x_1] + circuit2[pos_x_2:] + circuit2[:pos_x_2] + circuit1[pos_x_1:] def eulerian_circuit(multi_graph): circuits = list_of_circuits(multi_graph) if not circuits: return [] current = [] for circuit in circuits: current = raboutage(current, circuit) return current
class IntCode: def __init__(self, intcode): self.index = 0 self.output_ = 0 self.intcode = intcode def add(self, a, b): return a + b def mult(self, a, b): return a * b def store(self, v, p): self.intcode[p] = v def output(self, p): return self.intcode[p] def lessthan(self, a, b): return a < b def equals(self, a, b): return a == b def parse_mode(self, position, mode): if mode == "1": return self.intcode[position] else: return self.intcode[self.intcode[position]] def run(self, input_): # Iterate until reach the stop code while self.intcode[self.index] != 99: opcode = int(str(self.intcode[self.index])[-2:]) modes = str(self.intcode[self.index])[:-2][::-1] + '000' # Addition if opcode == 1: self.intcode[self.intcode[self.index + 3]] = self.add( self.parse_mode(self.index + 1, modes[0]), self.parse_mode(self.index + 2, modes[1]) ) self.index += 4 # Multiplication elif opcode == 2: self.intcode[self.intcode[self.index + 3]] = self.mult( self.parse_mode(self.index + 1, modes[0]), self.parse_mode(self.index + 2, modes[1]) ) self.index += 4 # Storage elif opcode == 3: if len(input_) > 0: self.store(input_.pop(0), self.intcode[self.index + 1]) self.index += 2 else: raise Exception("No input for storage") # Output elif opcode == 4: self.output_ = self.output(self.intcode[self.index + 1]) self.index += 2 # Jump if true elif opcode == 5: if self.parse_mode(self.index + 1, modes[0]) != 0: self.index = self.parse_mode(self.index + 2, modes[1]) else: self.index += 3 # Jump if false elif opcode == 6: if self.parse_mode(self.index + 1, modes[0]) == 0: self.index = self.parse_mode(self.index + 2, modes[1]) else: self.index += 3 # Less than elif opcode == 7: value = 0 position = self.intcode[self.index + 3] if self.lessthan( self.parse_mode(self.index + 1, modes[0]), self.parse_mode(self.index + 2, modes[1]) ): value = 1 self.store(value, position) self.index += 4 # Equals elif opcode == 8: value = 0 position = self.intcode[self.index + 3] if self.equals( self.parse_mode(self.index + 1, modes[0]), self.parse_mode(self.index + 2, modes[1]) ): value = 1 self.store(value, position) self.index += 4 # Unknown else: raise Exception("Unknown op code") return self.output_
while True: print(('=' * 20)) n = int(input('De qual valor você quer ver uma [VALOR NEGATIVO para PARAR]: ')) print(('=' * 20)) if n <= -1: break for c in range(1, 11): print(f'{n} x {c} = {n*c}') print('=' * 20) print('Programa encerrado com sucesso. Volte sempre!')
def math(): lists = [] count = 0 for i in range(20): j = int(input()) lists.append(j) for j in range(20)[::-1]: print('N[' + str(count) + '] =', lists[j]) count += 1 if __name__ == '__main__': math()
class NumberCheckerOnGroup: @classmethod def numberToGroup(cls, tNumber): clsNumber = 1 if tNumber >= 1 and tNumber <= 9: clsNumber = 1 elif tNumber >= 10 and tNumber <= 19: clsNumber = 10 elif tNumber >= 20 and tNumber <= 29: clsNumber = 20 elif tNumber >= 30 and tNumber <= 39: clsNumber = 30 elif tNumber >= 40 and tNumber <= 49: clsNumber = 40 elif tNumber >= 50 and tNumber <= 59: clsNumber = 50 elif tNumber >= 60 and tNumber <= 69: clsNumber = 60 elif tNumber >= 70 and tNumber <= 79: clsNumber = 70 return clsNumber def __init__(self): self.numberGroup = None def setGroup(self, numberGroupTuple): self.numberGroup = list(numberGroupTuple) def matchGroup(self, numberList): groupList = list(map(lambda n: NumberCheckerOnGroup.numberToGroup(n), numberList)) return groupList == self.numberGroup if __name__ == '__main__': numberCheckerOnGroup = NumberCheckerOnGroup() numberCheckerOnGroup.setGroup((1,20,30,40,40)) numList = list([3,25,34,45,41]) numberCheckerOnGroup.matchGroup(numList) NumberCheckerOnGroup.numberToGroup(20)
# -*- coding: utf-8 -*- """ Created on 2014-09-16 :author: Natan Žabkar (nightmarebadger) A for loop is usually used when we want to repeat a piece of code 'n' number of times, or when we want to iterate through the elements of a list (or something similar). In this example our program will 'sing' out the 99 bottles of beer song (http://en.wikipedia.org/wiki/99_Bottles_of_Beer). We use .format() to put the number of bottles in the text and we use an if sentance for the last two verses. """ if __name__ == '__main__': for i in range(100): bottle_num = 99 - i song = ("{0} bottles of beer on the wall, {0} bottles of beer.\n" + "Take one down, pass it around, {1} bottles of beer on the " + "wall ...\n") song_one = ("1 bottle of beer on the wall, 1 bottle of beer.\n" + "Take it down, pass it around, there are no bottles " + "left on the wall ...\n") song_no = ("No more bottles of beer on the wall, no more bottles of " + "beer.\nGo to the store and buy us some more, 99 bottles " + "of beer on the wall ...\n") if i == 99: print(song_no) elif i == 98: print(song_one) else: print(song.format(bottle_num, bottle_num - 1))
def between_markers(text: str, begin: str, end: str) -> str: """ returns substring between two given markers """ # your code here return text[text.find(begin)+1:text.find(end)] if __name__ == '__main__': print('Example:') print(between_markers('What is >apple<', '>', '<')) # These "asserts" are used for self-checking and not for testing assert between_markers('What is >apple<', '>', '<') == "apple" assert between_markers('What is [apple]', '[', ']') == "apple" assert between_markers('What is ><', '>', '<') == "" assert between_markers('>apple<', '>', '<') == "apple" print('Wow, you are doing pretty good. Time to check it!')
#addBorder picture = ["abc", "ded"] def addBorder(mang): print("*****") for x in mang: print("*"+x+"*") print("*****")
class Student: free_students = set() def __init__(self, sid: int, pref_list: list, math_grade, cs_grade, utils): self.sid = sid self.math_grade = math_grade self.cs_grade = cs_grade self.pref_list = pref_list self.project = None self.utils = utils self.pair = None def is_free(self): return bool(not self.project) class Project: def __init__(self, pid): self.pid = pid self.grade_type = 'cs_grade' if pid % 2 else 'math_grade' self.proposals = {} self.main_student = None self.partner_student = None self.price = 0 def is_free(self): return bool(not self.main_student) def run_deferred_acceptance(n) -> dict: return {1: 2, 2: 3, 3: 4, 4: 1, 5: 5} def run_deferred_acceptance_for_pairs(n) -> dict: return {1: 2, 2: 2, 3: 3, 4: 3, 5: 5} def count_blocking_pairs(matching_file, n) -> int: return 0 if 'single' in matching_file else 1 def calc_total_welfare(matching_file, n) -> int: return 73 if 'single' in matching_file else 63
text = "X-DSPAM-Confidence: 0.8475" pos = text.find(':') numString = text[pos+1:] num = float(numString) print(num)
x = [42,34,33,35,99] end = len(x) - 1 """ if len(x) % 2 == 0: m = int((0 + end) / 2) else: m = int((0 + end + 1) / 2) print(m) """ def find(arr, start, stop): # global peak if stop % 2 == 0: mid = int((start + stop) / 2) else: mid = int((start + stop - 1) / 2) if arr[mid] > arr[mid - 1] and arr[mid] > arr[mid + 1]: peak = arr[mid] return peak elif arr[mid] < arr[mid - 1]: peak = find(arr, start, mid-1) return peak else: peak = find(arr, mid + 1, stop) return peak print(find(x, 0, end))
def IsPrime(num): for i in range(2, num): if num % i == 0: return False return True fac = [] def solve(num): i = 2 while i <= num: if not IsPrime(i): i += 1 continue if num % i == 0: fac.append(i) num /= i else: i += 1 solve(600851475143) print(fac[-1])
#!/usr/bin/env python # -*- coding: utf-8 -*- class TrackedObj(object): def __init__(self, val): self.val = val def __str__(self): return '[%s]' % self.val class TrackField(TrackedObj): pass class TrackIndex(TrackedObj): pass class TrackVariant(TrackedObj): pass class Tracker(object): def __init__(self): self.cur = [] def push(self, obj): self.cur.append(obj) def push_field(self, obj): self.push(TrackField(obj)) def push_index(self, obj): self.push(TrackIndex(obj)) def push_variant(self, obj): self.push(TrackVariant(obj)) def pop(self): self.cur.pop() def __str__(self): return ''.join([str(x) for x in self.cur]) class ArchiveException(Exception): def __init__(self, *args, **kwargs): super().__init__(*args) self.subexc = None if len(args) == 0 else args[0] self.tracker = kwargs.get('tracker', None) def __str__(self): if self.subexc and isinstance(self.subexc, ArchiveException): return super().__str__() return '%s, path: %s' % (super().__str__(), self.tracker)
class DataGridBoolColumn( DataGridColumnStyle, IComponent, IDisposable, IDataGridColumnStyleEditingNotificationService, ): """ Specifies a column in which each cell contains a check box for representing a Boolean value. DataGridBoolColumn() DataGridBoolColumn(prop: PropertyDescriptor) DataGridBoolColumn(prop: PropertyDescriptor,isDefault: bool) """ def Abort(self, *args): """ Abort(self: DataGridBoolColumn,rowNum: int) Initiates a request to interrupt an edit procedure. rowNum: The number of the row in which an operation is being interrupted. """ pass def BeginUpdate(self, *args): """ BeginUpdate(self: DataGridColumnStyle) Suspends the painting of the column until the System.Windows.Forms.DataGridColumnStyle.EndUpdate method is called. """ pass def CheckValidDataSource(self, *args): """ CheckValidDataSource(self: DataGridColumnStyle,value: CurrencyManager) Throws an exception if the System.Windows.Forms.DataGrid does not have a valid data source,or if this column is not mapped to a valid property in the data source. value: A System.Windows.Forms.CurrencyManager to check. """ pass def ColumnStartedEditing(self, *args): """ ColumnStartedEditing(self: DataGridColumnStyle,editingControl: Control) Informs the System.Windows.Forms.DataGrid that the user has begun editing the column. editingControl: The System.Windows.Forms.Control that hosted by the column. """ pass def Commit(self, *args): """ Commit(self: DataGridBoolColumn,dataSource: CurrencyManager,rowNum: int) -> bool Initiates a request to complete an editing procedure. dataSource: The System.Data.DataView of the edited column. rowNum: The number of the edited row. Returns: true if the editing procedure committed successfully; otherwise,false. """ pass def ConcedeFocus(self, *args): """ ConcedeFocus(self: DataGridBoolColumn) """ pass def CreateHeaderAccessibleObject(self, *args): """ CreateHeaderAccessibleObject(self: DataGridColumnStyle) -> AccessibleObject Gets the System.Windows.Forms.AccessibleObject for the column. Returns: An System.Windows.Forms.AccessibleObject for the column. """ pass def Dispose(self): """ Dispose(self: Component,disposing: bool) Releases the unmanaged resources used by the System.ComponentModel.Component and optionally releases the managed resources. disposing: true to release both managed and unmanaged resources; false to release only unmanaged resources. """ pass def Edit(self, *args): """ Edit(self: DataGridBoolColumn,source: CurrencyManager,rowNum: int,bounds: Rectangle,readOnly: bool,displayText: str,cellIsVisible: bool) Prepares the cell for editing a value. source: The System.Data.DataView of the edited cell. rowNum: The row number of the edited cell. bounds: The System.Drawing.Rectangle in which the control is to be sited. readOnly: true if the value is read only; otherwise,false. displayText: The text to display in the cell. cellIsVisible: true to show the cell; otherwise,false. Edit(self: DataGridColumnStyle,source: CurrencyManager,rowNum: int,bounds: Rectangle,readOnly: bool,displayText: str) Prepares the cell for editing using the specified System.Windows.Forms.CurrencyManager,row number,and System.Drawing.Rectangle parameters. source: The System.Windows.Forms.CurrencyManager for the System.Windows.Forms.DataGridColumnStyle. rowNum: The row number in this column which is being edited. bounds: The System.Drawing.Rectangle in which the control is to be sited. readOnly: A value indicating whether the column is a read-only. true if the value is read-only; otherwise, false. displayText: The text to display in the control. Edit(self: DataGridColumnStyle,source: CurrencyManager,rowNum: int,bounds: Rectangle,readOnly: bool) Prepares a cell for editing. source: The System.Windows.Forms.CurrencyManager for the System.Windows.Forms.DataGridColumnStyle. rowNum: The row number to edit. bounds: The bounding System.Drawing.Rectangle in which the control is to be sited. readOnly: A value indicating whether the column is a read-only. true if the value is read-only; otherwise, false. """ pass def EndUpdate(self, *args): """ EndUpdate(self: DataGridColumnStyle) Resumes the painting of columns suspended by calling the System.Windows.Forms.DataGridColumnStyle.BeginUpdate method. """ pass def EnterNullValue(self, *args): """ EnterNullValue(self: DataGridBoolColumn) Enters a System.DBNull.Value into the column. """ pass def GetColumnValueAtRow(self, *args): """ GetColumnValueAtRow(self: DataGridBoolColumn,lm: CurrencyManager,row: int) -> object Gets the value at the specified row. lm: The System.Windows.Forms.CurrencyManager for the column. row: The row number. Returns: The value,typed as System.Object. """ pass def GetMinimumHeight(self, *args): """ GetMinimumHeight(self: DataGridBoolColumn) -> int Gets the height of a cell in a column. Returns: The height of the column. The default is 16. """ pass def GetPreferredHeight(self, *args): """ GetPreferredHeight(self: DataGridBoolColumn,g: Graphics,value: object) -> int Gets the height used when resizing columns. g: A System.Drawing.Graphics that draws on the screen. value: An System.Object that contains the value to be drawn to the screen. Returns: The height used to automatically resize cells in a column. """ pass def GetPreferredSize(self, *args): """ GetPreferredSize(self: DataGridBoolColumn,g: Graphics,value: object) -> Size Gets the optimum width and height of a cell given a specific value to contain. g: A System.Drawing.Graphics that draws the cell. value: The value that must fit in the cell. Returns: A System.Drawing.Size that contains the drawing information for the cell. """ pass def GetService(self, *args): """ GetService(self: Component,service: Type) -> object Returns an object that represents a service provided by the System.ComponentModel.Component or by its System.ComponentModel.Container. service: A service provided by the System.ComponentModel.Component. Returns: An System.Object that represents a service provided by the System.ComponentModel.Component,or null if the System.ComponentModel.Component does not provide the specified service. """ pass def Invalidate(self, *args): """ Invalidate(self: DataGridColumnStyle) Redraws the column and causes a paint message to be sent to the control. """ pass def MemberwiseClone(self, *args): """ MemberwiseClone(self: MarshalByRefObject,cloneIdentity: bool) -> MarshalByRefObject Creates a shallow copy of the current System.MarshalByRefObject object. cloneIdentity: false to delete the current System.MarshalByRefObject object's identity,which will cause the object to be assigned a new identity when it is marshaled across a remoting boundary. A value of false is usually appropriate. true to copy the current System.MarshalByRefObject object's identity to its clone,which will cause remoting client calls to be routed to the remote server object. Returns: A shallow copy of the current System.MarshalByRefObject object. MemberwiseClone(self: object) -> object Creates a shallow copy of the current System.Object. Returns: A shallow copy of the current System.Object. """ pass def Paint(self, *args): """ Paint(self: DataGridBoolColumn,g: Graphics,bounds: Rectangle,source: CurrencyManager,rowNum: int,backBrush: Brush,foreBrush: Brush,alignToRight: bool) Draws the System.Windows.Forms.DataGridBoolColumn with the given System.Drawing.Graphics, System.Drawing.Rectangle,row number,System.Drawing.Brush,and System.Drawing.Color. g: The System.Drawing.Graphics to draw to. bounds: The bounding System.Drawing.Rectangle to paint into. source: The System.Windows.Forms.CurrencyManager of the column. rowNum: The number of the row in the underlying data table being referred to. backBrush: A System.Drawing.Brush used to paint the background color. foreBrush: A System.Drawing.Color used to paint the foreground color. alignToRight: A value indicating whether to align the content to the right. true if the content is aligned to the right,otherwise,false. Paint(self: DataGridBoolColumn,g: Graphics,bounds: Rectangle,source: CurrencyManager,rowNum: int,alignToRight: bool) Draws the System.Windows.Forms.DataGridBoolColumn with the given System.Drawing.Graphics, System.Drawing.Rectangle,row number,and alignment settings. g: The System.Drawing.Graphics to draw to. bounds: The bounding System.Drawing.Rectangle to paint into. source: The System.Windows.Forms.CurrencyManager of the column. rowNum: The number of the row in the underlying data table being referred to. alignToRight: A value indicating whether to align the content to the right. true if the content is aligned to the right,otherwise,false. Paint(self: DataGridBoolColumn,g: Graphics,bounds: Rectangle,source: CurrencyManager,rowNum: int) Draws the System.Windows.Forms.DataGridBoolColumn with the given System.Drawing.Graphics, System.Drawing.Rectangle and row number. g: The System.Drawing.Graphics to draw to. bounds: The bounding System.Drawing.Rectangle to paint into. source: The System.Windows.Forms.CurrencyManager of the column. rowNum: The number of the row referred to in the underlying data. """ pass def ReleaseHostedControl(self, *args): """ ReleaseHostedControl(self: DataGridColumnStyle) Allows the column to free resources when the control it hosts is not needed. """ pass def SetColumnValueAtRow(self, *args): """ SetColumnValueAtRow(self: DataGridBoolColumn,lm: CurrencyManager,row: int,value: object) Sets the value of a specified row. lm: The System.Windows.Forms.CurrencyManager for the column. row: The row number. value: The value to set,typed as System.Object. """ pass def SetDataGrid(self, *args): """ SetDataGrid(self: DataGridColumnStyle,value: DataGrid) Sets the System.Windows.Forms.DataGrid control that this column belongs to. value: The System.Windows.Forms.DataGrid control that this column belongs to. """ pass def SetDataGridInColumn(self, *args): """ SetDataGridInColumn(self: DataGridColumnStyle,value: DataGrid) Sets the System.Windows.Forms.DataGrid for the column. value: A System.Windows.Forms.DataGrid. """ pass def UpdateUI(self, *args): """ UpdateUI(self: DataGridColumnStyle,source: CurrencyManager,rowNum: int,displayText: str) Updates the value of a specified row with the given text. source: The System.Windows.Forms.CurrencyManager associated with the System.Windows.Forms.DataGridColumnStyle. rowNum: The row to update. displayText: The new value. """ pass def __enter__(self, *args): """ __enter__(self: IDisposable) -> object Provides the implementation of __enter__ for objects which implement IDisposable. """ pass def __exit__(self, *args): """ __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) Provides the implementation of __exit__ for objects which implement IDisposable. """ pass def __init__(self, *args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass @staticmethod def __new__(self, prop=None, isDefault=None): """ __new__(cls: type) __new__(cls: type,prop: PropertyDescriptor) __new__(cls: type,prop: PropertyDescriptor,isDefault: bool) """ pass def __str__(self, *args): pass AllowNull = property(lambda self: object(), lambda self, v: None, lambda self: None) """Gets or sets a value indicating whether null values are allowed. Get: AllowNull(self: DataGridBoolColumn) -> bool Set: AllowNull(self: DataGridBoolColumn)=value """ CanRaiseEvents = property( lambda self: object(), lambda self, v: None, lambda self: None ) """Gets a value indicating whether the component can raise an event. """ DesignMode = property( lambda self: object(), lambda self, v: None, lambda self: None ) """Gets a value that indicates whether the System.ComponentModel.Component is currently in design mode. """ Events = property(lambda self: object(), lambda self, v: None, lambda self: None) """Gets the list of event handlers that are attached to this System.ComponentModel.Component. """ FalseValue = property( lambda self: object(), lambda self, v: None, lambda self: None ) """Gets or sets the actual value used when setting the value of the column to false. Get: FalseValue(self: DataGridBoolColumn) -> object Set: FalseValue(self: DataGridBoolColumn)=value """ FontHeight = property( lambda self: object(), lambda self, v: None, lambda self: None ) """Gets the height of the column's font. """ NullValue = property(lambda self: object(), lambda self, v: None, lambda self: None) """Gets or sets the actual value used when setting the value of the column to System.DBNull.Value. Get: NullValue(self: DataGridBoolColumn) -> object Set: NullValue(self: DataGridBoolColumn)=value """ TrueValue = property(lambda self: object(), lambda self, v: None, lambda self: None) """Gets or sets the actual value used when setting the value of the column to true. Get: TrueValue(self: DataGridBoolColumn) -> object Set: TrueValue(self: DataGridBoolColumn)=value """ AllowNullChanged = None FalseValueChanged = None TrueValueChanged = None
def standardize_text(df, question_field): df[question_field] = df[question_field].str.replace(r"http\S+", "") df[question_field] = df[question_field].str.replace(r"http", "") df[question_field] = df[question_field].str.replace(r"@\S+", "") df[question_field] = df[question_field].str.replace( r"[^A-Za-z0-9(),!?@\'\`\"\_\n]", " " ) df[question_field] = df[question_field].str.replace(r"@", "at") df[question_field] = df[question_field].str.lower() return df def text_to_array(text): empyt_emb = np.zeros(300) text = text[:-1].split()[:30] embeds = [embeddings_index.get(x, empyt_emb) for x in text] embeds += [empyt_emb] * (30 - len(embeds)) return np.array(embeds) def batch_gen(train_df): n_batches = math.ceil(len(train_df) / batch_size) while True: train_df = train_df.sample(frac=1.0) # Shuffle the data. for i in range(n_batches): texts = train_df.iloc[i * batch_size : (i + 1) * batch_size, 1] text_arr = np.array([text_to_array(text) for text in texts]) yield text_arr, np.array( train_df["target"][i * batch_size : (i + 1) * batch_size] )
class Solution: def countPairs(self, nums: List[int], k: int) -> int: ans = 0 gcds = Counter() for num in nums: gcd_i = math.gcd(num, k) for gcd_j, count in gcds.items(): if gcd_i * gcd_j % k == 0: ans += count gcds[gcd_i] += 1 return ans
class WebDriverFactory: def __init__(self): self._drivers = {} self._driver_options = {} def register_web_driver(self, driver_type, web_driver, driver_options): self._drivers[driver_type] = web_driver self._driver_options[driver_type] = driver_options def get_registered_web_drivers(self): return self._drivers def get_web_driver(self, driver_type, driver_path, user_defined_options=None): driver_options_reference = self._driver_options[driver_type] web_driver = self._drivers[driver_type] if not web_driver: raise NotImplemented(f'Unsupported type for browser {driver_type}.') if not user_defined_options or not driver_options_reference: return web_driver(driver_path) driver_options = driver_options_reference() if driver_type == 'EDGE': driver_options.use_chromium = True driver_options.add_argument(user_defined_options) return web_driver(executable_path=driver_path, options=driver_options)
class Solution(object): def countConsistentStrings(self, allowed, words): """ :type allowed: str :type words: List[str] :rtype: int """ str_count = 0 for i in words: flag = True str_count += 1 for j in i: if j not in allowed: flag = False str_count -= 1 break return str_count def main(): allowed = "ab" words = ["ad","bd","aaab","baa","badab"] allowed = "fstqyienx" words = ["n","eeitfns","eqqqsfs","i","feniqis","lhoa","yqyitei","sqtn","kug","z","neqqis"] obj = Solution() return obj.countConsistentStrings(allowed, words) if __name__ == '__main__': print(main())
class Image: def __init__(self): pass # @classmethod # def load(cls, path): # # raise NotImplementedError
''' Just like a balloon without a ribbon, an object without a reference variable cannot be used later. ''' class Mobile: def __init__(self, price, brand): self.price = price self.brand = brand Mobile(1000, "Apple") #After the above line the Mobile # object created is lost and unusable
expected_output = { "slot": { "rp0": { "cpu": { "0": { "idle": 99.1, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.2, "user": 0.7, "waiting": 0.0 }, "1": { "idle": 98.69, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.3, "user": 1.0, "waiting": 0.0 }, "10": { "idle": 97.3, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.19, "user": 2.49, "waiting": 0.0 }, "11": { "idle": 99.2, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.6, "user": 0.2, "waiting": 0.0 }, "12": { "idle": 99.19, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.4, "user": 0.3, "waiting": 0.1 }, "13": { "idle": 99.7, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.19, "user": 0.09, "waiting": 0.0 }, "14": { "idle": 99.4, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.3, "user": 0.3, "waiting": 0.0 }, "15": { "idle": 99.0, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.3, "user": 0.7, "waiting": 0.0 }, "2": { "idle": 99.7, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.2, "user": 0.1, "waiting": 0.0 }, "3": { "idle": 98.6, "irq": 0.0, "nice_process": 0.0, "sirq": 0.1, "system": 0.1, "user": 1.2, "waiting": 0.0 }, "4": { "idle": 98.39, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.4, "user": 1.2, "waiting": 0.0 }, "5": { "idle": 98.9, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.69, "user": 0.39, "waiting": 0.0 }, "6": { "idle": 99.0, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.5, "user": 0.5, "waiting": 0.0 }, "7": { "idle": 99.3, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.5, "user": 0.2, "waiting": 0.0 }, "8": { "idle": 98.9, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.49, "user": 0.59, "waiting": 0.0 }, "9": { "idle": 98.1, "irq": 0.0, "nice_process": 0.0, "sirq": 0.0, "system": 0.4, "user": 1.5, "waiting": 0.0 } }, "load_average": { "15_min": 0.39, "1_min": 0.66, "5_min": 0.6, "status": "unknown" }, "memory": { "committed": 11294396, "committed_percentage": 35, "free": 26573588, "free_percentage": 82, "status": "healthy", "total": 32423072, "used": 5849484, "used_percentage": 18 } } } }
# Create a program that receives two strings on a single line separated by a single space. # Then, it prints the sum of their multiplied character codes as follows: # multiply str1[0] with str2[0] and add the result to the total sum, then continue with the next two characters. # If one of the strings is longer than the other, add the remaining character codes to the total sum without multiplication. sum_of_multiplication = lambda x, y: sum([ord(x[i]) * ord(y[i]) for i in range(min(len(x),len(y)))]) def addition_of_remainder(x, y): diff = abs(len(x) - len(y)) if len(x) > len(y): return sum([ord(ch) for ch in x[-diff:]]) elif len (y) > len(x): return sum([ord(ch) for ch in y[-diff:]]) else: return 0 strings = input().split(' ') output = sum_of_multiplication(strings[0], strings[1]) + addition_of_remainder(strings[0],strings[1]) print (output)
OPENERS = {'(', '{', '['} CLOSER_MAP = {')': '(', '}': '{', ']': '['} def solve(s: str) -> bool: stack = [] for c in s: if c in OPENERS: stack.append(c) elif len(stack) == 0 or stack.pop() != CLOSER_MAP[c]: return False return True if len(stack) == 0 else False def main() -> None: cases = [('()', True), ('([{}])', True), ('((([[)]))', False), ("([)]", False)] for case in cases: print("{} resulted in {}. Expected: {}".format(case, solve(case[0]), case[1])) if __name__ == '__main__': main()
""" Given the triangle of consecutive odd numbers: 1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ... Calculate the row sums of this triangle from the row index (starting at index 1) """ def row_sum_odd_numbers(number: int) -> int: """Returns the row sums. Args: number (int): input number to evaluate Examples: >>> assert row_sum_odd_numbers(1) == 1 >>> assert row_sum_odd_numbers(2) == 8 >>> assert row_sum_odd_numbers(13) == 2197 >>> assert row_sum_odd_numbers(19) == 6859 >>> assert row_sum_odd_numbers(41) == 68921 """ return number ** 3 if __name__ == "__main__": print(row_sum_odd_numbers(19))
''' Task: Your task is to write a function which returns the sum of following series upto nth term(parameter). Series: 1 + 1/4 + 1/7 + 1/10 + 1/13 + 1/16 +... Rules: You need to round the answer to 2 decimal places and return it as String. If the given value is 0 then it should return 0.00 You will only be given Natural Numbers as arguments. Examples: SeriesSum(1) => 1 = "1.00" SeriesSum(2) => 1 + 1/4 = "1.25" SeriesSum(5) => 1 + 1/4 + 1/7 + 1/10 + 1/13 = "1.57" ''' def series_sum(n): summation = 0; denominator = 1 for _ in range(n): summation += 1 / denominator denominator += 3 return str('{:.2f}'.format(summation))
"""AyudaEnPython: https://www.facebook.com/groups/ayudapython Even though the group is only for spanish speakers, english speakers are welcome. """ numbers = [50, 30, 20, 50, 50, 62, 70, 50] # just the first match print("Index ->", numbers.index(50)) # output: Index -> 0 # all matches print("Indexes ->", list((i for i, el in enumerate(numbers) if el == 50))) # output: Indexes -> [0, 3, 4, 7]
# -*- coding: utf-8 -*- """ 1963. Minimum Number of Swaps to Make the String Balanced https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/ Example 1: Input: s = "][][" Output: 1 Explanation: You can make the string balanced by swapping index 0 with index 3. The resulting string is "[[]]". Example 2: Input: s = "]]][[[" Output: 2 Explanation: You can do the following to make the string balanced: - Swap index 0 with index 4. s = "[]][][". - Swap index 1 with index 5. s = "[[][]]". The resulting string is "[[][]]". Example 3: Input: s = "[]" Output: 0 Explanation: The string is already balanced. Reference: https://leetcode.com/problems/minimum-number-of-swaps-to-make-the-string-balanced/discuss/1401218/Very-simple-Python-solution """ class Solution: def minSwaps(self, s: str) -> int: """ TC: O(N) / SC: O(1) """ balance, ans = 0, 0 for i in range(len(s)): if s[i] == "[": balance -= 1 else: balance += 1 if balance > 0: ans += 1 balance = -1 return ans
def count_unique_values(arr): # return 0 of the length of array is 0 # loop the array by the second element at index j # compare the previous element at index i arr_len = len(arr) if arr_len == 0: return 0 pre_index = 0 unique_arr = [arr[pre_index]] for j in range(1, arr_len): if arr[pre_index] != arr[j]: unique_arr.append(arr[j]) pre_index = j print(unique_arr) return len(unique_arr) print(count_unique_values([1, 1, 1, 1, 1, 2])) print(count_unique_values([1, 2, 3, 4, 4, 4, 7, 7, 12, 12, 13])) print(count_unique_values([])) print(count_unique_values([-2, -1, -1, 0, 1]))
#05_01_converter class ScaleConverter: def __init__(self, units_from, units_to, factor): self.units_from = units_from self.units_to = units_to self.factor = factor def description(self): return 'Convert ' + self.units_from + ' to ' + self.units_to def convert(self, value): return value * self.factor c1 = ScaleConverter('inches', 'mm', 25) print(c1.description()) print('converting 2 inches') print(str(c1.convert(2)) + c1.units_to)
#local storage LOCAL="/home/pi/MTU-Timelapse-Pi" #in minutes. 60 % interval must be 0 INTERVAL=5 #time between failed uploads FAILTIME=5 #retry count RETRYCOUNT=3 CMD="raspistill -o '/home/pi/MTU-Timelapse-Pi/cam/%s/%s-%s.jpg' -h 1080 -w 1920 --nopreview --timeout 1"
#!/usr/bin/env python3 """ This Python script is to create temporary dictionary caches. These caches are designed to limit redundant queries. """ __author__ = 'John Bumgarner' __date__ = 'October 15, 2020' __status__ = 'Production' __license__ = 'MIT' __copyright__ = "Copyright (C) 2020 John Bumgarner" ################################################################################## # “AS-IS” Clause # # Except as represented in this agreement, all work produced by Developer is # provided “AS IS”. Other than as provided in this agreement, Developer makes no # other warranties, express or implied, and hereby disclaims all implied warranties, # including any warranty of merchantability and warranty of fitness for a particular # purpose. ################################################################################## ################################################################################## # # Date Completed: October 15, 2020 # Author: John Bumgarner # # Date Last Revised: July 4, 2021 # Revised by: John Bumgarner # ################################################################################## ################################################################################## # in memory temporary cache for antonyms ################################################################################## temporary_dict_antonyms = {} def cache_antonyms(word): item_to_check = f'{word}' if item_to_check in temporary_dict_antonyms.keys(): new_dict = {key: val for (key, val) in temporary_dict_antonyms.items() if key == item_to_check} return new_dict else: return False def insert_word_cache_antonyms(word, values): if word in temporary_dict_antonyms: temporary_dict_antonyms[word].append(values) else: temporary_dict_antonyms[word] = values ################################################################################## # in memory temporary cache for synonyms ################################################################################## temporary_dict_synonyms = {} def cache_synonyms(word): item_to_check = f'{word}' if item_to_check in temporary_dict_synonyms.keys(): new_dict = {key: val for (key, val) in temporary_dict_synonyms.items() if key == word} return new_dict else: return False def insert_word_cache_synonyms(word, values): if word in temporary_dict_synonyms: temporary_dict_synonyms[word].append(values) else: temporary_dict_synonyms[word] = values ################################################################################## # in memory temporary cache for definitions ################################################################################## temporary_dict_definition = {} def cache_definition(word): item_to_check = f'{word}' if item_to_check in temporary_dict_definition.keys(): new_dict = {key: val for (key, val) in temporary_dict_synonyms.items() if key == word} return new_dict else: return False def insert_word_cache_definition(word, values): if word in temporary_dict_definition: temporary_dict_definition.update({word: values}) else: temporary_dict_definition[word] = values ################################################################################## # in memory temporary cache for hypernyms ################################################################################## temporary_dict_hypernyms = {} def cache_hypernyms(word): item_to_check = f'{word}' if item_to_check in temporary_dict_hypernyms.keys(): new_dict = {key: val for (key, val) in temporary_dict_hypernyms.items() if key == word} return new_dict else: return False def insert_word_cache_hypernyms(word, values): if word in temporary_dict_hypernyms: temporary_dict_hypernyms[word].append(values) else: temporary_dict_hypernyms[word] = values ################################################################################## # in memory temporary cache for hyponyms ################################################################################## temporary_dict_hyponyms = {} def cache_hyponyms(word): item_to_check = f'{word}' if item_to_check in temporary_dict_hyponyms.keys(): new_dict = {key: val for (key, val) in temporary_dict_hyponyms.items() if key == word} return new_dict else: return False def insert_word_cache_hyponyms(word, values): if word in temporary_dict_hyponyms: temporary_dict_hyponyms[word].append(values) else: temporary_dict_hyponyms[word] = values
"""Zero_Width table. Created by setup.py.""" # Generated: 2020-03-23T04:40:34.685051 # Source: DerivedGeneralCategory-13.0.0.txt # Date: 2019-10-21, 14:30:32 GMT ZERO_WIDTH = ( (0x0300, 0x036F,), # Combining Grave Accent ..Combining Latin Small Le (0x0483, 0x0489,), # Combining Cyrillic Titlo..Combining Cyrillic Milli (0x0591, 0x05BD,), # Hebrew Accent Etnahta ..Hebrew Point Meteg (0x05BF, 0x05BF,), # Hebrew Point Rafe ..Hebrew Point Rafe (0x05C1, 0x05C2,), # Hebrew Point Shin Dot ..Hebrew Point Sin Dot (0x05C4, 0x05C5,), # Hebrew Mark Upper Dot ..Hebrew Mark Lower Dot (0x05C7, 0x05C7,), # Hebrew Point Qamats Qata..Hebrew Point Qamats Qata (0x0610, 0x061A,), # Arabic Sign Sallallahou ..Arabic Small Kasra (0x064B, 0x065F,), # Arabic Fathatan ..Arabic Wavy Hamza Below (0x0670, 0x0670,), # Arabic Letter Superscrip..Arabic Letter Superscrip (0x06D6, 0x06DC,), # Arabic Small High Ligatu..Arabic Small High Seen (0x06DF, 0x06E4,), # Arabic Small High Rounde..Arabic Small High Madda (0x06E7, 0x06E8,), # Arabic Small High Yeh ..Arabic Small High Noon (0x06EA, 0x06ED,), # Arabic Empty Centre Low ..Arabic Small Low Meem (0x0711, 0x0711,), # Syriac Letter Superscrip..Syriac Letter Superscrip (0x0730, 0x074A,), # Syriac Pthaha Above ..Syriac Barrekh (0x07A6, 0x07B0,), # Thaana Abafili ..Thaana Sukun (0x07EB, 0x07F3,), # Nko Combining Short High..Nko Combining Double Dot (0x07FD, 0x07FD,), # Nko Dantayalan ..Nko Dantayalan (0x0816, 0x0819,), # Samaritan Mark In ..Samaritan Mark Dagesh (0x081B, 0x0823,), # Samaritan Mark Epentheti..Samaritan Vowel Sign A (0x0825, 0x0827,), # Samaritan Vowel Sign Sho..Samaritan Vowel Sign U (0x0829, 0x082D,), # Samaritan Vowel Sign Lon..Samaritan Mark Nequdaa (0x0859, 0x085B,), # Mandaic Affrication Mark..Mandaic Gemination Mark (0x08D3, 0x08E1,), # Arabic Small Low Waw ..Arabic Small High Sign S (0x08E3, 0x0902,), # Arabic Turned Damma Belo..Devanagari Sign Anusvara (0x093A, 0x093A,), # Devanagari Vowel Sign Oe..Devanagari Vowel Sign Oe (0x093C, 0x093C,), # Devanagari Sign Nukta ..Devanagari Sign Nukta (0x0941, 0x0948,), # Devanagari Vowel Sign U ..Devanagari Vowel Sign Ai (0x094D, 0x094D,), # Devanagari Sign Virama ..Devanagari Sign Virama (0x0951, 0x0957,), # Devanagari Stress Sign U..Devanagari Vowel Sign Uu (0x0962, 0x0963,), # Devanagari Vowel Sign Vo..Devanagari Vowel Sign Vo (0x0981, 0x0981,), # Bengali Sign Candrabindu..Bengali Sign Candrabindu (0x09BC, 0x09BC,), # Bengali Sign Nukta ..Bengali Sign Nukta (0x09C1, 0x09C4,), # Bengali Vowel Sign U ..Bengali Vowel Sign Vocal (0x09CD, 0x09CD,), # Bengali Sign Virama ..Bengali Sign Virama (0x09E2, 0x09E3,), # Bengali Vowel Sign Vocal..Bengali Vowel Sign Vocal (0x09FE, 0x09FE,), # Bengali Sandhi Mark ..Bengali Sandhi Mark (0x0A01, 0x0A02,), # Gurmukhi Sign Adak Bindi..Gurmukhi Sign Bindi (0x0A3C, 0x0A3C,), # Gurmukhi Sign Nukta ..Gurmukhi Sign Nukta (0x0A41, 0x0A42,), # Gurmukhi Vowel Sign U ..Gurmukhi Vowel Sign Uu (0x0A47, 0x0A48,), # Gurmukhi Vowel Sign Ee ..Gurmukhi Vowel Sign Ai (0x0A4B, 0x0A4D,), # Gurmukhi Vowel Sign Oo ..Gurmukhi Sign Virama (0x0A51, 0x0A51,), # Gurmukhi Sign Udaat ..Gurmukhi Sign Udaat (0x0A70, 0x0A71,), # Gurmukhi Tippi ..Gurmukhi Addak (0x0A75, 0x0A75,), # Gurmukhi Sign Yakash ..Gurmukhi Sign Yakash (0x0A81, 0x0A82,), # Gujarati Sign Candrabind..Gujarati Sign Anusvara (0x0ABC, 0x0ABC,), # Gujarati Sign Nukta ..Gujarati Sign Nukta (0x0AC1, 0x0AC5,), # Gujarati Vowel Sign U ..Gujarati Vowel Sign Cand (0x0AC7, 0x0AC8,), # Gujarati Vowel Sign E ..Gujarati Vowel Sign Ai (0x0ACD, 0x0ACD,), # Gujarati Sign Virama ..Gujarati Sign Virama (0x0AE2, 0x0AE3,), # Gujarati Vowel Sign Voca..Gujarati Vowel Sign Voca (0x0AFA, 0x0AFF,), # Gujarati Sign Sukun ..Gujarati Sign Two-circle (0x0B01, 0x0B01,), # Oriya Sign Candrabindu ..Oriya Sign Candrabindu (0x0B3C, 0x0B3C,), # Oriya Sign Nukta ..Oriya Sign Nukta (0x0B3F, 0x0B3F,), # Oriya Vowel Sign I ..Oriya Vowel Sign I (0x0B41, 0x0B44,), # Oriya Vowel Sign U ..Oriya Vowel Sign Vocalic (0x0B4D, 0x0B4D,), # Oriya Sign Virama ..Oriya Sign Virama (0x0B55, 0x0B56,), # (nil) ..Oriya Ai Length Mark (0x0B62, 0x0B63,), # Oriya Vowel Sign Vocalic..Oriya Vowel Sign Vocalic (0x0B82, 0x0B82,), # Tamil Sign Anusvara ..Tamil Sign Anusvara (0x0BC0, 0x0BC0,), # Tamil Vowel Sign Ii ..Tamil Vowel Sign Ii (0x0BCD, 0x0BCD,), # Tamil Sign Virama ..Tamil Sign Virama (0x0C00, 0x0C00,), # Telugu Sign Combining Ca..Telugu Sign Combining Ca (0x0C04, 0x0C04,), # Telugu Sign Combining An..Telugu Sign Combining An (0x0C3E, 0x0C40,), # Telugu Vowel Sign Aa ..Telugu Vowel Sign Ii (0x0C46, 0x0C48,), # Telugu Vowel Sign E ..Telugu Vowel Sign Ai (0x0C4A, 0x0C4D,), # Telugu Vowel Sign O ..Telugu Sign Virama (0x0C55, 0x0C56,), # Telugu Length Mark ..Telugu Ai Length Mark (0x0C62, 0x0C63,), # Telugu Vowel Sign Vocali..Telugu Vowel Sign Vocali (0x0C81, 0x0C81,), # Kannada Sign Candrabindu..Kannada Sign Candrabindu (0x0CBC, 0x0CBC,), # Kannada Sign Nukta ..Kannada Sign Nukta (0x0CBF, 0x0CBF,), # Kannada Vowel Sign I ..Kannada Vowel Sign I (0x0CC6, 0x0CC6,), # Kannada Vowel Sign E ..Kannada Vowel Sign E (0x0CCC, 0x0CCD,), # Kannada Vowel Sign Au ..Kannada Sign Virama (0x0CE2, 0x0CE3,), # Kannada Vowel Sign Vocal..Kannada Vowel Sign Vocal (0x0D00, 0x0D01,), # Malayalam Sign Combining..Malayalam Sign Candrabin (0x0D3B, 0x0D3C,), # Malayalam Sign Vertical ..Malayalam Sign Circular (0x0D41, 0x0D44,), # Malayalam Vowel Sign U ..Malayalam Vowel Sign Voc (0x0D4D, 0x0D4D,), # Malayalam Sign Virama ..Malayalam Sign Virama (0x0D62, 0x0D63,), # Malayalam Vowel Sign Voc..Malayalam Vowel Sign Voc (0x0D81, 0x0D81,), # (nil) .. (0x0DCA, 0x0DCA,), # Sinhala Sign Al-lakuna ..Sinhala Sign Al-lakuna (0x0DD2, 0x0DD4,), # Sinhala Vowel Sign Ketti..Sinhala Vowel Sign Ketti (0x0DD6, 0x0DD6,), # Sinhala Vowel Sign Diga ..Sinhala Vowel Sign Diga (0x0E31, 0x0E31,), # Thai Character Mai Han-a..Thai Character Mai Han-a (0x0E34, 0x0E3A,), # Thai Character Sara I ..Thai Character Phinthu (0x0E47, 0x0E4E,), # Thai Character Maitaikhu..Thai Character Yamakkan (0x0EB1, 0x0EB1,), # Lao Vowel Sign Mai Kan ..Lao Vowel Sign Mai Kan (0x0EB4, 0x0EBC,), # Lao Vowel Sign I ..Lao Semivowel Sign Lo (0x0EC8, 0x0ECD,), # Lao Tone Mai Ek ..Lao Niggahita (0x0F18, 0x0F19,), # Tibetan Astrological Sig..Tibetan Astrological Sig (0x0F35, 0x0F35,), # Tibetan Mark Ngas Bzung ..Tibetan Mark Ngas Bzung (0x0F37, 0x0F37,), # Tibetan Mark Ngas Bzung ..Tibetan Mark Ngas Bzung (0x0F39, 0x0F39,), # Tibetan Mark Tsa -phru ..Tibetan Mark Tsa -phru (0x0F71, 0x0F7E,), # Tibetan Vowel Sign Aa ..Tibetan Sign Rjes Su Nga (0x0F80, 0x0F84,), # Tibetan Vowel Sign Rever..Tibetan Mark Halanta (0x0F86, 0x0F87,), # Tibetan Sign Lci Rtags ..Tibetan Sign Yang Rtags (0x0F8D, 0x0F97,), # Tibetan Subjoined Sign L..Tibetan Subjoined Letter (0x0F99, 0x0FBC,), # Tibetan Subjoined Letter..Tibetan Subjoined Letter (0x0FC6, 0x0FC6,), # Tibetan Symbol Padma Gda..Tibetan Symbol Padma Gda (0x102D, 0x1030,), # Myanmar Vowel Sign I ..Myanmar Vowel Sign Uu (0x1032, 0x1037,), # Myanmar Vowel Sign Ai ..Myanmar Sign Dot Below (0x1039, 0x103A,), # Myanmar Sign Virama ..Myanmar Sign Asat (0x103D, 0x103E,), # Myanmar Consonant Sign M..Myanmar Consonant Sign M (0x1058, 0x1059,), # Myanmar Vowel Sign Vocal..Myanmar Vowel Sign Vocal (0x105E, 0x1060,), # Myanmar Consonant Sign M..Myanmar Consonant Sign M (0x1071, 0x1074,), # Myanmar Vowel Sign Geba ..Myanmar Vowel Sign Kayah (0x1082, 0x1082,), # Myanmar Consonant Sign S..Myanmar Consonant Sign S (0x1085, 0x1086,), # Myanmar Vowel Sign Shan ..Myanmar Vowel Sign Shan (0x108D, 0x108D,), # Myanmar Sign Shan Counci..Myanmar Sign Shan Counci (0x109D, 0x109D,), # Myanmar Vowel Sign Aiton..Myanmar Vowel Sign Aiton (0x135D, 0x135F,), # Ethiopic Combining Gemin..Ethiopic Combining Gemin (0x1712, 0x1714,), # Tagalog Vowel Sign I ..Tagalog Sign Virama (0x1732, 0x1734,), # Hanunoo Vowel Sign I ..Hanunoo Sign Pamudpod (0x1752, 0x1753,), # Buhid Vowel Sign I ..Buhid Vowel Sign U (0x1772, 0x1773,), # Tagbanwa Vowel Sign I ..Tagbanwa Vowel Sign U (0x17B4, 0x17B5,), # Khmer Vowel Inherent Aq ..Khmer Vowel Inherent Aa (0x17B7, 0x17BD,), # Khmer Vowel Sign I ..Khmer Vowel Sign Ua (0x17C6, 0x17C6,), # Khmer Sign Nikahit ..Khmer Sign Nikahit (0x17C9, 0x17D3,), # Khmer Sign Muusikatoan ..Khmer Sign Bathamasat (0x17DD, 0x17DD,), # Khmer Sign Atthacan ..Khmer Sign Atthacan (0x180B, 0x180D,), # Mongolian Free Variation..Mongolian Free Variation (0x1885, 0x1886,), # Mongolian Letter Ali Gal..Mongolian Letter Ali Gal (0x18A9, 0x18A9,), # Mongolian Letter Ali Gal..Mongolian Letter Ali Gal (0x1920, 0x1922,), # Limbu Vowel Sign A ..Limbu Vowel Sign U (0x1927, 0x1928,), # Limbu Vowel Sign E ..Limbu Vowel Sign O (0x1932, 0x1932,), # Limbu Small Letter Anusv..Limbu Small Letter Anusv (0x1939, 0x193B,), # Limbu Sign Mukphreng ..Limbu Sign Sa-i (0x1A17, 0x1A18,), # Buginese Vowel Sign I ..Buginese Vowel Sign U (0x1A1B, 0x1A1B,), # Buginese Vowel Sign Ae ..Buginese Vowel Sign Ae (0x1A56, 0x1A56,), # Tai Tham Consonant Sign ..Tai Tham Consonant Sign (0x1A58, 0x1A5E,), # Tai Tham Sign Mai Kang L..Tai Tham Consonant Sign (0x1A60, 0x1A60,), # Tai Tham Sign Sakot ..Tai Tham Sign Sakot (0x1A62, 0x1A62,), # Tai Tham Vowel Sign Mai ..Tai Tham Vowel Sign Mai (0x1A65, 0x1A6C,), # Tai Tham Vowel Sign I ..Tai Tham Vowel Sign Oa B (0x1A73, 0x1A7C,), # Tai Tham Vowel Sign Oa A..Tai Tham Sign Khuen-lue (0x1A7F, 0x1A7F,), # Tai Tham Combining Crypt..Tai Tham Combining Crypt (0x1AB0, 0x1AC0,), # Combining Doubled Circum.. (0x1B00, 0x1B03,), # Balinese Sign Ulu Ricem ..Balinese Sign Surang (0x1B34, 0x1B34,), # Balinese Sign Rerekan ..Balinese Sign Rerekan (0x1B36, 0x1B3A,), # Balinese Vowel Sign Ulu ..Balinese Vowel Sign Ra R (0x1B3C, 0x1B3C,), # Balinese Vowel Sign La L..Balinese Vowel Sign La L (0x1B42, 0x1B42,), # Balinese Vowel Sign Pepe..Balinese Vowel Sign Pepe (0x1B6B, 0x1B73,), # Balinese Musical Symbol ..Balinese Musical Symbol (0x1B80, 0x1B81,), # Sundanese Sign Panyecek ..Sundanese Sign Panglayar (0x1BA2, 0x1BA5,), # Sundanese Consonant Sign..Sundanese Vowel Sign Pan (0x1BA8, 0x1BA9,), # Sundanese Vowel Sign Pam..Sundanese Vowel Sign Pan (0x1BAB, 0x1BAD,), # Sundanese Sign Virama ..Sundanese Consonant Sign (0x1BE6, 0x1BE6,), # Batak Sign Tompi ..Batak Sign Tompi (0x1BE8, 0x1BE9,), # Batak Vowel Sign Pakpak ..Batak Vowel Sign Ee (0x1BED, 0x1BED,), # Batak Vowel Sign Karo O ..Batak Vowel Sign Karo O (0x1BEF, 0x1BF1,), # Batak Vowel Sign U For S..Batak Consonant Sign H (0x1C2C, 0x1C33,), # Lepcha Vowel Sign E ..Lepcha Consonant Sign T (0x1C36, 0x1C37,), # Lepcha Sign Ran ..Lepcha Sign Nukta (0x1CD0, 0x1CD2,), # Vedic Tone Karshana ..Vedic Tone Prenkha (0x1CD4, 0x1CE0,), # Vedic Sign Yajurvedic Mi..Vedic Tone Rigvedic Kash (0x1CE2, 0x1CE8,), # Vedic Sign Visarga Svari..Vedic Sign Visarga Anuda (0x1CED, 0x1CED,), # Vedic Sign Tiryak ..Vedic Sign Tiryak (0x1CF4, 0x1CF4,), # Vedic Tone Candra Above ..Vedic Tone Candra Above (0x1CF8, 0x1CF9,), # Vedic Tone Ring Above ..Vedic Tone Double Ring A (0x1DC0, 0x1DF9,), # Combining Dotted Grave A..Combining Wide Inverted (0x1DFB, 0x1DFF,), # Combining Deletion Mark ..Combining Right Arrowhea (0x20D0, 0x20F0,), # Combining Left Harpoon A..Combining Asterisk Above (0x2CEF, 0x2CF1,), # Coptic Combining Ni Abov..Coptic Combining Spiritu (0x2D7F, 0x2D7F,), # Tifinagh Consonant Joine..Tifinagh Consonant Joine (0x2DE0, 0x2DFF,), # Combining Cyrillic Lette..Combining Cyrillic Lette (0x302A, 0x302D,), # Ideographic Level Tone M..Ideographic Entering Ton (0x3099, 0x309A,), # Combining Katakana-hirag..Combining Katakana-hirag (0xA66F, 0xA672,), # Combining Cyrillic Vzmet..Combining Cyrillic Thous (0xA674, 0xA67D,), # Combining Cyrillic Lette..Combining Cyrillic Payer (0xA69E, 0xA69F,), # Combining Cyrillic Lette..Combining Cyrillic Lette (0xA6F0, 0xA6F1,), # Bamum Combining Mark Koq..Bamum Combining Mark Tuk (0xA802, 0xA802,), # Syloti Nagri Sign Dvisva..Syloti Nagri Sign Dvisva (0xA806, 0xA806,), # Syloti Nagri Sign Hasant..Syloti Nagri Sign Hasant (0xA80B, 0xA80B,), # Syloti Nagri Sign Anusva..Syloti Nagri Sign Anusva (0xA825, 0xA826,), # Syloti Nagri Vowel Sign ..Syloti Nagri Vowel Sign (0xA82C, 0xA82C,), # (nil) .. (0xA8C4, 0xA8C5,), # Saurashtra Sign Virama ..Saurashtra Sign Candrabi (0xA8E0, 0xA8F1,), # Combining Devanagari Dig..Combining Devanagari Sig (0xA8FF, 0xA8FF,), # Devanagari Vowel Sign Ay..Devanagari Vowel Sign Ay (0xA926, 0xA92D,), # Kayah Li Vowel Ue ..Kayah Li Tone Calya Plop (0xA947, 0xA951,), # Rejang Vowel Sign I ..Rejang Consonant Sign R (0xA980, 0xA982,), # Javanese Sign Panyangga ..Javanese Sign Layar (0xA9B3, 0xA9B3,), # Javanese Sign Cecak Telu..Javanese Sign Cecak Telu (0xA9B6, 0xA9B9,), # Javanese Vowel Sign Wulu..Javanese Vowel Sign Suku (0xA9BC, 0xA9BD,), # Javanese Vowel Sign Pepe..Javanese Consonant Sign (0xA9E5, 0xA9E5,), # Myanmar Sign Shan Saw ..Myanmar Sign Shan Saw (0xAA29, 0xAA2E,), # Cham Vowel Sign Aa ..Cham Vowel Sign Oe (0xAA31, 0xAA32,), # Cham Vowel Sign Au ..Cham Vowel Sign Ue (0xAA35, 0xAA36,), # Cham Consonant Sign La ..Cham Consonant Sign Wa (0xAA43, 0xAA43,), # Cham Consonant Sign Fina..Cham Consonant Sign Fina (0xAA4C, 0xAA4C,), # Cham Consonant Sign Fina..Cham Consonant Sign Fina (0xAA7C, 0xAA7C,), # Myanmar Sign Tai Laing T..Myanmar Sign Tai Laing T (0xAAB0, 0xAAB0,), # Tai Viet Mai Kang ..Tai Viet Mai Kang (0xAAB2, 0xAAB4,), # Tai Viet Vowel I ..Tai Viet Vowel U (0xAAB7, 0xAAB8,), # Tai Viet Mai Khit ..Tai Viet Vowel Ia (0xAABE, 0xAABF,), # Tai Viet Vowel Am ..Tai Viet Tone Mai Ek (0xAAC1, 0xAAC1,), # Tai Viet Tone Mai Tho ..Tai Viet Tone Mai Tho (0xAAEC, 0xAAED,), # Meetei Mayek Vowel Sign ..Meetei Mayek Vowel Sign (0xAAF6, 0xAAF6,), # Meetei Mayek Virama ..Meetei Mayek Virama (0xABE5, 0xABE5,), # Meetei Mayek Vowel Sign ..Meetei Mayek Vowel Sign (0xABE8, 0xABE8,), # Meetei Mayek Vowel Sign ..Meetei Mayek Vowel Sign (0xABED, 0xABED,), # Meetei Mayek Apun Iyek ..Meetei Mayek Apun Iyek (0xFB1E, 0xFB1E,), # Hebrew Point Judeo-spani..Hebrew Point Judeo-spani (0xFE00, 0xFE0F,), # Variation Selector-1 ..Variation Selector-16 (0xFE20, 0xFE2F,), # Combining Ligature Left ..Combining Cyrillic Titlo (0x101FD, 0x101FD,), # Phaistos Disc Sign Combi..Phaistos Disc Sign Combi (0x102E0, 0x102E0,), # Coptic Epact Thousands M..Coptic Epact Thousands M (0x10376, 0x1037A,), # Combining Old Permic Let..Combining Old Permic Let (0x10A01, 0x10A03,), # Kharoshthi Vowel Sign I ..Kharoshthi Vowel Sign Vo (0x10A05, 0x10A06,), # Kharoshthi Vowel Sign E ..Kharoshthi Vowel Sign O (0x10A0C, 0x10A0F,), # Kharoshthi Vowel Length ..Kharoshthi Sign Visarga (0x10A38, 0x10A3A,), # Kharoshthi Sign Bar Abov..Kharoshthi Sign Dot Belo (0x10A3F, 0x10A3F,), # Kharoshthi Virama ..Kharoshthi Virama (0x10AE5, 0x10AE6,), # Manichaean Abbreviation ..Manichaean Abbreviation (0x10D24, 0x10D27,), # Hanifi Rohingya Sign Har..Hanifi Rohingya Sign Tas (0x10EAB, 0x10EAC,), # (nil) .. (0x10F46, 0x10F50,), # Sogdian Combining Dot Be..Sogdian Combining Stroke (0x11001, 0x11001,), # Brahmi Sign Anusvara ..Brahmi Sign Anusvara (0x11038, 0x11046,), # Brahmi Vowel Sign Aa ..Brahmi Virama (0x1107F, 0x11081,), # Brahmi Number Joiner ..Kaithi Sign Anusvara (0x110B3, 0x110B6,), # Kaithi Vowel Sign U ..Kaithi Vowel Sign Ai (0x110B9, 0x110BA,), # Kaithi Sign Virama ..Kaithi Sign Nukta (0x11100, 0x11102,), # Chakma Sign Candrabindu ..Chakma Sign Visarga (0x11127, 0x1112B,), # Chakma Vowel Sign A ..Chakma Vowel Sign Uu (0x1112D, 0x11134,), # Chakma Vowel Sign Ai ..Chakma Maayyaa (0x11173, 0x11173,), # Mahajani Sign Nukta ..Mahajani Sign Nukta (0x11180, 0x11181,), # Sharada Sign Candrabindu..Sharada Sign Anusvara (0x111B6, 0x111BE,), # Sharada Vowel Sign U ..Sharada Vowel Sign O (0x111C9, 0x111CC,), # Sharada Sandhi Mark ..Sharada Extra Short Vowe (0x111CF, 0x111CF,), # (nil) .. (0x1122F, 0x11231,), # Khojki Vowel Sign U ..Khojki Vowel Sign Ai (0x11234, 0x11234,), # Khojki Sign Anusvara ..Khojki Sign Anusvara (0x11236, 0x11237,), # Khojki Sign Nukta ..Khojki Sign Shadda (0x1123E, 0x1123E,), # Khojki Sign Sukun ..Khojki Sign Sukun (0x112DF, 0x112DF,), # Khudawadi Sign Anusvara ..Khudawadi Sign Anusvara (0x112E3, 0x112EA,), # Khudawadi Vowel Sign U ..Khudawadi Sign Virama (0x11300, 0x11301,), # Grantha Sign Combining A..Grantha Sign Candrabindu (0x1133B, 0x1133C,), # Combining Bindu Below ..Grantha Sign Nukta (0x11340, 0x11340,), # Grantha Vowel Sign Ii ..Grantha Vowel Sign Ii (0x11366, 0x1136C,), # Combining Grantha Digit ..Combining Grantha Digit (0x11370, 0x11374,), # Combining Grantha Letter..Combining Grantha Letter (0x11438, 0x1143F,), # Newa Vowel Sign U ..Newa Vowel Sign Ai (0x11442, 0x11444,), # Newa Sign Virama ..Newa Sign Anusvara (0x11446, 0x11446,), # Newa Sign Nukta ..Newa Sign Nukta (0x1145E, 0x1145E,), # Newa Sandhi Mark ..Newa Sandhi Mark (0x114B3, 0x114B8,), # Tirhuta Vowel Sign U ..Tirhuta Vowel Sign Vocal (0x114BA, 0x114BA,), # Tirhuta Vowel Sign Short..Tirhuta Vowel Sign Short (0x114BF, 0x114C0,), # Tirhuta Sign Candrabindu..Tirhuta Sign Anusvara (0x114C2, 0x114C3,), # Tirhuta Sign Virama ..Tirhuta Sign Nukta (0x115B2, 0x115B5,), # Siddham Vowel Sign U ..Siddham Vowel Sign Vocal (0x115BC, 0x115BD,), # Siddham Sign Candrabindu..Siddham Sign Anusvara (0x115BF, 0x115C0,), # Siddham Sign Virama ..Siddham Sign Nukta (0x115DC, 0x115DD,), # Siddham Vowel Sign Alter..Siddham Vowel Sign Alter (0x11633, 0x1163A,), # Modi Vowel Sign U ..Modi Vowel Sign Ai (0x1163D, 0x1163D,), # Modi Sign Anusvara ..Modi Sign Anusvara (0x1163F, 0x11640,), # Modi Sign Virama ..Modi Sign Ardhacandra (0x116AB, 0x116AB,), # Takri Sign Anusvara ..Takri Sign Anusvara (0x116AD, 0x116AD,), # Takri Vowel Sign Aa ..Takri Vowel Sign Aa (0x116B0, 0x116B5,), # Takri Vowel Sign U ..Takri Vowel Sign Au (0x116B7, 0x116B7,), # Takri Sign Nukta ..Takri Sign Nukta (0x1171D, 0x1171F,), # Ahom Consonant Sign Medi..Ahom Consonant Sign Medi (0x11722, 0x11725,), # Ahom Vowel Sign I ..Ahom Vowel Sign Uu (0x11727, 0x1172B,), # Ahom Vowel Sign Aw ..Ahom Sign Killer (0x1182F, 0x11837,), # Dogra Vowel Sign U ..Dogra Sign Anusvara (0x11839, 0x1183A,), # Dogra Sign Virama ..Dogra Sign Nukta (0x1193B, 0x1193C,), # (nil) .. (0x1193E, 0x1193E,), # (nil) .. (0x11943, 0x11943,), # (nil) .. (0x119D4, 0x119D7,), # (nil) .. (0x119DA, 0x119DB,), # (nil) .. (0x119E0, 0x119E0,), # (nil) .. (0x11A01, 0x11A0A,), # Zanabazar Square Vowel S..Zanabazar Square Vowel L (0x11A33, 0x11A38,), # Zanabazar Square Final C..Zanabazar Square Sign An (0x11A3B, 0x11A3E,), # Zanabazar Square Cluster..Zanabazar Square Cluster (0x11A47, 0x11A47,), # Zanabazar Square Subjoin..Zanabazar Square Subjoin (0x11A51, 0x11A56,), # Soyombo Vowel Sign I ..Soyombo Vowel Sign Oe (0x11A59, 0x11A5B,), # Soyombo Vowel Sign Vocal..Soyombo Vowel Length Mar (0x11A8A, 0x11A96,), # Soyombo Final Consonant ..Soyombo Sign Anusvara (0x11A98, 0x11A99,), # Soyombo Gemination Mark ..Soyombo Subjoiner (0x11C30, 0x11C36,), # Bhaiksuki Vowel Sign I ..Bhaiksuki Vowel Sign Voc (0x11C38, 0x11C3D,), # Bhaiksuki Vowel Sign E ..Bhaiksuki Sign Anusvara (0x11C3F, 0x11C3F,), # Bhaiksuki Sign Virama ..Bhaiksuki Sign Virama (0x11C92, 0x11CA7,), # Marchen Subjoined Letter..Marchen Subjoined Letter (0x11CAA, 0x11CB0,), # Marchen Subjoined Letter..Marchen Vowel Sign Aa (0x11CB2, 0x11CB3,), # Marchen Vowel Sign U ..Marchen Vowel Sign E (0x11CB5, 0x11CB6,), # Marchen Sign Anusvara ..Marchen Sign Candrabindu (0x11D31, 0x11D36,), # Masaram Gondi Vowel Sign..Masaram Gondi Vowel Sign (0x11D3A, 0x11D3A,), # Masaram Gondi Vowel Sign..Masaram Gondi Vowel Sign (0x11D3C, 0x11D3D,), # Masaram Gondi Vowel Sign..Masaram Gondi Vowel Sign (0x11D3F, 0x11D45,), # Masaram Gondi Vowel Sign..Masaram Gondi Virama (0x11D47, 0x11D47,), # Masaram Gondi Ra-kara ..Masaram Gondi Ra-kara (0x11D90, 0x11D91,), # Gunjala Gondi Vowel Sign..Gunjala Gondi Vowel Sign (0x11D95, 0x11D95,), # Gunjala Gondi Sign Anusv..Gunjala Gondi Sign Anusv (0x11D97, 0x11D97,), # Gunjala Gondi Virama ..Gunjala Gondi Virama (0x11EF3, 0x11EF4,), # Makasar Vowel Sign I ..Makasar Vowel Sign U (0x16AF0, 0x16AF4,), # Bassa Vah Combining High..Bassa Vah Combining High (0x16B30, 0x16B36,), # Pahawh Hmong Mark Cim Tu..Pahawh Hmong Mark Cim Ta (0x16F4F, 0x16F4F,), # (nil) .. (0x16F8F, 0x16F92,), # Miao Tone Right ..Miao Tone Below (0x16FE4, 0x16FE4,), # (nil) .. (0x1BC9D, 0x1BC9E,), # Duployan Thick Letter Se..Duployan Double Mark (0x1D167, 0x1D169,), # Musical Symbol Combining..Musical Symbol Combining (0x1D17B, 0x1D182,), # Musical Symbol Combining..Musical Symbol Combining (0x1D185, 0x1D18B,), # Musical Symbol Combining..Musical Symbol Combining (0x1D1AA, 0x1D1AD,), # Musical Symbol Combining..Musical Symbol Combining (0x1D242, 0x1D244,), # Combining Greek Musical ..Combining Greek Musical (0x1DA00, 0x1DA36,), # Signwriting Head Rim ..Signwriting Air Sucking (0x1DA3B, 0x1DA6C,), # Signwriting Mouth Closed..Signwriting Excitement (0x1DA75, 0x1DA75,), # Signwriting Upper Body T..Signwriting Upper Body T (0x1DA84, 0x1DA84,), # Signwriting Location Hea..Signwriting Location Hea (0x1DA9B, 0x1DA9F,), # Signwriting Fill Modifie..Signwriting Fill Modifie (0x1DAA1, 0x1DAAF,), # Signwriting Rotation Mod..Signwriting Rotation Mod (0x1E000, 0x1E006,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E008, 0x1E018,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E01B, 0x1E021,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E023, 0x1E024,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E026, 0x1E02A,), # Combining Glagolitic Let..Combining Glagolitic Let (0x1E130, 0x1E136,), # (nil) .. (0x1E2EC, 0x1E2EF,), # (nil) .. (0x1E8D0, 0x1E8D6,), # Mende Kikakui Combining ..Mende Kikakui Combining (0x1E944, 0x1E94A,), # Adlam Alif Lengthener ..Adlam Nukta (0xE0100, 0xE01EF,), # Variation Selector-17 ..Variation Selector-256 )
class line(object): def __init__(self, _char, _row, _column, _dir, _length): self.char = _char self.row = _row self.column = _column self.dir = _dir self.length = _length return None
"""Compare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0. You may assume that the version strings are non-empty and contain only digits and the . character. The . character does not represent a decimal point and is used to separate number sequences. For instance, 2.5 is not "two and a half" or "half way to version three", it is the fifth second-level revision of the second first-level revision. """ class Solution(object): def compareVersion(self, version1, version2): """ :type version1: str :type version2: str :rtype: int """ version1 = [int(v) for v in version1.split('.')] version2 = [int(v) for v in version2.split('.')] for i in range(max(len(version1), len(version2))): v1 = version1[i] if i < len(version1) else 0 v2 = version2[i] if i < len(version2) else 0 if v1 > v2: return 1 elif v1 < v2: return -1 return 0 if __name__ == '__main__': solution = Solution() print(solution.compareVersion("0.1", "1.1"))
A, B, C = map(int, input().split()) print((A+B)%C) print((A%C+B%C)%C) print((A*B)%C) print(((A%C)*(B%C))%C)
lst_1=[1,2,4,88] lst_2=[1,3,4,95,120] lst_3=[] i=0 j=0 for k in range(len(lst_1)+len(lst_2)): if (lst_1[i]<= (lst_2[j])): lst_3.append(lst_1[i]) if (i>=len(lst_1)-1): if j<=(len(lst_2)-1): lst_3.append(lst_2[j]) if j<len(lst_2)-1: j+=1 else: break else: break else: i+=1 else: if j<len(lst_2)-1: lst_3.append(lst_2[j]) j+=1 else: break print(lst_3) i = j = 0 for index in range(len(lst_1)): if lst_1[i] == lst_2[j]: lst_3.append([lst_1[i],lst_2[j]]) i = i + 1 j = j + 1 elif lst_1[i] > lst_2[j]: lst_3.append(lst_2[j]) j= j + 1 elif lst_2[j] > lst_1[i]: lst_3.append(lst_1[i]) i = i + 1
class JournalBlock: """ Represents a JournalBlock that was recorded after executing a transaction in the ledger. """ def __init__(self, block_address, transaction_id, block_timestamp, block_hash, entries_hash, previous_block_hash, entries_hash_list, transaction_info, revisions): self.block_address = block_address self.transaction_id = transaction_id self.block_timestamp = block_timestamp self.block_hash = block_hash self.entries_hash = entries_hash self.previous_block_hash = previous_block_hash self.entries_hash_list = entries_hash_list self.transaction_info = transaction_info self.revisions = revisions def from_ion(ion_value): """ Construct a new JournalBlock object from an IonStruct. :type ion_value: :py:class:`amazon.ion.simple_types.IonSymbol` :param ion_value: The IonStruct returned by QLDB that represents a journal block. :rtype: :py:class:`hash_chain.ledger.qldb.journal_block.JournalBlock` :return: The constructed JournalBlock object. """ block_address = ion_value.get('blockAddress') transaction_id = ion_value.get('transactionId') block_timestamp = ion_value.get('blockTimestamp') block_hash = ion_value.get('blockHash') entries_hash = ion_value.get('entriesHash') previous_block_hash = ion_value.get('previousBlockHash') entries_hash_list = ion_value.get('entriesHashList') transaction_info = ion_value.get('transactionInfo') revisions = ion_value.get('revisions') journal_block = JournalBlock(block_address, transaction_id, block_timestamp, block_hash, entries_hash, previous_block_hash, entries_hash_list, transaction_info, revisions) return journal_block
__author__ = 'shukkkur' ''' https://codeforces.com/problemset/problem/1475/B B. New Year's Number ''' t = int(input()) for _ in range(t): n = int(input()) if n < 2020: print('NO') else: if n % 2020 <= n / 2020: print('YES') else: print('NO')
def caller(): a = [] for i in range(33, 49): a.append(chr(i)) b = [] c = [] d = [] for i in range(65, 91): b.append(chr(i)) for i in range(97, 123): c.append(chr(i)) for i in range(48, 58): d.append(chr(i)) return a, b, c, d
""" A list of CSS properties to expand. Format: (property, [aliases], unit, [values]) - property : (String) the full CSS property name. - aliases : (String list) a list of aliases for this shortcut. - unit : (String) when defined, assumes that the property has a value with a unit. When the value is numberless (eg, `margin:12`), the given unit will be assumed (`12px`). Set this to `_` for unitless numbers (eg, line-height). - values : (String list) possible values for this property. Each property will be accessible through these ways: - fuzzy matches of the aliases defined - fuzzy matches of the property name, no dashes (eg: mi, min, minh, minhe, minhei...) - fuzzy matches with dashes (eg: min-h, min-hei, min-heig...) """ properties = [ ("margin", [], "px", ["auto"]), ("width", [], "px", ["auto"]), ("height", [], "px", ["auto"]), ("padding", [], "px", ["auto"]), ("border", [], None, None), ("outline", [], None, None), ("left", [], "px", None), ("top", [], "px", None), ("bottom", [], "px", None), ("right", [], "px", None), ("background", ["bground"], None, ["transparent"]), ("min-height", ["mheight"], "px", ["auto"]), ("min-width", ["mwidth"], "px", ["auto"]), ("max-height", ["xheight","mxheight"], "px", ["auto"]), ("max-width", ["xwidth","mxheight"], "px", ["auto"]), ("margin-left", ["mleft","marleft"], "px", ["auto"]), ("margin-right", ["mright","marright"], "px", ["auto"]), ("margin-top", ["mtop","martop"], "px", ["auto"]), ("margin-bottom", ["mbottom","marbottom"], "px", ["auto"]), ("padding-left", ["pleft","padleft"], "px", None), ("padding-right", ["pright","padright"], "px", None), ("padding-top", ["ptop","padtop"], "px", None), ("padding-bottom", ["pbottom","padbottom"], "px", None), ("z-index", [], "_", None), ("display", [], None, ["none", "block", "inline", "inline-block", "table", "table-cell", "table-row"]), ("text-align", ["talign"], None, ["left", "right", "justify", "center", "inherit"]), ("overflow", ["oflow"], None, ["visible", "scroll", "hidden", "auto", "inherit"]), ("overflow-x", ["ox"], None, ["visible", "scroll", "hidden", "auto", "inherit"]), ("overflow-y", ["oy"], None, ["visible", "scroll", "hidden", "auto", "inherit"]), ("font", [], None, None), ("font-size", ["fsize", "fosize"], "em", None), ("font-style", ["fstyle", "fostyle"], None, ["italic","normal","inherit"]), ("font-weight", ["fweight", "foweight"], None, ["100","200","300","400","500","600","700","800","900","bold","normal","inherit"]), ("font-variant", ["fvariant", "fovariant"], None, None), ("font-family", ["ffamily", "family"], None, None), ("line-height", ["lheight", "liheight"], "_", None), ("letter-spacing", ["lspacing", "lespacing"], "px", None), ("transition", ["trans", "tn", "tsition"], None, None), ("transform", ["tform", "xform"], None, None), ("text-transform", ["ttransform"], None, ["uppercase", "lowercase", "capitalize", "none", "full-width", "inherit"]), ("text-decoration", ["tdecoration"], None, ["underline", "none", "line-through", "overline", "inherit", "initial"]), ("text-decoration-line", ["tdline"], None, ["underline", "none", "line-through", "overline", "inherit", "initial"]), ("text-indent", ["tindent"], "px", None), ("text-shadow", ["tshadow", "teshadow"], None, ["none"]), ("table-layout", ["tlayout", "talayout"], None, ["fixed", "auto", "inherit"]), ("vertical-align", ["valign"], None, ["middle","top","bottom","baseline","text-top","text-bottom","sub","super"]), ("transition-duration", ["tduration"], "ms", None), ("float", [], None, ["left", "right", "none", "inherit"]), ("color", [], None, None), ("opacity", [], "_", None), ("border-right", ["bright", "borright"], None, None), ("border-left", ["bleft", "borleft"], None, None), ("border-top", ["btop", "bortop"], None, None), ("border-bottom", ["bbottom", "borbottom"], None, None), ("border-width", ["bwidth"], "px", None), ("border-right-width", ["brwidth"], "px", None), ("border-left-width", ["blwidth"], "px", None), ("border-top-width", ["btwidth"], "px", None), ("border-bottom-width", ["bbwidth"], "px", None), ("border-image", ["borimage"], None, None), ("cursor", [], None, ["wait", "pointer", "auto", "default", "help", "progress", "cell", "crosshair", "text", "vertical-text", "alias", "copy", "move", "not-allowed", "no-drop", "all-scroll", "col-resize", "row-resize", "n-resize", "e-resize", "s-resize", "w-resize", "nw-resize", "ne-resize", "sw-resize", "se-resize", "ew-resize", "ns-resize", "zoom-in", "zoom-out", "grab", "grabbing" ]), ("animation", [], None, None), ("background-image", ["bgimage", "backimage", "bimage"], None, None), ("background-color", ["bgcolor", "backcolor", "bcolor"], None, None), ("background-size", ["bgsize", "backsize"], None, None), ("background-position", ["bgposition", "backposition", "bposition"], None, ["center", "top", "left", "middle", "bottom", "right"]), ("background-repeat", ["bgrepeat", "backrepeat", "brepeat"], None, ["repeat-x", "repeat-y", "no-repeat"]), ("border-radius", ["bradius", "boradius"], "px", None), ("border-color", ["bcolor", "bocolor", "borcolor"], "px", None), ("border-collapse", ["bcollapse", "borcollapse", "collapse"], None, ["collapse","auto","inherit"]), ("box-shadow", ["bshadow", "boshadow"], None, ["none"]), ("box-sizing", ["bsizing", "bsize", "boxsize"], None, ["border-box", "content-box", "padding-box"]), ("position", [], None, ["absolute", "relative", "fixed", "static", "inherit"]), ("flex", [], None, None), ("white-space", ["wspace", "whispace", "whspace", "wispace"], None, ["nowrap", "normal", "pre", "pre-wrap", "pre-line", "inherit"]), ("visibility", [], None, ["visible", "hidden", "collapse", "inherit"]), ("flex-grow", ["fgrow", "flgrow", "flegrow"], "_", None), ("flex-shrink", ["fshrink", "flshrink", "fleshrink"], "_", None), ("flex-direction", ["fdirection", "fldirection", "fledirection"], None, None), ("flex-wrap", ["fwrap", "flwrap", "flewrap"], None, None), ("align-items", ["aitems", "alitems"], None, ["flex-start", "flex-end", "center", "baseline", "stretch", "inherit"]), ("justify-content", ["jcontent", "jucontent", "juscontent", "justcontent"], None, ["flex-start", "flex-end", "center", "space-around", "space-between", "inherit"]), ("order", [], "_", None), ("page-break-after", ["pbafter"], None, ["always", "auto", "avoid", "left", "right", "inherit"]), ("page-break-before", ["pbbefore"], None, ["always", "auto", "avoid", "left", "right", "inherit"]), ("perspective", [], None, None), ("perspective-origin", ["porigin"], None, None), ("word-break", ["wbreak"], None, []), ("quotes", [], None, None), ("content", [], None, None), ("clear", [], None, ["left", "right", "both", "inherit"]), ("zoom", [], "_", None), ("direction", [], None, ["ltr", "rtl", "inherit"]), ("list-style", ["lstyle"], None, ["none", "square", "disc", "inside", "outside", "inherit", "initial", "unset", "decimal", "georgian"]), ] """ A list of CSS statements to expand. This differs from `properties` as this defines shortcuts for an entire statement. For instance, `dib<Enter>` will expand to `display: inline-block`. Each line is in this format: (property, value, alias) The following options are available: - alias : (String list) see `property_list` on how aliases work. """ statements = [ ("display", "block", ["dblock"]), ("display", "inline", ["dinline"]), ("display", "inline-block", ["diblock"]), ("display", "inline-flex", ["diflex"]), ("display", "table", ["dtable", "table"]), ("display", "table-cell", ["dtcell","cell","tablecell","table-cell"]), ("display", "table-row", ["dtrow","row","tablerow","table-row"]), ("float", "left", ["fleft", "flleft", "floleft"]), ("float", "right", ["fright", "flright", "floright"]), ("float", "none", ["fnone", "flnone", "flonone"]), ("display", "none", ["dnone"]), ("display", "flex", ["dflex", "flex"]), ("font-weight", "normal", ["fwnormal"]), ("font-weight", "bold", ["fwbold", "bold"]), ("font-style", "italic", ["fsitalic", "italic"]), ("font-style", "normal", ["fnormal"]), ("border", "0", ["b0"]), ("padding", "0", ["p0","po"]), ("margin", "0", ["m0","mo"]), ("margin", "0 auto", ["m0a", "moa"]), ("overflow", "hidden", ["ohidden"]), ("overflow", "scroll", ["oscroll"]), ("overflow", "auto", ["oauto"]), ("overflow", "visible", ["ovisible"]), ("overflow-x", "hidden", ["oxhidden"]), ("overflow-x", "scroll", ["oxscroll"]), ("overflow-x", "auto", ["oxauto"]), ("overflow-x", "visible", ["oxvisible"]), ("overflow-y", "hidden", ["oyhidden"]), ("overflow-y", "scroll", ["oyscroll"]), ("overflow-y", "auto", ["oyauto"]), ("overflow-y", "visible", ["oyvisible"]), ("font-weight", "100", ["f100", "fw100"]), ("font-weight", "200", ["f200", "fw200"]), ("font-weight", "300", ["f300", "fw300"]), ("font-weight", "400", ["f400", "fw400"]), ("font-weight", "500", ["f500", "fw500"]), ("font-weight", "600", ["f600", "fw600"]), ("font-weight", "700", ["f700", "fw700"]), ("font-weight", "800", ["f800", "fw800"]), ("font-weight", "900", ["f900", "fw900"]), ("border", "0", ["b0"]), ("border-collapse", "collapse", ["bccollapse"]), ("border-collapse", "separate", ["bcseparate"]), ("background-repeat", "repeat-x", [ "brx", "rx", "bgrx", "repeatx" ]), ("background-repeat", "repeat-y", [ "bry", "ry", "bgry", "repeaty" ]), ("background-repeat", "no-repeat", [ "brnorepeat", "norepeat"]), ("background-size", "cover", ["cover"]), ("background-size", "contain", ["contain"]), ("cursor", "pointer", ["cupointer", "curpointer"]), ("cursor", "wait", ["cuwait", "curwait"]), ("cursor", "busy", ["cubusy", "curbusy"]), ("cursor", "text", ["cutext", "curtext"]), ("vertical-align", "middle", ["vamiddle"]), ("vertical-align", "top", ["vatop"]), ("vertical-align", "bottom", ["vabottom"]), ("vertical-align", "sub", ["vasub"]), ("vertical-align", "super", ["vasuper"]), ("vertical-align", "baseline", ["vabline", "vabaseline", "baseline"]), ("vertical-align", "text-top", ["vattop"]), ("vertical-align", "text-bottom", ["vattbottom"]), ("visibility", "visible", ["vvisible","visible"]), ("visibility", "hidden", ["vhidden", "vishidden", "vihidden", "hidden", "hide"]), ("visibility", "collapse", ["vcollapse", "viscollapse", "vicollapse"]), ("clear", "both", ["cboth"]), ("clear", "right", ["cright"]), ("clear", "left", ["cleft"]), ("content", "''", ["content"]), ("text-transform", "uppercase", ["ttupper", "uppercase"]), ("text-transform", "lowercase", ["ttlower"]), ("text-transform", "none", ["ttnone"]), ("text-transform", "capitalize", ["ttcap"]), ("text-transform", "full-width", ["ttfull"]), ("text-align", "left", ["taleft"]), ("text-align", "right", ["taright"]), ("text-align", "center", ["tacenter", "center"]), ("text-align", "justify", ["tajustify", "justify"]), ("text-decoration", "underline", ["tdunderline", "underline"]), ("text-decoration", "none", ["tdnone"]), ("box-sizing", "border-box", ["bsbox"]), ("box-sizing", "padding-box", ["bspadding"]), ("box-sizing", "content-box", ["bscontent"]), ("margin", "auto", ["mauto"]), ("margin-left", "auto", ["mlauto"]), ("margin-right", "auto", ["mrauto"]), ("width", "auto", ["wauto"]), ("height", "auto", ["hauto"]), ("position", "relative", ["porelative", "prelative", "relative"]), ("position", "fixed", ["pofixed", "pfixed", "fixed"]), ("position", "static", ["postatic", "pstatic", "static"]), ("position", "absolute", ["poabsolute", "pabsolute", "absolute"]), ("white-space", "nowrap", ["nowrap"]), ("text-overflow", "ellipsis", ["ellipsis"]), ("flex", "auto", ["flauto"]), ("align-items", "flex-start", ["aistart"]), ("align-items", "flex-end", ["aiend"]), ("align-items", "center", ["aicenter"]), ("align-items", "stretch", ["aistretch"]), ("text-overflow", "ellipsis", ["elip", "ellipsis", "toellipsis"]), ("flex-wrap", "wrap", ["fwrap","flexwrap"]), ("flex-wrap", "nowrap", ["fnowrap"]), ("flex-direction", "row", ["fdrow"]), ("flex-direction", "row-reverse", ["fdrreverse"]), ("flex-direction", "column", ["fdcolumn"]), ("flex-direction", "column-reverse", ["fdcreverse"]), ("justify-content", "center", ["jccenter"]), ("justify-content", "flex-start", ["jcstart"]), ("justify-content", "flex-end", ["jcend"]), ("direction", "ltr", ["ltr","dirltr"]), ("direction", "rtl", ["rtl","dirrtl"]), ("text-shadow", "none", ["tsnone", "teshnone"]), ("table-layout", "fixed", ["tlfixed"]), ("table-layout", "auto", ["tlauto"]), ("list-style", "none", ["lsnone"]), ("list-style-type", "none", ["lstnone"]), ] definitions = { "properties": properties, "statements": statements }
class Beacon(): def __init__(self, sprite, type): self.sprite = sprite self.type = type ''' self.x = 0 self.y = 0 def set_pos(self, x, y): self.x = x self.y = y ''' @property def position(self): return self.sprite.position @position.setter def position(self, val): self.sprite.position = val @property def x(self): return self.sprite.position[0] @property def y(self): return self.sprite.position[1]
#Escreva um programa que leia a velocidade de um carro. #Se ela ultrapassar 80km/h, mostre a mensagem dizendo que ele foi multado. #A multa vai custar R$7,00 por cada km acima do limite vel = float(input('Qual é a velocidade atual do carro? ')) if vel > 80: print('Você acaba de ser multado. O valor da sua multa será :R$ {}. '.format((vel-80)*7.00)) else: print('Tanha uma boa viagem!')
class Attribute: NAME = 'Keyboard' class KeyState: LEFT_ARROW_DOWN = 'leftArrowDown' RIGHT_ARROW_DOWN = 'rightArrowDown' UP_ARROW_DOWN = 'upArrowDown' DOWN_ARROW_DOWN = 'downArrowDown'
#Hierarchical Inheritance class A: #Super Class or Parent Class def feature1(self): print("Feature 1 Working") def feature2(self): print("Feature 2 Working") class B(A): # Subclass or Child Class def feature3(self): print("Feature 3 Working") def feature4(self): print("Feature 4 Working") class C(A): #GrandChild class def feature5(self): print("Feature 5 Working") class D(A): #GrandChild class def feature6(self): print("Feature 6 Working") b = B() c = C() d = D()
def hurdleRace(k, height): if k >= max(height): return 0 else: return max(height) - k # test case h = [1,3,4,5,2,5] print(hurdleRace(3, h)) # Should be 2 print(hurdleRace(8, h)) # Should be 0
DATETIME_FORMAT = 'j. F Y H:i' SHORT_YEAR_FORMAT = 'Y' SHORT_MONTH_FORMAT = 'b' SHORT_DAY_FORMAT = 'j.' SHORT_DAY_MONTH_FORMAT = 'j.n.' SHORT_YEAR_MONTH_FORMAT = 'n/Y' SHORT_DATE_FORMAT = 'j.n.Y' SHORT_TIME_FORMAT = 'q' LONG_DATE_FORMAT = 'l, j. F Y' YEAR_FORMAT = 'Y' MONTH_FORMAT = 'F' DAY_FORMAT = 'j.' DAY_MONTH_FORMAT = 'j. F' # from Django: YEAR_MONTH_FORMAT SHORT_DAYONLY_FORMAT = SHORT_DAY_FORMAT # FIXME Deprecated SHORT_DAYMONTH_FORMAT = SHORT_DAY_MONTH_FORMAT # FIXME Deprecated DAYONLY_FORMAT = DAY_FORMAT # FIXME Deprecated DAYMONTH_FORMAT = DAY_MONTH_FORMAT # FIXME Deprecated DATE_RANGE_SEPARATOR = '–' OPENING_HOURS_DATE_FORMAT = 'D j. F' OPENING_HOURS_TIME_FORMAT = 'q'
# try: # except KeyError: # return render(request, "circle/error.html", context={"message": "Upload file.!!", "type": "Key Error", "link": "newArticle"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field image.!!", "type": "Value Error", "link": "newArticle"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newArticle"}) # class Meta: # db_table = "person" # verbose_name = "Person" # get_latest_by = "id" # ordering = ['id'] # class Meta: # # db_table = "person" # verbose_name = "Messages" # validators=[MinLengthValidator(1), MaxLengthValidator(255)], # class Meta: # db_table = 'article' # verbose_name = 'circle_article' # def login(request): # return render(request, "circle/home.html", context={}) # def logout(request): # return render(request, "circle/home.html", context={}) MESSAGE_TAGS = { messages.DEBUG: 'alert-secondary', messages.INFO: 'alert-info', messages.SUCCESS: 'alert-success', messages.WARNING: 'alert-warning', messages.ERROR: 'alert-danger', } def verification(request): ph_no = 9316300064 request.session['ph_no'] = ph_no otp = str(random.randint(100000, 999999)) cprint(otp, 'white') connection = http.client.HTTPSConnection("api.msg91.com") authkey = settings.authkey code = 91 sender = "Marketplace Team" # payload = "{\"Value1\":\"Param1\",\"Value2\":\"Param2\",\"Value3\":\"Param3\"}" headers = {'content-type': "application/json"} connection.request("GET", "http://control.msg91.com/api/sendotp.php", params={ "otp": otp, "mobile": ph_no, "sender": sender, "message": message, "country": code, "authkey": authkey, "otp_length": 6}, headers=headers) res = connection.getresponse() data = res.read() print(data) print(data.decode("utf-8")) return render(request, "circle/test.html", context={"message": "OTP sent.!!"}) if request.GET: return HttpResponseRedirect(reverse('newArticle', args=())) else: user_id = request.user.id try: title = str(request.POST.get("title")) except KeyError: return render(request, "circle/error.html", context={"message": "Enter title.!!", "type": "Key Error", "link": "newArticle"}) except ValueError: return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newArticle"}) except TypeError: return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newArticle"}) try: description = str(request.POST.get('description')) except KeyError: return render(request, "circle/error.html", context={"message": "Enter description.!!", "type": "Key Error", "link": "newArticle"}) except ValueError: return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newArticle"}) except TypeError: return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newArticle"}) try: price = float(request.POST.get('price')) except KeyError: return render(request, "circle/error.html", context={"message": "Enter price.!!", "type": "Key Error", "link": "newArticle"}) except ValueError: return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newArticle"}) except TypeError: return render(request, "circle/error.html", context={"message": "Incompatible Tag DataType.!!", "type": "Type Error", "link": "newArticle"}) # try: # tags = request.POST.get('tags') # if tags is not None: # tags = list(tags) # else: # tags = [] # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter title.!!", "type": "Key Error", "link": "newArticle"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newArticle"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newArticle"}) image = request.FILES['image'] article = Article.objects.create(title=title, description=description, image=image, price=price) # cprint(article, 'red') # pub_ts = article.pub_ts # cprint(pub_ts, 'white') # article.image = set_unique_name(article.image.url, pub_ts) # cprint(article.image.url, 'blue') # for tag in tags: # article.tags.add(tag) try: person = Person.objects.filter(user_id=user_id).first() person.display.add(article) person.save() return HttpResponseRedirect(reverse("article", args=(article.id, ))) except Person.DoesNotExist: return render(request, "circle/error.html", context={"message": "No person found.!!", "type": "Data Error", "link": "newArticle"}) # if request.GET: # return HttpResponseRedirect(reverse('newPerson', args=())) # else: # try: # user = User.objects.get(pk=request.user.id) # try: # bio = str(request.POST.get("bio")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter a Bio.!!", "type": "Key Error", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # first = str(request.POST.get("first")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter a First Name.!!", "type": "Key Error", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # last = str(request.POST.get("last")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter a Last Name.!!", "type": "Key Error", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # age = int(request.POST.get("age")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter a Age!", "type": "Key Error.!!", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # sex = str(request.POST.get("sex")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Select gender from the options provided.!!", "type": "KeyError", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # sex = sex[0] # try: # email = str(request.POST.get("email")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter an e-mail address.!!", "type": "KeyError", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # try: # ph_no = str(request.POST.get("ph_no")) # except KeyError: # return render(request, "circle/error.html", context={"message": "Enter an e-mail address.!!", "type": "KeyError", "link": "newPerson"}) # except ValueError: # return render(request, "circle/error.html", context={"message": "Invalid Value to given field.!!", "type": "Value Error", "link": "newPerson"}) # except TypeError: # return render(request, "circle/error.html", context={"message": "Incompatible DataType.!!", "type": "Type Error", "link": "newPerson"}) # username = email.split('@')[0] # profile = request.FILES['profile'] # try: # Person.objects.create(user=user, profile=profile, username=username, bio=bio, first=first, last=last, age=age, sex=sex, email=email, ph_no=ph_no) # return HttpResponseRedirect(reverse('person', args=(person.id, ))) # except: # return render(request, "circle/error.html", context={"message": "No person found.!!", "type": "Data Error", "link": "newPerson"}) # except User.DoesNotExist: # return render(request, "circle/error.html", context={"message": "No user found.!!", "type": "Data Error", "link": "newPerson"})
class Solution: def isPalindrome(self, s: str) -> bool: string2 = "" for character in s.lower(): if character.isalnum(): string2 += character if string2 == string2[::-1]: return True return False
squares = [value ** 2 for value in range(1, 11)] print(squares) cubes = [value ** 3 for value in range(1, 11)] print(cubes) a_million = list(range(1, 1_000_0001)) print(min(a_million)) print(max(a_million)) print(sum(a_million))
class Restaurant: def __init__(self, restaurant_name, cuisine_type): self.restaurant_name = restaurant_name self.cuisine_type = cuisine_type self.number_serverd = 0 def describe_restaurant(self): print(f'Welcome to {self.restaurant_name.title()}') print(f'Our cousine type is: {self.cuisine_type.title()}') def open_restaurant(self): print(f'The {self.restaurant_name.title()} is OPEN') def set_number_server(self, number): self.number_serverd = number def increment_number_served(self, number): self.number_serverd += number print(f'Customers: {self.number_serverd}') def show_number_serverd(self): print(f'{self.number_serverd}') restaurant = Restaurant('Don Lucho', 'burguer') restaurant.increment_number_served(100) restaurant.increment_number_served(200) restaurant.increment_number_served(500)
mtx = [] while True: n = str(input()) if n == 'end': break mtx.append([int(s) for s in n.split()]) out_mtx = [[0 for j in range(len(mtx[i]))] for i in range(len(mtx))] for i in range(len(mtx)): for j in range(len(mtx[i])): ylen = len(mtx) xlen = len(mtx[0]) out_mtx[i][j]=int(mtx[i-1][j]) + int(mtx[(i+1)%ylen][j]) + int(mtx[i][j-1]) + int(mtx[i][(j+1)%xlen]) for i in range(ylen): for j in range(xlen): print(out_mtx[i][j], end = ' ') print()
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ # @Author: Bai Lingnan # @Project: Pytorch-Template # @Filename: metric.py # @Time: 2020/3/12 10:15 """ """ tricks: 1.torch-optimizer:实现了最新的一些优化器. 2.numba:import numba as nb,纯python或numpy加速,加@nb.njit或@nb.jit(nopython=True) 3.swifter:df.apply()→·df.swifter.apply(),加速pandas 4.cupy:1000万以上数据更快 5.modin:import modin.pandas as mdpd,用mdpd代替pd即可,加速pandas,加载数据和查询数据更快,统计方法pandas更快 """ # #自定义损失函数 # class CustomLoss(nn.Module): # # def __init__(self): # super(CustomLoss, self).__init__() # # def forward(self, x, y): # loss = torch.mean((x - y) ** 2) # return loss
# https://leetcode.com/problems/check-array-formation-through-concatenation/ class Solution: def canFormArray(self, arr: List[int], pieces: List[List[int]]) -> bool: result = [] for j in arr: for i in pieces: if i[0] == j: for m in range(len(i)): result.append(i[m]) if result == arr: return True else: return False
a = 10 b = 3 print('Add -', a + b) print('Subtract -', a - b) print('Multiply -', a * b) print('Divide (with floating point) -', a / b) print('Divide (ignoring floats) -', a // b) # With interactive python # >>> 10 / 3 # 3.3333333333333335 # >>> 10.0 / 3 # 3.3333333333333335 # >>> 10 // 3 # 3 # >>> 10 // 3.0 # 3.0 print('Remainder or Modulus -', a % b) print('a raised to power b -', a ** b) # Augmented assignment operator or enhanced assignment operator # Increment a += b # Means, a = a + b print('a incremented by b -', a); # Decrement a -= b print('a decremented by b -', a) # Multiply, Divide (floating point & integer), Modulo a *= b print(a) a /= b print(a) a //= b print(a) a %= b print(a)
class IrregualrConfigParser(object): COMMENT_FLAGS = ("#", ";") def __init__(self): super(IrregualrConfigParser, self).__init__() self.__content = [] def read(self, fn_or_fp): content = [] if isinstance(fn_or_fp, file): content = [line.strip() for line in fn_or_fp.xreadlines()] else: with open(fn_or_fp, "r") as fp: content = [line.strip() for line in fp.xreadlines()] self.__content = self.parse_content(content) def write(self, fp): for line in self.__content: if line is None: fp.write("\n") continue section = line.get("section", None) comment = line.get("comment", None) option = line.get("option", None) value = line.get("value", None) if comment: fp.write(comment + "\n") continue elif section and option is None: fp.write("[{0}]\n".format(section)) continue elif option and value is not None: fp.write("{0}={1}\n".format(option, value)) elif not section and not option: continue else: fp.write(option + "\n") def parse_content(self, content): def _is_blank(line): return not line def _is_comment(line): return line[0] in self.COMMENT_FLAGS def _is_section(line): return line[0] == '[' and line[-1] == ']' def _is_option(line): return "=" in line def _parse_content(): section = None for line in content: if _is_blank(line): yield None continue if _is_comment(line): yield {"comment": line} continue if _is_section(line): section = line[1:-1] yield {"section": section} continue if _is_option(line): option, value = [i.strip() for i in line.split("=", 1)] yield {"option": option, "value": value, "section": section} else: yield {"option": line, "section": section} return list(_parse_content()) if content else [] def __get_option(self, section, option): for ln, line in enumerate(self.__content): if not line: continue section_name = line.get("section", None) option_name = line.get("option", None) if section_name == section and option_name == option: return ln, line return -1, None def __get_section(self, section): for ln, line in enumerate(self.__content): if not line: continue section_name = line.get("section", None) if section_name == section: return ln, line return -1, None def has_section(self, section): ln, _ = self.__get_section(section) return ln != -1 def has_option(self, section, option): ln, _ = self.__get_option(section, option) return ln != -1 def __add_section(self, section): line = {"section": section} self.__content.append(line) return len(self.__content) - 1, line def add_section(self, section): ln, _ = self.__add_section(section) return ln != -1 def get(self, section, option): _, option_line = self.__get_option(section, option) if not option_line: return None else: return option_line.get("value", None) def set(self, section, option, value=None): _, option_line = self.__get_option(section, option) if option_line: if value is None: option_line.pop('value', None) else: option_line['value'] = value return True ln, _ = self.__get_section(section) if ln == -1: ln, _ = self.__add_section(section) if value is None: line = {"option": option, "section": section} else: line = {"option": option, "value": value, "section": section} self.__content.insert(ln + 1, line) return True
# -*- coding: utf-8 -*- ''' tagset_constants.py.py Constants for opencorpora and syntagrus tagsets Author: mkudinov ''' #Grammar categories CAT_POS = u'POS' CAT_ANIMACY = u'ANIMACY' CAT_GENDER = u'GENDER' CAT_NUMBER = u'NUMBER' CAT_CASE = u'CASE' CAT_ASPECT = u'ASPECT' CAT_TENSE = u'TENSE' CAT_MODE = u'MODE' CAT_VOICE = u'VOICE' CAT_PERSON = u'PERSON' CAT_ADJ_TYPE = u'ADJF_TYPE' CAT_ADJ_DEGREE = u'DEGREE' CAT_TRANSIT = u'TRANS' #transitivity #OpenCorpora constants #Parts of speech OC_NOUN = u"NOUN" OC_VERB = u"VERB" OC_INFN = u"INFN" OC_PRTF = u"PRTF" OC_PRTS = u"PRTS" OC_GRND = u"GRND" OC_ADJF = u"ADJF" OC_ADJS = u"ADJS" OC_COMP = u"COMP" OC_NUMR = u"NUMR" OC_ADVB = u"ADVB" OC_NPRO = u"NPRO" OC_PRED = u"PRED" OC_PREP = u"PREP" OC_CONJ = u"CONJ" OC_PRCL = u"PRCL" OC_INTJ = u"INTJ" OC_UNKN = u"UNKN" OC_PNCT = u"PNCT" OC_DIGT = u"NUMB" OC_LATN = u"LATN" OC_ROMN = u"ROMN" OC_POS = [OC_NOUN, OC_VERB, OC_INFN, OC_PRTF, OC_PRTS, OC_GRND, OC_ADJF, OC_ADJS, OC_COMP, OC_NUMR, OC_ADVB, OC_NPRO, OC_PRED, OC_PREP, OC_CONJ, OC_PRCL, OC_INTJ, OC_UNKN, OC_PNCT, OC_DIGT, OC_LATN , OC_ROMN] #animacy OC_ANIM_Y = u'anim' OC_ANIM_N = u'inan' OC_ANIM_P = u'Inmx' OC_ANIMACY = [OC_ANIM_Y, OC_ANIM_N, OC_ANIM_P] #gender OC_MASC = u'masc' OC_FEMN = u'femn' OC_NEUT = u'neut' OC_MSF = u'Ms-f' OC_GENDER = [OC_MASC, OC_FEMN, OC_NEUT, OC_MSF] #number OC_SING = u'sing' OC_PLUR = u'plur' OC_SINGTANTUM = u'Sgtm' OC_PLURTANTUM = u'Pltm' OC_NUMBER = [OC_SING, OC_PLUR, OC_SINGTANTUM, OC_PLURTANTUM] #case OC_NOM = u'nomn' OC_GEN = u'gent' OC_DAT = u'datv' OC_ACC = u'accs' OC_ABL = u'ablt' OC_VOC = u'voct' OC_LOC = u'loct' OC_GEN1 = u'gen1' OC_GEN2 = u'gen2' OC_LOC1 = u'loc1' OC_LOC2 = u'loc2' OC_CASE = [OC_NOM, OC_GEN, OC_DAT, OC_ACC, OC_ABL, OC_VOC, OC_LOC, OC_GEN1, OC_GEN2, OC_LOC1, OC_LOC2] #aspect OC_PERF = u'perf' OC_IMPERF = u'impf' OC_ASPECT = [OC_PERF, OC_IMPERF] #tense OC_PRES = u'pres' OC_PAST = u'past' OC_FUTR = u'futr' OC_TENSE = [OC_PRES, OC_PAST, OC_FUTR] #mode OC_INDIC = u'indc' OC_IMPR = u'impr' OC_MODE = [OC_INDIC, OC_IMPR] #voice OC_ACTV = u'actv' OC_PASV = u'pssv' OC_VOICE = [OC_ACTV, OC_PASV] #person OC_1PER = u'1per' OC_2PER = u'2per' OC_3PER = u'3per' OC_PERSON = [OC_1PER, OC_2PER, OC_3PER] #adjective type OC_ADJ_QUAL = u'Qual' OC_ADJ_PRO = u'Apro' OC_ADJ_NUM = u'Anum' OC_ADJ_POSS = u'Poss' OC_ADJ_TYPE = [OC_ADJ_QUAL, OC_ADJ_PRO, OC_ADJ_NUM, OC_ADJ_POSS] #adjective comp. degree OC_SUPER = u'Supr' OC_DEGREE = [OC_SUPER] #transitivity OC_INTRANS = u'intr' OC_TRANS = u'tran' OC_TRANSIT = [OC_INTRANS, OC_TRANS] #SynTagRus constants #Parts of speech STR_NOUN = u"S" STR_VERB = u"V" STR_ADJ = u"A" STR_NUMR = u"NUM" STR_ADVB = u"ADV" STR_PREP = u"PR" STR_CONJ = u"CONJ" STR_PRCL = u"PART" STR_INTJ = u"INTJ" STR_UNKN = u"NID" STR_EOS= u"P" STR_POS = [STR_NOUN, STR_VERB, STR_ADJ, STR_NUMR, STR_ADVB, STR_PREP, STR_CONJ, STR_PRCL, STR_INTJ, STR_UNKN, STR_EOS] #animacy STR_ANIM_Y = u'ОД' STR_ANIM_N = u'НЕОД' STR_ANIMACY = [STR_ANIM_Y, STR_ANIM_N] #gender STR_MASC = u'МУЖ' STR_FEMN = u'ЖЕН' STR_NEUT = u'СРЕД' STR_GENDER = [STR_MASC, STR_FEMN, STR_NEUT] #number STR_SING = u'ЕД' STR_PLUR = u'МН' STR_NUMBER = [STR_SING, STR_PLUR] #case STR_NOM = u'ИМ' STR_GEN = u'РОД' STR_DAT = u'ДАТ' STR_ACC = u'ВИН' STR_ABL = u'ТВОР' STR_GEN2 = u'ПАРТ' STR_LOC = u'ПР' STR_LOC2 = u'МЕСТ' STR_CASE = [STR_NOM, STR_GEN, STR_DAT, STR_ACC, STR_ABL, STR_GEN2, STR_LOC, STR_LOC2] #adjective degree and form STR_COMP = u'СРАВ' STR_SUPERL = u'ПРЕВ' STR_SHORT= u'КР' STR_ADJFORM = [STR_COMP, STR_SUPERL, STR_SHORT] #verb form STR_GRND = u'ДЕЕПР' STR_INF = u'ИНФ' STR_PRT = u'ПРИЧ' STR_VFORM = [STR_GRND, STR_INF, STR_PRT] #mode STR_INDIC = u'ИЗЪЯВ' STR_IMPR = u'ПОВ' STR_MODE = [STR_INDIC, STR_IMPR] #aspect STR_IMPERF = u'НЕСОВ' STR_PERF = u'СОВ' STR_ASPECT = [STR_IMPERF, STR_PERF] #tense STR_PAST = u'ПРОШ' STR_NONPAST = u'НЕПРОШ' STR_PRES = u'НАСТ' STR_TENSE = [STR_PAST, STR_NONPAST, STR_PRES] #person STR_1PER = u'1-Л' STR_2PER = u'2-Л' STR_3PER = u'3-Л' STR_PERSON = [STR_1PER, STR_2PER, STR_3PER] #voice STR_PASV = u'СТРАД' STR_VOCIE = [STR_PASV] #misc STR_COMP_PART = u'СЛ' STR_SOFT = u'СМЯГ' STR_MISC = [STR_COMP_PART, STR_SOFT] #tagset classes class OpenCorporaTagset(object): ''' OpenCorporaTagset class. Provides basic mappings for grammar markers for OpenCorpora ''' def __init__(self): self.tagset_ = {} self.tagset_[CAT_POS] = OC_POS self.tagset_[CAT_ANIMACY] = OC_ANIMACY self.tagset_[CAT_GENDER] = OC_GENDER self.tagset_[CAT_NUMBER] = OC_NUMBER self.tagset_[CAT_CASE] = OC_CASE self.tagset_[CAT_ASPECT] = OC_ASPECT self.tagset_[CAT_TENSE] = OC_TENSE self.tagset_[CAT_MODE] = OC_MODE self.tagset_[CAT_VOICE] = OC_VOICE self.tagset_[CAT_PERSON] = OC_PERSON self.tagset_[CAT_ADJ_TYPE] = OC_ADJ_TYPE self.tagset_[CAT_ADJ_DEGREE] = OC_DEGREE self.tagset_[CAT_TRANSIT] = OC_TRANSIT self.inv_tagset_ = {} for cat in self.tagset_.keys(): for val in self.tagset_[cat]: self.inv_tagset_[val] = cat def categories(self): cats = self.tagset_.keys() for cat in cats: yield cat
def readConstants(constants_list): constants = [] for attribute, value in constants_list.items(): constants.append({"name": attribute, "cname": "c_" + attribute, "value": value}) return constants def readClocks(clocks_lists): clocks = {"par": [], "seq": []} for attribute, value in clocks_lists["par_time"].items(): clocks["par"].append({ "name": attribute, "cname": "cp_" + attribute, "start_str": value[0], "cname_start_f": "start_cp_" + attribute, "end_str": value[1], "cname_end_f": "end_cp_" + attribute, "cname_size_f": "size_cp_" + attribute, }) for attribute, value in clocks_lists["seq_time"].items(): clocks["seq"].append({ "name": attribute, "cname": "cs_" + attribute, "start_str": value[0], "cname_start_f": "start_cs_" + attribute, "end_str": value[1], "cname_end_f": "end_cs_" + attribute, "cname_size_f": "size_cs_" + attribute, }) return clocks def readCubeNests(cube_nests_json): cube_nests = [] for attribute, value in cube_nests_json.items(): cube_list = [] for clock_attr, clock_val in value.items(): cube_list.append({ "clock_mask": clock_val["clock_mask"], "name": clock_attr, "depth": clock_val["depth"], "x_dim_str": clock_val["x-dim"], # array with [0] = min , [1] = max, [?2] = grid_alignment_clock "y_dim_str": clock_val["y-dim"], # array with [0] = min , [1] = max, [?2] = grid_alignment_clock "z_dim_str": clock_val["z-dim"], # array with [0] = min , [1] = max, [?2] = grid_alignment_clock "cname_x_dim_start_f": "x_dim_start_" + attribute + "_" + clock_attr, "cname_y_dim_start_f": "y_dim_start_" + attribute + "_" + clock_attr, "cname_z_dim_start_f": "z_dim_start_" + attribute + "_" + clock_attr, "cname_x_dim_end_f": "x_dim_end_" + attribute + "_" + clock_attr, "cname_y_dim_end_f": "y_dim_end_" + attribute + "_" + clock_attr, "cname_z_dim_end_f": "z_dim_end_" + attribute + "_" + clock_attr, "cname_x_dim_jump_f": "x_dim_jump_" + attribute + "_" + clock_attr, "cname_y_dim_jump_f": "y_dim_jump_" + attribute + "_" + clock_attr, "cname_z_dim_jump_f": "z_dim_jump_" + attribute + "_" + clock_attr, "cname_x_dim_size_f": "x_dim_size_" + attribute + "_" + clock_attr, "cname_y_dim_size_f": "y_dim_size_" + attribute + "_" + clock_attr, "cname_z_dim_size_f": "z_dim_size_" + attribute + "_" + clock_attr, "cname_x_dim_jump_offset_f": "x_dim_jump_offset_" + attribute + "_" + clock_attr, "cname_y_dim_jump_offset_f": "y_dim_jump_offset_" + attribute + "_" + clock_attr, "cname_z_dim_jump_offset_f": "z_dim_jump_offset_" + attribute + "_" + clock_attr }) cube_nests.append({ "name": attribute, "cubes": cube_list, }) return cube_nests
def main() -> None: N = int(input()) S = [] T = [] for _ in range(N): S.append(input()) for _ in range(N): T.append(input()) assert 1 <= N <= 100 assert all(len(S_i) == N for S_i in S) assert all(len(T_i) == N for T_i in S) assert all(S_ij in ('.', '#') for S_i in S for S_ij in S_i) assert all(T_ij in ('.', '#') for T_i in T for T_ij in T_i) assert any(S_ij == '#' for S_i in S for S_ij in S_i) assert any(T_ij == '#' for T_i in T for T_ij in T_i) if __name__ == '__main__': main()
# # @lc app=leetcode id=134 lang=python3 # # [134] Gas Station # # https://leetcode.com/problems/gas-station/description/ # # algorithms # Medium (35.34%) # Likes: 966 # Dislikes: 321 # Total Accepted: 163.9K # Total Submissions: 463.7K # Testcase Example: '[1,2,3,4,5]\n[3,4,5,1,2]' # # There are N gas stations along a circular route, where the amount of gas at # station i is gas[i]. # # You have a car with an unlimited gas tank and it costs cost[i] of gas to # travel from station i to its next station (i+1). You begin the journey with # an empty tank at one of the gas stations. # # Return the starting gas station's index if you can travel around the circuit # once in the clockwise direction, otherwise return -1. # # Note: # # # If there exists a solution, it is guaranteed to be unique. # Both input arrays are non-empty and have the same length. # Each element in the input arrays is a non-negative integer. # # # Example 1: # # # Input: # gas = [1,2,3,4,5] # cost = [3,4,5,1,2] # # Output: 3 # # Explanation: # Start at station 3 (index 3) and fill up with 4 unit of gas. Your tank = 0 + # 4 = 4 # Travel to station 4. Your tank = 4 - 1 + 5 = 8 # Travel to station 0. Your tank = 8 - 2 + 1 = 7 # Travel to station 1. Your tank = 7 - 3 + 2 = 6 # Travel to station 2. Your tank = 6 - 4 + 3 = 5 # Travel to station 3. The cost is 5. Your gas is just enough to travel back to # station 3. # Therefore, return 3 as the starting index. # # # Example 2: # # # Input: # gas = [2,3,4] # cost = [3,4,3] # # Output: -1 # # Explanation: # You can't start at station 0 or 1, as there is not enough gas to travel to # the next station. # Let's start at station 2 and fill up with 4 unit of gas. Your tank = 0 + 4 = # 4 # Travel to station 0. Your tank = 4 - 3 + 2 = 3 # Travel to station 1. Your tank = 3 - 3 + 3 = 3 # You cannot travel back to station 2, as it requires 4 unit of gas but you # only have 3. # Therefore, you can't travel around the circuit once no matter where you # start. # # # # @lc code=start class Solution: def canCompleteCircuit(self, gas: List[int], cost: List[int]) -> int: if not gas or not cost or len(gas) == 0 or len(cost) == 0 or len(gas) != len(cost): return -1 start_points = [] l = len(gas) for i in range(l): if gas[i] >= cost[i]: start_points.append(i) for sp in start_points: tmp_res = sp curr_gas = 0 d = 0 while d < l: # if the index is out of bound # we can try using `%` curr_gas += gas[sp % l] curr_gas -= cost[sp % l] sp += 1 d += 1 if curr_gas <= 0: break if d == l and curr_gas >= 0: return tmp_res return -1 # @lc code=end
""" --- Even the last --- Elementary You are given an array of integers. You should find the sum of the elements with even indexes (0th, 2nd, 4th...) then multiply this summed number and the final element of the array together. Don't forget that the first element has an index of 0. For an empty array, the result will always be 0 (zero). Input: A list of integers. Output: The number as an integer. How it is used: Indexes and slices are important elements of coding in python and other languages. This will come in handy down the road! Precondition: 0 <= len(array) <= 20 all(isinstance(x, int) for x in array) all(-100 < x < 100 for x in array) """ def my_solution(array): return sum(array[::2]) * array[-1] if array else 0 aggelgian_solution = lambda x: sum(x[::2]) * x[-1] if x else 0
def fib(n): if n == 1: return 1 return n + fib(n-1) def main(): n = 0 m = 1 result = 0 while n < 4000000: tmp = n n = n + m m = tmp if n % 2 == 0: result += n # print(n, n % 2) # print(n, result) print("Problem 2:", result)
# file path (load_data.py, main.py, and compute_relation_vectors.py) _SOURCE_DATA = '../data/source.csv' _TARGET_DATA = '../data/target.csv' _RESULT_FILE = '../results/results.csv' _MEAN_RELATION = '../results/relation_vectors_before.csv' _MODIFIED_MEAN_RELATINON = '../results/relation_vectors_after.csv' _COUNT_RELATINON = '../results/count_ver_relation_vectors.csv' # the number of labels _SOURCE_DIM_NUM=9 _TARGET_DIM_NUM=2 # for learning _FOLD_NUM = 10 _SORUCE_LATENT_TRAIN = True _TARGET_LATENT_TRAIN = True _DROPOUT_RATE = 0.01 _L2_REGULARIZE_RATE = 0.00001 # for setting models (models.py and main.py) _BATCH_SIZE=32 _OUT_DIM=188 # epoch (main.py) _SOURCE_EPOCH_NUM=5 _TARGET_EPOCH_NUM=5 # for compute_relation_vectors.py _ITERATION = 1000 _SAMPLING = 100 _EPS=1.0e-10 # method flag (main.py, and compute_relation_vectors.py)) _SCRATCH=0 _CONV_TRANSFER=1 _COUNT_ATDL=2 _MEAN_ATDL=3 _MODIFIED_MEAN_ATDL=4
# coding=utf8 # Copyright 2018 JDCLOUD.COM # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # # NOTE: This class is auto generated by the jdcloud code generator program. class ServiceUser(object): def __init__(self, uuid=None, userPin=None, userName=None, userPhone=None, company=None, address=None, desc=None, createTime=None): """ :param uuid: (Optional) 用户唯一标识 :param userPin: (Optional) 用户Pin :param userName: (Optional) 用户名称 :param userPhone: (Optional) 用户电话 :param company: (Optional) 用户公司 :param address: (Optional) 用户地址 :param desc: (Optional) 用户描述 :param createTime: (Optional) 注册时间 """ self.uuid = uuid self.userPin = userPin self.userName = userName self.userPhone = userPhone self.company = company self.address = address self.desc = desc self.createTime = createTime
# Copyright © 2021 by Shun Huang. All rights reserved. # Licensed under MIT License. # See LICENSE in the project root for license information. variable = 10 variable = "string" variable = 2.0 variable = [1, 2, 3]
class Instruction: def __init__(self, name): if not(name in dir(self)): raise Exception("Instruction not exists") self.name = name def execute(self, cpu, a, b, c): func = getattr(self,self.name) func(cpu, a, b, c) def addr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] + cpu[b] def addi(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] + b def mulr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] * cpu[b] def muli(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] * b def banr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] & cpu[b] def bani(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] & b def borr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] | cpu[b] def bori(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] | b def setr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = cpu[a] def seti(self, cpu, a, b, c): if not(self.checkRegister(c)): return False cpu[c] = a def gtir(self, cpu, a, b, c): if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if a > cpu[b] else 0 def gtri(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if cpu[a] > b else 0 def gtrr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if cpu[a] > cpu[b] else 0 def eqir(self, cpu, a, b, c): if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if a == cpu[b] else 0 def eqri(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if cpu[a] == b else 0 def eqrr(self, cpu, a, b, c): if not(self.checkRegister(a)): return False if not(self.checkRegister(b)): return False if not(self.checkRegister(c)): return False cpu[c] = 1 if cpu[a] == cpu[b] else 0 def checkRegister(self, x): return x >= 0 and x < 4 instructions = [Instruction(x) for x in dir(Instruction) if x[0]!="_" and not(x in ["checkRegister", "execute"])] print([i.name for i in instructions]) instructionsMap = [set() for x in instructions] counter = 0 program = list() with open("input.txt", "r") as file: line = file.readline() while line != "": if line.startswith("Before"): print(line, end="") registersBefore = list([int(x) for x in line[9:-2].split(",")]) line = file.readline() print(line, end="") op = list([int(x) for x in line.split(" ")]) line = file.readline() print(line, end="") registersAfter = list([int(x) for x in line[9:-2].split(",")]) possibleInstructions = list() for instruction in instructions: cpu = list(registersBefore) if instruction.execute(cpu, op[1], op[2], op[3]) != False and cpu == registersAfter: possibleInstructions.append(instruction) print([i.name for i in possibleInstructions]) if len(possibleInstructions) >= 3: counter+=1 if len(instructionsMap[op[0]]) == 0: instructionsMap[op[0]] = set(possibleInstructions) else: instructionsMap[op[0]] & set(possibleInstructions) elif line.strip() != "": program.append(list([int(x) for x in line.split(" ")])) line = file.readline() print(str(counter)+" behaves like 3 or more") for opCode, possibleInstructions in enumerate(instructionsMap): print("Opcode: "+str(opCode)+" - "+str([i.name for i in possibleInstructions])) finalMap = [None for x in instructions] wasChange = True while wasChange: wasChange = False for opCode, possibleInstructions in enumerate(instructionsMap): if len(possibleInstructions) == 1: wasChange = True toRemove = list(possibleInstructions)[0] finalMap[opCode] = toRemove for iSet in instructionsMap: iSet.discard(toRemove) break; for opCode, instruction in enumerate(finalMap): print("Opcode: "+str(opCode)+" - "+str(instruction.name if instruction != None else "None")) print("Executing program") cpu = [0, 0, 0, 0] for op in program: print(op) finalMap[op[0]].execute(cpu, op[1], op[2], op[3]) print("Cpu state: "+str(cpu))
TITLE = "Служба восстановления данных" STATEMENT_TEMPLATE = ''' В службу восстановления данных с флешек и дисков обратился клиент. Он принёс эту флешку. Говорит, что случайно её отформатировал. Посмотрите, что здесь можно сделать. [usb.img.tar.gz](http://ctf.sicamp.ru/static/xn9gwqz3/{0}.tar.gz) ''' def generate(context): participant = context['participant'] token = tokens[participant.id % len(tokens)] return TaskStatement(TITLE, STATEMENT_TEMPLATE.format(token)) tokens = ['Mr3eduBFiL5Q', 'vrXy4Rdaen5S', 'axslTWTAiCi3', 'QjHNEKgjpTws', 'sJtkuzyvg9wg', '0YPXCNV8VC2p', 'eaK2ouSQCUJL', 'xYBIp9KyLHzq', 'fvAOg47w4ieO', 'o5GvLgsMlWvm', 'WPBJ01VinoTL', '94Kjg3sm9KnW', 'AmV6R8sH5RSA', 'FAquLF7ZNrkN', '3DdXvbLEuI0S', 'xG3NFcZzqUcC', 'fURyowGENyN0', 'SMDfqcydbwFr', 'hfkrmKP7fjT2', '6fkZDHMRo6Vi', 'zYrts1ujsGmo', '71K6bWC4aCXH', 'jtjYiHLJXoYE', 'fZ1oX6PZXHgW', 't9U1GlIzAaz6', 'wme1sB43CZlZ', 'irltDxxTjwLl', 'RAnJnOIjNVxQ', 'jRyPOhcDb7xf', 'fkOQhV5WugjM', 'XihOAdnD2v1p', 'GJMueiBRRIV2', 'AE1PkrTLBH8u', 'BpkYOgzD78H4', 'LNqEX2CHaEuk', 'uzxFG9ohS2Zw', 'nlB6Aom800WZ', 'pGRoc7lzrcCm', 'Ymd3Bbh5C7kb', 'AfC1CCKXmA9Q', 'DtXuaEDo9D2Z', 'sFGu3iLm4nBB', 'HNzP3j8JYL3N', 'Vjkk68YwSAKe', 'BRFWaskdMWIN', '22Y0hVdCJfmx', 'zjmqGlhd6uuE', 'i202k0QWJzCD', 'GYevjmTxLMMg', '32IfFwGKZilz', 'NdjTqlQ0qVqB', 'YzYj7Xl9cZuB', 'Lni7sYlFNh7D', 'u4nl86Bx79F1', 'nMY4jYZ4YI1I', 'lW3eFNz2qjiG', 'uKDe5CDEBWl2', 'T6U4yaryhKU9', 'LKUehxgyndUq', 'leJGPPnlz2Hk', 'XenXVeJBL7TR', 'hg1nZAzYwwP1', 'KOvfqetAxKMR', 'IUdq5PIih81t', 'oajMjb8RPuw0', 'mmdKiNfVQzxn', 'OcSoW1NRu1ct', 'V9vcCaV5nJLw', 'EfpRA1y5FtKY', 'w9tfbgCi89cj', '8tHlDW8aAwlB', '4IG04xPVvf6R', '4QSJe1oHLS9o', '9svihqFTpOr3', 'u4fmf2uECnev', 'oUuMHc8svhv1', 'o6MMTSPbEULu', 'mmUsieaPn4Bc', 'JixyWUbjHJcn', 'ZyHUnCWrParR', 'X1WzBdU9Ksx0', 'eD7dITb0Iu0f', 'qfBaHTBays6N', 'Mkkiy6mNpQVs', 'by1Y89f9682T', 'fq6lJD8HOZoK', 'WgUrJQ16T8Yy', 'C4blcGm51wq9', '5uLvI0PumRnM', 'gEtLjEEj9FSB', 'N6Jf79Zp9JZr', 'EfTdozXNDktL', 'mD94p1N0Cu5C', '9O9V1J0VZ9A8', '1SPnTT9NKACZ', 'Mc5a2gI7eHvX', 'fwbdfpqGPeHG', 'qtp8IWzxT3RQ', '1VQSCoiHFNEe', 'tAMiOmDDaLAh', 'SXaaidwcHnk2', 'ExBvND2huJVv', 'GX1g8x3QCN58', 'jALkAEDJOR9l', 'SWpvCklFI8rS', 'A6qrBZ2olfOC', 'X3rmzQXkNtqC', 'tUmEV52qbaMW', '4VjcGfMbAcLP', 'hwCMLpi51RCH', 'LQDycefd4v5V', 'eZvEmlExaon7', 'hhKaujS2uwIj', 'VvgfCmxwYxqz', 'PXTADJei3sD1', 'usvBsMJtRRVZ', 'rRTfTl2vnJio', 'ygn6XpAxkifd', '45PMmH1RtNI1', 'KHMWEiycTNok', '7yOTLI1fGQXH', 'pkM1lV70Mzzu', 'Up0rh6dAGbZP', 'U8F3z3tYi6dz', 'TM9yWapHihfa', 'pxpo9IGyDV6o', 'vdVfgxpYDleH', 's5HBVHNUCYUb', 'uoVhn0ZmqSmN', 'PikqkGxincyL', 'OCO0SQ6UGozP', 'X4sTKm24EFHa', 'ctiVBTGg7UnJ', 'mFwwhyN7oIvP', 'Gh32nCmZBYq0', 'Ltqdnn68Ua1i', '4z3tFkQx8LpA', 'DAwP7yhgAwxC', 'm1G3046SzAZA', 'LiWR1lNWwE2G', 'jwTbRQ8nDKgV', 'jdJudNryfQ2r', 'Pxv2MicWt6Xb', 'eMCTgdngNiro', '3jhwXGDrBkrH', 'U9YRx1gpJRCg', 'h514NMFs8fpQ', '4UwthP557aW0', 'qctm7MWHtD5N', 'Exqm76bh3Urv', 'BSZniPARofeC', 'IqRTj8HgWJZC', 'oiXWaed3nWtH', 'zvlEjKG7ePqL', 'KQAND0y0RxCf', 'MiZOTaHvckq1', 't0m8eITjuViD', 't3nAHGEPRvYQ', 'NdjXbqZAQhYf', 'sxtMZJJp0LPR', 'urtaqBRJUdKv', 'Hr1vZqTSgDkV', 'nvCZtJi6FeCt', 'XOE0EgSxQZti', 'b51NVJnuGqOa', 'rQC52mjcQOuf', 'ggfzEd9k9fNf', '2i77TjRXpKyH', 'Oe9SFaso0V9R', 'P4nTMNCOmIlG', 'WeWo9vd6KfGC', 'bB7rQp7BhIrT', 'gw4rmUp0uD86', 'lpuVXxHnToCe', 'GsQQz3tdgNEM', 'MAwwGaCcppaL', '6FY7bkuEzch6', 'gOxcsbFfCMGy', 'MhTJiHGHnFwC', '6RffySDswn7R', '6rrTopLQsqdU', 'f57OiSKaEflx', 'HWcrECXE8dQ2', 'QiTXTmJmrpTh', 'hBx5zFNIB9xo', 'heHKngO0lww8', '5s3RR21Eq7RR', 'WEBSwC23d0Eh', 'GUB4P81cmuTU', 'aMg1e8FlmFW9', 'BTDtwXw5qGhb', '4t4HbyTei08w', 'YAOanbEXUXrh', 'pYgp6IgCKXaf', 'dAej0hUDNq56', 'ySJHvXevQi7x', 'DwHcjMdr1yA2', 'BRLp31SroULu', 'AXUVePOcw75D', 'TIZTmcLJVx9V']
''' modifier: 02 eqtime: 10 ''' def main(): info("Jan Air Sniff Pipette x1") gosub('jan:WaitForMiniboneAccess') gosub('jan:PrepareForAirShot') gosub('jan:EvacPipette2') gosub('common:FillPipette2') gosub('jan:PrepareForAirShotExpansion') close(name="M", description="Microbone to Getter NP-10H") sleep(duration=2.0) gosub('common:SniffPipette2')
class Verdict: OK = 'OK' WA = 'WA' RE = 'RE' CE = 'CE' TL = 'TL' ML = 'ML' FAIL = 'FAIL' NR = 'NR'
# 2014.10.20 12:29:04 CEST typew = {'AROMATIC': 3.0, 'DOUBLE': 2.0, 'TRIPLE': 3.0, 'SINGLE': 1.0} heterow = {False: 2, True: 1} missingfragmentpenalty = 10.0 mims = {'H': 1.0078250321, 'He': 3.016029, 'Li': 6.015122, 'Be': 9.012182, 'B': 10.012937, 'C': 12.000000, 'N': 14.0030740052, 'O': 15.9949146221, 'F': 18.9984032, 'Ne': 19.992440, 'Na': 22.9897692809, 'Mg': 23.985042, 'Al': 26.981538, 'Si': 27.976927, 'P': 30.97376151, 'S': 31.97207069, 'Cl': 34.96885271, 'Ar': 35.967546, 'K': 38.96370668, 'Ca': 39.962591, 'Sc': 44.955910, 'Ti': 45.952629, 'V': 49.947163, 'Cr': 49.946050, 'Mn': 54.938050, 'Fe': 53.939615, 'Co': 58.933200, 'Ni': 57.935348, 'Cu': 62.929601, 'Zn': 63.929147, 'Ga': 68.925581, 'Ge': 69.924250, 'As': 74.921596, 'Se': 73.922477, 'Br': 78.9183376, 'Kr': 77.920386, 'Rb': 84.911789, 'Sr': 83.913425, 'Y': 88.905848, 'Zr': 89.904704, 'Nb': 92.906378, 'Mo': 91.906810, 'Tc': 97.907216, 'Ru': 95.907598, 'Rh': 102.905504, 'Pd': 101.905608, 'Ag': 106.905093, 'Cd': 105.906458, 'In': 112.904061, 'Sn': 111.904821, 'Sb': 120.903818, 'Te': 119.904020, 'I': 126.904468, 'Xe': 123.905896, 'Cs': 132.905447, 'Ba': 129.906310, 'La': 137.907107, 'Ce': 135.907144, 'Pr': 140.907648, 'Nd': 141.907719, 'Pm': 144.912744, 'Sm': 143.911995, 'Eu': 150.919846, 'Gd': 151.919788, 'Tb': 158.925343, 'Dy': 155.924278, 'Ho': 164.930319, 'Er': 161.928775, 'Tm': 168.934211, 'Yb': 167.933894, 'Lu': 174.940768, 'Hf': 173.940040, 'Ta': 179.947466, 'W': 179.946706, 'Re': 184.952956, 'Os': 183.952491, 'Ir': 190.960591, 'Pt': 189.959930, 'Au': 196.966552, 'Hg': 195.965815, 'Tl': 202.972329, 'Pb': 203.973029, 'Bi': 208.980383} Hmass = mims['H'] elmass = 0.0005486 ionmasses = {1: {'+H': mims['H'], '+NH4': mims['N'] + 4 * mims['H'], '+Na': mims['Na'], '-OH': -(mims['O'] + mims['H']), '+K': mims['K']}, -1: {'-H': -mims['H'], '+Cl': mims['Cl']}}
for i in range(1, 101): name = str(i) name = name + ".txt" print(name) print(type(name)) arq = open(name, "w") arq.close();
guild = """CREATE TABLE IF NOT EXISTS guild (guild_id bigint NOT NULL, guild_name varchar(100) NOT NULL, prefix varchar(5), server_log bigint, mod_log bigint, ignored_channel bigint[], lockdown_channel bigint[], filter_ignored_channel bigint[], profanity_check boolean DEFAULT false, invite_link boolean DEFAULT false, PRIMARY KEY(guild_id))""" bonafidecoin = """CREATE TABLE IF NOT EXISTS bonafidecoin (guild_id bigint NOT NULL, user_id bigint NOT NULL, wallet int, bank int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE)""" cog_check = """CREATE TABLE IF NOT EXISTS cog_check (guild_id bigint NOT NULL, cog_name text, enabled boolean, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE)""" filter = """CREATE TABLE IF NOT EXISTS filter (guild_id bigint NOT NULL, keyword text UNIQUE, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ level = """CREATE TABLE IF NOT EXISTS level(guild_id bigint NOT NULL, user_id bigint NOT NULL, total_xp int, current_xp int, required_xp int, lvl int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ mod_logs = """CREATE TABLE IF NOT EXISTS mod_logs(guild_id bigint NOT NULL, user_id bigint NOT NULL, moderator bigint NOT NULL, reason text, created_at timestamp, type text, case_no int, message_id bigint, duration timestamp, action boolean DEFAULT true, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild( guild_id) ON DELETE CASCADE) """ roles = """CREATE TABLE IF NOT EXISTS roles (guild_id bigint NOT NULL, user_id bigint NOT NULL, role_id bigint NOT NULL, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ shop = """CREATE TABLE IF NOT EXISTS shop (guild_id bigint NOT NULL, items text UNIQUE, value int, role_id bigint, description text, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ stats = """CREATE TABLE IF NOT EXISTS stats (guild_id bigint NOT NULL, user_id bigint NOT NULL, message_count int, created_at date, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ stats_server = """CREATE TABLE IF NOT EXISTS stats_server(guild_id bigint, member_count int, created_at date, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ tags = """CREATE TABLE IF NOT EXISTS tag(guild_id bigint NOT NULL, creator bigint NOT NULL, name text UNIQUE, description text, created_at timestamp, uses int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild( guild_id) ON DELETE CASCADE) """ user_inventory = """CREATE TABLE IF NOT EXISTS stats (guild_id bigint NOT NULL, user_id bigint NOT NULL, items text, value int, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE) """ role_check = """CREATE TABLE IF NOT EXISTS role_check (guild_id bigint, cog_name text, role_id bigint, enabled boolean, CONSTRAINT fk_guild FOREIGN KEY(guild_id) REFERENCES guild(guild_id) ON DELETE CASCADE); """
def post_to_dict(post): data = {} data["owner_username"] = post.owner_username data["owner_id"] = post.owner_id data["post_date"] = post.date_utc data["post_caption"] = post.caption data["tagged_users"] = post.tagged_users data["caption_mentions"] = post.caption_mentions data["is_video"] = post.is_video data["video_view_count"] = post.video_view_count data["video_duration"] = post.video_duration data["likes"] = post.likes data["comments"] = post.comments data["post_url"] = "https://www.instagram.com/p/"+post.shortcode data["hashtags_caption"] = post.caption_hashtags return data
class Solution: def equationsPossible(self, equations: List[str]) -> bool: parent = {} def findParent(x): if x not in parent: parent[x] = x else: while parent[x] != x: parent[x] = parent[parent[x]] x = parent[x] return x for eq in equations: if eq[1] == '=': x, y = eq[0], eq[3] px = findParent(x) py = findParent(y) parent[px] = py for eq in equations: if eq[1] == '!': x, y = eq[0], eq[3] px = findParent(x) py = findParent(y) if px == py: return False return True
def new_decorator(func): def wrapper_func(): print('code before executing func') func() print('func() has been called') return wrapper_func @new_decorator def func_needs_decorator(): print('this function is in need of decorator!') # func_needs_decorator() # before adding @new_decorator # decorator = new_decorator(func_needs_decorator) # print(decorator) # decorator() # after adding @new_decorator func_needs_decorator()
class Stats: def min(dataset): value = dataset[0] for data in dataset: if data < value: value = data return value def max(dataset): value = dataset[0] for data in dataset: if data > value: value = data return value def range(dataset): return Stats.max(dataset) - Stats.min(dataset) def mean(dataset): total = 0 terms = 0 for value in dataset: total += value terms += 1 return float(total) / float(terms) def variance(dataset): terms = 0 total = 0.0 for value in dataset: total += (value - Stats.mean(dataset))**(2) terms += 1 return float(total) / float(terms) def standard_deviation(dataset): return Stats.variance(dataset)**(1.0/2.0) def median(dataset): dataset.sort() if len(dataset) % 2 == 0: value_1 = dataset[int(len(dataset) / 2)] value_2 = dataset[int(len(dataset) / 2 - 1)] return (float(value_1) + float(value_2)) / 2 else: return dataset[int(len(dataset) / 2)] def mode(dataset): dataset.sort() occurences = {} tracker = 0 while tracker < len(dataset): if f'{dataset[tracker]}' not in occurences.keys(): occurences[f'{dataset[tracker]}'] = 1 else: occurences[f'{dataset[tracker]}'] += 1 tracker += 1 greatest = -100000000000 for key in occurences.keys(): if occurences[key] > greatest: greatest = occurences[key] greatest_list = [] for key in occurences.keys(): if occurences[key] == greatest: greatest_list.append(key) return greatest_list
# -*- coding: utf-8 -*- # # Copyright © 2020 The Aerospace Corporation # # 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. """Contains exceptions for specific use-case in samba.py""" class CorecproError(Exception): """Base class for exceptions in CORECPRO Attributes: message -- explanation of the error """ def __init__(self, message): self.message = message class SambaError(CorecproError): """Exception raised for errors in Samba that cannot be covered by default Python errors Attributes: message -- explanation of the error """ def __init__(self, message): self.message = message class NotNmapError(SambaError): """Exception raised if there is confirmation that an SMB packet is NOT an Nmap SMB packet Attributes: message -- explanation of the error """ def __init__(self, message): self.message = message
######## # PART 1 # on python 3.7+ can just call pow(base, exp, mod), no need to implement anything! def modexp(base, exp, mod): ''' mod exp by repeated squaring ''' res = 1 cur = base while (exp > 0): if (exp % 2 == 1): res = (res * cur) % mod exp = exp >> 1 cur = (cur * cur) % mod return res # To continue, please consult the code grid in the manual. Enter the code at row 2981, column 3075. row, col = (2981, 3075) firstcode = 20151125 base = 252533 mod = 33554393 diag = row + col - 1 exp = diag * (diag - 1) // 2 + col - 1 answer = modexp(base, exp, mod) * firstcode % mod print("Part 1 =", answer) assert answer == 9132360 # check with accepted answer
# swap it to get solution fin = open("pic.png", "rb") fout = open("../public/file.bin", "wb") data = fin.read()[::-1] result = bytearray() for byte in data: high = byte >> 4 low = byte & 0xF rbyte = (low << 4) + high result.append(rbyte) fout.write(result) fout.close()
WTF_CSRF_ENABLED = True SECRET_KEY = 'you-will-never-guess' projects = {}
# -*- encoding: utf-8 -*- SCORE_NONE = -1 class Life(object): """个体类""" def __init__(self, aGene = None): self.gene = aGene self.score = SCORE_NONE
# some specific relevant fields timestamp_field = 'requestInTs' service_call_fields = ["clientMemberClass", "clientMemberCode", "clientXRoadInstance", "clientSubsystemCode", "serviceCode", "serviceVersion", "serviceMemberClass", "serviceMemberCode", "serviceXRoadInstance", "serviceSubsystemCode"] # Fields to query from the database # 'relevant_cols_general' are fields that are present on the top level relevant_cols_general = ["_id", 'totalDuration', 'producerDurationProducerView', 'requestNwDuration', 'responseNwDuration', 'correctorStatus'] # 'relevant_cols_nested' are fields that are nested inside 'client' and 'producer'. # If 'client' is present, values for these fields will be taken from there, otherwise from 'producer'. relevant_cols_nested = service_call_fields + ["succeeded", "messageId", timestamp_field] # 'relevant_cols_general_alternative' are fields that are present on the top level, but exist for both client and producer. # The value will be taken from the field assigned in the second position in the triplet if it exists, # otherwise from the third field. The first value in the triplet is the name that will be used. # Example: metric 'requestSize' will be assigned value from database field 'clientRequestSize' if it exists, # otherwise from the database field 'producerRequestSize'. relevant_cols_general_alternative = [('requestSize', 'clientRequestSize', 'producerRequestSize'), ('responseSize', 'clientResponseSize', 'producerResponseSize')] # some possible aggregation windows hour_aggregation_time_window = {'agg_window_name': 'hour', 'agg_minutes': 60, 'pd_timeunit': 'h'} day_aggregation_time_window = {'agg_window_name': 'day', 'agg_minutes': 1440, 'pd_timeunit': 'd'} # for historic averages model, we also need to determine which are the "similar" periods hour_weekday_similarity_time_window = {'timeunit_name': 'hour_weekday', 'agg_window': hour_aggregation_time_window, 'similar_periods': ['hour', 'weekday']} weekday_similarity_time_window = {'timeunit_name': 'weekday', 'agg_window': day_aggregation_time_window, 'similar_periods': ['weekday']} hour_monthday_similarity_time_window = {'timeunit_name': 'hour_monthday', 'agg_window': hour_aggregation_time_window, 'similar_periods': ['hour', 'day']} monthday_similarity_time_window = {'timeunit_name': 'monthday', 'agg_window': day_aggregation_time_window, 'similar_periods': ['day']} # which windows are actually used time_windows = {"failed_request_ratio": hour_aggregation_time_window, "duplicate_message_ids": day_aggregation_time_window, "time_sync_errors": hour_aggregation_time_window} historic_averages_time_windows = [(hour_weekday_similarity_time_window, "update"), (weekday_similarity_time_window, "update")] # set the relevant fields (metrics) that will be monitored, aggregation functions to apply # and their anomaly confidence thresholds for the historic averages model historic_averages_thresholds = {'request_count': 0.95, 'mean_request_size': 0.95, 'mean_response_size': 0.95, 'mean_client_duration': 0.95, 'mean_producer_duration': 0.95} # set the relevant fields for monitoring time sync anomalies, and the respective minimum value threshold time_sync_monitored_lower_thresholds = {'requestNwDuration': -1000, 'responseNwDuration': -1000} # set the ratio of allowed failed requests per time window failed_request_ratio_threshold = 0.9 corrector_buffer_time = 14400 # minutes incident_expiration_time = 14400 # minutes training_period_time = 3 # months
##1 x = float(input()) if x < 60: print("不及格") elif 60 < x and x < 80: print("及格") elif 80 < x and x < 90: print("良好") elif 90 < x and x < 100: print("优秀")
class Mesh(GeometryObject,IDisposable): """ A triangular mesh. """ def Dispose(self): """ Dispose(self: Mesh,A_0: bool) """ pass def ReleaseManagedResources(self,*args): """ ReleaseManagedResources(self: APIObject) """ pass def ReleaseUnmanagedResources(self,*args): """ ReleaseUnmanagedResources(self: GeometryObject) """ pass def __enter__(self,*args): """ __enter__(self: IDisposable) -> object """ pass def __exit__(self,*args): """ __exit__(self: IDisposable,exc_type: object,exc_value: object,exc_back: object) """ pass def __init__(self,*args): """ x.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signaturex.__init__(...) initializes x; see x.__class__.__doc__ for signature """ pass MaterialElementId=property(lambda self: object(),lambda self,v: None,lambda self: None) """Element ID of the material from which this mesh is composed. Get: MaterialElementId(self: Mesh) -> ElementId """ NumTriangles=property(lambda self: object(),lambda self,v: None,lambda self: None) """The number of triangles that the mesh contains. Get: NumTriangles(self: Mesh) -> int """ Vertices=property(lambda self: object(),lambda self,v: None,lambda self: None) """Retrieves all vertices used to define this mesh. Intended for indexed access. Get: Vertices(self: Mesh) -> IList[XYZ] """
n, k = map(int, input().split()) graph = [] printInfo = [] for i in range(n): graph.append([]) for i in range(k): oper, u, v = input().split() u = int(u) - 1 v = int(v) - 1 if oper == '+': graph[u] += [v] graph[v] += [u] if oper == '?': if not(graph[u] and graph[v]): printInfo += ['?'] elif set(graph[u]) & set(graph[v]): printInfo += ['+'] else: printInfo += ['-'] for info in printInfo: print(info)
# A colection of key value pairs # Keys need to be a string my_dict = {'name':'john', 'age':27, 'gender':'male', 'subs': ['Eng', 'Math', 'Sci'], 'marks':(58, 79,63)} print(my_dict['name']) print(my_dict['age']) my_dict['age'] += 3 print(my_dict['age']) print(my_dict['subs']) print(my_dict['marks']) print(my_dict['subs'][1],end='--') print(my_dict['marks'][1]) # Other ways to make a dictionary d = {} d['key1'] = 'value1' d['key2'] = 'value2' print(d) # Dictionary nested inside a dictionary nested inside a dictionary d = {'key1':{'nestkey':{'subnestkey':'value'}}} print(d['key1']['nestkey']['subnestkey']) # DIctionary methods d = {'key1':1, 'key2':2} print(d.keys()) print(d.values()) print(d.items())
str1="Never give in — Never, never, never, never, in nothing great or small, \ large or petty, never give in except to convictions of honour and good sense. \ Never yield to force; never yield to the apparently overwhelming might of the enemy. O horror, horror, horror. \ Words, words, word. But you never know now do you now do you now do you." rmstr1=str1.replace(',','') rmstr2=rmstr1.replace(';','') rmstr3=rmstr2.replace('.','') rmstr4=rmstr3.replace('—','') lowerstr1=rmstr4.lower() str2=lowerstr1.split() #print(str2) uniqstr=[str2.sort()] for i in str2: if i not in uniqstr: uniqstr.append(i) #print(uniqstr) for i in range (1,len(uniqstr)): print("The word", uniqstr[i],"appears", str2.count(uniqstr[i]),"times")
simulation_parameters = { 'temperature', 'integrator', 'collisions_rate', 'integration_timestep', 'initial_velocities_to_temperature', 'constraint_tolerance', 'platform', 'cuda_precision' } def is_simulation_dict(dictionary): keys=set(dictionary.keys()) output = (keys <= simulation_parameters) return output
# %% [836. *Rectangle Overlap](https://leetcode.com/problems/rectangle-overlap/) # 問題:2つの長方形が重なるかどうかを返せ # 解法:X軸、Y軸で重なるかを調べる class Solution: def isRectangleOverlap(self, rec1: List[int], rec2: List[int]) -> bool: x1, y1, x2, y2, x3, y3, x4, y4 = *rec1, *rec2 return x1 < x4 and x3 < x2 and y1 < y4 and y3 < y2
""" isValidIP("0.0.0.0") ==> true isValidIP("12.255.56.1") ==> true isValidIP("137.255.156.100") ==> true isValidIP('') ==> false isValidIP('abc.def.ghi.jkl') ==> false isValidIP('123.456.789.0') ==> false isValidIP('12.34.56') ==> false isValidIP('01.02.03.04') ==> false """ def isValidIP(string): info = string.split('.') if len(string) < 1: return(False) if len(info) == 4: for x in info: if x.isdigit() == False: return False elif len(x) > 1 and x[0] == "0": return False elif x == "": return False elif x.isdigit() == True and (int(x)>= 0 and int(x)<=255): pass else: return False return True else: return False print(isValidIP("0.0.0.0")) print(isValidIP("12.255.56.1")) print(isValidIP("137.255.156.100")) print(isValidIP('')) # DONE print(isValidIP('abc.def.ghi.jkl')) # DONE print(isValidIP('123.456.789.0')) # DONE print(isValidIP('12.34.56')) # DONE print(isValidIP('01.02.03.04')) print(isValidIP('12.34.56.')) # print(isValidIP('1.34.56.9'))
""" Regression utils """ class Regressor(object): def __init__(self): pass def fit(self): pass
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"triee": "00_core.ipynb", "cov": "01_oval_clean.ipynb", "numpts": "01_oval_clean.ipynb", "Points": "01_oval_clean.ipynb", "vlen": "01_oval_clean.ipynb", "major": "01_oval_clean.ipynb", "minor": "01_oval_clean.ipynb", "x_vec": "01_oval_clean.ipynb", "dot": "01_oval_clean.ipynb", "ang": "01_oval_clean.ipynb", "rat": "01_oval_clean.ipynb", "major_length": "01_oval_clean.ipynb", "minor_length": "01_oval_clean.ipynb", "transform_x": "01_oval_clean.ipynb", "transform_y": "01_oval_clean.ipynb", "cos": "01_oval_clean.ipynb", "sin": "01_oval_clean.ipynb", "theta": "01_oval_clean.ipynb", "x": "01_oval_clean.ipynb", "y": "01_oval_clean.ipynb", "x_oval": "01_oval_clean.ipynb", "y_oval": "01_oval_clean.ipynb", "Points_map": "01_oval_clean.ipynb", "boundary": "01_oval_clean.ipynb", "xx": "01_oval_clean.ipynb", "y1": "01_oval_clean.ipynb", "y2": "01_oval_clean.ipynb", "layer_init": "02_NN.ipynb", "linear": "02_NN.ipynb", "fetch": "03_NN_numpy.ipynb", "mnist": "03_NN_numpy.ipynb", "kaiming_uniform": "03_NN_numpy.ipynb", "kaiming_normal": "03_NN_numpy.ipynb", "stat": "03_NN_numpy.ipynb", "Linear": "03_NN_numpy.ipynb", "MSELoss": "03_NN_numpy.ipynb", "NNL": "03_NN_numpy.ipynb", "CELoss": "03_NN_numpy.ipynb", "SGD": "03_NN_numpy.ipynb", "Adam": "03_NN_numpy.ipynb", "Sequential": "03_NN_numpy.ipynb", "Conv": "03_NN_numpy.ipynb", "naive": "03_NN_numpy.ipynb", "Conv_dump": "03_NN_numpy.ipynb", "Flatten": "03_NN_numpy.ipynb", "people": "04_DNAA.ipynb", "data": "04_DNAA.ipynb", "frags": "04_DNAA.ipynb", "checkppl": "04_DNAA.ipynb"} modules = ["core.py", "to_submit.py", "nn.py", "nnsig.py", "dnaa.py"] doc_url = "https://Kelvinthedrugger.github.io/HWs/" git_url = "https://github.com/Kelvinthedrugger/HWs/tree/master/" def custom_doc_links(name): return None