def METHOD_NAME(self):
    if self.progress:
        try:
            from tqdm import trange
            return trange
        except ImportError:
            raise ImportError(
                "tqdm must be installed to use progress=True when running "
                f"{self.__class__.__name__}"
            )
    return range