MCPcopy Index your code
hub / github.com/RustPython/RustPython / get_local_events

Function get_local_events

crates/vm/src/stdlib/sys/monitoring.rs:637–649  ·  view source on GitHub ↗
(tool_id: i32, code: PyObjectRef, vm: &VirtualMachine)

Source from the content-addressed store, hash-verified

635}
636
637fn get_local_events(tool_id: i32, code: PyObjectRef, vm: &VirtualMachine) -> PyResult<u32> {
638 if code.downcast_ref::<PyCode>().is_none() {
639 return Err(vm.new_type_error("code must be a code object"));
640 }
641 let tool = check_valid_tool(tool_id, vm)?;
642 let code_id = code.get_id();
643 let state = vm.state.monitoring.lock();
644 Ok(state
645 .local_events
646 .get(&(tool, code_id))
647 .copied()
648 .unwrap_or(0))
649}
650
651fn set_local_events(
652 tool_id: i32,

Callers

nothing calls this directly

Calls 6

check_valid_toolFunction · 0.85
ErrClass · 0.50
is_noneMethod · 0.45
get_idMethod · 0.45
lockMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected