code: def divergence(vect, frame):
      """
      Returns the divergence of a vector field computed wrt the coordinate
      symbols of the given frame.
  
      Parameters
      ==========
  
      vect : Vector
          The vector operand
  
      frame : ReferenceFrame
          The reference frame to calculate the divergence in
  
      Examples
      ========
  
      >>> from sympy.physics.vector import ReferenceFrame
      >>> from sympy.physics.vector import divergence
      >>> R = ReferenceFrame('R')
      >>> v1 = R[0]*R[1]*R[2] * (R.x+R.y+R.z)
      >>> divergence(v1, R)
      R_x*R_y + R_x*R_z + R_y*R_z
      >>> v2 = 2*R[1]*R[2]*R.y
      >>> divergence(v2, R)
      2*R_z
  
      """
  
      _check_vector(vect)
      if vect == 0:
          return S.Zero
      vect = express(vect, frame, variables=True)
      vectx = vect.dot(frame.x)
      vecty = vect.dot(frame.y)
      vectz = vect.dot(frame.z)
      out = S.Zero
      out += diff(vectx, frame[0])
      out += diff(vecty, frame[1])
      out += diff(vectz, frame[2])
      return out
  
file_path: sympy/sympy/physics/vector/fieldfunctions.py
imports: from sympy.core.function import diff
  from sympy.core.singleton import S
  from sympy.integrals.integrals import integrate
  from sympy.physics.vector import Vector, express
  from sympy.physics.vector.frame import _check_frame
  from sympy.physics.vector.vector import _check_vector
label_desc: Use image node_id 2 for calling a global function with example usage: divergence(vect, frame) and returns: out, S