code: def diagonal(a, offset=0, axis1=0, axis2=1):
      return ivy.diagonal(a, offset=offset, axis1=axis1, axis2=axis2)
  
imports: import inspect
  import abc
  import ivy
  from ivy.functional.frontends.jax.func_wrapper import to_ivy_arrays_and_back
  from .creation import linspace, arange, array
  from .manipulations import transpose, concatenate, expand_dims
label_desc: Use image node_id 6 for calling a global function with example usage: diagonal(a, offset, axis1, axis2) and returns: ivy