code: def _petitjean_assignment(X, barycenter, metric_params=None):
      if metric_params is None:
          metric_params = {}
      n = X.shape[0]
      barycenter_size = barycenter.shape[0]
      assign = (
          [[] for _ in range(barycenter_size)],
          [[] for _ in range(barycenter_size)],
      )
      for i in range(n):
          path, _ = dtw_path(X[i], barycenter, **metric_params)
          for pair in path:
              assign[0][pair[1]].append(i)
              assign[1][pair[1]].append(pair[0])
      return assign
  
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 2 for calling a global function with example usage: _petitjean_assignment(X, barycenter, metric_params) and returns: assign