code: def test_default_blas_ldflags(
      mock_std_lib_dirs,
      mock_check_mkl_openmp,
      cxx_search_dirs,
      cxx_search_dirs_status,
  ):
      cxx_search_dirs, expected_blas_ldflags = cxx_search_dirs
      mock_process = MagicMock()
      if cxx_search_dirs_status:
          error_message = ""
          mock_process.communicate = lambda *args, **kwargs: (
              cxx_search_dirs,
              b"",
          )
          mock_process.returncode = 0
      else:
          error_message = "Unsupported argument -print-search-dirs"
          error_message_bytes = error_message.encode(
              sys.stderr.encoding
          )
          mock_process.communicate = lambda *args, **kwargs: (
              b"",
              error_message_bytes,
          )
          mock_process.returncode = 1
      with patch(
          "pytensor.link.c.cmodule.subprocess_Popen",
          return_value=mock_process,
      ):
          with patch.object(
              pytensor.link.c.cmodule.GCC_compiler,
              "try_compile_tmp",
              return_value=(True, True),
          ):
              if cxx_search_dirs_status:
                  assert set(default_blas_ldflags().split(" ")) == set(
                      expected_blas_ldflags.split(" ")
                  )
              else:
                  expected_warning = re.escape(
                      "Pytensor cxx failed to communicate its search dirs. As a consequence, "
                      "it might not be possible to automatically determine the blas link flags to use.\n"
                      f"Command that was run: {config.cxx} -print-search-dirs\n"
                      f"Output printed to stderr: {error_message}"
                  )
                  with pytest.warns(
                      UserWarning,
                      match=expected_warning,
                  ):
                      assert default_blas_ldflags() == ""
  
imports: import multiprocessing
  import os
  import re
  import sys
  import tempfile
  from unittest.mock import MagicMock, patch
  import numpy
  import pytest
  import pytensor
  import pytensor.tensor
  from pytensor.compile.function import function
  from pytensor.compile.ops import DeepCopyOp
  from pytensor.configdefaults import config
  from pytensor.graph.basic import Apply
  from pytensor.graph.fg import FunctionGraph
  from pytensor.link.c.basic import CLinker
  from pytensor.link.c.cmodule import GCC_compiler, ModuleCache, default_blas_ldflags
  from pytensor.link.c.exceptions import CompileError
  from pytensor.link.c.op import COp
  from pytensor.tensor.type import dvectors, vector
label_desc: Use image node_id 9 for calling a global function with example usage: test_default_blas_ldflags(mock_std_lib_dirs, mock_check_mkl_openmp, cxx_search_dirs, cxx_search_dirs_status) without return types