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
| @asynccontextmanager | |
| async def lifespan(app: FastAPI): | |
| process_pool = ProcessPoolExecutor( | |
| max_workers=2, | |
| mp_context=multiprocessing.get_context("spawn"), | |
| initializer=process_pool_initializer, | |
| ) | |
| yield |
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
| :root { | |
| --list-item-spacing-top: 0.2em; | |
| --list-item-spacing-bottom: 0.2em; | |
| } | |
| /* reading mode */ | |
| :is(ul, ol) li { | |
| padding-top: var(--list-item-spacing-top) !important; | |
| padding-bottom: var(--list-item-spacing-bottom) !important; | |
| &:last-child { | |
| margin-bottom: unset; |
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 concurrent.futures import ProcessPoolExecutor, as_completed | |
| import itertools | |
| import numpy as np | |
| from typing import List | |
| def calculate_index(img_i: np.array, img_j: np.array, n_groups: int) -> float: | |
| # faz alguma manipulacoes nas imagens e calcula um indice entre elas | |
| pass | |
| def _calculate_index_in_multiprocess( |
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
| import json | |
| import requests | |
| ESTADOS_BRASILEIROS = ( | |
| ("AC", "Acre"), | |
| ("AL", "Alagoas"), | |
| ("AP", "Amapá"), | |
| ("AM", "Amazonas"), | |
| ("BA", "Bahia"), |