code: def _fit_edges_polyfit(
      x, window_length, polyorder, deriv, delta, axis, y
  ):
      """
      Use polynomial interpolation of x at the low and high ends of the axis
      to fill in the halflen values in y.
  
      This function just calls _fit_edge twice, once for each end of the axis.
      """
      halflen = window_length // 2
      _fit_edge(
          x,
          0,
          window_length,
          0,
          halflen,
          axis,
          polyorder,
          deriv,
          delta,
          y,
      )
      n = x.shape[axis]
      _fit_edge(
          x,
          n - window_length,
          n,
          n - halflen,
          n,
          axis,
          polyorder,
          deriv,
          delta,
          y,
      )
  
file_path: scipy/scipy/signal/_savitzky_golay.py
imports: import numpy
  from scipy.linalg import lstsq
  from scipy._lib._util import float_factorial
  from scipy.ndimage import convolve1d
  from ._arraytools import axis_slice
label_desc: Use image node_id 4 for calling a global function with example usage: _fit_edges_polyfit(x, window_length, polyorder, deriv, delta, axis, y) without return types