code: def _initial_inertia(K, Features, seeds=None):
      """Compute the variance associated with each
      edge-related pair of vertices
      The result is written in K;weights
      if seeds if provided (seeds!=None)
      this is done only for vertices adjacent to the seeds
      """
      if seeds is None:
          for e in range(K.E):
              i = K.edges[e, 0]
              j = K.edges[e, 1]
              ESS = _inertia(i, j, Features)
              K.weights[e] = ESS
      else:
          aux = np.zeros(K.V).astype("bool")
          aux[seeds] = 1
          for e in range(K.E):
              i = K.edges[e, 0]
              j = K.edges[e, 1]
              if aux[i] or aux[j]:
                  K.weights[e] = _inertia(i, j, Features)
              else:
                  K.weights[e] = np.inf
  
imports: from warnings import warn
  import numpy
  from ..graph.forest import Forest
  from ..graph.graph import WeightedGraph
label_desc: Use image node_id 6 for calling a global function with example usage: _initial_inertia(K, Features, seeds) without return types