def _split_channels(num_chan, num_groups):
        """
        Splits the total number of channels into a specified
        number of groups as evenly as possible.

        Parameters
        ----------
        num_chan : int
            The total number of channels to split.
        num_groups : int
            The number of groups to split the channels into.

        Returns
        -------
        list of int
            A list containing the number of channels in each group.
            The first group may have more channels if the division is not even.
        """
        split = [num_chan // num_groups for _ in range(num_groups)]
        split[0] += num_chan - sum(split)
        return split

        Splits the total number of channels into a specified
        number of groups as evenly as possible.

        Parameters
        ----------
        num_chan : int
            The total number of channels to split.
        num_groups : int
            The number of groups to split the channels into.

        Returns
        -------
        list of int
            A list containing the number of channels in each group.
            The first group may have more channels if the division is not even.
        
braindecode/models/fbmsnet.py