code: def update_mask(condition, collapse, new=False):
      """update the termination condition with the given collapse (dict)"""
      if collapse is None:
          return condition
      for kind, mask in collapse.items():
          condition = _update_masks(condition, mask, kind, new)
      return condition
  
file_path: mystic/mystic/mask.py
imports: import mystic.termination
label_desc: Use image node_id 2 for calling a global function with example usage: update_mask(condition, collapse, new) and returns: condition, condition