Orders the events in the catalogue according to an indexing vector.

        :param np.ndarray id0:
            Pointer array indicating the locations of selected events
427993
def select_catalogue_events(self, id0):
        '''
        
        '''
        for key in self.data:
            if isinstance(
                    self.data[key], np.ndarray) and len(self.data[key]) > 0:
                # Dictionary element is numpy array - use logical indexing
                self.data[key] = self.data[key][id0]
            elif isinstance(
                    self.data[key], list) and len(self.data[key]) > 0:
                # Dictionary element is list
                self.data[key] = [self.data[key][iloc] for iloc in id0]
            else:
                continue
160669
def get_events_map():
    
    from nefertari import events
    set_keys = ('create', 'update', 'replace', 'update_many', 'register')
    before_events = events.BEFORE_EVENTS.copy()
    before_events['set'] = [before_events[key] for key in set_keys]
    after_events = events.AFTER_EVENTS.copy()
    after_events['set'] = [after_events[key] for key in set_keys]
    return {
        'before': before_events,
        'after': after_events,
    }
1077723
def insert_ordered(value, array):
    

    index = 0

    # search for the last array item that value is larger than
    for n in range(0,len(array)):
        if value >= array[n]: index = n+1

    array.insert(index, value)
    return index
836403
def _selectItem(self, index):
        
        self._selectedIndex = index
        self.setCurrentIndex(self.model().createIndex(index, 0))
652116
def idx_sequence(self):
        
        return [x[1] for x in sorted(zip(self._record, list(range(len(self._record)))))]
528062
def ordered_dirs(self):
        
        return [item[0] for item in sorted(
            self.byte_contents.items(), key=lambda entry: entry[1].st_ino)]
1051771
public static void indexToPointIndex( List<Point2D_I32> sequence , GrowQueue_I32 indexes ,
										  FastQueue<PointIndex_I32> output ) {
		output.reset();

		for( int i = 0; i < indexes.size; i++ ) {
			int index = indexes.data[i];
			Point2D_I32 p = sequence.get(index);

			PointIndex_I32 o = output.grow();
			o.x = p.x;
			o.y = p.y;
			o.index = index;
		}
	}
376136
def get_events(self, rlzs_by_gsim):
        
        all_eids, rlzs = [], []
        for rlz, eids in self.get_eids_by_rlz(rlzs_by_gsim).items():
            all_eids.extend(eids)
            rlzs.extend([rlz] * len(eids))
        return numpy.fromiter(zip(all_eids, rlzs), events_dt)
323110
private static int next_idx( long [] tl ) {
    // Spin until we can CAS-acquire a fresh index
    while( true ) {
      int oldidx = (int)tl[0];
      int newidx = (oldidx+1)&(MAX_EVENTS-1);
      if( CAS( tl, 0, oldidx, newidx ) )
        return oldidx;
    }
  }
43640
def selection_index_to_idx(self, key, selection_index):
        ''''''
        a = key.split(' ')
        if a[0] != 'mission' or len(a) != 2:
            print("Bad mission object %s" % key)
            return None
        midx = int(a[1])
        if midx < 0 or midx >= len(self.mission_list):
            print("Bad mission index %s" % key)
            return None
        mlist = self.mission_list[midx]
        if selection_index < 0 or selection_index >= len(mlist):
            print("Bad mission polygon %s" % selection_index)
            return None
        idx = mlist[selection_index]
        return idx
631935
def index(self, item):
        
        for i, x in enumerate(self.iter()):
            if x == item:
                return i
        return None
596933
def _increment_index(self, di=1):
        
        if self._last_event is None:
            return

        if not hasattr(self._last_event, 'ind'):
            return

        event = self._last_event
        xy = pick_info.get_xy(event.artist)

        if xy is not None:
            x, y = xy
            i = (event.ind[0] + di) % len(x)
            event.ind = [i]
            event.mouseevent.xdata = x[i]
            event.mouseevent.ydata = y[i]

            self.update(event, self._last_annotation)
639291
def index_at_event(self, event):
        
        # find index at mouse position
        globalpos = event.globalPos()
        viewport = self.viewport()
        pos = viewport.mapFromGlobal(globalpos)
        return self.indexAt(pos)
1370768
def index(value, array):
    
    i = array.searchsorted(value)
    if i == len(array): return -1
    else:               return i
519835
def search_indices(values, source):
    
    orig_indices = source.argsort()
    return orig_indices[np.searchsorted(source[orig_indices], values)]
1195803
def index(self, axes):
        
        return None if axes is self._colormap_axes else self._axes.index(axes)
638040
def dict2orderedlist(dic, order_list, default='', **kwargs):
    
    result = []
    for key_order in order_list:
        value = get_element(dic, key_order, **kwargs)
        result.append(value if value is not None else default)
    return result