code: def _get_test_tolerance(type_char, mattype=None):
      """
      Return tolerance values suitable for a given test:
  
      Parameters
      ----------
      type_char : {'f', 'd', 'F', 'D'}
          Data type in ARPACK eigenvalue problem
      mattype : {csr_matrix, aslinearoperator, asarray}, optional
          Linear operator type
  
      Returns
      -------
      tol
          Tolerance to pass to the ARPACK routine
      rtol
          Relative tolerance for outputs
      atol
          Absolute tolerance for outputs
  
      """
  
      rtol = {
          "f": 3000 * np.finfo(np.float32).eps,
          "F": 3000 * np.finfo(np.float32).eps,
          "d": 2000 * np.finfo(np.float64).eps,
          "D": 2000 * np.finfo(np.float64).eps,
      }[type_char]
      atol = rtol
      tol = 0
  
      if mattype is aslinearoperator and type_char in ("f", "F"):
          # iterative methods in single precision: worse errors
          # also: bump ARPACK tolerance so that the iterative method converges
          tol = 30 * np.finfo(np.float32).eps
          rtol *= 5
  
      if mattype is csr_matrix and type_char in ("f", "F"):
          # sparse in single precision: worse errors
          rtol *= 5
  
      return tol, rtol, atol
  
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 1 for calling a global function with example usage: _get_test_tolerance(type_char, mattype) and returns: tol,  rtol,  atol