code: def test_dsyr2k():
      A = np.random.rand(n1, n1)
      B = np.random.rand(n1, n1)
      C = np.random.rand(n1, n1)
      alpha = np.double(np.random.rand(1))
      beta = np.double(np.random.rand(1))
      # Test A*B' + B*A'
      U = np.triu(blas_dsyr2k(0, 0, alpha, A, B, beta, C))
      L = np.tril(blas_dsyr2k(1, 0, alpha, A, B, beta, C))
      Dgold = alpha * (np.dot(A, B.T) + np.dot(B, A.T)) + beta * C
      Ugold = np.triu(Dgold)
      Lgold = np.tril(Dgold)
      assert_almost_equal(Ugold, U)
      assert_almost_equal(Lgold, L)
      # Test A'*B + B'*A
      U = np.triu(blas_dsyr2k(0, 1, alpha, A, B, beta, C))
      L = np.tril(blas_dsyr2k(1, 1, alpha, A, B, beta, C))
      Dgold = alpha * (np.dot(A.T, B) + np.dot(B.T, A)) + beta * C
      Ugold = np.triu(Dgold)
      Lgold = np.tril(Dgold)
      assert_almost_equal(Ugold, U)
      assert_almost_equal(Lgold, L)
  
file_path: nipy/nipy/labs/bindings/tests/test_blas3.py
imports: import numpy
  from numpy.testing import assert_almost_equal
  from ..None import blas_dgemm, blas_dsymm, blas_dsyr2k, blas_dsyrk, blas_dtrmm, blas_dtrsm
label_desc: Use image node_id 7 for calling a global function with example usage: test_dsyr2k() without return types