160def _config_from_cpp(cpp_cfg: Any) -> CopulaConfigPy:
161 """Dispatch a bound C++ copula config to the matching Python wrapper.
164 cpp_cfg: Bound C++ copula configuration object.
167 A ``GaussianCopulaConfigPy`` or ``StudentTCopulaConfigPy`` instance.
170 TypeError: If the C++ object type is not recognized.
172 if isinstance(cpp_cfg, st.GaussianCopulaConfig):
173 return GaussianCopulaConfigPy.from_cpp(cpp_cfg)
174 if isinstance(cpp_cfg, st.StudentTCopulaConfig):
175 return StudentTCopulaConfigPy.from_cpp(cpp_cfg)
176 raise TypeError(f
"Copula config C++ inconnue: {type(cpp_cfg)!r}")