code: def apply_graph_updates_high_memory(current_graph, updates, in_graph):
      n_changes = 0
  
      for i in range(len(updates)):
          for j in range(len(updates[i])):
              p, q, d = updates[i][j]
  
              if p == -1 or q == -1:
                  continue
  
              if q in in_graph[p] and p in in_graph[q]:
                  continue
              elif q in in_graph[p]:
                  pass
              else:
                  added = checked_flagged_heap_push(
                      current_graph[1][p],
                      current_graph[0][p],
                      current_graph[2][p],
                      d,
                      q,
                      1,
                  )
  
                  if added > 0:
                      in_graph[p].add(q)
                      n_changes += added
  
              if p == q or p in in_graph[q]:
                  pass
              else:
                  added = checked_flagged_heap_push(
                      current_graph[1][p],
                      current_graph[0][p],
                      current_graph[2][p],
                      d,
                      q,
                      1,
                  )
  
                  if added > 0:
                      in_graph[q].add(p)
                      n_changes += added
  
      return n_changes
  
imports: import time
  import numba
  from numba.core import types
  import numba.experimental.structref
  import numpy
label_desc: Use image node_id 19 for calling a global function with example usage: apply_graph_updates_high_memory(current_graph, updates, in_graph) and returns: n_changes