def sample_class(self, rec_ind=None):
        """Return a random class.

        Parameters
        ----------
        rec_ind : int | None
            Index to the recording to sample from. If None, the recording will
            be uniformly sampled across available recordings.

        Returns
        -------
        int
            Sampled class.
        int
            Index to the recording the class was sampled from.
        """
        if rec_ind is None:
            rec_ind = self.sample_recording()
        available_classes = self.info_class.loc[self.info.iloc[rec_ind].name].index
        return self.rng.choice(available_classes), rec_ind
Return a random class.

        Parameters
        ----------
        rec_ind : int | None
            Index to the recording to sample from. If None, the recording will
            be uniformly sampled across available recordings.

        Returns
        -------
        int
            Sampled class.
        int
            Index to the recording the class was sampled from.
        
braindecode/samplers/base.py