code: def _divergence(F):
      """
      Computes divergence of a 3-dimensional vector field (with one way
      first difference)
      """
      Fx = F[:, :, :, 0, :]
      Fy = F[:, :, :, 1, :]
      Fz = F[:, :, :, 2, :]
  
      x_ind = [0] + list(range(F.shape[0] - 1))
      y_ind = [0] + list(range(F.shape[1] - 1))
      z_ind = [0] + list(range(F.shape[2] - 1))
  
      fx = Fx - Fx[x_ind, :, :, :]
      fx[0, :, :, :] = Fx[0, :, :, :]  # edge conditions
      fx[-1, :, :, :] = -Fx[-2, :, :, :]
  
      fy = Fy - Fy[:, y_ind, :, :]
      fy[:, 0, :, :] = Fy[:, 0, :, :]
      fy[:, -1, :, :] = -Fy[:, -2, :, :]
  
      fz = Fz - Fz[:, :, z_ind, :]
      fz[:, :, 0, :] = Fz[:, :, 0, :]
      fz[:, :, -1, :] = -Fz[:, :, -2, :]
  
      return fx + fy + fz
  
imports: import logging
  import warnings
  import numpy
  from dipy.core.geometry import vec2vec_rotmat
  from dipy.core.gradients import gradient_table, unique_bvals_tolerance, get_bval_indices
  from dipy.core.onetime import auto_attr
  from dipy.core.sphere import Sphere
  from dipy.data import get_sphere
  from dipy.reconst.shm import lazy_index, normalize_data
  from dipy.reconst.odf import OdfModel, OdfFit
  from dipy.reconst.csdeconv import AxSymShResponse
  from dipy.segment.mask import bounding_box, crop
  from dipy.sims.voxel import single_tensor, all_tensor_evecs
label_desc: Use image node_id 6 for calling a global function with example usage: _divergence(F) and returns: unknown