human
I wrote the below code

    if (not dask_available):
        raise RuntimeError("Could    not    import    'dask'.        Please    install    using    'pip    install    dask'")
    if (chunks is None):
        shape = array.shape
        try:
            ncpu = cpu_count()
        except NotImplementedError:
            ncpu = 4
        chunks = _get_chunks(shape, ncpu)
    if (mode == 'wrap'):
        mode = 'periodic'
    elif (mode == 'symmetric'):
        mode = 'reflect'
    elif (mode == 'edge'):
        mode = 'nearest'
    def wrapped_func(arr):
        return function(arr, *extra_arguments, **extra_keywords)
    darr = da.from_array(array, chunks=chunks)
    return darr.map_overlap(wrapped_func, depth, boundary=mode).compute()

What's a good function header?

Here's a good function header?
assistant
#Here's a good function header.

def apply_parallel(function, array, chunks=None, depth=0, mode=None, extra_arguments=(), extra_keywords={}):