code: def test_parallel_threads():
      results = []
      v0 = np.random.rand(50)
  
      def worker():
          x = diags([1, -2, 1], [-1, 0, 1], shape=(50, 50))
          w, v = eigs(x, k=3, v0=v0)
          results.append(w)
  
          w, v = eigsh(x, k=3, v0=v0)
          results.append(w)
  
      threads = [threading.Thread(target=worker) for k in range(10)]
      for t in threads:
          t.start()
      for t in threads:
          t.join()
  
      worker()
  
      for r in results:
          assert_allclose(r, results[-1])
  
imports: from __future__ import division, print_function, absolute_import
  import threading
  import itertools
  import numpy
  from numpy.testing import assert_allclose, assert_array_almost_equal_nulp, assert_equal, assert_array_equal
  from pytest import raises
  import pytest
  from numpy import dot, conj, random
  from scipy.linalg import eig, eigh, hilbert, svd
  from scipy.sparse import csc_matrix, csr_matrix, isspmatrix, diags, rand
  from scipy.sparse.linalg import LinearOperator, aslinearoperator
  from scipy.sparse.linalg.eigen.arpack import eigs, eigsh, svds, ArpackNoConvergence, arpack
  from scipy._lib._gcutils import assert_deallocated, IS_PYPY
  from scipy._lib._numpy_compat import suppress_warnings
label_desc: Use image node_id 37 for calling a global function with example usage: test_parallel_threads() without return types