code: def checked_flagged_heap_push(priorities, indices, flags, p, n, f):
      if p >= priorities[0]:
          return 0
  
      size = priorities.shape[0]
  
      # break if we already have this element.
      for i in range(size):
          if n == indices[i]:
              return 0
  
      # insert val at position zero
      priorities[0] = p
      indices[0] = n
      flags[0] = f
  
      # descend the heap, swapping values until the max heap criterion is met
      i = 0
      while True:
          ic1 = 2 * i + 1
          ic2 = ic1 + 1
  
          if ic1 >= size:
              break
          elif ic2 >= size:
              if priorities[ic1] > p:
                  i_swap = ic1
              else:
                  break
          elif priorities[ic1] >= priorities[ic2]:
              if p < priorities[ic1]:
                  i_swap = ic1
              else:
                  break
          else:
              if p < priorities[ic2]:
                  i_swap = ic2
              else:
                  break
  
          priorities[i] = priorities[i_swap]
          indices[i] = indices[i_swap]
          flags[i] = flags[i_swap]
  
          i = i_swap
  
      priorities[i] = p
      indices[i] = n
      flags[i] = f
  
      return 1
  
imports: import time
  import numba
  from numba.core import types
  import numba.experimental.structref
  import numpy
label_desc: Use image node_id 17 for calling a global function with example usage: checked_flagged_heap_push(priorities, indices, flags, p, n, f) and returns: int, int, int