code: def booth(x):
      """Booth's objective function.
  
      Only takes two dimensions and has a global minimum of `0` at
      :code:`f([1,3])`. Its domain is bounded between :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(
              "Booth function only takes two-dimensional input."
          )
      if not np.logical_and(x >= -10, x <= 10).all():
          raise ValueError(
              "Input for Booth function must be within [-10, 10]."
          )
  
      x_ = x[:, 0]
      y_ = x[:, 1]
      j = (x_ + 2 * y_ - 7) ** 2.0 + (2 * x_ + y_ - 5) ** 2.0
  
      return j
  
file_path: pyswarms/pyswarms/utils/functions/single_obj.py
imports: import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: booth(x) and returns: j