code: def eggholder(x):
      """Eggholder objective function.
  
      Only takes two dimensions and has a global minimum of
      `-959.6407` at :code:`f([512, 404.3219])`.
      Its coordinates are bounded within :code:`[-512, 512]`.
  
      Best visualized in the full domain and a range of :code:`[-1000, 1000]`.
  
      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(
              "Eggholder function only takes two-dimensional input."
          )
      if not np.logical_and(x >= -512, x <= 512).all():
          raise ValueError(
              "Input for Eggholder function must be within [-512, 512]."
          )
  
      x_ = x[:, 0]
      y_ = x[:, 1]
  
      j = -(y_ + 47) * np.sin(
          np.sqrt(np.abs((x_ / 2) + y_ + 47))
      ) - x_ * np.sin(np.sqrt(np.abs(x_ - (y_ + 47))))
  
      return j
  
file_path: pyswarms/pyswarms/utils/functions/single_obj.py
imports: import numpy
label_desc: Use image node_id 7 for calling a global function with example usage: eggholder(x) and returns: j