code: def test_lloyds():
      """Test implementation of Lloyds."""
      X_train = create_test_distance_numpy(20, 10, 10)
      X_test = create_test_distance_numpy(20, 10, 10, random_state=2)
  
      lloyd = _test_class()
      lloyd.fit(X_train)
      test_result = lloyd.predict(X_test)
  
      assert test_result.dtype is np.dtype("int64")
  
      assert np.array_equal(
          test_result,
          np.array(
              [
                  0,
                  1,
                  2,
                  3,
                  4,
                  5,
                  6,
                  7,
                  8,
                  9,
                  10,
                  11,
                  12,
                  13,
                  14,
                  15,
                  16,
                  17,
                  18,
                  19,
              ]
          ),
      )
  
file_path: sktime/sktime/clustering/tests/test_lloyds.py
imports: from typing import Callable
  import numpy
  import pytest
  from sklearn.model_selection import train_test_split
  from sklearn.utils import check_random_state
  from sktime.clustering.partitioning._lloyds import TimeSeriesLloyds, _forgy_center_initializer, _kmeans_plus_plus, _random_center_initializer
  from sktime.datasets import load_arrow_head
  from sktime.datatypes import convert_to
  from sktime.distances.tests._utils import create_test_distance_numpy
label_desc: Use image node_id 1 for calling a global function with example usage: test_lloyds() without return types