def shuffle(self, state, device_id=None):
        """ Toggle playback shuffling.

            Parameters:
                - state - true or false
                - device_id - device target for playback
        """
        if not isinstance(state, bool):
            logger.warning("state must be a boolean")
            return
        state = str(state).lower()
        self._put(
            self._append_device_id(
                f"me/player/shuffle?state={state}", device_id
            )
        )
 Toggle playback shuffling.

            Parameters:
                - state - true or false
                - device_id - device target for playback
        
spotipy/client.py