code: def rosen(x):
      """
      The Rosenbrock function.
  
      The function computed is::
  
          sum(100.0*(x[1:] - x[:-1]**2.0)**2.0 + (1 - x[:-1])**2.0)
  
      Parameters
      ----------
      x : array_like
          1-D array of points at which the Rosenbrock function is to be computed.
  
      Returns
      -------
      f : float
          The value of the Rosenbrock function.
  
      See Also
      --------
      rosen_der, rosen_hess, rosen_hess_prod
  
      Examples
      --------
      >>> from scipy.optimize import rosen
      >>> X = 0.1 * np.arange(10)
      >>> rosen(X)
      76.56
  
      For higher-dimensional input ``rosen`` broadcasts.
      In the following example, we use this to plot a 2D landscape.
      Note that ``rosen_hess`` does not broadcast in this manner.
  
      >>> import matplotlib.pyplot as plt
      >>> from mpl_toolkits.mplot3d import Axes3D
      >>> x = np.linspace(-1, 1, 50)
      >>> X, Y = np.meshgrid(x, x)
      >>> ax = plt.subplot(111, projection='3d')
      >>> ax.plot_surface(X, Y, rosen([X, Y]))
      >>> plt.show()
      """
      x = asarray(x)
      r = np.sum(
          100.0 * (x[1:] - x[:-1] ** 2.0) ** 2.0 + (1 - x[:-1]) ** 2.0,
          axis=0,
      )
      return r
  
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 7 for calling a global function with example usage: rosen(x) and returns: r