Set the callback function to consume on medium changed events.

        Callback receives a IMediumChangedEvent object.

        Returns the callback_id
432607
def register_on_medium_changed(self, callback):
        
        event_type = library.VBoxEventType.on_medium_changed
        return self.event_source.register_callback(callback, event_type)
1134841
def _copy_with_changed_callback(self, new_callback):
        '''  '''
        return PeriodicCallback(self._document, new_callback, self._period, self._id)
515007
def _update_proxy(self, change):
        
        if change['type'] in ['event', 'update'] and self.proxy_is_active:
            handler = getattr(self.proxy, 'set_' + change['name'], None)
            if handler is not None:
                handler(change['value'])
1229550
def on(self, name, _callback=None):
        

        # this is being used as a decorator
        if _callback is None:
            return lambda cb: self.on(name, cb)

        if not (callable(_callback) or isawaitable(_callback)):
            msg = "Callback not callable: {0!r}".format(_callback)
            raise ValueError(msg)

        self._event_list[name].append(_callback)
        return _callback
1023234
def set_mouse_button_callback(window, cbfun):
    
    window_addr = ctypes.cast(ctypes.pointer(window),
                              ctypes.POINTER(ctypes.c_long)).contents.value
    if window_addr in _mouse_button_callback_repository:
        previous_callback = _mouse_button_callback_repository[window_addr]
    else:
        previous_callback = None
    if cbfun is None:
        cbfun = 0
    c_cbfun = _GLFWmousebuttonfun(cbfun)
    _mouse_button_callback_repository[window_addr] = (cbfun, c_cbfun)
    cbfun = c_cbfun
    _glfw.glfwSetMouseButtonCallback(window, cbfun)
    if previous_callback is not None and previous_callback[0] != 0:
        return previous_callback[0]
1195193
def callback(self, callback, *args, **kwds):
        
        return self << _CloseDummy(callback, args, kwds)
948134
function(error) {
        if (error) {
          return callback(error);
        }
        probe.off('change', monitor.probeChange);
        monitor.set({probeId:null});
        monitor.probe = monitor.probeChange = null;
        return callback(null, reason);
      }
609505
def register_on_extra_data_can_change(self, callback):
        
        event_type = library.VBoxEventType.on_extra_data_can_change
        return self.event_source.register_callback(callback, event_type)
1154840
def model_m2m_changed(sender, instance, action, **kwargs):
    

    if sender._meta.app_label == 'rest_framework_reactive':
        # Ignore own events.
        return

    def notify():
        table = sender._meta.db_table
        if action == 'post_add':
            notify_observers(table, ORM_NOTIFY_KIND_CREATE)
        elif action in ('post_remove', 'post_clear'):
            notify_observers(table, ORM_NOTIFY_KIND_DELETE)

    transaction.on_commit(notify)
38227
function onChange(_cm, changeObj) {
      var macroModeState = vimGlobalState.macroModeState;
      var lastChange = macroModeState.lastInsertModeChanges;
      while (changeObj) {
        lastChange.expectCursorActivityForChange = true;
        if (changeObj.origin == '+input' || changeObj.origin == 'paste'
            || changeObj.origin === undefined /* only in testing */) {
          var text = changeObj.text.join('\n');
          lastChange.changes.push(text);
        }
        // Change objects may be chained with next.
        changeObj = changeObj.next;
      }
    }
208777
def callback(event, buffer = nil, start = nil, the_end = nil)
      return if !start.nil? && start == the_end
      if @callbacks.has_key? event
        @callbacks[event].call(buffer, start, the_end)
      end
    end
996231
def register_on_extra_data_changed(self, callback):
        
        event_type = library.VBoxEventType.on_extra_data_changed
        return self.event_source.register_callback(callback, event_type)
610779
def set_receive_callback(self, callback, *args, **kwargs):
        """"""
        self.data_callback = callback
        self.data_callback_kwargs = kwargs
1148533
def set_read_events_callback(self, call_back):
        
        logger.info("setting read event callback")
        callback_wrapper = ctypes.CFUNCTYPE(None, ctypes.c_void_p,
                                            ctypes.POINTER(snap7.snap7types.SrvEvent),
                                            ctypes.c_int)

        def wrapper(usrptr, pevent, size):
            """
            Wraps python function into a ctypes function

            :param usrptr: not used
            :param pevent: pointer to snap7 event struct
            :param size:
            :returns: should return an int
            """
            logger.info("callback event: " + self.event_text(pevent.contents))
            call_back(pevent.contents)
            return 0

        self._read_callback = callback_wrapper(wrapper)
        return self.library.Srv_SetReadEventsCallback(self.pointer,
                                                      self._read_callback)
398642
def set_callback(self, func):
        

        if isinstance(func, str if py3k else basestring) and func:
            self.arguments.update({'callback': '%s' % func})
        else:
            raise TwitterSearchException(1006)
173392
def register_on_drag_and_drop_mode_changed(self, callback):
        
        event_type = library.VBoxEventType.on_drag_and_drop_mode_changed
        return self.event_source.register_callback(callback, event_type)
745223
def capture(self, *args, **kwargs):
        
        if not self.is_enabled():
            return

        data = self.build_msg(*args, **kwargs)

        future = self.send(callback=kwargs.get('callback', None), **data)

        return (data['event_id'], future)