code: def remove(self, msg, callback):
          
          if callback is None:
              self._dict.pop(msg, None)
          else:
              cb = self._dict.get(msg, [])
              try:
                  cb.remove(callback)
              except ValueError:
                  pass
              if cb:
                  _LOGGER.debug('%d callbacks for message: %s', len(cb), msg)
                  self.add(msg, cb, True)
              else:
                  self._dict.pop(msg, None)
                  _LOGGER.debug('Removed all callbacks for message: %s', msg)
docs: Remove a callback from the callback list.
  
          msg: Message template
          callback: Callback method to remove.
  
          If callback is None, all callbacks for the message template are
          removed.