code: def compare_solutions(A, B, m):
      """Check eig vs. lobpcg consistency."""
      n = A.shape[0]
      np.random.seed(0)
      V = rand(n, m)
      X = orth(V)
      eigvals, _ = lobpcg(
          A, X, B=B, tol=1e-5, maxiter=30, largest=False
      )
      eigvals.sort()
      w, _ = eig(A, b=B)
      w.sort()
      assert_almost_equal(
          w[: int(m / 2)], eigvals[: int(m / 2)], decimal=2
      )
  
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 3 for calling a global function with example usage: compare_solutions(A, B, m) without return types