code: def _weighted(edges: List[tuple]) -> np.ndarray:
      weights = map(lambda edge: edge[-1]["weight"], edges)
  
      return np.array([*weights])
  
imports: import random
  from functools import partial
  from typing import List, Callable
  import numpy
  import networkx
label_desc: Use image node_id 6 for calling a global function with example usage: _weighted(edges) and returns: np