def iterators(self, frequency=None):
        """
        Returns the iterators (i.e. subject_id, visit_id) that the pipeline
        iterates over

        Parameters
        ----------
        frequency : str | None
            A selected data frequency to use to determine which iterators are
            required. If None, all input frequencies of the pipeline are
            assumed
        """
        iterators = set()
        if frequency is None:
            input_freqs = list(self.input_frequencies)
        else:
            input_freqs = [frequency]
        for freq in input_freqs:
            iterators.update(self.study.FREQUENCIES[freq])
        return iterators