code: def test_array_match_difference_1d(l1, l2, l1_to_arr, l2_to_arr):
      if l1_to_arr:
          l1 = np.array(l1)
      if l2_to_arr:
          l2 = np.array(l2)
  
      if len(l1) != len(l2):
          with pytest.raises(ValueError):  # lengths must be the same
              array_match_difference_1d(l1, l2)
          return
      if len(l1) == 0:
          with pytest.raises(ValueError):  # lengths must be > 0
              array_match_difference_1d(l1, l2)
          return
  
      diff1 = array_match_difference_1d(l1, l2)
      assert diff1 == array_match_difference_1d(l2, l1)
      assert diff1 == np.sum(np.abs(np.array(l1) - np.array(l2)))
  
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 4 for calling a global function with example usage: test_array_match_difference_1d(l1, l2, l1_to_arr, l2_to_arr) without return types