code: def test_generalized_connected_component_analysis_1d():
      A = [1, 2, 3]
  
      results = generalized_connected_component_analysis_1d(
          A, scoring_func=lambda x, y: abs(x - y) <= 1
      )
      assert len(results) == 1
  
      A = [1, 2, 3, 5, 6, 7]
      results = generalized_connected_component_analysis_1d(
          A, scoring_func=lambda x, y: abs(x - y) <= 1
      )
      assert len(results) == 2
  
      A = [1, 2, 3, 5, 6, 7]
      results = generalized_connected_component_analysis_1d(
          A, scoring_func=lambda x, y: abs(x - y) <= 2
      )
      assert len(results) == 1
  
      A = [1, 2, 3, 5, 6, 7]
      results = generalized_connected_component_analysis_1d(
          A,
          scoring_func=lambda x, y: abs(x - y) <= 1,
          aggregation_func=max,
      )
      assert results == [3, 7]
  
imports: from layoutparser import load_pdf
  from layoutparser.tools import generalized_connected_component_analysis_1d, simple_line_detection, group_textblocks_based_on_category
label_desc: Use image node_id 1 for calling a global function with example usage: test_generalized_connected_component_analysis_1d() without return types