code: def apply_graph_updates_low_memory(current_graph, updates, n_threads):
      n_changes = 0
      priorities = current_graph[1]
      indices = current_graph[0]
      flags = current_graph[2]
      # n_threads = numba.get_num_threads()
  
      for n in numba.prange(n_threads):
          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 p % n_threads == n:
                      added = checked_flagged_heap_push(
                          priorities[p], indices[p], flags[p], d, q, 1
                      )
                      n_changes += added
  
                  if q % n_threads == n:
                      added = checked_flagged_heap_push(
                          priorities[q], indices[q], flags[q], d, p, 1
                      )
                      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 18 for calling a global function with example usage: apply_graph_updates_low_memory(current_graph, updates, n_threads) and returns: n_changes