code: def test_permutations():
      seed(1234)
      for _ in range(10):
          n = randint(1, 100)
          # Random real/complex array
          x = rand(n, n) if randint(2) else rand(n, n) + rand(n, n) * 1j
          x = x + x.conj().T
          x += eye(n) * randint(5, 1e6)
          l_ind = tril_indices_from(x, k=-1)
          u_ind = triu_indices_from(x, k=1)
  
          # Test whether permutations lead to a triangular array
          u, d, p = ldl(x, lower=0)
          # lower part should be zero
          assert_(not any(u[p, :][l_ind]), "Spin {} failed".format(_))
  
          l, d, p = ldl(x, lower=1)
          # upper part should be zero
          assert_(not any(l[p, :][u_ind]), "Spin {} failed".format(_))
  
file_path: catboost/contrib/python/scipy/py3/scipy/linalg/tests/test_decomp_ldl.py
imports: import itertools
  from numpy.testing import assert_array_almost_equal, assert_allclose, assert_
  from numpy import array, eye, zeros, empty_like, empty, tril_indices_from, tril, triu_indices_from, spacing, float32, float64, complex64, complex128
  from numpy.random import rand, randint, seed
  from scipy.linalg import ldl
  from pytest import raises, warns
  from numpy import ComplexWarning
label_desc: Use image node_id 4 for calling a global function with example usage: test_permutations() without return types