python agent cleanup resource