code: def _index_selector(mask):
      """generate a selector for a mask of indices"""
      # assume a sequence of indices is given, specifying one member of a pair
      # all pairs where this index appears are valid
      return lambda x: (int(x[0]) in mask or int(x[1]) in mask)
  
file_path: mystic/mystic/collapse.py
imports: import mystic.monitors
label_desc: Use image node_id 8 for calling a global function with example usage: _index_selector(mask) and returns: function