code: def select_and_store(self, vi, sources, targets, ft_feature, dt_unit):
      # input value dict
      ivdic = {}
  
      # input features
      for feature in self.input_features:
          if feature.endswith("_s"):
              ivdic[feature] = vi[feature[:-2]].values[sources]
          elif feature.endswith("_t"):
              ivdic[feature] = vi[feature[:-2]].values[targets]
  
      # input relations
      for r in self.input_rs:
          if r not in CreatorFunction.stored_relations:
              self.request_r(
                  r, vi, sources, targets, dt_unit, ft_feature
              )
          try:
              ivdic[r] = CreatorFunction.stored_relations[r]
          except KeyError:
              msg = (
                  "{} requests {}, which has not yet "
                  "been computed. Check the order of "
                  "your connectors and selectors.".format(self.name, r)
              )
              raise KeyError(msg)
  
      # input indices
      ivdic["sources"] = sources
      ivdic["targets"] = targets
  
      # for the fast track selector, we need the threshold value
      if self.name == "_ft_selector":
          ivdic["ftt"] = ft_feature[1]
  
      # select and return rs and new node indices
      output = self.fct(**ivdic)
  
      # output value dict
      ovdic = {}
      for i, name in enumerate(self.output):
          ovdic[name] = output[i]
  
      # assert that all output_rs have the same shape as the indices
      # PERFORMANCE
      for r in self.output_rs:
          assert len(ovdic[r]) == len(
              sources
          ), "shape of {} has been modified in {}".format(r, self.name)
  
      # assert that new sources and target indices have same shape
      # PERFORMANCE
      assert len(ovdic["sources"]) == len(
          ovdic["targets"]
      ), "shape of reduced source and target indices must be the same."
  
      # store output rs of selectors in CreatorFunction.stored_relations
      for r in self.output_rs:
          CreatorFunction.stored_relations[r] = ovdic[r]
  
      # positional indices of selected pairs in the former indices
      if not len(ovdic["sources"]) == len(sources):
          index = _find_selected_indices(
              sources, targets, ovdic["sources"], ovdic["targets"]
          )
      else:
          index = np.arange(len(sources))
  
      # shrink CreatorFunction.stored_relations by selected indices
      for r in CreatorFunction.stored_relations:
          CreatorFunction.stored_relations[
              r
          ] = CreatorFunction.stored_relations[r][index]
  
      # return updated indices
      return ovdic["sources"], ovdic["targets"]
  
file_path: deepgraph/deepgraph/connectors_and_selectors.py
imports: import inspect
  import warnings
  from collections import Counter
  import numpy
  from deepgraph._find_selected_indices import _find_selected_indices
  from deepgraph.utils import _flatten
label_desc: Use image node_id 2 for calling the Selector obj's underlying member method code with example usage: obj.select_and_store(vi, sources, targets, ft_feature, dt_unit) and returns: ovdic,  ovdic