code: def dijkstra(A, source, non_edges_are_zero_or_inf="zero"):
      """Run's dijkstra's on the vertex to produce the shortest path to all nodes.
      Just copyng the pseudo code in Wikipedia.
      non_edges_are_zero_or_inf indicate whether a non-edge is indicated as a 0 or
      inf in A.
      """
      vertex_is_remaining = np.array([1] * A.shape[0])
      all_vertices = np.array(range(A.shape[0]))
      all_dists = np.array([np.inf] * A.shape[0])
      all_dists[source] = 0
      while sum(vertex_is_remaining) > 0:
          # Find the minimum and remove it.
          rem_dists = deepcopy(all_dists)
          rem_dists[vertex_is_remaining == 0] = np.nan
          u = np.nanargmin(rem_dists)
          vertex_is_remaining[u] = 0
          if np.all(np.logical_not(np.isfinite(rem_dists))):
              break
          # Now apply dijkstra's updates
          if non_edges_are_zero_or_inf == "zero":
              u_nbd = all_vertices[A[u] > 0]
          elif non_edges_are_zero_or_inf == "inf":
              u_nbd = all_vertices[A[u] < np.inf]
          else:
              raise ValueError(
                  "non_edges_are_zero_or_inf should be 'zero' or 'inf'."
              )
          for v in u_nbd:
              alt = all_dists[u] + A[u][v]
              if alt < all_dists[v]:
                  all_dists[v] = alt
      return all_dists
  
file_path: dragonfly/dragonfly/utils/graph_utils.py
imports: from copy import deepcopy
  import numpy
  from scipy.linalg import eigh
  from .general_utils import get_nonzero_indices_in_vector
label_desc: Use image node_id 13 for calling a global function with example usage: dijkstra(A, source, non_edges_are_zero_or_inf) and returns: all_dists