This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unicodedata import normalize | |
''' | |
Método para verificar se uma sequencia de valores é um palindromo | |
''' | |
def converter_ascii(chars: str) -> str: | |
return normalize('NFKD', chars).encode('ASCII', 'ignore').decode('ASCII') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from datetime import timedelta | |
def converter_em_segundos(hora: int = 0, minutos: int = 0, segundos: int = 0) -> float: | |
"""Função para converter hora, minutos e segundos em segundos.""" | |
return timedelta(hours=hora, minutes=minutos, seconds=segundos).total_seconds() | |
if __name__ == "__main__": | |
assert converter_em_segundos(hora=1) == 3600.0 |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _log_execution( # type: ignore[override] | |
self, | |
func: Callable[ | |
[PropanMessage[MsgType]], | |
Awaitable[T_HandlerReturn], | |
], | |
**broker_args: AnyDict, | |
) -> Callable[[PropanMessage[MsgType]], Awaitable[T_HandlerReturn]]: | |
@wraps(func) | |
async def log_wrapper(message: PropanMessage[MsgType]) -> T_HandlerReturn: |