While hot-cooked peanut sauce is better, more flavorful, and generally just unctuous to the max, sometimes you want: a) to not cook anything. b) to have a smoother, sweeter sauce for dipping e.g. salad rolls in.
This fits that bill.
import contextlib | |
import resource | |
import typing | |
memory_profiler_data = dict() | |
@contextlib.contextmanager | |
def record_memory(name: str) -> typing.ContextManager: | |
initial_rusage = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss | |
assert name not in memory_profiler_data, f"{name}'s memory usage has already been recorded, can't record again" |
@st.cache_resource | |
def load_model(modelnum: int): | |
return keras.models.load_model(f"root/C{modelnum}free') | |
... | |
modelnum = int(re.findall(r'\d+', option)[0]) | |
cNfree = pred(load_model(modelnum), list50) # model{n} for c{n}free |
use tokio::select; | |
use tokio::time::{sleep, Duration}; | |
struct CanDrop { | |
a: Vec<i32>, | |
} | |
impl Drop for CanDrop { | |
fn drop(&mut self) { | |
println!("Dropping!") |
use tokio::io::AsyncReadExt; | |
use tokio::net::TcpStream; | |
use tokio::select; | |
use tokio::task::spawn_blocking; | |
use tokio::time::{sleep, Duration}; | |
async fn main() { | |
let mut stream = TcpStream::connect("...").await?; | |
let thread_handle = spawn_blocking(|| { |