def _append_device_id(self, path, device_id):
        """ Append device ID to API path.

            Parameters:
                - device_id - device id to append
        """
        if device_id:
            if "?" in path:
                path += f"&device_id={device_id}"
            else:
                path += f"?device_id={device_id}"
        return path
 Append device ID to API path.

            Parameters:
                - device_id - device id to append
        
spotipy/client.py