code: def filter_predicate_with_keep(ir_pred, keep):
      import hail.ir.ir as ir
  
      return ir.Coalesce(
          ir_pred if keep else ir.ApplyUnaryPrimOp("!", ir_pred),
          ir.FalseIR(),
      )
  
file_path: hail/hail/python/hail/ir/utils.py
imports: from typing import Optional, List, Any, Tuple
  import hail
  from hail.utils.java import Env
  from hail.expr.types import tint32, tint64
label_desc: Use image node_id 8 for calling a global function with example usage: filter_predicate_with_keep(ir_pred, keep) and returns: ir