code: def detrend_linear(y):
      """
      Return *x* minus best fit line; 'linear' detrending.
  
      Parameters
      ----------
      y : 0-D or 1-D array or sequence
          Array or sequence containing the data
  
      See Also
      --------
      detrend_mean : Another detrend algorithm.
      detrend_none : Another detrend algorithm.
      detrend : A wrapper around all the detrend algorithms.
      """
      # This is faster than an algorithm based on linalg.lstsq.
      y = np.asarray(y)
  
      if y.ndim > 1:
          raise ValueError("y cannot have ndim > 1")
  
      # short-circuit 0-D array.
      if not y.ndim:
          return np.array(0.0, dtype=y.dtype)
  
      x = np.arange(y.size, dtype=float)
  
      C = np.cov(x, y, bias=1)
      b = C[0, 1] / C[0, 0]
  
      a = y.mean() - b * x.mean()
      return y - (b * x + a)
  
imports: import functools
  from numbers import Number
  import numpy
  from matplotlib import _api, _docstring, cbook
label_desc: Use image node_id 6 for calling a global function with example usage: detrend_linear(y) and returns: unknown, np