def METHOD_NAME(self, fitted_model):  # pylint: disable=arguments-renamed
    """Convert the fit object returned by ``self.sample`` to InferenceData."""
    if fitted_model.__class__.__name__ == "CmdStanMCMC":
        idata = from_cmdstanpy(posterior=fitted_model, **self.idata_kwargs)
    else:
        idata = from_pystan(posterior=fitted_model, **self.idata_kwargs)
    return idata