Choose spikes from the specified clusters and emit the
        `select` event on the GUI.
558116
def _emit_select(self, cluster_ids, **kwargs):
        """"""
        # Remove non-existing clusters from the selection.
        cluster_ids = self._keep_existing_clusters(cluster_ids)
        logger.debug("Select cluster(s): %s.",
                     ', '.join(map(str, cluster_ids)))
        self.emit('select', cluster_ids, **kwargs)
1138806
def pick(options, title=None, indicator='*', default_index=0, multi_select=False, min_selection_count=0, options_map_func=None):
    
    picker = Picker(options, title, indicator, default_index, multi_select, min_selection_count, options_map_func)
    return picker.start()
1293988
def regular_subset(spikes, n_spikes_max=None, offset=0):
    """"""
    assert spikes is not None
    # Nothing to do if the selection already satisfies n_spikes_max.
    if n_spikes_max is None or len(spikes) <= n_spikes_max:  # pragma: no cover
        return spikes
    step = math.ceil(np.clip(1. / n_spikes_max * len(spikes),
                             1, len(spikes)))
    step = int(step)
    # Note: randomly-changing selections are confusing...
    my_spikes = spikes[offset::step][:n_spikes_max]
    assert len(my_spikes) <= len(spikes)
    assert len(my_spikes) <= n_spikes_max
    return my_spikes
1301752
public void selectByIndex(int index) {
        getDispatcher().beforeSelect(this, index);
        
        new Select(getElement()).selectByIndex(index);
        if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
            logUIActions(UIActions.SELECTED, Integer.toString(index));
        }
        
        getDispatcher().afterSelect(this, index);
    }
579506
def _select_input(self):
        """"""
        line, index = self.get_position('eof')
        if self.current_prompt_pos is None:
            pline, pindex = line, index
        else:
            pline, pindex = self.current_prompt_pos
        self.setSelection(pline, pindex, line, index)
155940
private void selectGroup(final Object key, final Handler<AsyncResult<String>> doneHandler) {
    context.execute(new Action<String>() {
      @Override
      public String perform() {
        String address = groupSelectors.get(key);
        if (address != null) {
          return address;
        }
        Set<String> groups = DefaultClusterManager.this.groups.keySet();
        int index = new Random().nextInt(groups.size());
        int i = 0;
        for (String group : groups) {
          if (i == index) {
            groupSelectors.put(key, group);
            return group;
          }
          i++;
        }
        return null;
      }
    }, doneHandler);
  }
555439
def save(self):
        """"""
        spike_clusters = self.clustering.spike_clusters
        groups = {c: self.cluster_meta.get('group', c) or 'unsorted'
                  for c in self.clustering.cluster_ids}
        # List of tuples (field_name, dictionary).
        labels = [(field, self.get_labels(field))
                  for field in self.cluster_meta.fields
                  if field not in ('next_cluster')]
        # TODO: add option in add_field to declare a field unsavable.
        self.emit('request_save', spike_clusters, groups, *labels)
        # Cache the spikes_per_cluster array.
        self._save_spikes_per_cluster()
682156
def pick_event(self):
        
        logger.debug("checking event queue")
        event = snap7.snap7types.SrvEvent()
        ready = ctypes.c_int32()
        code = self.library.Srv_PickEvent(self.pointer, ctypes.byref(event),
                                          ctypes.byref(ready))
        check_error(code)
        if ready:
            logger.debug("one event ready: %s" % event)
            return event
        logger.debug("no events ready")
1234655
def OnSelectAll(self, event):
        """"""

        entry_line = \
            self.main_window.entry_line_panel.entry_line_panel.entry_line

        if wx.Window.FindFocus() != entry_line:
            self.main_window.grid.SelectAll()

        else:
            entry_line.SelectAll()
624451
def selectByIdx(self, rowIdxs):
        ''
        self.select((self.rows[i] for i in rowIdxs), progress=False)
353495
def callback_box_select(attr, old, new):
    ''''''

    # Get indices of selection
    ind = sorted(new['1d']['indices'])

    if new is None:
        start_input.value = '0'
        end_input.value = '0'
    else:
        start_input.value = str(source.data['ind'][ind[0]])
        end_input.value = str(source.data['ind'][ind[-1]])
        msg = '''
              New start and end index values set.
              '''
        output_window.text = output_template.format(msg)

    return None
730090
@Override
    protected void doPick()
    {
        if (mCollidables.size() > 0)
        {
            GVRPickedObject[] picked = null;

            synchronized (mCollidables)
            {
                picked = pickBounds(mScene, mCollidables);
            }
            if (mPickClosest && (picked.length > 0))
            {
                GVRPickedObject closest = null;
                float dist = 100000.0f;
                for (GVRPickedObject hit : picked)
                {
                    if ((hit != null) && (hit.hitDistance < dist))
                    {
                        dist = hit.hitDistance;
                        closest = hit;
                    }
                }
                if (closest != null)
                {
                    picked = new GVRPickedObject[] { closest };
                }
                else
                {
                    picked = sEmptyList;
                }
            }
            generatePickEvents(picked);
        }
    }
978744
def attach(self, gui):
        """"""
        super(TraceView, self).attach(gui)
        self.actions.add(self.go_to, alias='tg')
        self.actions.separator()
        self.actions.add(self.shift, alias='ts')
        self.actions.add(self.go_right)
        self.actions.add(self.go_left)
        self.actions.separator()
        self.actions.add(self.increase)
        self.actions.add(self.decrease)
        self.actions.separator()
        self.actions.add(self.widen)
        self.actions.add(self.narrow)
        self.actions.separator()
        self.actions.add(self.toggle_show_labels)

        # We forward the event from VisPy to the phy GUI.
        @self.connect
        def on_spike_click(e):
            logger.log(5, "Spike click on channel %s, spike %s, cluster %s.",
                       e.channel_id, e.spike_id, e.cluster_id)
            gui.emit('spike_click',
                     channel_id=e.channel_id,
                     spike_id=e.spike_id,
                     cluster_id=e.cluster_id,
                     )
51661
def select_warp_gates(action, action_space, select_add):
  """"""
  del action_space
  action.action_ui.select_warp_gates.selection_add = select_add
168875
def selection(self):
        """"""
        sel = QtGui.QItemSelection()
        for index in self.selectedIndexes():
            sel.select(index, index)
        return sel
308034
def select(&blk)
      if block_given?
        Thresholds.new(@thresholds.select(&blk))
      else
        Thresholds.new(@thresholds.select)
      end
    end
341987
def _on_select(self, *args):
        
        if callable(self.__callback):
            self.__callback(self.selection)