code: def linspace(
      start,
      stop,
      num=50,
      endpoint=True,
      retstep=False,
      chunks="auto",
      dtype=None,
  ):
      """
      Return `num` evenly spaced values over the closed interval [`start`,
      `stop`].
  
      Parameters
      ----------
      start : scalar
          The starting value of the sequence.
      stop : scalar
          The last value of the sequence.
      num : int, optional
          Number of samples to include in the returned dask array, including the
          endpoints. Default is 50.
      endpoint : bool, optional
          If True, ``stop`` is the last sample. Otherwise, it is not included.
          Default is True.
      retstep : bool, optional
          If True, return (samples, step), where step is the spacing between
          samples. Default is False.
      chunks :  int
          The number of samples on each block. Note that the last block will have
          fewer samples if `num % blocksize != 0`
      dtype : dtype, optional
          The type of the output array.
  
      Returns
      -------
      samples : dask array
      step : float, optional
          Only returned if ``retstep`` is True. Size of spacing between samples.
  
  
      See Also
      --------
      dask.array.arange
      """
      num = int(num)
  
      if dtype is None:
          dtype = np.linspace(0, 1, 1).dtype
  
      chunks = normalize_chunks(chunks, (num,), dtype=dtype)
  
      range_ = stop - start
  
      div = (num - 1) if endpoint else num
      if div == 0:
          div = 1
  
      step = float(range_) / div
  
      name = "linspace-" + tokenize(
          (start, stop, num, endpoint, chunks, dtype)
      )
  
      dsk = {}
      blockstart = start
  
      for i, bs in enumerate(chunks[0]):
          bs_space = bs - 1 if endpoint else bs
          blockstop = blockstart + (bs_space * step)
          task = (
              partial(chunk.linspace, endpoint=endpoint, dtype=dtype),
              blockstart,
              blockstop,
              bs,
          )
          blockstart = blockstart + (step * bs)
          dsk[(name, i)] = task
  
      if retstep:
          return Array(dsk, name, chunks, dtype=dtype), step
      else:
          return Array(dsk, name, chunks, dtype=dtype)
  
imports: from __future__ import annotations
  import itertools
  from collections.abc import Sequence
  from functools import partial
  from itertools import product
  from numbers import Integral, Number
  import numpy
  from tlz import sliding_window
  from dask.array import chunk
  from dask.array.backends import array_creation_dispatch
  from dask.array.core import Array, asarray, block, blockwise, broadcast_arrays, broadcast_to, concatenate, normalize_chunks, stack
  from dask.array.numpy_compat import AxisError
  from dask.array.ufunc import greater_equal, rint
  from dask.array.utils import meta_from_array
  from dask.array.wrap import empty, full, ones, zeros
  from dask.base import tokenize
  from dask.highlevelgraph import HighLevelGraph
  from dask.utils import cached_cumsum, derived_from, is_cupy_type
label_desc: Use image node_id 7 for calling a global function with example usage: linspace(start, stop, num, endpoint, retstep, chunks, dtype) and returns: Array,  step, Array