in one terminal:
python processor.py
in another terminal:
nc -U /tmp/my_unix_socket
class RateLimiter: | |
def __init__( | |
self, *, name: str, max_requests_per_period: int, period_duration_secs: int | |
): | |
self.__name = name | |
self.__max_requests_per_period = max_requests_per_period | |
self.__semaphore = asyncio.Semaphore(max_requests_per_period) | |
self.__period_duration_secs = period_duration_secs |
{ | |
"openapi": "3.0.0", | |
"info": { | |
"description": "baml-cli serve", | |
"version": "0.1.0", | |
"title": "baml-cli serve" | |
}, | |
"servers": [ | |
{ | |
"url": "{address}", |
in one terminal:
python processor.py
in another terminal:
nc -U /tmp/my_unix_socket
------------------------------------- | |
Translated Report (Full Report Below) | |
------------------------------------- | |
Process: Python [4917] | |
Path: /opt/homebrew/*/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python | |
Identifier: org.python.python | |
Version: 3.12.4 (3.12.4) | |
Code Type: ARM-64 (Native) | |
Parent Process: Python [4908] |
Answer in JSON using this schema: | |
{ | |
// The list of medical conditions that were addressed during the episode of care. | |
diagnosis: [ | |
{ | |
// May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and managable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions. | |
// | |
// Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself). | |
modifierExtension: str |
it('test local trace async', async () => { | |
const s2 = new AsyncLocalStorage<string[]>() | |
s2.enterWith(['first']) | |
const localTraceAsync = <ReturnType, F extends (...args: any[]) => Promise<ReturnType>>( | |
name: string, | |
func: F, | |
): F => { | |
const funcName = name |
~/sandbox/python-repro is 📦 v0.1.0 via 🐍 v3.12.3 | [0] at 15:45:16 | |
❯ poetry remove baml-py; RUST_LOG=maturin=debug poetry run maturin build --manifest-path ~/baml/engine/language_client_python/Cargo.toml && poetry add ~/baml/engine/target/wheels/baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl | |
Updating dependencies | |
Resolving dependencies... (0.1s) | |
Package operations: 0 installs, 0 updates, 1 removal | |
- Removing baml-py (0.40.0 /Users/sam/baml/engine/target/wheels/baml_py-0.40.0-cp38-abi3-macosx_11_0_arm64.whl) |
use futures::{future, FutureExt}; | |
use magnus::{ | |
class, exception::runtime_error, function, method, prelude::*, Error, IntoValue, RModule, | |
}; | |
//#[cfg(ruby_have_ruby_fiber_scheduler_h)] | |
use rb_sys::bindings::uncategorized::{ | |
rb_fiber_current, rb_fiber_scheduler_block, rb_fiber_scheduler_current, rb_fiber_scheduler_get, | |
rb_fiber_scheduler_kernel_sleep, rb_fiber_scheduler_unblock, | |
}; | |
use std::cell::RefCell; |
{ | |
"description": "In Terminal/VSCode, caps_lock is CTRL", | |
"manipulators": [ | |
{ | |
"conditions": [ | |
{ | |
"bundle_identifiers": [ | |
"^com\\.apple\\.Terminal", | |
"^com\\.googlecode\\.iterm2", | |
"^com\\.microsoft\\.VSCode" |
fn remove_dir_safe(&self, output_path: &Path) -> Result<()> { | |
if !output_path.exists() { | |
return Ok(()); | |
} | |
const MAX_UNKNOWN_FILES: usize = 5; | |
let mut unknown_files = vec![]; | |
for entry in walkdir::WalkDir::new(output_path) { | |
if unknown_files.len() > MAX_UNKNOWN_FILES { | |
break; |