code: def _mm_update_barycenter(X, diag_sum_v_k, list_w_k):
      """Update barycenters using the formula from Algorithm 2 in [1]_.
  
      Parameters
      ----------
      X : numpy.array of shape (n, sz, d)
          Time-series to be averaged
  
      diag_sum_v_k : numpy.array of shape (barycenter_size, )
          sum of weighted :math:`V^{(k)}` diagonals (as a vector)
  
      list_w_k : list of numpy.array of shape (barycenter_size, sz_k)
          list of weighted :math:`W^{(k)}` matrices
  
      Returns
      -------
      numpy.array of shape (barycenter_size, d)
          Updated barycenter
  
      References
      ----------
  
      .. [1] D. Schultz and B. Jain. Nonsmooth Analysis and Subgradient Methods
         for Averaging in Dynamic Time Warping Spaces.
         Pattern Recognition, 74, 340-358.
      """
      d = X.shape[2]
      barycenter_size = diag_sum_v_k.shape[0]
      sum_w_x = numpy.zeros((barycenter_size, d))
      for k, (w_k, x_k) in enumerate(zip(list_w_k, X)):
          sum_w_x += w_k.dot(x_k[: ts_size(x_k)])
      barycenter = numpy.diag(1.0 / diag_sum_v_k).dot(sum_w_x)
      return barycenter
  
imports: import numpy
  import warnings
  from scipy.interpolate import interp1d
  from sklearn.exceptions import ConvergenceWarning
  from sklearn.utils import check_random_state
  from ..metrics import dtw_path
  from ..utils import to_time_series_dataset, ts_size
  from .utils import _set_weights
label_desc: Use image node_id 9 for calling a global function with example usage: _mm_update_barycenter(X, diag_sum_v_k, list_w_k) and returns: barycenter