code: def test_set_weights():
      w = tslearn.barycenters._set_weights(None, 3)
      np.testing.assert_allclose(w, np.ones((3,)))
  
      w = tslearn.barycenters._set_weights([0.5, 0.25, 0.25], 3)
      np.testing.assert_allclose(w, [0.5, 0.25, 0.25])
  
      w = tslearn.barycenters._set_weights([0.5, 0.25, 0.25], 2)
      np.testing.assert_allclose(w, np.ones((2,)))
  
imports: import numpy
  import tslearn.barycenters
label_desc: Use image node_id 1 for calling a global function with example usage: test_set_weights() without return types