code: def test_exclude_border(indices):
      image = np.zeros((5, 5))
      image[indices] = 1
  
      # exclude_border = False, means it will always be found.
      assert len(peak.peak_local_max(image, exclude_border=False)) == 1
  
      # exclude_border = 0, means it will always be found.
      assert len(peak.peak_local_max(image, exclude_border=0)) == 1
  
      # exclude_border = True, min_distance=1 means it will be found unless it's
      # on the edge.
      if indices[0] in (0, 4) or indices[1] in (0, 4):
          expected_peaks = 0
      else:
          expected_peaks = 1
      assert (
          len(
              peak.peak_local_max(
                  image, min_distance=1, exclude_border=True
              )
          )
          == expected_peaks
      )
  
      # exclude_border = (1, 0) means it will be found unless it's on the edge of
      # the first dimension.
      if indices[0] in (0, 4):
          expected_peaks = 0
      else:
          expected_peaks = 1
      assert (
          len(peak.peak_local_max(image, exclude_border=(1, 0)))
          == expected_peaks
      )
  
      # exclude_border = (0, 1) means it will be found unless it's on the edge of
      # the second dimension.
      if indices[1] in (0, 4):
          expected_peaks = 0
      else:
          expected_peaks = 1
      assert (
          len(peak.peak_local_max(image, exclude_border=(0, 1)))
          == expected_peaks
      )
  
imports: import itertools
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal, assert_equal
  from scipy import ndimage
  from skimage._shared._warnings import expected_warnings
  from skimage.feature import peak
label_desc: Use image node_id 1 for calling a global function with example usage: test_exclude_border(indices) without return types