code: def check_blas_config():
      """checks to see if using OpenBlas/Intel MKL. If so, warn if the number of threads isn't set
      to 1 (causes severe perf issues when training - can be 10x slower)
      """
      # don't warn repeatedly
      global _checked_blas_config  # pylint: disable=global-statement
      if _checked_blas_config:
          return
  
      for api in threadpoolctl.threadpool_info():
          num_threads = api["num_threads"]
          if api["user_api"] != "blas" or num_threads == 1:
              continue
  
          internal_api = api["internal_api"]
          if internal_api == "openblas":
              warnings.warn(
                  f"OpenBLAS is configured to use {num_threads} threads. It is highly recommended"
                  " to disable its internal threadpool by setting the environment variable"
                  " 'OPENBLAS_NUM_THREADS=1' or by calling 'threadpoolctl.threadpool_limits(1,"
                  ' "blas")\'. Having OpenBLAS use a threadpool can lead to severe performance'
                  " issues here.",
                  RuntimeWarning,
                  stacklevel=2,
              )
          elif internal_api == "mkl":
              warnings.warn(
                  f"Intel MKL BLAS is configured to use {num_threads} threads. It is highly"
                  " recommended to disable its internal threadpool by setting the environment"
                  " variable 'MKL_NUM_THREADS=1' or by callng 'threadpoolctl.threadpool_limits(1,"
                  ' "blas")\'. Having MKL use a threadpool can lead to severe performance issues',
                  RuntimeWarning,
                  stacklevel=2,
              )
          else:
              # probably using blis, which is by default single threaded. warn anyways
              # for when threadpoolctl gets support for VecLib/Accelerate etc
              warnings.warn(
                  f"BLAS library {internal_api} is configured to use {num_threads} threads."
                  " It is highly recommended to disable its internal threadpool by calling"
                  " 'threadpoolctl.threadpool_limits(1, \"blas\")'.",
                  RuntimeWarning,
                  stacklevel=2,
              )
  
      _checked_blas_config = True
  
file_path: implicit/implicit/utils.py
imports: import time
  import warnings
  import numpy
  import scipy.sparse
  import threadpoolctl
label_desc: Use image node_id 2 for calling a global function with example usage: check_blas_config() without return types