code: def _replace_mask(condition, mask):
      """replace the mask in the termination condition with the given mask"""
      kwds = _term.state(condition).popitem()[-1]
      if "mask" in kwds:
          kwds["mask"] = mask
      return _term.type(condition)(**kwds)
  
file_path: mystic/mystic/mask.py
imports: import mystic.termination
label_desc: Use image node_id 4 for calling a global function with example usage: _replace_mask(condition, mask) and returns: _term