code: def test_custom_penalty():
      """Test multivariate data with functional input as penalty."""
      X = pd.DataFrame([-7.207066, -5.722571, 5.889715, 5.488990])
  
      cluster_expected = [0, 0, 1, 1]
      fit_expected = [105.77424, 135.84720, 188.92586, -29.15431]
  
      model = EAgglo(penalty=lambda x: np.mean(np.diff(np.sort(x))))
      fitted_model = model._fit(X)
  
      cluster_actual = fitted_model.cluster_
      fit_actual = fitted_model.gof_
  
      assert np.allclose(cluster_actual, cluster_expected)
      assert np.allclose(fit_actual, fit_expected)
  
file_path: sktime/sktime/annotation/tests/test_eagglo.py
imports: import numpy
  import pandas
  from sktime.annotation.eagglo import EAgglo
label_desc: Use image node_id 5 for calling a global function with example usage: test_custom_penalty() without return types