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