Connects callbacks and makes artists pickable. If the datacursor has
        already been enabled, this function has no effect.
483172
def enable(self):
        """"""
        def connect(fig):
            if self.hover:
                event = 'motion_notify_event'
            else:
                event = 'button_press_event'
            cids = [fig.canvas.mpl_connect(event, self._select)]

            # None of this should be necessary. Workaround for a bug in some
            # mpl versions
            try:
                proxy = fig.canvas.callbacks.BoundMethodProxy(self)
                fig.canvas.callbacks.callbacks[event][cids[-1]] = proxy
            except AttributeError:
                # In some versions of mpl, BoundMethodProxy doesn't exist...
                # See: https://github.com/joferkington/mpldatacursor/issues/2
                pass
            return cids

        if not getattr(self, '_enabled', False):
            self._cids = [(fig, connect(fig)) for fig in self.figures]
            self._enabled = True
            try:
                # Newer versions of MPL use set_pickradius
                for artist in self.artists:
                    artist.set_pickradius(self.tolerance)
            except AttributeError:
                # Older versions of MPL control pick radius through set_picker
                for artist in self.artists:
                    artist.set_picker(self.tolerance)

        return self
894844
function(self, callback) {
  if (self.cursorState.dead && self.cursorState.killed) {
    handleCallback(callback, new MongoError('cursor is dead'));
    return true;
  }

  return false;
}
1260045
function Player(eventHandlers) {
    var self = this, loading = null;
    this.label = 'Bandcamp';
    this.eventHandlers = eventHandlers || {};
    this.currentTrack = {position: 0, duration: 0};
    this.sound = null;
    this.isReady = false;
    loading = setInterval(function(){
      if (!!window["soundManager"]) {
        clearInterval(loading);
        self.isReady = true;
        self.clientCall("onApiReady", self);
      }
    }, 200);
  }
303130
def connect(self, name, callback):
        ''''''
        if not self._callbacks[name]:
            self._callbacks[name] = callback
        else:
            raise HookAlreadyConnectedError('Callback hook already connected.')
799726
void onDataSetSelected() {
        String selectedUUID = view.getSelectedDataSetId();
        for (DataSetDef dataSetDef : _dataSetDefList) {
            if (dataSetDef.getUUID().equals(selectedUUID)) {
                fetchMetadata(selectedUUID,
                              new RemoteCallback<DataSetMetadata>() {

                                  public void callback(DataSetMetadata metadata) {
                                      dataSetLookup = lookupConstraints.newDataSetLookup(metadata);
                                      updateDataSetLookup();
                                      changeEvent.fire(new DataSetLookupChangedEvent(dataSetLookup));
                                  }
                              });
            }
        }
    }
1091158
def cursor(self,*args,**kwargs):
        
        d_out("Handle.cursor: Creating cursor..")
        if not self.open:
            raise Exception("Connection isn't open.")

        if 'cursor_factory' not in kwargs or kwargs['cursor_factory'] == None:
            kwargs["cursor_factory"] = Cursor
        callback = kwargs.pop('callback', None)
        cur = self.conn.cursor(*args,**kwargs)
        if callback:
            d_out('Handle.cursor() setting callback attrib {0}'.format(callback))
            cur.callback = callback
        return cur
977918
function addCallback (t, data) {
  var result = data.result || data.error;
  cbid = data.id;
  if (t.callbacks[cbid]) {
    if (data.result) {
      t.callbacks[cbid](result);
    } else {
      t.callbacks[cbid](result, 'error');
    }
  }
}
774721
function(){
      var value = this.get();
      var cursor = this;

      while (cursor = cursor.handler)
        cursor.fn.call(cursor.context, value);
    }
916800
function (callback) {
    var self = this;

    function initDispatcher() {
      debug('init event dispatcher');
      self.dispatcher = new EventDispatcher(self.publisher, self);
      self.dispatcher.start(callback);
    }

    this.store.on('connect', function () {
      self.emit('connect');
    });

    this.store.on('disconnect', function () {
      self.emit('disconnect');
    });

    process.nextTick(function() {
      tolerate(function(callback) {
        self.store.connect(callback);
      }, self.options.timeout || 0, function (err) {
        if (err) {
          debug(err);
          if (callback) callback(err);
          return;
        }
        if (!self.publisher) {
          debug('no publisher defined');
          if (callback) callback(null);
          return;
        }
        initDispatcher();
      });
    });
  }
261131
def update(self, event, annotation):
        """"""
        # Get artist-specific information about the pick event
        info = self.event_info(event)

        if self.props_override is not None:
            info = self.props_override(**info)

        # Update the xy position and text using the formatter function
        annotation.set_text(self.formatter(**info))
        annotation.xy = info['x'], info['y']

        # Unfortnately, 3D artists are a bit more complex...
        # Also, 3D artists don't share inheritance. Use naming instead.
        if '3D' in type(event.artist).__name__:
            annotation.xy = event.mouseevent.xdata, event.mouseevent.ydata

        # In case it's been hidden earlier...
        annotation.set_visible(True)

        if self.keep_inside:
            self._keep_annotation_inside(annotation)

        annotation._has_been_shown = True
        self._last_event = event
        self._last_annotation = annotation

        event.canvas.draw()
88018
public boolean onItemClick(IDrawerItem selectedDrawerItem) {
        //We only need to clear if the new item is selectable
        if (selectedDrawerItem.isSelectable()) {
            //crossfade if we are cross faded
            if (mCrossFader != null) {
                if (mCrossFader.isCrossfaded()) {
                    mCrossFader.crossfade();
                }
            }
            //update everything
            setSelection(selectedDrawerItem.getIdentifier());

            return false;
        } else {
            return true;
        }
    }
1208987
public void makeTouchable(GVRSceneObject sceneObject, OnTouch handler) {
        if (handler != null) {
            if (sceneObject.getRenderData() != null) {
                if (!touchHandlers.containsKey(sceneObject)) {
                    makePickable(sceneObject);
                    touchHandlers.put(sceneObject, new WeakReference<>(handler));
                }
            } else if (sceneObject.getChildrenCount() > 0) {
                for (GVRSceneObject child : sceneObject.getChildren()) {
                    makeTouchable(child, handler);
                }
            }
        }
    }
730928
function isCursorKilled(cursor, callback) {
  if (cursor.s.killed) {
    setCursorNotified(cursor, callback);
    return true;
  }

  return false;
}
1317223
function addInteraction() {
  const value = typeSelect.value;
  if (value !== 'None') {
    draw = new Draw({
      source: source,
      type: typeSelect.value,
      freehand: true
    });
    map.addInteraction(draw);
  }
}
933402
def add_listener(self, listener_type, callback):
        
        self.listener_type= listener_type
        if listener_type == 'objectHovered':
            self.listener_callback_source_hover= callback
        elif listener_type == 'objectClicked':
            self.listener_callback_source_click= callback
        elif listener_type == 'click':
            self.listener_callback_click= callback
        elif listener_type == 'select':
            self.listener_callback_select= callback

        self.listener_flag= not self.listener_flag
319412
function(self, callback) {
  if (self.cursorState.killed) {
    setCursorNotified(self, callback);
    return true;
  }

  return false;
}
992967
def init_artists(self, ax, plot_args, plot_kwargs):
        
        plot_method = self._plot_methods.get('batched' if self.batched else 'single')
        plot_fn = getattr(ax, plot_method)
        artist = plot_fn(*plot_args, **plot_kwargs)
        return {'artist': artist[0] if isinstance(artist, list) and
                len(artist) == 1 else artist}