code: def test_overlap_allow_rechunk_kwarg():
      # The smallest array chunk is too small to fit overlap depth
      arr = da.arange(6, chunks=5)
      da.overlap.overlap(arr, 2, "reflect", allow_rechunk=True)
      arr.map_overlap(lambda x: x, 2, "reflect", allow_rechunk=True)
      with pytest.raises(ValueError):
          da.overlap.overlap(arr, 2, "reflect", allow_rechunk=False)
      with pytest.raises(ValueError):
          arr.map_overlap(
              lambda x: x, 2, "reflect", allow_rechunk=False
          )
      # No rechunking required
      arr = da.arange(6, chunks=4)
      da.overlap.overlap(arr, 2, "reflect", allow_rechunk=False)
  
imports: from __future__ import annotations
  import pytest
  import numpy
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  import dask.array
  from dask.array.lib.stride_tricks import sliding_window_view
  from dask.array.overlap import boundaries, constant, ensure_minimum_chunksize, nearest, overlap, overlap_internal, periodic, reflect, trim_internal
  from dask.array.utils import assert_eq, same_keys
label_desc: Use image node_id 11 for calling a global function with example usage: test_overlap_allow_rechunk_kwarg() without return types