This file contains 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 scenario3.price_client import get_price | |
def retrieve_prices(products_id: list[str]) -> dict[str, float]: | |
prices = [] | |
for product_id in products_id: | |
price = get_price(product_id) | |
prices.append({'product_id': product_id, 'price': price}) | |
return prices |
This file contains 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 typing import Union | |
from io import BytesIO | |
from scenario2.nf_client import get_nf_data | |
from scenario2.pdf_service import generate_pdf | |
def issue_nota_fiscal(nf_id: str) -> BytesIO: | |
nf_data = get_nf_data(nf_id) | |
template = 'nf_pdf.template' |
This file contains 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 save_pokemon_name(pokemon_name: str): | |
# Should save pokemon name in database | |
pass |
This file contains 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
class X: | |
def __eq__(self, other): | |
return True | |
x = X() | |
if x == 1 and x == 2 and x == 3: | |
print('Absurdo') |
This file contains 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
VARIABLE_CACHE = {} | |
def request_data(url): | |
if 'my_data' not in VARIABLE_CACHE: | |
data = request_data_from_web(url) | |
VARIABLE_CACHE['my_data'] = data | |
return data | |
else: | |
return VARIABLE_CACHE['my-data'] |
This file contains 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
class MyFormClass(forms.ModelForm): | |
def __init__(self, *args, **kwargs): | |
super() | |
pk = kwargs.pop("pk", None) | |
if pk: | |
self.field_with_querystring.query = Something.objects.filter(pk=pk) | |
form = MyFormClass(pk=client_id) |
This file contains 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 locust import stats, HttpLocust, TaskSet, task, events | |
from locust.runners import locust_runner | |
import sys | |
class QueryElyssonMRTaskSet(TaskSet): | |
@task(5) | |
def query_for_facebook(self): | |
url = "" | |
self.client.get(url) |
This file contains 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 locust import stats, HttpLocust, TaskSet, task, events | |
from locust.runners import locust_runner | |
import sys | |
class QueryElyssonMRTaskSet(TaskSet): | |
@task(5) | |
def query_for_facebook(self): | |
url = "" | |
self.client.get(url) |
This file contains 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
""" | |
Fluxo de usuário se conectando | |
1. usuário vai se conectar usando o websocket | |
1.1. quando o usuário se conectar vamos adiciona-lo a uma lista (ou dicionado) de usuários conectados | |
3. Ler os ramais registrados no redis | |
4. Responder o usuário com a lista de Ramais. | |
Novo Ramal cadastrado |
This file contains 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
python teste.py | |
EXEC1=$? | |
python teste2.py | |
EXEC2=$? | |
python teste3.py | |
EXEC3=$? | |
if [ $EXEC1 -eq "1" ] || [ $EXEC2 -eq "1" ] || [ $EXEC3 -eq "1" ] | |
then | |
echo "ooohh snap :(" |
NewerOlder