<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def disconnect(self, event, cb):
 """ Disconnect a previously connected callback. If a callback is connected multiple times, only one connection is removed. """

        try:
            self._callbacks[event].remove(cb)
        except KeyError:
            raise ValueError("{!r} is not a valid cursor event".format(event))
        except ValueError:
            raise ValueError("Callback {} is not registered".format(event))