code: def sphere(x):
      """Sphere objective function.
  
      Has a global minimum at :code:`0` and with a search domain of
          :code:`[-inf, inf]`
  
      Parameters
      ----------
      x : numpy.ndarray
          set of inputs of shape :code:`(n_particles, dimensions)`
  
      Returns
      -------
      numpy.ndarray
          computed cost of size :code:`(n_particles, )`
      """
      j = (x**2.0).sum(axis=1)
  
      return j
  
file_path: pyswarms/pyswarms/utils/functions/single_obj.py
imports: import numpy
label_desc: Use image node_id 16 for calling a global function with example usage: sphere(x) and returns: j