code: def test_unpack_condition_args():
      """
      Verify parsing of condition arguments for `scipy.signal.find_peaks` function.
      """
      x = np.arange(10)
      amin_true = x
      amax_true = amin_true + 10
      peaks = amin_true[1::2]
  
      # Test unpacking with None or interval
      assert_(
          (None, None) == _unpack_condition_args((None, None), x, peaks)
      )
      assert_((1, None) == _unpack_condition_args(1, x, peaks))
      assert_((1, None) == _unpack_condition_args((1, None), x, peaks))
      assert_((None, 2) == _unpack_condition_args((None, 2), x, peaks))
      assert_(
          (3.0, 4.5) == _unpack_condition_args((3.0, 4.5), x, peaks)
      )
  
      # Test if borders are correctly reduced with `peaks`
      amin_calc, amax_calc = _unpack_condition_args(
          (amin_true, amax_true), x, peaks
      )
      assert_equal(amin_calc, amin_true[peaks])
      assert_equal(amax_calc, amax_true[peaks])
  
      # Test raises if array borders don't match x
      with raises(ValueError, match="array size of lower"):
          _unpack_condition_args(amin_true, np.arange(11), peaks)
      with raises(ValueError, match="array size of upper"):
          _unpack_condition_args(
              (None, amin_true), np.arange(11), peaks
          )
  
imports: from __future__ import division, print_function, absolute_import
  import copy
  import numpy
  from numpy.testing import assert_, assert_equal, assert_allclose, assert_array_equal
  import pytest
  from pytest import raises, warns
  from scipy._lib.six import xrange
  from scipy.signal._peak_finding import argrelmax, argrelmin, peak_prominences, peak_widths, _unpack_condition_args, find_peaks, find_peaks_cwt, _identify_ridge_lines
  from scipy.signal._peak_finding_utils import _local_maxima_1d, PeakPropertyWarning
label_desc: Use image node_id 4 for calling a global function with example usage: test_unpack_condition_args() without return types