def set_num_channels(channels):
    """Set the total number of playback channels.

    Sets the number of available channels for the mixer. The default value is
    8. The value can be increased or decreased. If the value is decreased,
    sounds playing on the truncated channels are stopped.

    :Parameters:
        `channels` : int
            Number of channels

    """
    _mixer_init_check()
    Mix_AllocateChannels(channels)

    for i in list(_channels.keys()[:]):
        if i >= channels:
            del channels[i]
dataset/ETHPy150Open los-cocos/cocos/cocos/audio/pygame/mixer.py/set_num_channels/original