code: def _pair_selector(mask):
      """generate a selector for a mask of tuples (pairs)"""
      # assume a sequence of pairs is given, exactly specifying the pairs
      from mystic.tools import _inverted
  
      return lambda x: (tuple(x) in mask or tuple(x) in _inverted(mask))
  
file_path: mystic/mystic/collapse.py
imports: import mystic.monitors
label_desc: Use image node_id 7 for calling a global function with example usage: _pair_selector(mask) and returns: function