code: def levi(x):
      """Levi objective function
  
      Only takes two dimensions and has a global minimum at
      :code:`f([1,1])`. Its coordinates are bounded within
      :code:`[-10,10]`.
  
      Parameters
      ----------
      x : numpy.ndarray
          set of inputs of shape :code:`(n_particles, dimensions)`
  
      Returns
      -------
      numpy.ndarray
          computed cost of size :code:`(n_particles, )`
  
      Raises
      ------
      IndexError
          When the input dimensions is greater than what the function
          allows
      ValueError
          When the input is out of bounds with respect to the function
          domain
      """
      if not x.shape[1] == 2:
          raise IndexError(
              "Levi function only takes two-dimensional input."
          )
      if not np.logical_and(x >= -10, x <= 10).all():
          raise ValueError(
              "Input for Levi function must be within [-10, 10]."
          )
  
      mask = np.full(x.shape, False)
      mask[:, -1] = True
      masked_x = np.ma.array(x, mask=mask)
  
      w_ = 1 + (x - 1) / 4
      masked_w_ = np.ma.array(w_, mask=mask)
      d_ = x.shape[1] - 1
  
      j = (
          np.sin(np.pi * w_[:, 0]) ** 2.0
          + ((masked_x - 1) ** 2.0).sum(axis=1)
          * (
              1
              + 10 * np.sin(np.pi * (masked_w_).sum(axis=1) + 1) ** 2.0
          )
          + (w_[:, d_] - 1) ** 2.0
          * (1 + np.sin(2 * np.pi * w_[:, d_]) ** 2.0)
      )
  
      return j
  
file_path: pyswarms/pyswarms/utils/functions/single_obj.py
imports: import numpy
label_desc: Use image node_id 11 for calling a global function with example usage: levi(x) and returns: j