code: def test_hermitian():
      """Check complex-value Hermitian cases."""
      np.random.seed(1234)
  
      sizes = [3, 10, 50]
      ks = [1, 3, 10, 50]
      gens = [True, False]
  
      for size, k, gen in itertools.product(sizes, ks, gens):
          if k > size:
              continue
  
          H = np.random.rand(size, size) + 1.0j * np.random.rand(
              size, size
          )
          H = 10 * np.eye(size) + H + H.T.conj()
  
          X = np.random.rand(size, k)
  
          if not gen:
              B = np.eye(size)
              w, v = lobpcg(H, X, maxiter=5000)
              w0, _ = eigh(H)
          else:
              B = np.random.rand(size, size) + 1.0j * np.random.rand(
                  size, size
              )
              B = 10 * np.eye(size) + B.dot(B.T.conj())
              w, v = lobpcg(H, X, B, maxiter=5000, largest=False)
              w0, _ = eigh(H, B)
  
          for wx, vx in zip(w, v.T):
              # Check eigenvector
              assert_allclose(
                  np.linalg.norm(H.dot(vx) - B.dot(vx) * wx)
                  / np.linalg.norm(H.dot(vx)),
                  0,
                  atol=5e-4,
                  rtol=0,
              )
  
              # Compare eigenvalues
              j = np.argmin(abs(w0 - wx))
              assert_allclose(wx, w0[j], rtol=1e-4)
  
imports: import itertools
  import platform
  import numpy
  from numpy.testing import assert_almost_equal, assert_equal, assert_allclose, assert_array_less
  import pytest
  from numpy import ones, r_, diag
  from numpy.random import rand
  from scipy.linalg import eig, eigh, toeplitz, orth
  from scipy.sparse import spdiags, diags, eye
  from scipy.sparse.linalg import eigs, LinearOperator
  from scipy.sparse.linalg.eigen.lobpcg import lobpcg
label_desc: Use image node_id 13 for calling a global function with example usage: test_hermitian() without return types