Added necessary functions with call_guard policy py::gil_scoped_release to avoid blocking python threads