code: def rosen_der(x):
      """
      The derivative (i.e. gradient) of the Rosenbrock function.
  
      Parameters
      ----------
      x : array_like
          1-D array of points at which the derivative is to be computed.
  
      Returns
      -------
      rosen_der : (N,) ndarray
          The gradient of the Rosenbrock function at `x`.
  
      See Also
      --------
      rosen, rosen_hess, rosen_hess_prod
  
      Examples
      --------
      >>> from scipy.optimize import rosen_der
      >>> X = 0.1 * np.arange(9)
      >>> rosen_der(X)
      array([ -2. ,  10.6,  15.6,  13.4,   6.4,  -3. , -12.4, -19.4,  62. ])
  
      """
      x = asarray(x)
      xm = x[1:-1]
      xm_m1 = x[:-2]
      xm_p1 = x[2:]
      der = np.zeros_like(x)
      der[1:-1] = (
          200 * (xm - xm_m1**2)
          - 400 * (xm_p1 - xm**2) * xm
          - 2 * (1 - xm)
      )
      der[0] = -400 * x[0] * (x[1] - x[0] ** 2) - 2 * (1 - x[0])
      der[-1] = 200 * (x[-1] - x[-2] ** 2)
      return der
  
imports: import warnings
  import sys
  from numpy import atleast_1d, eye, argmin, zeros, shape, squeeze, asarray, sqrt, Inf, asfarray, isinf
  import numpy
  from .linesearch import line_search_wolfe1, line_search_wolfe2, line_search_wolfe2, LineSearchWarning
  from ._numdiff import approx_derivative
  from scipy._lib._util import getfullargspec_no_self
  from scipy._lib._util import MapWrapper
  from scipy.optimize._differentiable_functions import ScalarFunction, FD_METHODS
label_desc: Use image node_id 8 for calling a global function with example usage: rosen_der(x) and returns: der