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
  
      """
      x = asarray(x)
      r = numpy.sum(
          100.0 * (x[1:] - x[:-1] ** 2.0) ** 2.0 + (1 - x[:-1]) ** 2.0,
          axis=0,
      )
      return r
  
imports: from __future__ import division, print_function, absolute_import
  import warnings
  import sys
  import numpy
  from scipy._lib.six import callable, xrange
  from numpy import atleast_1d, eye, mgrid, argmin, zeros, shape, squeeze, vectorize, asarray, sqrt, Inf, asfarray, isinf
  import numpy
  from .linesearch import line_search_wolfe1, line_search_wolfe2, line_search_wolfe2, LineSearchWarning
  from scipy._lib._util import getargspec_no_self
label_desc: Use image node_id 4 for calling a global function with example usage: rosen(x) and returns: r