code: def diag_indices_from(arr):
      print(arr)
      n = arr.shape[0]
      ndim = ivy.get_num_dims(arr)
      if not all(arr.shape[i] == n for i in range(ndim)):
          raise ValueError(
              "All dimensions of input must be of equal length"
          )
      idx = ivy.arange(n, dtype=int)
      return (idx,) * ndim
  
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 5 for calling a global function with example usage: diag_indices_from(arr) and returns: unknown