docstr: Test plateau size condition for peaks.
docstr_tok: ["Test","plateau","size","condition","for","peaks","."]
code: def test_plateau_size(self):
      """
      Test plateau size condition for peaks.
      """
      # Prepare signal with peaks with peak_height == plateau_size
      plateau_sizes = np.array([1, 2, 3, 4, 8, 20, 111])
      x = np.zeros(plateau_sizes.size * 2 + 1)
      x[1::2] = plateau_sizes
      repeats = np.ones(x.size, dtype=int)
      repeats[1::2] = x[1::2]
      x = np.repeat(x, repeats)
  
      # Test full output
      peaks, props = find_peaks(x, plateau_size=(None, None))
      assert_equal(peaks, [1, 3, 7, 11, 18, 33, 100])
      assert_equal(props["plateau_sizes"], plateau_sizes)
      assert_equal(
          props["left_edges"], peaks - (plateau_sizes - 1) // 2
      )
      assert_equal(props["right_edges"], peaks + plateau_sizes // 2)
  
      # Test conditions
      assert_equal(find_peaks(x, plateau_size=4)[0], [11, 18, 33, 100])
      assert_equal(
          find_peaks(x, plateau_size=(None, 3.5))[0], [1, 3, 7]
      )
      assert_equal(find_peaks(x, plateau_size=(5, 50))[0], [18, 33])
  
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 2 for calling the TestFindPeaks obj's underlying member method code with example usage: obj.test_plateau_size() without return types