code: def selector(mask):
      """generate a selector for a mask of pairs and/or indices"""
      indices, pairs = _split_mask(mask)
      return lambda x: (
          _pair_selector(pairs)(x) or _index_selector(indices)(x)
      )
  
file_path: mystic/mystic/collapse.py
imports: import mystic.monitors
label_desc: Use image node_id 9 for calling a global function with example usage: selector(mask) and returns: function