content
stringlengths
7
1.05M
for i in range(1,11,1): print(i) # limit=int(input('Enter the limit:')) # sum=0 # for i in range(1,limit+1,1): # print(i) # sum=sum+i # print("sum of numbers:",sum) # for i in range(11,10,1): # if(i==5): # continue # print(i) # else: # print("Hello")
""" link: https://leetcode-cn.com/problems/sliding-window-median problem: 给数组和与滑动窗口长度 k,求数组从左向右每个窗口的中位数 solution: 大顶堆 + 小顶堆。思路类似 295,由于多了一个删除操作,增加一个 multiset 做延迟删除。 """ class Heap: def __init__(self): self.data = [] self.k = 1 def max_heap(self): self.k = -1 return self ...
for _ in range(int(input())): n = int(input()) l = list(map(int,input().split())) l.sort() print(l[0]+l[1])
class InvalidUserId(Exception): """The userid does not meet the expected pattern.""" def __init__(self, user_id): super().__init__(f"User id '{user_id}' is not valid") class RealtimeMessageQueueError(Exception): """A message could not be sent to the realtime Rabbit queue.""" def __init__(sel...
def kvadrat(x): return x**2 + 1 def test_kvadrat(): assert kvadrat(2) == 4
#!/usr/bin/env python3 # -*- coding: utf-8 -*- #Author:Winston.Wang print('---------------获取对象信息-----------------') #判断对象类型 type,<class 'int'> print(type(123)) print(type('hello')) #判断函数 print(type(abs)) #判断类型是否相同 if(type(123) == type(456)): print('相同类型') #isinstance类型判断对象 class Animal(object): def __init__(self): ...
#!/usr/bin/env python3 # terminal input: 1 def read_value(pc, prog, mode): if mode == 0: return prog[prog[pc]] elif mode == 1: return prog[pc] else: raise Exception("unknown mode: %d" % mode) def write_value(pc, prog, mode, value): if mode != 0: raise Exception("only...
fig, axs = plt.subplots(3, sharex=True, gridspec_kw={'hspace': 0}) axs[0].plot(ffp, 10*np.log10(Pxp)) axs[0].set_ylim([-80, 25]) axs[0].set_xlim([-0.2, 0.2]) axs[1].plot(ffn, 10*np.log10(Pxn)) axs[1].set_ylim([-80, 25]) axs[1].set_ylabel('Power Spectral Density (dB/Hz)') axs[2].plot(ff_out, 10*np.log10(Px_out)) axs[...
class GeneralHistogramDataObject(object): def __init__(self, feature_name, edges, bins): self._feature_name = feature_name self._edges = edges self._bins = bins def get_feature_name(self): return self._feature_name def get_edges(self): """String representation of H...
# Given an encoded string, return it's decoded string. # The encoding rule is: k[encoded_string], where the encoded_string # inside the square brackets is being repeated exactly k times. # Note that k is guaranteed to be a positive integer. # You may assume that the input string is always valid; No extra white spaces...
#input vertices are defined here inputs = [[22, 6], [20, 11], [18, 6], [16, 5], [15, 8], [20, 13], [18, 15],\ [15, 13], [13, 8], [9, 13], [3, 9], [6, 2], [6, 5], [11, 6], [16, 1]] x_p = [] y_p = [] x = 0 y = 1 px = input("Enter point x: ") py = input("Enter point y: ") crossing = 0 ranges = range(0, len(inputs)) size =...
a,b,x=map(int,input().split()) l=0 r=10**9+1 ans=10**9 while r-l>=2: n1=l+(r-l)//2 n2=n1+1 p1=a*n1+b*len(str(n1)) p2=a*n2+b*len(str(n2)) if p1 <= x < p2: ans=n1 break elif p1 < x: l=n1 else: r=n1 if p1>x: print(0) else: print(ans)
"""2.3.3 가중치와 편향 구현하기""" def AND(x1, x2): x = np.array([x1, x2]) w = np.array([0.5, 0.5]) b = -0.7 tmp = np.sum(w*x) + b if tmp <= 0: return 0 else: return 1 def NAND(x1, x2): x = np.array([x1, x2]) # AND와 NAND는 가중치(w와 b)만 다르다 w = np.array([-0.5, -0.5]) b = 0.7 tmp = np.s...
""" 18408. 3 つの整数 작성자: xCrypt0r 언어: Python 3 사용 메모리: 29,380 KB 소요 시간: 64 ms 해결 날짜: 2020년 9월 14일 """ def main(): n = list(map(int, input().split())) print(1 if n.count(1) > n.count(2) else 2) if __name__ == '__main__': main()
''' An implementation of the `Annotation store API <http://docs.annotatorjs.org/en/v1.2.x/storage.html.>`_ for `Annotator.js <http://annotatorjs.org/>`_. '''
# GENERATED VERSION FILE # TIME: Wed Aug 26 17:17:32 2020 __version__ = '0.0.0rc0+unknown' short_version = '0.0.0rc0'
class AllResponses: def __init__(self, identifier, query_title, project_id=None, query_id=None): self.id = identifier self.scopus_abstract_retrieval = None self.unpaywall_response = None self.altmetric_response = None self.scival_data = None self.query_title = query_...
# 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 ...
def rotate_index(arr, k, src_ind, src_num, count=0): if count == len(arr): return des_ind = (src_ind + k) % len(arr) des_num = arr[des_ind] arr[des_ind] = src_num rotate_index(arr, k, des_ind, des_num, count + 1) def rotate_k(arr, k): if k < 1: return arr start = 0 ...
rcParams = {"figdir": "figures", "usematplotlib": True, "storeresults": False, "cachedir": 'cache', "chunk": {"defaultoptions": { "echo": True, "results": 'verbatim', "chunk_type": "code", "fig": True, ...
# Grace Foster # ITP 100-01 # EXERCISE: 06 # ageclass.py # ---------------------------------------------------------------- print("Age Classification program") print("-----------------------------------------------") age = 1 while age > 0: age = float(input(f"Enter the age: ")) if age != 0: if age ...
class InadequateArgsCombination(Exception): pass
""" ((32+8)∗(5/2))/(2+6). Take a string as an input and return True if it's parentheses are balanced or False if it is not. """ class Stack: def __init__(self): self.items = [] def size(self): return len(self.items) def push(self, item): """ Adds item to the end "...
# -*- coding: utf-8 -*- # Copyright 2020 Google LLC # # 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...
# Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def levelOrderBottom(self, root: TreeNode): result, level = [], [root] while root and level: result.append([n.val for n...
# -*- coding: utf-8 -*- # @Time : 2020/8/21 3:56 AM # @Author : Yinghao Qin # @Email : y.qin@hss18.qmul.ac.uk # @File : utils6.py # @Software: PyCharm ####################################################################################### # 'utils6' is used to calculate the Levenshtein distance between the p...
# Demonstration of basic Python functions beginning on page 16 # # Basic addition x =44+11*4-6/11 print(x) m = 60*24*7 print("Number of minutes in a week: ", m) times = 2304811//47 #Integer division remainder = 2304811 - (times*47) print("Remainder of 2304811 divided by 47 without using modulo: ", remainder) print(2...
""" aprimore o desafio anterior, mostrando no final a - a soma de todos os valores pares digitados, b - a soma dos valores da terceira coluna. c - O maior valor da segunda linha""" matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]] spar = maior = scol = 0 for linha in range(0, 3): for coluna in range(0, 3): matriz[...
class Bridge: __ipaddress = None __username = None def __init__(self): pass def discover_bridges(self): pass
# # PySNMP MIB module SONUS-REDUNDANCY-SERVICES-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/SONUS-REDUNDANCY-SERVICES-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 21:02:05 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python ve...
def TSMC_Tech_Map(depth, width) -> dict: ''' Currently returns the tech map for the single port SRAM, but we can procedurally generate different tech maps ''' ports = [] single_port = { 'data_in': 'D', 'addr': 'A', 'write_enable': 'WEB', 'cen': 'CEB', 'cl...
def extractMayonaizeshrimpWordpressCom(item): ''' Parser for 'mayonaizeshrimp.wordpress.com' ''' vol, chp, frag, postfix = extractVolChapterFragmentPostfix(item['title']) if not (chp or vol) or "preview" in item['title'].lower(): return None tagmap = [ ('Love Switch', ...
short_sample_text = "Our booked passenger showed in a moment that it was his name. The guard, the coachman, and the " \ "two other passengers eyed him distrustfully." medium_sample_text = "It was the year of Our Lord one thousand seven hundred and seventy-five. Spiritual revelations " \ ...
# A simple while loop example user_input = input('Hey how are you ') while user_input != 'stop copying me': print(user_input) user_input = input() else: print('UGHH Fine')
class A: pass class B(A): """ This is B class comments """ def __init__(self) -> None: super().__init__() @classmethod def get_class_name(cls): return cls.__name__ if __name__ == "__main__": def add_attr(self): print("add_attr") def add_static_attr(): ...
# # PySNMP MIB module ALCATEL-IND1-ISIS-SPB-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/ALCATEL-IND1-ISIS-SPB-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:18:13 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3....
# Marcelo Campos de Medeiros # ADS UNIFIP # Lista_2_de_exercicios # 15/03/2020 ''' 3 - Faça um Programa que verifique se uma letra digitada é "F" ou "M". Conforme a letra escrever: F - Feminino, M - Masculino, Sexo Inválido. ''' #variáveis sexo = str(input('Informe seu sexo ditando "M" para masculido e "F" para femin...
# # @lc app=leetcode.cn id=236 lang=python3 # # [236] lowest-common-ancestor-of-a-binary-tree # None # @lc code=end
"""Quiz: What Type Do These Objects Have? 1 → What type does this object have? "12". → <class 'str'> 2 → What type does this object have? 12.3. → <class 'float'> 3 → What type does this object have? len("my_string"). → <class 'int'> 4 → What type does this object have? "hippo" *12. → <class 'str'> """ print(type('12...
#!/usr/bin/env python3 CI_CONFIG = { "build_config": [ { "compiler": "clang-13", "build_type": "", "sanitizer": "", "package_type": "deb", "bundled": "bundled", "splitted": "unsplitted", "alien_pkgs": True, "tid...
# import pytest class TestTime: def test___str__(self): # synced assert True def test_shift(self): # synced assert True def test_to_isoformat(self): # synced assert True def test_to_format(self): # synced assert True def test_now(self): # synced ass...
def main(): data = open("day9/input.txt", "r") data = [int(line.strip()) for line in data] answer = 0 for i in range(25, len(data)): value = data[i] found = False spliced_data = data[i - 25 : i] for num in spliced_data: num2 = value - num if num2 ...
# Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: # # Integers in each row are sorted from left to right. # The first integer of each row is greater than the last integer of the previous row. # For example, # # Consider the following matrix: # # [ # ...
# # PySNMP MIB module BSUCLK-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BSUCLK-MIB # Produced by pysmi-0.3.4 at Wed May 1 11:41:36 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:...
def descrive_pet(pet_name, animal_type='dog'): """显示宠物信息""" print("\nI have a " + animal_type + ".") print("My " + animal_type + "'s name is " + pet_name.title() + ".") #descrive_pet('hamster', 'harry') #descrive_pet(animal_type='hamster', pet_name='harry') descrive_pet(pet_name='harry', animal_type='hamst...
""" Cut matrices by row or column and apply operations to them. """ class Cutter: """ Base class that pre-calculates cuts and can use them to apply a function to the layout. Each "cut" is a row or column, depending on the value of by_row. The entries are iterated forward or backwards, depending ...
#!/usr/bin/env python3 """SoloLearn > Code Coach > Pig Latin""" english = input('Enter a phrase without punctuation: ').lower() piglatin = '' # NOT REQUIRED: Sanitize the string common_punctuation = ('.', '?', '!', ',', ';', ':') for punctuation in common_punctuation: english = english.replace(punctuation, '') #...
# # @lc app=leetcode id=557 lang=python3 # # [557] Reverse Words in a String III # # https://leetcode.com/problems/reverse-words-in-a-string-iii/description/ # # algorithms # Easy (66.26%) # Likes: 778 # Dislikes: 80 # Total Accepted: 166.2K # Total Submissions: 248.5K # Testcase Example: `"Let's take LeetCode c...
dvs = [] for i in range(9): dvs.append(int(input())) for i in dvs: for j in dvs: if i != j and i + j == sum(dvs) - 100: dvs.remove(i) dvs.remove(j) break print(*dvs)
def put(data,location): f = open(location,"w") for i in data: f.write(i+"\n\n--------------====================--------------\n\n") f.close()
def main(): print(not 1) if __name__ == "__main__": main()
# """ # x = int(input("Enter 1st Number ")) # y = int(input("Enter 2nd Number ")) # z = int(input("Enter 3rd Number ")) # print("The sum is : " + str(x + y + z)) # """ name = "Hey There !!" print(name.replace('ey', 'ii')) print(name.count("Hey There!!")) print(name.lower()) print(name.upper()) cars = ['Lamborghini...
# Для списка реализовать обмен значений соседних элементов, т.е. # Значениями обмениваются элементы с индексами 0 и 1, 2 и 3 и т.д. # При нечетном количестве элементов последний сохранить на своем месте. # Для заполнения списка элементов необходимо использовать функцию input(). my_list = ["2", "1", "4", "3", "6", "5",...
#!/usr/bin/python3 magic = [0x47, 0xCD, 0x40, 0xC6, 0x7A, 0xD9, 0x45, 0xD9, 0x45, 0xAF, 0x2F, 0xAF, 0x50, 0xC0, 0x50, 0xFC] x = 1 for i in magic: print(chr(i ^ x), end = '') x ^= 0x80
class Suit: """Representation of a standard playing card suit.""" def __init__(self, name: str, color: str) -> None: self.name = name self.color = color def __repr__(self) -> str: return f"Suit({self.name}, {self.color})" def __str__(self) -> str: return f"{self.name}"...
DATA = [ '210.153.84.0/24', '210.136.161.0/24', '210.153.86.0/24', '124.146.174.0/24', '124.146.175.0/24', '202.229.176.0/24', '202.229.177.0/24', '202.229.178.0/24']
class Solution(object): def fib(self, n): """ :type n: int :rtype: int """ d = {} def fibo_r(n): if(n in d): return d[n] if(n < 2): res = n else: res = fibo_r(n-1) + fibo_r(n-2) ...
a0 = int(input('Digite o primeiro termo da progressão aritmética: ')) termos = int(input('Digite quantos termos deseja exibir: ')) razao = int(input('Digite qual é a razão da progressão aritmética: ')) an = 0 print('A progressão final é:') for i in range(0, termos * razao, razao): an = a0 + i print(an)
#------------------------------------------------------------------------------ # Copyright (c) 2013, Nucleic Development Team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. #-------------------------------------------------...
''' In order to get the Learn credentials, they do not to open a case on behind the blackboard nor email developers@blackboard.com. They need to go to developer.blackboard.com and register from there to grab the Learn credentials for their application, it is also imperative to remind them that they are creating an app...
next = True while next == True: print("""From all the mentioned zodiac signs 1)Aries 2)Tauras 3)Gemini 4)Cancer 5)Leo 6)Virgo 7)Libra 8)Scorpio 9)Sagittarius 10)Capricorn 11)Aquarius 12)Pisces """) s = int(input("Pick your sign number and Press Enter ...
#!/usr/bin/env python class Bee: def __init__(self, bee_id, tag_id, length_tracked): self.bee_id = bee_id self.tag_id = tag_id self.length_tracked = length_tracked self.last_path_id = None self.path_length = None self.last_x = None self.last_y = None ...
good_ops = {'+': '-', '-': '+', '=<': '==', '>=': '==', '==': '=/=', '=/=': '==', '<':'>', '>': '<'} def count(ast): if ast.expr_name == "binary_operator": return 1 if ast.text in good_ops else 0 if ast.children: return sum(map(count, ast.children)) return 0 def inverse(number,...
""" Um funcionário recebe aumento anual. Em 1995 foi contratado por 2000 reais. Em 1996 recebeu aumento de 1.5%. A partir de 1997, os aumentos sempre correspondem ao dobro do ano anterior. Faça um programa que determine o salário atual do funcionário. """ anoA = int(input('Digite o ano em que estamos: ')) salario = 20...
''' The MIT License(MIT) Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com) 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 ...
""" Estimated time 5 minutes Level of difficulty Very easy Objectives Familiarize the student with: using the for loop; reflecting real-life situations in computer code. Scenario Do you know what Mississippi is? Well, it's the name of one of the states and rivers in the United States. The Mississippi River is about ...
#suma de dos digitos print(1+2) #multiplicacion de dos digitos print (3*4) #division de dos digitos print(3/2) #division estricta, sin decimales, de dos digitos print(81//2) #Potencia de un digito print(3**2)
# This is the main chess game engine that implements the rules of the game # and stores the state of the the chess board, including its pieces and moves class Game_state(): def __init__(self): """ The chess board is an 8 X 8 dimensional array (Matrix of 8 rows and 8 columns ) ...
class Player: VERSION = "fuck" def betRequest(self, game_state): return 10000000 def showdown(self, game_state): pass
# You are given N counters, initially set to 0, and you have two possible operations on them: # increase(X) − counter X is increased by 1, # max counter − all counters are set to the maximum value of any counter. # Write a function that, given an integer N and a non-empty array A consisting of M integ...
class WL(object): def __init__(self,data=None): if data: self.id = data['id'] self.title = data['title'] self.created_at = data['created_at'] def get_id(self): return self.id def get_title(self): return self.title def get_cre...
# Title: Array Partition 1 # Link: https://leetcode.com/problems/array-partition-i/ class Solution: def array_pair_sum(self, nums: list) -> int: nums = sorted(nums) s = 0 for i in range(0, len(nums), 2): s += nums[i] return s def solution(): nums = [1,4,3,2] ...
# coding=utf-8 UNICODE12 = u""" 🥱 Yawning Face 🤎 Brown Heart 🤍 White Heart 🤏 Pinching Hand 🦾 Mechanical Arm 🦿 Mechanical Leg 🦻 Ear With Hearing Aid 🧏 Deaf Person 🧍 Person Standing 🧎 Person Kneeling 🦧 Orangutan 🦮 Guide Dog 🦥 Sloth 🦦 Otter 🦨 Skunk 🦩 Flamingo 🧄 Garlic 🧅 Onion 🧇 Waffle 🧆 Falafel 🧈 But...
def get_user_response(question, valid_responses, error_message=None): """ Function to obtain input from the user. :param question: string Question to ask user :param valid_responses: list of valid responses to use in error catching :param error_message: string Message to display if an exception occu...
# Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def swapPairs(self, head: ListNode) -> ListNode: pre, pre.next = self, head while pre.next and pre.next.next: a = pre.next b ...
class layerClass(): """Class describing single layer of the bundle""" def __init__(self, residues): self.res = residues def __str__(self): return " ".join(["%s:%s" % (r.chain_name, r.res.id[1]) for r in self.res]) def get_layer_CA(self): return [ [res.Ca[0], res.Ca[1], res.Ca[2] ] for res in self.res ] d...
#!/usr/bin/env python3 passphrases = [] try: while True: passphrases.append(input()) except EOFError: pass s1 = 0 for passphrase in passphrases: words = set() for word in passphrase.split(): if word in words: break words.add(word) else: s1 += 1 s2=0 fo...
#!/usr/bin/env python3 # coding: utf-8 def save_vtk(fn: str, vtkn: str, dtn: str, pts, seg): """ save geometry as vtk file args: fn(str) : file name vtkn (str) : vtk global name dtn(str): data name pts (list) : points seg (list) : segments """ with open(fn,...
a3 = int(input("a3=")) a2 = int(input("a2=")) a1 = int(input("a1=")) b2 = int(input("b2=")) b1 = int(input("b1=")) c3 = a3 c2 = a2 + b2 c1 = a1 + b1 print("????? ????? ?????: {0} {1} {2}. ".format(c3 , c2 , c1))
def main(filepath): #file input with open(filepath) as file: rows = [x.strip().split("contain") for x in file.readlines()] #####---start of input parsing---##### #hash = {bag: list of contained bags} #numberhash = {bag: list of cardinalities of contained bags} #numberhash maps o...
class TaskException(Exception): def __init__(self, message): self.message = message class TaskDelayResource(TaskException): def __init__(self, message=None, resource=None, delay=60*60): self.message = message self.resource = resource self.delay = delay class TaskError(TaskExcep...
def sum_triangular_numbers(n): sum_trian = 0 if n < 0: return 0 for i in range(n+1): sum_trian += i*(i+1) // 2 return sum_trian print(sum_triangular_numbers(4))
""" link: https://leetcode.com/problems/odd-even-linked-list problem: 给链表,要求拆分成奇数项在前,偶数项在后的形式,时间O(n),空间O(1) solution: 拆链表保存奇偶项表头和表尾 """ # Definition for singly-linked list. # class ListNode: # def __init__(self, x): # self.val = x # self.next = None class Solution: def oddEvenList(self, hea...
class Cat: def __init__(self, name): self.name = name self.fed = False self.sleepy = False self.size = 0 def eat(self): if self.fed: raise Exception('Already fed.') self.fed = True self.sleepy = True self.size += 1 def sleep(self): if not self.fed: raise Excepti...
#!/usr/bin/env python # -*- coding: utf-8 -*- class VolatileCookie(dict): def __reduce__(self): return (VolatileCookie.__new__, (VolatileCookie,)) def __deepcopy__(self, memo): '''Deep copy of a volatile cookie is intentionally nullified.''' return type(self)()
# -*- coding: UTF-8 -*- defaults = dict( BACKEND='django_datawatch.backends.synchronous', RUN_SIGNALS=True, SHOW_ADMIN_DEBUG=True)
"These are constants used for Toolbox testing." # 'name', 'state', 'end_user_registration_required', 'backend_version', # 'deployment_option', 'buyer_can_select_plan', # 'buyer_key_regenerate_enabled', 'buyer_plan_change_permission', # 'buyers_manage_apps', 'buyers_manage_keys', 'custom_keys_enabled','intentions_requi...
# coding=utf-8 books = ( { 'template_id': 0, 'template_text_file': 'When_I_met_the_Pirates.txt', 'template_dir': 'When_I_met_the_Pirates', 'title': 'When I met the Pirates', 'title_brief': 'Pirates', 'title_RO': u'Aventuri cu pirații', 'title_IT': 'Avventure ...
""" 09 - Faça um programa que leia um número inteiro qualquer e mostre na tela a sua tabuada. """ print('=' * 10, ' TABUADA ', '=' * 10) n = int(input('Digite um número: ')) print(f'{n} x {1:2} = {n*1}') print(f'{n} x {2:2} = {n*2}') print(f'{n} x {3:2} = {n*3}') print(f'{n} x {4:2} = {n*4}') print(f'{n} x {5:2} ...
code_to_state = { 'AK': {'name': 'ALASKA', 'fips': '02'}, 'AL': {'name': 'ALABAMA', 'fips': '01'}, 'AR': {'name': 'ARKANSAS', 'fips': '05'}, 'AS': {'name': 'AMERICAN SAMOA', 'fips': '60'}, 'AZ': {'name': 'ARIZONA', 'fips': '04'}, 'CA': {'name': 'CALIFORNIA', 'fips': '06'}, 'CO': {'name': 'CO...
class TestGames(object): def __init__(self, game_id): self.game_id = game_id @classmethod def create(self, game_id, highScoreNames=None, maxEntries=None, onlyKeepBestEntry=None, socialNetwork=None): return True @classmethod def delete(self, game_id): return ...
""" skcom 例外模組 """ class SkcomException(Exception): """ SKCOM 通用例外 """ class ShellException(SkcomException): """ 在 PowerShell 環境內執行失敗 """ def __init__(self, return_code, stderr): super().__init__() self.return_code = return_code self.stderr = stderr.strip() def get_return_cod...
# _ __ _ ___ _ ___ _ _ # | |/ /_ _ __ _| |_ ___ __/ __| __ _| |___ _ __ ___| _ \ |_ _ __ _(_)_ _ # | ' <| '_/ _` | _/ _ (_-<__ \/ _` | / _ \ ' \/ -_) _/ | || / _` | | ' \ # |_|\_\_| \__,_|\__\___/__/___/\__,_|_\___/_|_|_\___|_| |_|\_,_\__, |_|_||_| # ...
# Copyright (c) 2021 by Cisco Systems, Inc. # All rights reserved. expected_output = { 'evi': { 1: { 'bd_id': { 11: { 'eth_tag': { 0 : { 'mac_addr':{ '0050.56a9.f5af': { ...
class Produtos(): flag=False def __init__(self,nome: str,quantidade: int): self.__nome=nome self.__quantidade=quantidade Produtos.flag=True #talvez essa verificação fique no estoque agora. @property def quantidade(self): return self.__quantidade @quantidade.setter def quantidade(self,value...
# Copyright 2016-2022 Swiss National Supercomputing Centre (CSCS/ETH Zurich) # ReFrame Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: BSD-3-Clause # # Hooks specific to the CSCS GPU microbenchmark tests. # def set_gpu_arch(self): '''Set the compile options for the gp...
HTML_VOID_TAGS = [ 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr', ] HTML_TAGS = [ 'a', 'address', 'applet', 'area', 'article', 'aside', 'b', 'base', ...
LOCAL_TRACE = """ ContractA.methodWithoutArguments() -> 0x00..7a9c [469604 gas] ├── CALL: SYMBOL.<0x045856de> [461506 gas] ├── SYMBOL.methodB1(lolol="ice-cream", dynamo=345457847457457458457457457) │ [402067 gas] │ ├── ContractC.getSomeList() -> [ │ │ 3425311345134513461345134534531452345, │ │ 11134444...
class BlessError(Exception): """ Base Exception for Bless """
#!/usr/bin/env python # -*- coding: UTF-8 -*- # https://docs.python.org/3/library/functions.html#bool # https://docs.python.org/3/library/stdtypes.html#truth # class bool([x]) # Return a Boolean value, i.e. one of True or False. def test1(): print(bool(0)) print(bool(0.0)) print(bool('')) print(bo...