content
stringlengths
7
1.05M
# uncompyle6 version 2.9.10 # Python bytecode 2.6 (62161) # Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10) # [GCC 6.2.0 20161005] # Embedded file name: c:\Temp\build\ZIBE\pyreadline\error.py # Compiled at: 2011-06-23 17:25:54 class ReadlineError(Exception): pass class GetSetError(ReadlineErro...
# Exercicios Listas https://wiki.python.org.br/ExerciciosListas # Marcelo Campos de Medeiros # Aluno UNIFIP ADS 2020 # Patos-PB, maio de 2020. ''' 7 - Faça um Programa que leia um vetor de 5 números inteiros, mostre a soma, a multiplicação e os números. ''' lista = list() # multip = 1 pq 1 elemento neutro da multipl...
#Exercício05 x = int(input('Digite um número:')) print('O número que você digitou foi: {}\nO antecessor desse número é: {}\nO sucessor desse número é: {}'.format(x, x-1, x+1)) print('xD')
def page_layout(): response.headers['Content-Type']='text/css' boxes = get_boxes_on_page(request.vars.id) contents = "" for box in boxes : contents += ".cbox#c%(id)s { top:%(y)sem; left:%(x)sem; height:%(h)sem; width:%(w)sem; } \n"%dict(id=box.id, x=box.position_x, y=box.position_y, h=box.h...
############################################################################ # ##ABSOLUTE CORDINATE to screed CONVERSTION ############################################################################ def CorToSrc(x, y, ylen): i = ylen-1-y return(x, i) ##################################################...
text = "The black cat climbed the green tree." print(text.index("c")) # 7 print(text.index("c", 8)) # 10 next c after index 8 print(text.index("gr", 8)) # 26 print(text.index("gr", 8, 16))
class yin: pass class yang: def __del__(self): print("yang destruido") print("?")
"""Python hook that can be used to disable ignored rules in ZAP scans.""" def zap_started(zap, target): """This hook runs after the ZAP API has been successfully started. This is needed to disable passive scanning rules which we have set to IGNORE in the ZAP configuration files. Due to an unresolved issu...
def dicts_from_table(keys, array_of_values): dicts = [] for values in array_of_values: dicts.append({key: value for key, value in zip(keys, values)}) return dicts
""" If the number x occurs before x+1 then you can always take both of them in a single round and hence it won’t contribute anything to the answer but if x comes after x+1 then we cannot take them in the single round hence we add 1 to the final answer. """ n = int(input()) arr = list(map(int,input().split())) brr = [0...
''' Backtracking: Backtracking is a general algorithm for finding all (or some) solutions to some computational problems, notably constraint satisfaction problems. Problem statement: Given a set of n integers, divide the set into 2 halves such a way that the difference of sum of 2 sets is minimum. Input formate: Line...
class ListChecker: def __init__(self): self.my_list = [] def __str__(self): return str(self.my_list) def append_value(self): state = 'y' while True: if state == 'n': break elif state not in ('y', 'n'): state = input('П...
# flake8: noqa # http://patorjk.com/software/taag/#p=display&f=Big&t=Monero # http://patorjk.com/software/taag/#p=display&f=Big&t=XMR.to __xmrto__ = ( " __ ____ __ _____ _ \n" " \ \ / / \/ | __ \ | | \n" " \ V /| \ / | |__) || |_ ___ \n" " > < | |\/| | _ / | __/ _ \ \n"...
#!/usr/bin/env python3 left = pd.DataFrame({'key1': ['foo', 'foo', 'bar'], 'key2': ['one', 'two', 'one'], 'lval': [1, 2, 3]}) right = pd.DataFrame({'key1': ['foo', 'foo', 'bar', 'bar'], 'key2': ['one', 'one', 'one', 'two'], 'rval': ...
# The Coin Change Problem # Developer: Murillo Grübler # Link: https://www.hackerrank.com/challenges/coin-change/problem # Time complexity: O(n²) def getWays(arr, m, n): table = [1 if i == 0 else 0 for i in range(n + 1)] for i in range(m): for j in range(1, len(table)): result = j - arr[i] if result >= 0: ...
''' Kattis - peasoup Just check membership in set. Time: O(sum(m) + n), Space: O(m) ''' n = int(input()) for _ in range(n): m = int(input()) name = input() s = set(input() for i in range(m)) if "pea soup" in s and "pancakes" in s: print(name) exit() print("Anywhere is fine I guess") ...
#sel_muni_name = "Giv'atayim" sel_muni_name = "Rishon LeZiyyon" # RLZ analysis_locs = [ {'name': 'RLZ_center_HertzelxRothchild', 'loc': ['31.963961', '34.803033'] }, {'name': 'RLZ_Azrieli_Rishonim', 'loc': ['31.949232', '34.803299'] }, {'name': 'RLZ_Canyon_Hazahav', 'loc': ['31.990121', '34.774849'] }, ...
class HumioException(Exception): pass class HumioConnectionException(HumioException): pass class HumioHTTPException(HumioException): def __init__(self, message, status_code=None): self.message = message self.status_code = status_code class HumioTimeoutException(HumioException): pass class Hu...
#Faça um programa que leia um inteiro qualquer e mostre na tela a sua tabuada n1 = int(input('Informe um número inteiro: ')) um = int(n1*1) dois = int(n1 * 2) tres = int(n1 * 3) quatro = int(n1 * 4) cinco = int(n1 * 5) seis = int(n1 * 6) sete = int(n1 * 7) oito = int(n1 * 8) nove = int(n1 * 9) dez = int(n1 *10) print(...
def fails(): x = 1 / 0 try: fails() except Exception as e: print(type(e)) print(e) print(e.args)
# # PySNMP MIB module A3COM-HUAWEI-BLG-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/A3COM-HUAWEI-BLG-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 16:49:09 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (defau...
brasileirao = ('Palmeiras', 'Flamengo', 'Internacional', 'Grêmio', 'São Paulo', 'Atlético-MG', 'Atlético-PR', 'Cruzeiro', 'Botafogo', 'Santos', 'Bahia', 'Fluminense', 'Corinthians', 'Chapecoense', 'Ceará SC', 'Vasco da Gama', 'Sport Recife', 'América-MG', 'EC Vitória', 'Para...
""" Time Complexity """ def bubble_sort(data): for i in range(len(data)): # swapped = False, if False return for j in range(len(data)-i-1): if data[j] > data[j+1]: # swapped = True data[j], data[j+1] = data[j+1], data[j] return data data = [1, 2, 10, 9, 8 ,7, 4, 5, 6, 3] bubble_sort...
""" Exercício: undo e redo................................................................. Faça uma lista de 'tarefas' com as seguintes opções: # adicionar tarefa # listar tarefas # opção de desfazer tarefa (a cada vez que chamarmos, desfaz a última ação) - undo # opção de refazer tarefa (a cada vez ...
def command(*command_list): def add_attribute(function): function.command_list = command_list return function return add_attribute
''' URL: https://leetcode.com/problems/add-two-numbers/ Time complexity: O(n) Space complexity: O(1) ''' # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = x # self.next = None class Solution(object): def get_length(self, node): count =...
class Solution: def countOrders(self, n: int) -> int: @functools.cache def totalWays(unpicked, undelivered): if not unpicked and not undelivered: # We have completed all orders. return 1 if (unpicked < 0 or undelivered < 0 or undelivered < unp...
lista = [] for x in range(0, 4+1): num = int(input("Informe um valor: ")) if x == 0 or num > lista[-1]: lista.append(num) else: pos = 0 while pos < len(lista): if num <= lista[pos]: lista.insert(pos, num) break pos += 1 print('...
A, B = map(int, input().split()) C, D = A // B, A % B if A != 0 and D < 0: C, D = C + 1, D - B print(C) print(D)
#: Common folder in which all data are stored BASE_FOLDER = r'/Users/mdartiailh/Labber/Data/2019/11/Data_1114' #: Name of the sample and associated parameters as a dict. #: The currently expected keys are: #: - path #: - Tc (in K) #: - gap size (in nm) SAMPLES = {"JJ200": {"path": "JS129D_BM001_030.hdf5", ...
# reverse a linkedlist # O(N) space:O(1) class Node: def __init__(self, value, next = None) -> None: self.value = value self.next = None def print_linkedlist(head): while head is not None: print(str(head.value) + "", end = "") head = head.next print() d...
# terrascript/data/paultyng/twitter.py # Automatically generated by tools/makecode.py (24-Sep-2021 15:29:28 UTC) __all__ = []
def validSolution(sudoku): row=[] column=[] box=[] for i in range(9): row.append([]) column.append([]) box.append([]) for r in sudoku: i= sudoku.index(r) for c in r: j= r.index(c) if c in row[i] or c in column[j] or c in box[(i/3)*3+j/3]: return False else: row[i].append(c) column[j]...
#Done by Carlos Amaral in 01/07/2020 """ Write a function that accepts a list of items a person wants on a sandwich. The function should have one parameter that collects as many items as the function call provides, and it should print a summary of the sand- wich that’s being ordered. Call the function three times, usi...
# # PySNMP MIB module CISCO-ATM-EXT-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-ATM-EXT-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:33:12 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
# Set window of past points for LSTM model window = 10 # Split 80/20 into train/test data last = int(n/5.0) Xtrain = X[:-last] Xtest = X[-last-window:] # Store window number of points as a sequence xin = [] next_X = [] for i in range(window,len(Xtrain)): xin.append(Xtrain[i-window:i]) next_X.append(Xtrain[i]...
COLUMNS = [ 'TIPO_REGISTRO', 'NRO_FILIAL_PONTO_VENDA', 'NRO_RESUMO_VENDAS', 'DT_CV', 'VL_BRUTO', 'VL_DESCONTO', 'VL_LIQUIDO', 'NRO_CARTAO', 'TIPO_TRANSACAO', 'NRO_CV', 'DT_CREDITO', 'STATUS_TRANSACAO', 'HR_TRANSACAO', 'NRO_TERMINAL', 'TIPO_CAPTURA', 'RESER...
""" Finds the largest palindrome product of 2 n-digit nubers """ def find_largest_palindrome_product(n): """ Finds the largest palindrome product of 2 n-digit numbers :param n: N digit number which specifies the number of digits of a given number :return: Largest Palindrome product of 2 n-digit number...
# Large non-Mersenne prime def solve(): return (28433 * pow(2, 7830457, 10**10) + 1) % 10**10 if __name__ == "__main__": print(solve())
''' * Exercício: Sistema de login * Repositório: Lógica de Programação e Algoritmos em Python * GitHub: @michelelozada Escreva um algoritmo para simular permissão de acesso a um sistema. Após três tentativas sem sucesso de inclusão de senha, o programa deve ser encerrado. ''' email = "ana@example.com" senha =...
class Solution: def isIsomorphic(self, s, t): """ :type s: str :type t: str :rtype: bool """ if len(s) != len(t): return False map1 = {} map2 = {} # reverse for i in range(len(s)): if s[i] in map1: if map...
#! /usr/bin/env python """ ------------------- depexoTools module. ------------------- This module was written primarily for the Depexo source finder, and the tools BANE and MIMAS. The wcs_helpers and angle_tools modules contain many useful classes and methods that would be useful more generally. """ __author__ = 'Pa...
# 3 row=0 while row<8: col=0 while col<6: if (row==0) or (row==1 and col==4) or (row==2 and col==3)or (row==3 and col==2)or (row==4 and col==3)or (row==5 and col==4) or row==6: print("*",end=" ") else: print(" ",end=" ") col +=1 row +=1 print(...
def _git_toolchain_alias_impl(ctx): toolchain = ctx.toolchains["//tools/git-toolchain:toolchain_type"] return [ platform_common.TemplateVariableInfo({ "GIT_BIN_PATH": toolchain.binary_path, }), ] git_toolchain_alias = rule( implementation = _git_toolchain_alias_impl, to...
""" Demo application for cli-toolkit shell wrappers """ __version__ = '1.0'
class Solution: def longestMountain(self, arr: List[int]) -> int: forward_list = [0] backward_list = [0] res = [] for i in range(1,len(arr)): if arr[i] > arr[i-1]: forward_list.append(forward_list[i-1] + 1) else: forward_list.a...
# Data Structure Base Class class DS: def __init__(self, cmp): raise NotImplementedError def gettop(self): raise NotImplementedError def extracttop(self): raise NotImplementedError def insert(self, val): raise NotImplementedError def print(self): raise No...
def arg_parse_common(parser): parser.add_argument('-d', action = 'store_true', help = "Debug mode") parser.add_argument('-f', type = str, nargs = '?', help = 'Format output') parser.add_argument('-b', type = str, nargs = '?', help = 'Batch file') parser.add_argument('-config', type = str, nargs = '?',...
# ============================================================================= # 点类 # ============================================================================= class Point: def __init__(self, point): # x1, y1, x2, y2 = l # 前两个数为起点,后两个数为终点 self.x = point[0] self.y = point[1] def c...
def hello (s): print("Hello, " + s + "!") hello("world") hello("python") hello("Sergey")
# class Tree: # def __init__(self, val, left=None, right=None): # self.val = val # self.left = left # self.right = right # class LLNode: # def __init__(self, val, next=None): # self.val = val # self.next = next class Solution: def solve(self, root): ans = LLN...
class Main: def __init__(self): self.pi = 3.14159 self.r = float(input()) def output(self): print("A=%0.4f" % (self.pi * self.r ** 2)) if __name__ == '__main__': obj = Main() obj.output()
class InvalidConfigException(Exception): """Thrown when the configuration for a question is invalid""" class EvaluationException(Exception): """Thrown when an excetption was thrown from either the evaluation of a code block or a user function call"""
# ATENTION!!! """ 7-8. Deli: Make a list called sandwich_orders and fill it with the names of various sandwiches. Then make an empty list called finished_sandwiches. Loop through the list of sandwich orders and print a message for each order, such as I made your tuna sandwich. As each sandwich is made, move it to the ...
""" Ex 02 - Make a program that reads a person's name and shows a welcome message """ #reads something typed by the user n = str(input('Type your name: ')) print(f'Nice to Meet you {n}') input('Enter to exit')
class Perceptron(object): def __init__(self, lr=0.1, epoch=10): self.lr = lr self.epoch = epoch def fit(self, x, y): self.n_classes = len(np.unique(test_y)) self.w = np.zeros((x.shape[1]+1,self.n_classes)) for _ in range(self.epoch): for xi, yi in zip(x,y): ...
''' Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window. Example: Input: nums = [1,3,-1,-3,5,3,6,7], and k = 3 ...
cor = {'traço': '\033[35m', 'ex': '\033[4;31m', 'título': '\033[1;34m', 'num': '\033[1;33m', 'soma': '\033[1;32m', 'reset': '\033[m'} print('{}-=-{}'.format(cor['traço'], cor['reset'])*18, '{} Exercício 003 {}'.format(cor['ex'], cor['reset']), '{}-=-{}'.format(cor['traço'], cor['reset'])*18) print('{}Crie...
sentence = 'tom\'s pet is a cat' sentence2 = "tom's pet is a cat" sentence3 = "tom said:\"hello world!\"" sentence4 = 'tom said:"hello world"' # 三个连续的单引号或双引号,可以保存输入格式 words = """ hello world abcd""" print(words) py_str = 'python' len(py_str) # 取长度 py_str[0] # 第一个字符 'python'[0] py_str[-1] # 最后一个字符 # py_str[6] # 错误,...
# # PySNMP MIB module CISCO-SESS-BORDER-CTRLR-STATS-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-SESS-BORDER-CTRLR-STATS-MIB # Produced by pysmi-0.3.4 at Wed May 1 12:11:55 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using P...
def print_formatted(number): s=len(bin(number)[2:]) for i in range(1,number+1): print(repr(i).rjust(s),oct(i)[2:].rjust(s+1),hex(i)[2:].upper().rjust(s+1),bin(i)[2:].rjust(s+1)) # your code goes here if __name__ == '__main__': print_formatted(17)
# -*- coding: utf-8 -*- """ A sample of kay settings. :Copyright: (c) 2009 Accense Technology, Inc. Takashi Matsuo <tmatsuo@candit.jp>, All rights reserved. :license: BSD, see LICENSE for more details. """ DEFAULT_TIMEZONE = 'Asia/Kuala_Lumpur' DEBUG = True PROFILE = False ...
def cycle(arg, all_ids=None): if all_ids is None: all_ids = set() arg_id = id(arg) if arg_id not in all_ids: all_ids.add(arg_id) if isinstance(arg, list): for a in arg: for b in cycle(a, all_ids): yield b elif isinstance(arg, di...
menor = 0 maior = 0 for c in range(1, 5): pes = int(input('Em Que Ano a \033[35m{}\033[m Pessoa Nasceu?'.format(c))) if pes >= 1999: menor = menor + 1 else: maior = maior + 1 print('A \033[35m {}\033[m menor de idade e \033[36m{}\033[m maior de idade'.format(menor, maior))
# 数据集存放目录 DATASET_DIR = './datasets' # 训练集路径 TRAIN_SET_PATH = DATASET_DIR + '/track1_round1_train_20210222.csv' # A榜测试集路径 TEST_SET_A_PATH = DATASET_DIR + '/track1_round1_testA_20210222.csv' # B榜测试集路径 TEST_SET_B_PATH = DATASET_DIR + '/track1_round1_testB.csv' # 词向量目录 VECTOR_DIR = './vector' # 语料库文本文件路径 CORPUS_PATH ...
def is_integral(n): return int(n) == n LOCALES = { "af": { "format": { "date": "%Y-%m-%-d", "datetime": "%Y-%m-%-d %-I:%M:%S %p", "datetime_short": "%Y-%m-%-d %-I:%M %p", "decimal_point": ",", "time": "%-I:%M:%S %p", "time_short": ...
#Aprovação de empréstimo bancário #O programa vai perguntar Valor da casa, salário do comprador e em quantos anos ele vai pagar #calcule o valor da prestação mensal , sabendo que ela não pode exceder 30% do salário ou então o empréstimo será negado #Header print('{:=^20}'.format('Desafio 36')) print('='*5,'Avaliação ...
""" nested helpers """ def get_(obj, field, default=None): if callable(field): return field(obj) if isinstance(obj, dict): return obj.get(field, default) return getattr(obj, field, default) def set_(obj, field, value): if isinstance(obj, dict): obj[field] = value else: ...
def load(h): return ({'abbr': 0, 'code': 0, 'title': 'Confidence index'}, {'abbr': 1, 'code': 1, 'title': 'Quality indicator'}, {'abbr': 2, 'code': 2, 'title': 'Correlation of product with used calibration product'}, {'abbr': 3, 'code': 3, 'title': 'Stan...
def binary_search(arr, low, high, number): while(low <= high): mid = (low + high)//2 if arr[mid] == number: return True elif(arr[mid] > number): high = mid -1 else: low = mid + 1 return False if __name__ == "__main__": print(binary_search(...
def _flatten(x): result = [] for el in x: if hasattr(el, "__iter__") and not isinstance(el, basestring): result.extend(_flatten(el)) else: result.append(el) return result class Utils: @staticmethod def _deleteEmpty(str): return str != "" ...
# Length of Last Word # https://www.interviewbit.com/problems/length-of-last-word/ # # Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. # # If the last word does not exist, return 0. # # Note: A word is defined as a character sequence ...
# # @lc app=leetcode id=845 lang=python3 # # [845] Longest Mountain in Array # # @lc code=start class Solution: def longestMountain(self, A) -> int: tend = [] for i in range(0, len(A) - 1): if A[i + 1] > A[i]: tend.append(1) elif A[i + 1] == A[i]: ...
#replace blank space with / def replace(a): temp=a.split(" ") temp2='/' for i in range(0,len(temp)): temp2=temp2+temp[i]+'/' print(temp2) a=raw_input("enter string") replace(a)
def main(request, response): response.headers.set("Access-Control-Allow-Origin", "*") response.headers.set("Access-Control-Max-Age", 0) response.headers.set('Access-Control-Allow-Headers', "x-test") if request.method == "OPTIONS": if not request.headers.get("User-Agent"): response.c...
class HealthCheck: _instance = None def __new__(cls, *args, **kwargs): if not HealthCheck._instance: HealthCheck._instance = super(HealthCheck, cls).__new__(cls, *args, **kwargs) return HealthCheck._instance def __init__(self): self._servers = [] def add_server(...
n=int(input("Enter a Number - ")) for i in range (1,n+1): if (n%i==0): print (i)
print("hello.") def test_hello(): print("\ntesting the words 'hello' and 'goodbye'\n") assert "hello" > "goodbye" def test_add(): assert 1==2-1
# suites SIMPLE = 'simple' ARGS = 'args' GENERATOR = 'generator' LAZY_GENERATOR = 'lazy_generator' FIXTURE = 'fixture' FIXTURE_ARGS = 'fixture_args' FIXTURE_GENERATOR = 'fixture_generator' FIXTURE_LAZY_GENERATOR = 'fixture_lazy_generator' FIXTURE_BUILDER = 'fixture_builder' FIXTURE_BUILDER_ARGS = 'fixture_builder_args...
#User function Template for python3 class Solution: def subsetSums(self, arr, N): # code here def subset(arr,N,ind,sum,res): if ind==N: res.append(sum) return subset(arr,N,ind+1,sum+arr[ind],res) subset(arr,N,ind+1,sum,res) re=[] subset(arr,N,0,0,re) return re #{ #...
""" https://edabit.com/challenge/5S97Me79PDAefLEXv Convert from lambda to def Given a piece of code with a function assigned by lambda, rewrite it into a function assigned by def. The code given would be in string. Overview This is a quick example of a lambda expression: func = lambda a, b: a * (b - 2) ... is the sa...
# https://www.interviewbit.com/problems/merge-intervals/ # Definition for an interval. # class Interval: # def __init__(self, s=0, e=0): # self.start = s # self.end = e class Solution: # @param intervals, a list of Intervals # @param new_interval, a Interval # @return a list of Interva...
RELEASE_HUMAN = "104" RELEASE_MOUSE = "104" ASSEMBLY_HUMAN = f"Homo_sapiens.GRCh38.{RELEASE_HUMAN}" ASSEMBLY_MOUSE = f"Mus_musculus.GRCm39.{RELEASE_MOUSE}" CELLTYPES = ["adventitial cell", "endothelial cell", "acinar cell", "pancreatic PP cell", "type B pancreatic cell"] CL_VERSION = "v2021-08-10"
def subarray_sum_non_negative(lst, target_sum): ''' Simple 2-pointer-window. ''' window_idx_left = 0 window_idx_right = 1 current_sum = lst[0] while True: if current_sum == target_sum: return window_idx_left, window_idx_right - 1 if window_idx_right >= len(lst): ...
### Mock Config ### env = { "name": "mock_env", "render": False, } agent = { "name": "mock_agent", "network": "mock_network", } optim = { "name": "mock_optim", "lr": 0.0001, } train = { "training": True, "load_path": None, "run_step": 100000, "print_period": 1000, "save_p...
#!/usr/bin/python3 """ imports Flask instance for gunicorn configurations gunicorn --bind 127.0.0.1:8003 wsgi.wsgi_amazon.amazon.app """ amazon = __import__('app', globals(), locals(), ['*']) if __name__ == "__main__": """runs the main flask app""" amazon.app.run()
APIS = [{ 'field_name': 'SymbolDescription', 'field_price': 'AvgPrice', 'field_symbol': 'Symbol', 'name': 'SASE', 'root': 'http://www.sase.ba', 'params': { 'type': 19 }, 'request_type': "POST", 'status': 'FeedServices/HandlerChart.ashx', 'type': 'json' }, { 'field_name': 'Descrip...
# -*- coding: utf-8 -*- """ Spyder Editor This is a temporary script file. """ def descompact(lista): binario = [] quantidade = [] qualidade = [] quantidade.append(lista[0]) lista.remove(lista[0]) lista_completa = [] outra_lista = [] dicionario = {} binario_completo = [] result...
''' "Fizz buzz" is a word game we will use to teach the robots about division. Let's learn computers. You should write a function that will receive a positive integer and return: "Fizz Buzz" if the number is divisible by 3 and by 5; "Fizz" if the number is divisible by 3; "Buzz" if the number is divisible by 5; The n...
ah1 = input() ah2 = input() if len(ah1) < len(ah2): print("no") else: print("go")
class Node: def __init__(self, value=None, next_=None): self.value = value self.next_ = next_ class Stack: def __init__(self, top=None): self.top = top def push(self, value): new_node = Node(value, self.top) self.top = new_node def pop(self): if not self.top: raise TypeError remove_node = sel...
#: The AWS access key. Should look something like this:: #: #: AUTH = {'aws_access_key_id': 'XXXXXXXXXXXXXXXXX', #: 'aws_secret_access_key': 'aaaaaaaaaaaa\BBBBBBBBB\dsaddad'} #: AUTH = {} #: The default AWS region to use with the commands where REGION is supported. DEFAULT_REGION = 'eu-west-1' #: Defau...
""" SwFTP is an FTP and SFTP interface for Openstack Swift See COPYING for license information. """ VERSION = '1.0.7' USER_AGENT = 'SwFTP v%s' % VERSION __title__ = 'swftp' __version__ = VERSION __author__ = 'SoftLayer Technologies, Inc.' __license__ = 'MIT' __copyright__ = 'Copyright 2014 SoftLayer Technologies, Inc...
# This software and supporting documentation are distributed by # Institut Federatif de Recherche 49 # CEA/NeuroSpin, Batiment 145, # 91191 Gif-sur-Yvette cedex # France # # This software is governed by the CeCILL-B license under # French law and abiding by the rules of distribution of free softwar...
cups = [True, False, False] steps = list(input()) for c in list(steps): if c == 'A': _ = cups[0] cups[0] = cups[1] cups[1] = _ elif c == 'B': _ = cups[1] cups[1] = cups[2] cups[2] = _ else: _ = cups[0] cups[0] = cups[2] cups[2] = _ pr...
PASSWORD = "Lq#QHMnpyk6Y+.]" def check(selenium_obj, host): current_host = f"http://na2.{host}/" selenium_obj.get(current_host) selenium_obj.add_cookie({'name': 'token', 'value': PASSWORD, 'path': '/'})
LEFT_PADDING = ' ' # using spaces instead of tabs ('/t') creates more consistent results #DIGRAPH_START = 'digraph G { \n' DIGRAPH_END = ' }' # todo: fix padding for sub-graphs class Graph_Dot_Render: def __init__(self, graph, sub_graphs, graph_name='G', graph_type='digraph'): ...
def to_pandas_table(self, ): self.lock.aquire() try: asks_tbl = pd.DataFrame(data=self._asks, index=range(len(self._asks))) asks_tbl = pd.DataFrame(data=self._bids, index=range(len(self._bids))) finally: self.lock.release()
"""Constants for the Govee LED strips integration.""" DOMAIN = "dw_spectrum" CONF_DISABLE_ATTRIBUTE_UPDATES = "disable_attribute_updates" CONF_OFFLINE_IS_OFF = "offline_is_off" CONF_USE_ASSUMED_STATE = "use_assumed_state"
#! /usr/bin/env python # encoding: utf-8 """ Copyright (C) 2018 Yunrong Technology description: author:yutingting time:2018/4/25 PN: """