code: def test_map_overlap():
      x = da.arange(10, chunks=5)
      y = x.map_overlap(
          lambda x: x + len(x),
          depth=2,
          dtype=x.dtype,
          boundary="reflect",
      )
      assert_eq(y, np.arange(10) + 5 + 2 + 2)
  
      x = da.arange(10, chunks=5)
      y = x.map_overlap(
          lambda x: x + len(x),
          depth=np.int64(2),
          dtype=x.dtype,
          boundary="reflect",
      )
      assert all([(type(s) is int) for s in y.shape])
      assert_eq(y, np.arange(10) + 5 + 2 + 2)
  
      x = da.ones((10, 10), chunks=(3, 4))
      z = x.map_overlap(lambda x: x, depth={1: 5}, boundary="reflect")
      assert (
          z.chunks[0] == x.chunks[0]
      )  # don't rechunk the first dimension
  
      x = np.arange(16).reshape((4, 4))
      d = da.from_array(x, chunks=(2, 2))
      exp1 = d.map_overlap(
          lambda x: x + x.size,
          depth=1,
          dtype=d.dtype,
          boundary="reflect",
      )
      exp2 = d.map_overlap(
          lambda x: x + x.size,
          depth={0: 1, 1: 1},
          boundary={0: "reflect", 1: "none"},
          dtype=d.dtype,
      )
      exp3 = d.map_overlap(
          lambda x: x + x.size,
          depth={1: 1},
          boundary={1: "reflect"},
          dtype=d.dtype,
      )
      exp4 = d.map_overlap(
          lambda x: x + x.size,
          depth={1: (1, 0)},
          boundary={0: "none", 1: "none"},
          dtype=d.dtype,
      )
      assert_eq(exp1, x + 16)
      assert_eq(exp2, x + 12)
      assert_eq(exp3, x + 8)
      assert_eq(
          exp4,
          np.block(
              [
                  [x[0:2, 0:2] + 4, x[0:2, 2:4] + 6],
                  [x[2:4, 0:2] + 4, x[2:4, 2:4] + 6],
              ]
          ),
      )
  
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 13 for calling a global function with example usage: test_map_overlap() without return types