code: def test_adjust_bad_positions():
      pages_positions = {
          0: [8, 28, 33, 38],
          1: [10, 30, 35, 40],
          2: [10, 30, 35, 40],
          3: [0, 20, 25, 32],
          4: [3, 21, 25, 31],
          5: [3, 21, 25, 31],
      }
  
      mean_widths = np.diff(
          [np.mean(pos) for pos in zip(*pages_positions.values())]
      )
  
      pages_positions.update(
          {
              6: [3, 21, 20, 31],  # bad: neg. width
              7: [3, 21, 25, 28, 31],  # bad: too many positions
              8: [3, 21, 25, 70],  # bad: invalid last position
          }
      )
  
      alpha = 0.05
      adj_positions = adjust_bad_positions(
          pages_positions, pos_check_signif_level=alpha
      )
  
      assert pages_positions.keys() == adj_positions.keys()
  
      for p_num in pages_positions.keys():
          orig = pages_positions[p_num]
          adj = adj_positions[p_num]
  
          assert len(adj) == 4
          assert adj[0] == orig[0]
  
          adj_widths = np.diff(adj)
          _, p_val = chisquare(adj_widths, mean_widths)
          assert p_val >= alpha
  
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 8 for calling a global function with example usage: test_adjust_bad_positions() without return types