code: def jacobian_to_div(jacobian):
      """Computes the divergence from the Jacobian."""
      # If F : x -> x + f(x) then dF/dx = 1 + df/dx, so subtract 1 for each
      # diagonal of the Jacobian.
      return jnp.trace(jacobian, axis1=-2, axis2=-1) - 3.0
  
imports: import collections
  from concurrent import futures
  import contextlib
  import functools
  import time
  from typing import List, Union
  import jax
  from jax import tree_util
  import jax.numpy
  import numpy
  from scipy import interpolate
  from scipy.spatial import transform
  import tqdm
label_desc: Use image node_id 4 for calling a global function with example usage: jacobian_to_div(jacobian) and returns: unknown