def handle_base_indices_arg(base_periods):
    """Converts arg to list if int, or raises error if not int or list."""
    if not isinstance(base_periods, list):
        if isinstance(base_periods, int):
            return [base_periods]
        else:
            raise ValueError(
                "base_periods must be int or list of ints,"
                f" got type {type(base_periods)}"
            )
    else:
        return base_periods