Performance?
- Memory
- CPU/GPU
- I/O
import uuid | |
from sqlmodel import Field, Session, SQLModel, create_engine, select | |
# class Hero(SQLModel, table=True): | |
# id: uuid.UUID = Field(default=uuid.uuid4(), primary_key=True) | |
# # id: int | None = Field(default=None, primary_key=True) | |
# name: str = Field(index=True) | |
# secret_name: str | |
# age: int | None = Field(default=None, index=True) | |
import time | |
import asyncio | |
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor, as_completed | |
class SyncWork: | |
def __init__(self): | |
self.active_tasks_limit = 10 | |
def __call__(self, *args, **kwargs): |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Page Title</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
/*! |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Page Title</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous"> | |
</head> |
Exception | |
HTTPException | |
HTTPSuccessful | |
* 200 - HTTPOk | |
* 201 - HTTPCreated | |
* 202 - HTTPAccepted | |
* 203 - HTTPNonAuthoritativeInformation | |
* 204 - HTTPNoContent | |
* 205 - HTTPResetContent | |
* 206 - HTTPPartialContent |
import time | |
import logging | |
import pyautogui | |
logging.basicConfig(level=logging.DEBUG, | |
format='[%(asctime)s] - %(message)s') | |
pyautogui.FAILSAFE = False | |
pyautogui.PAUSE = 2.5 |
import io | |
import json | |
from pprint import pprint | |
import pycurl | |
def post(url, data): | |
buffer = io.BytesIO() |
def decorator(f): | |
@functools.wraps(f) | |
def wrapper(*args, **kwargs): | |
print('Wrapping') | |
return f(*args, **kwargs) | |
return wrapper | |
@decorator | |
def f(): | |
print('Function f') |
<!DOCTYPE html> | |
<html> | |
<head> | |
<script type="text/javascript"> | |
// use vanilla JS because why not | |
window.addEventListener("load", function() { | |
// create websocket instance | |
var mySocket = new WebSocket("ws://localhost:8080/ws"); | |