code: def test_calc_cluster_centers_1d(seq, delta):
      arr = np.array(seq)
  
      try:
          clusts = find_clusters_1d_break_dist(arr, delta)
          clusts_w_vals = zip_clusters_and_values(clusts, arr)
      except:  # exceptions are tested in test_find_clusters_1d_break_dist and test_zip_clusters_and_values
          return
  
      centers = calc_cluster_centers_1d(clusts_w_vals)
      assert len(centers) == len(clusts_w_vals)
  
      for c, (_, vals) in zip(centers, clusts_w_vals):
          assert c == np.median(vals)
  
file_path: pdftabextract/tests/test_clustering.py
imports: import pytest
  from hypothesis import given
  import hypothesis.strategies
  import numpy
  from scipy.stats import chisquare
  from pdftabextract.clustering import find_clusters_1d_break_dist, zip_clusters_and_values, calc_cluster_centers_1d, array_match_difference_1d, find_best_matching_array, adjust_bad_positions
label_desc: Use image node_id 3 for calling a global function with example usage: test_calc_cluster_centers_1d(seq, delta) without return types