code: def _diagonal(x, dim1, dim2):
      return np.diagonal(x, axis1=dim1, axis2=dim2)
  
imports: import numbers
  import typing
  import jax.numpy
  import jax.random
  import numpy
  from jax import lax
  from jax.core import Tracer
  from jax.scipy.linalg import cho_solve, solve_triangular
  from jax.scipy.special import expit, gammaln, logsumexp
  from ..None import ops
label_desc: Use image node_id 18 for calling a global function with example usage: _diagonal(x, dim1, dim2) and returns: np