code: def test_paddle_linalg_diagonal(
      dtype_and_values,
      axis_and_offset,
      on_device,
      fn_tree,
      frontend,
      test_flags,
      backend_fw,
  ):
      input_dtype, value = dtype_and_values
      axis1, axis2, offset = axis_and_offset
      input = value[0]
      num_dims = len(np.shape(input))
      assume(axis1 != axis2)
      if axis1 < 0:
          assume(axis1 + num_dims != axis2)
      if axis2 < 0:
          assume(axis1 != axis2 + num_dims)
      helpers.test_frontend_function(
          input_dtypes=input_dtype,
          on_device=on_device,
          frontend=frontend,
          backend_to_test=backend_fw,
          test_flags=test_flags,
          fn_tree=fn_tree,
          x=input,
          offset=offset,
          axis1=axis1,
          axis2=axis2,
      )
  
imports: import ivy
  from hypothesis import strategies, assume
  import numpy
  import ivy_tests.test_ivy.helpers
  from ivy_tests.test_ivy.helpers import assert_all_close
  from ivy_tests.test_ivy.helpers import handle_frontend_test, matrix_is_stable
  from ivy_tests.test_ivy.test_functional.test_core.test_linalg import _get_dtype_and_matrix
  from ivy_tests.test_ivy.test_frontends.test_tensorflow.test_linalg import _get_second_matrix, _get_cholesky_matrix
  from ivy_tests.test_ivy.test_frontends.test_torch.test_blas_and_lapack_ops import _get_dtype_input_and_mat_vec
label_desc: Use image node_id 21 for calling a global function with example usage: test_paddle_linalg_diagonal(dtype_and_values, axis_and_offset, on_device, fn_tree, frontend, test_flags, backend_fw) without return types