code: def _select_and_return(
      vi,
      sources,
      targets,
      ft_feature,
      dt_unit,
      transfer_features,
      coldtypedic,
  ):
      for selector in CreatorFunction.s_instances:
          sources, targets = selector.select_and_store(
              vi, sources, targets, ft_feature, dt_unit
          )
  
      # output relations that have not been requested by selectors
      for r in CreatorFunction.c_output_rs:
          if r not in CreatorFunction.stored_relations:
              Selector.request_r(
                  r, vi, sources, targets, dt_unit, ft_feature
              )
  
      # ========================================================================
      #  COLLECT DATA (indices, rs and transfer features)
      # ========================================================================
  
      data = CreatorFunction.stored_relations
  
      # go back in original v base
      sources = vi.index.values[sources]
      targets = vi.index.values[targets]
  
      # node indices
      data["s"] = sources
      data["t"] = targets
  
      # transfer features
      for tf in transfer_features:
          data[tf + "_s"] = vi.loc[sources, tf].values
          data[tf + "_t"] = vi.loc[targets, tf].values
  
      # create ei
      ei = pd.DataFrame({col: data[col] for col in coldtypedic})
  
      # dtypes
      cdd = {
          key: value
          for key, value in coldtypedic.items()
          if value is not None
      }
      ei = ei.astype(cdd)
  
      # reset stored_relations
      CreatorFunction.reset("stored_relations")
  
      return ei
  
file_path: deepgraph/deepgraph/iterators_and_indexers.py
imports: from datetime import datetime
  from itertools import chain
  import numpy
  import pandas
  from deepgraph._triu_indices import _triu_indices, _union_of_indices, _reduce_triu_indices
  from deepgraph.connector_selector_implementations import _ft_connector, _ft_selector
  from deepgraph.connectors_and_selectors import CreatorFunction, Selector, Connector
  from deepgraph.utils import _flatten, _is_array_like, _merge_dicts
label_desc: Use image node_id 9 for calling a global function with example usage: _select_and_return(vi, sources, targets, ft_feature, dt_unit, transfer_features, coldtypedic) and returns: ei