content
stringlengths
7
1.05M
class Source: def __init__(self,id,name): self.id = id self.name = name class Articles: def __init__(self, publishedAt, urlToImage,title,content,author,url): self.publishedAt = publishedAt self.urlToImage= urlToImage self.title = title self.content =content self.author...
# from 1.0.0 data1 = { 'fs': { 'nn::fssrv::sf::IFileSystemProxyForLoader': { 0: {"inbytes": 0, "outbytes": 0, "buffers": [25], "outinterfaces": ['nn::fssrv::sf::IFileSystem']}, 1: {"inbytes": 8, "outbytes": 1}, }, 'nn::fssrv::sf::IEventNotifier': { 0: {"inbytes": ...
def median(list): center_value = len(list) // 2 return list[center_value] def sort_list(list_to_order): while True: changed = False for index, value in enumerate(list_to_order): if not(index + 1 == len(list_to_order)): if value > list_to_order[index + 1]: ...
def transpose_inside_axis(x, axis, index_ls): """ 将变量 x 的第 axis 个轴内的各个维度,按照 index_ls 的顺序进行重排/转置 """ assert isinstance(index_ls, (list, tuple,)) and len(index_ls) == x.shape[axis], \ f"{len(index_ls)} == {x.shape[axis]}?" x = x.swapaxes(axis, -1) y = x[..., index_ls] y = y.swapax...
# Utilizando o type() para criar classes # Método convencional class Pessoa: def respirar(self): print('Olá, estou respirando!') # Método diferenciado, com o type ClassePai = type( # Nome da classe, classes a qual ela herda, atributos/métodos de classe respectivamente 'ClassePai', (Pessoa,), ...
def soma(var1, var2): var = var1 +var2 return var def subtracao(var1, var2): var =var1 - var2 return var def multiplicacao(var1, var2): var =var1 * var2 return var def divisao(var1, var2): var =var1/var2 return var
class Settings: def __init__(self): pass # default settings master_title = 'Mr.' master_name = 'John' master_surname = 'Doe' master_gender = 'female' master_formal_address = 'sir' master_email_username = None master_email_password = None jarvis_name = 'jarvis' ja...
# Created by MechAviv # NPC ID :: 9131007 # Takeda Shingen if sm.getFieldID() == 807100000: sm.setSpeakerID(9131007) sm.sendNext("Get to the Honnou-ji Outer Wall and open the Eastern Door.") elif sm.getFieldID() == 807100001: # Honnou-ji Eastern Grounds sm.startQuest(57101) # Unhandled Field Effect [O...
a,b,c=map(int,input().split()) e=180 d=a+b+c if(e==d): print("yes") else: print("no")
salario = float(input('Digite o seu salário: ')) if salario > 1250.00: aumento = (salario * 0.10) print('PARABÈNS! Você recebeu um aumento de R${:.2f}! Seu salário total será R${:.2f}'.format(aumento, salario+aumento)) else: aumento = (salario * 0.15) print('PARABÉNS! Você recebeu um aumento de R${:.2f}...
# https://www.hackerrank.com/challenges/encryption/problem def encryption(s): n = len(s) r, c = math.floor(math.sqrt(n)), math.ceil(math.sqrt(n)) if r*c<n: r+=1 res =[] for i in range(c): temp = [] j = 0 while i+j<n: temp.append(s[i+j]) j...
#1 Uzdevums # temper = float(input("What is your temperature? ")) # if temper < 35: # print('nav par aukstu') # elif 35 <= temper <= 37: # print('viss kārtībā') # else: # print('iespējams drudzis') temp=float(input("Nelabi izskaties, negribi pamērīt temperatūru!")) low_temp=35 high_temp=36.9 if temp < low_...
"""Workspace rules for importing Haskell packages.""" load("@ai_formation_hazel//tools:mangling.bzl", "hazel_workspace") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") def new_cabal_package(package, sha256, url = None, strip_prefix = None): url = url or "https://hackage.haskell.org/package/%...
#!/user/bin/env python '''rFree.py: This filter returns true if the rFree value for this structure is within the specified range References ---------- - `rFree <http://pdb101.rcsb.org/learn/guide-to-understanding-pdb-data/r-value-and-r-free>`_ ''' __author__ = "Mars (Shih-Cheng) Huang" __maintainer__ = "Mars (Shih-C...
lista=[] while True: l = int(input('Digite um valor:')) if l not in lista: lista.append(l) print('Valor adicionado com sucesso...') else: print('Valor duplicado! Não vou adicionar...') resp = ' ' resp = str(input('Quer continuar? [S/N]')).strip().upper()[0] if resp!='S': ...
# Declare some constants and variables WIDTH, HEIGHT = (600, 400) FPS = 60 BLACK = "#000000" DARKGRAY = "#404040" GRAY = "#808080" LIGHTGRAY = "#d3d3d3" WHITE = "#FFFFFF" ORANGE = "#FF6600" RED = "#FF1F00" PURPLE = "#800080" DARKPURPLE = "#301934"
def generate_log(logs): logs.create('test', '123', '0.0.0.0', 'os', '1.0.0', 'browser', '1.0.0', 'continent', 'country', 'country_emoji', 'region', 'city') def test_logs(logs): test_logs_log(logs) test_reset(logs) test_clean(logs) def test_logs_log(logs): generate_l...
first_number = int(input("Enter the first number: ")) second_number = int(input("Enter the second number: ")) operation = input("Choose operation(+, -, *, /, %): ") result = 0 if operation == "+" or operation == "-" or operation == "*": if operation == "+": result = first_number + second_number elif op...
# -*- coding: utf-8 -*- class PfigAttributeError(Exception): """ Exception raised when a attribute is wrong or missing """ pass class PfigTransactionError(Exception): """ Exception raised when a transaction is failed. """ pass
WORD_VEC_SIZE = 256 # Suggest: 300 MAX_LENGTH = 8 ENDING_MARK = "<e>" LSTM_UNIT = 64 # Suggest: 512 ATTENTION_UNIT = 1 # Suggest: 128??? EPOCHS = 400
class Card(object): """docstring for Card""" def __init__(self, rank, suit): self.rank = rank self.suit = suit def is_same_suit(self, card): return self.suit == card.suit def is_same_rank(self, card): return self.rank == card.rank def __str__(self): return str(self.rank) + " of " + str(...
lines = open("../in/input02.txt").read().splitlines() count = 0 for line in lines: line = line.replace('-',' ').replace(':','').split(' ') # print(line) # print(line[3].count(line[2])) if int(line[0]) <= line[3].count(line[2]) <= int(line[1]): count = count + 1 print('part 1: ',count...
""" Should emit: B020 - on lines 8, 21, and 36 """ items = [1, 2, 3] for items in items: print(items) items = [1, 2, 3] for item in items: print(item) values = {"secret": 123} for key, value in values.items(): print(f"{key}, {value}") for key, values in values.items(): print(f"{key}, {values}") ...
''' This file will control the keyboard mapping to flying commands. The init routine will setup the default values, however, the api supports the ability to update the value for any of the flying commands. ''' LAND1 = "LAND1" FORWARD = "FORWARD" BACKWARD = "BACKWARD" LEFT = "LEFT" RIGHT = "RIGHT" CLOCKWISE = "CLOCKWI...
class Moon: position = [None, None, None] velocity = [None, None, None] def __init__(self, position): self.position = list(position) self.velocity = [0] * len(position) def ApplyGravity(self, moons): for moon in moons: for coord in range(len(moon.position)): ...
def default_cmp(x, y): """ Default comparison function """ if x < y: return -1 elif x > y: return +1 else: return 0 def order(seq, cmp = default_cmp, reverse = False): """ Return the order in which to take the items to obtained a sorted sequence.""" o = range(len(s...
# -*- coding: utf-8 -*- """Top-level package for {{ cookiecutter.project_name }}.""" VERSION = tuple('{{cookiecutter.version}}'.split('.')) __author__ = '{{ cookiecutter.full_name }}' __email__ = '{{ cookiecutter.email }}' # string created from tuple to avoid inconsistency __version__ = ".".join([str(x) for x in VERS...
def compute(original_input): # copy of input input = [x for x in original_input] pointer = 0 while(input[pointer] != 99): if input[pointer] == 1: input[input[pointer+3]] = input[input[pointer+1]] + input[input[pointer+2]] elif input[pointer] == 2: input[input[poi...
def wheat_from_chaff(values): last=len(values)-1 for i, j in enumerate(values): if j<0: continue rec=last while values[last]>=0: last-=1 if i>=last: break values[last], values[i]=values[i], values[last] if rec==last: ...
# https://programmers.co.kr/learn/courses/30/lessons/60058?language=python3 def solution(p): answer = '' def is_balanced(p): return p.count("(") == p.count(")") def is_correct(p): count = 0 if is_balanced(p): for x in p: if x =='(': count += 1 ...
def rotLeft(a, d): # shift d times to the left (d is in the range of 1 - n) n = len(a) temp = [None for _ in range(n)] for i in range(n): temp[i-d] = a[i] return temp # driver code print(rotLeft([1,2,3,4,5], 4))
A, B = [int(a) for a in input().split()] outlet = 1 ans = 0 while outlet < B: outlet += A-1 ans += 1 print(ans)
# -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may cause incor...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Tue Aug 17 14:16:44 2021 Version: 1.0 Universidad Santo Tomás Tunja Simulation @author: Juana Valentina Mendoza Santamaría @author: Alix Ivonne Chaparro Vasquez presented to: Martha Susana Contreras Ortiz """ class Bank(): """Bank class. ...
boot_capacity = float(input()) entries = 0 capacity = 0 suitcases_inside = 0 command = input() while command != "End": suitcases = float(command) entries += 1 suitcases_inside += 1 command = input() if entries % 3 == 0: capacity += suitcases + suitcases * 10 / 100 if capacity > b...
class LargerStrKey(str): def __lt__(x: str, y: str) -> bool: return x + y > y + x class Solution: def largestNumber(self, nums: List[int]) -> str: return ''.join(sorted(map(str, nums), key=LargerStrKey)).lstrip('0') or '0'
""" Created on Sat Apr 18 10:45:11 2020 @author: Pieter Cawood """ class Location(object): def __init__(self, col, row): self.col = col self.row = row def __eq__(self, other): return self.col == other.col and self.row == other.row def __hash__(self): re...
"\n" "\nfoo" "bar\n" "foo\nbar"
{ "targets": [ { "target_name": "module", "sources": [ "cc/module.cc", "cc/functions.cc", "cc/satgraph.cc" ] } ] }
# Copyright (c) 1996-2015 PSERC. All rights reserved. # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. """PYPOWER solves power flow and Optimal Power Flow (OPF) problems. """
# # PySNMP MIB module NSCHippiSonet-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/NSCHippiSonet-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 20:15:26 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Ma...
# # Copyright 2019 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable ...
class Solution: def maxProfit(self, prices, fee): """ :type prices: List[int] :type fee: int :rtype: int """ # two states: one is hold, one is free hold = -prices[0] free = 0 for price in prices[1:]: hold, free = max(hold, free - pr...
class DataCheckAction: """Base class for all DataCheckActions.""" def __init__(self, action_code, details=None): """ A recommended action returned by a DataCheck. Arguments: action_code (DataCheckActionCode): Action code associated with the action. details (dict...
def test_python_is_installed(host): assert host.run('python --version').rc == 0 def test_sudo_is_installed(host): assert host.run('sudo --version').rc == 0
"""Errors for messaging_service_scripts.""" class EndToEnd: """Errors for end-to-end benchmark code.""" class ReceivedUnexpectedObjectError(Exception): """Got an unexpected object from another process.""" class SubprocessTimeoutError(Exception): """Subprocess output timed out.""" class SubprocessFa...
### we prepend t_ to tablenames and f_ to fieldnames for disambiguity ######################################## db.define_table('t_queue', Field('f_name', type='string', label=T('Name')), auth.signature, format='%(f_name)s', migrate=settings.migrate) db.define_table('t_queue_archive',db.t_qu...
''' 1. Get user input using input(“Enter your age: ”). If user is 18 or older, give feedback: You are old enough to drive. If below 18 give feedback to wait for the missing amount of years. Output: ```sh Enter your age: 30 You are old enough to learn to drive. Output: Enter your age: 15 You nee...
# -*- coding: utf-8 -*- # @author: Longxing Tan, tanlongxing888@163.com # @date: 2020-09 class GBDTRegressor(object): # This model can predict multiple steps time series prediction by GBDT model, and the main 3 mode can be all included def __init__(self, use_model, each_model_per_prediction, extend_prediction...
# input S, K = map(int, input().split()) # process ''' 곱이 최대가 되려면 K개로 나눈 조각들의 크기가 최대한 비슷해야 한다. ''' base, rest = divmod(S, K) sol = ((base + 1) ** rest) * (base ** (K - rest)) # output print(sol)
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right class Solution: def maximumAverageSubtree(self, root: TreeNode) -> float: maxScore = 0 def dfs(curr): ...
#shift cracker global iora; iora = "" alpha = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] def crack(text): for integer in range(0,len(text)): v = text[integer] vv = text[integer+1] ...
#--- Exercício 4 - Variáveis #--- Imprima a tela de um itinerário de viagem #--- O itinerário deve conter o ponto de partida e de destino #--- O ponto de partida e de destino devem estar armazenados em variáveis #--- Entre os dois pontos deve conter no mínimo 10 pontos de parada #--- Cada item ponto de parada deve con...
class Singleton(type): instance = None def __call__(cls, *args, **kw): if not cls.instance: cls.instance = super(Singleton, cls).__call__(*args, **kw) return cls.instance class SingletonObject(object): __metaclass__ = Singleton a = SingletonObject() b = SingletonObject() pr...
# Django settings for example project. ########################################################################### INSTALLED_APPS = ( 'django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'example', ###############...
def load_wmap(filename): wmap = dict() with open(filename, 'rb') as fp: for line in fp: entry = line.strip().split('\t') if len(entry) != 2: continue try: wmap[entry[1].decode('utf-8')] = int(entry[0]) except ValueError...
class Event: def __init__(self, _src, _target, _type, _time): self.src = _src self.target = _target self.type = _type self.time = _time def __eq__(self, other): return self.__dict__ == other.__dict__
__author__ = 'Viswanath Chidambaram' __email__ = 'viswanc@thoughtworks.com' __version__ = '0.0.1'
def test_str(project_client): project = project_client assert project.__str__() == project._domain.__str__() def test_get_repository(rubicon_client): rubicon = rubicon_client assert rubicon.repository == rubicon.config.repository
def to_d3_graph(g): """convert networkx format graph to d3 format node/edge attributes are copied """ data = {'nodes': [], 'edges': []} for n in g.nodes_iter(): node = g.node[n] # print('node', node) for f in ('topics', 'bow', 'hashtag_bow'): if f in node: ...
# EXAMPLE PATH: define the actual path on your system gpkg_path = "C:/Users/joker/OneDrive/Mantsa 6. vuosi/Work/PYQGIS-dev/data/practical_data.gpkg" # windows gpkg_layer = QgsVectorLayer(gpkg_path, "whole_gpkg", "ogr") # returns a list of strings describing the sublayers # !!::!! separetes the values # EXAMPLE: 1!!::!!...
class HttpError(Exception): def __init__(self, res, data): self.res = res self.status = res.status_code self.reason = res.reason_phrase self.method = res.method if isinstance(data, dict): self.message = data.get('statusMessage', '') else: self....
# -*- python -*- # Copyright 2009, Google Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of con...
''' 1. Write a Python program to find the single element appears once in a list where every element appears four times except for one. Input : [1, 1, 1, 2, 2, 2, 3] Output : 3 2. Write a Python program to find two elements appear twice in a list where all the other elements appear exactly twice in the list. Input : ...
# Implementation of Doubly Linked List. """In computer science, a doubly linked list is a linked data structure that consists of a set of sequentially linked records called nodes. ... The beginning and ending nodes' previous and next links, respectively, point to some kind of terminator, typically a sentinel node or ...
#-*- encoding:utf-8 -*- """ Copyrigth : Project Name: openAPI3 Module Name: objects Author : sven date: 19-7-8 Description : """ __author__ = "sven" __email__ = "474416133@qq.com" """ open API3 对象 ref:https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types """
class RuleChecker: def __init__(self): pass ''' data: a list of data that has the format {'price': 0.5}, sorted by time descending ''' def check(self, rule, data): return getattr(self, rule)(data) def oldest_newest_single_larger_than_5per(self, tickerData): data = ticke...
# import yaml # print(yaml.safe_load("""--- # version: 1 # disable_existing_loggers: False # formatters: # simple: # format: '[%(levelname)s] [%(asctime)s:%(name)s] %(message)s' # handlers: # console: # class: logging.StreamHandler # level: WARNING # formatter: simple # stream: ext://sys.stdou...
# -*- coding: utf-8 -*- # ******************************************************** # Author and developer: Aleksandr Suvorov # -------------------------------------------------------- # Licensed: BSD 3-Clause License (see LICENSE for details) # -------------------------------------------------------- # Url: https://git...
""" Faça uma função para verificar se um número é positivo ou negativo. sendo que o valor de retorno será 1 se positivo, -1 se negativo e 0 se for igual a 0. Doctests: >>> posneg(1) 1 >>> posneg(-4) -1 >>> posneg(0) 0 >>> posneg(8) 1 """ def posneg(num: int): if num > 0: resp = 1 elif num < 0: ...
def old_monk(n): content = '从前有座山\n山里有座庙\n庙里有个老和尚给小和尚讲故事\n讲的故事是:' print(content) if n < 1: print('......') else: return old_monk(n-1) n = int(input('我有很多故事,你想听几个?\n')) old_monk(n)
'Constant strings for scripts in the repo' UPLOAD_CONTAINER = 'results' UPLOAD_TOKEN_VAR = 'PERFLAB_UPLOAD_TOKEN' UPLOAD_STORAGE_URI = 'https://pvscmdupload.{}.core.windows.net' UPLOAD_QUEUE = 'resultsqueue'
for _ in range(int(input())): n,m=map(int,input().split()) l=[] for i in range(n): l1=list(map(int,input().split())) l.append(l1) for i in range(n): for j in range(m): if i%2==1: if j%2==1: if l[i][j]%2==0: l...
""" Jobs service. This Django app manages API endpoints related to managing 'pg_cron'-based scheduling around data lifecycles, particularly around refreshing materialized views. This scheduling service is colocated with the database in order to keep the scheduling logic defined within the same runtime as the data man...
class Solution(object): def search(self, nums, target): """ :type nums: List[int] :type target: int :rtype: int """ def binarySearch (arr, l, r, x): if r >= l: mid = l + (r - l) // 2 if arr[mid] == x: ...
src = Split(''' api/api_readholdingregisters.c pdu/readholdingregisters.c adu/rtu/rtu.c adu/rtu/mbcrc.c physical/serial.c auxiliary/log.c auxiliary/other.c api/mbm.c ''') component = aos_component('mbmaster', src) component.add_global_includes('includ...
class Simulator: # the maximum number of steps the agent should take before we interrupt him to break infinite cycles max_steps = 500 # the recommended number of random game walkthroughs for vocabulary initialization # should ideally cover all possible states and used words initialization_iteratio...
# Element der Fibonacci-Folge berechnen: def fib(n): if n == 0: # f(0) = 0 return 0 elif n == 1: # f(1) = 1 return 1 else: # f(n) = f(n-1) + f(n-2) return fib (n-1) + fib (n-2) # Ackermann-Funktion berechnen: def ack(m,n): if m == 0: # A(0,n) = n+1 return n+1 elif n == 0: # A(...
class To_int_ask: def __init__(self): pass def func_(self): try: self.a = int(input('> ')) return self.a except ValueError: print('''Maybe you entered some str symbol's, try with out it''') ret = self.func_() retur...
print('\033[32m Olá! Seja bem vindo a aula de 66 \033[m') # Crie um programa que leia vários números inteiros pelo teclado. O programa só vai parar quando o usuario digitar o valor 999, que é a condição de parada. No final, mostre quantos números foram digitados e qual foi a soma entre eles. s = t = 0 while True: ...
""" 443. Two Sum - Greater than target https://www.lintcode.com/problem/two-sum-greater-than-target/description """ class Solution: """ @param nums: an array of integer @param target: An integer @return: an integer """ def twoSum2(self, nums, target): # write your code here num...
n,k=map(int, input().split()) s = input() nums = [] sums = [] cnt = 1 for i in range(1, n): if s[i - 1] != s[i]: nums.append(int(s[i - 1])) sums.append(cnt) cnt = 1 else: cnt += 1 candi = 0 ansli = [] if s[0] == "0": if s[-1] == "0": k = min(k, len(sums)//2 + 1) ...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- add(1, 2) + "!" result =add(1, 2) + "!" result= add(1, 2) + "!" result = add(1, 2) + "!" x= add(1, 2) + "!" def add(x: int, y: int) -> int: add(1, 2) + "!" result =add(1, 2) + "!" result= add(1, 2) + "!" result = add(1, 2) + "!" x= add(1, 2) + "!" def xadd(x: int,...
#-- powertools.vendorize ''' script to vendorize dependencies for a module ''' #-------------------------------------------------------------------------------------------------# #-------------------------------------------------------------------------------------------------#
# -*- coding: utf-8 -*- #auth table for developer and others #search bar(using keywords) #public,private projects #group accesses for many groups #this for the main categories.. db.define_table('category', Field('name',requires=(IS_SLUG(),IS_LOWER(),IS_NOT_IN_DB(db,'category.name')))) ##this is for sub_category d...
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Поле first — целое число, левая граница диапазона, включается в диапазон; поле second — целое число, правая граница диапазона, не включается в диапазон. Пара чисел представляет полуоткрытый интервал [first, second). Реализовать метод rangecheck() — проверку заданного ...
#Faça um Programa que verifique se uma letra digitada é vogal ou consoante. letters = input("Informe a letra(minuscula): ") if((letters=="a")or(letters=="e")or(letters=="i")or(letters=="o")or(letters=="u")): print("Esta letra eh uma vogal") else: print("Esta letra eh uma consoante")
#! /usr/bin/python3 # -*- coding: utf-8 -*- # @Time : 2019/3/10 5:28 PM # @Author : xiaoliji # @Email : yutian9527@gmail.com """ 最长不含重复字符的子字符串 >>> s = 'arabcacfr' >>> lengthOfLongestSubstring(s) 4 >>> lengthOfLongestSubstring('abba') 2 """ def lengthOfLongestSubstring(s: str) -> s...
num = 1 num = 2 num2 = 3
""" Helper variables, lists, dictionaries, used for a clean display in the template. """ # Advanced Search Template Helpers ----------------------------------- SORT_OPTIONS_ORDER = ['Router Name', 'Fingerprint', 'Country Code', 'Bandwidth', 'Uptime', 'Last Descriptor Published', ...
PROJECT_URL = "https://github.com/sebiweise/Home-Assistant-Parcello/" ISSUE_URL = "{}issues".format(PROJECT_URL) DOMAIN = "parcello" VERSION = "0.0.1" ISSUE_URL = "https://github.com/sebiweise/Home-Assistant-Parcello/issues" PLATFORM = "sensor" API_BASEURL = "https://api-v4.parcello.org/v1/app" # Configuration Proper...
class DatabaseManipulator: def __init__(self, conexao): self.__conexao = conexao self.__cursor = self.__conexao.cursor() def getConexao(self): return self.__conexao def setConexao(self, conexao): self.__conexao = conexao def getCursor(self): return self.__curso...
# # Copyright 2017 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
""" Two-Fer module. """ def two_fer(name="you"): """ :param name:str name of the person :return str message. """ return f"One for {name}, one for me."
N = int(input()) def get_impact(s: str): strength = 1 impact = 0 for c in s: if c == 'S': impact += strength else: strength *= 2 return impact for i in range(N): d, p = input().split() d = int(d) sol = 0 if p.count('S') > d: sol = ...
# -*- coding: utf-8 -*- """Top-level package for Movie Recommender.""" __author__ = """SPICED""" __email__ = 'kristian@spiced-academy.com' __version__ = '0.1.0'
#!/usr/bin/env python """ Copyright 2014 Denys Sobchyshak 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 a...
n = int(input()) if 0 <= n <= 100: if n == 0: print('E') elif 1 <= n <= 35: print('D') elif 36 <= n <= 60: print('C') elif 61 <= n <= 85: print('B') elif 86 <= n <= 100: print('A')
def main(): n = int(input()) ans = list(map(int, input().split())) m = int(input()) bms = list(map(int, input().split())) gears = [bj/ai for bj in bms for ai in ans] checked = list(filter(lambda gear : gear == int(gear), gears)) maximum = max(checked) checked = list(filter(lambda gear ...
class StaticSelf: def __init__(self): class C: SELF = self self.c = C() assert self.c.SELF is self