code: def _docdir(request):
      # Trigger ONLY for the doctests
      doctest_m = request.config.option.doctestmodules
      doctest_c = getattr(
          request.config.option, "doctest_cython", False
      )
  
      if doctest_m or doctest_c:
          # Get the fixture dynamically by its name.
          tmpdir = request.getfixturevalue("tmpdir")
  
          # Chdir only for the duration of the test.
          with tmpdir.as_cwd():
              yield
  
      else:
          yield
  
file_path: arrow/python/pyarrow/conftest.py
imports: import pytest
  import pyarrow
  from pyarrow import Codec
  from pyarrow import fs
  import numpy
label_desc: Use image node_id 2 for calling a global function with example usage: _docdir(request) without return types