code: def pytest_configure(config):
      """Create a TempdirFactory and attach it to the config object.
  
      This is to comply with existing plugins which expect the handler to be
      available at pytest_configure time, but ideally should be moved entirely
      to the tmpdir_factory session fixture.
      """
      mp = MonkeyPatch()
      tmppath_handler = TempPathFactory.from_config(config)
      t = TempdirFactory(tmppath_handler)
      config._cleanup.append(mp.undo)
      mp.setattr(
          config, "_tmp_path_factory", tmppath_handler, raising=False
      )
      mp.setattr(config, "_tmpdirhandler", t, raising=False)
      mp.setattr(pytest, "ensuretemp", t.ensuretemp, raising=False)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  import re
  import tempfile
  import warnings
  import attr
  import py
  import six
  import pytest
  from .pathlib import ensure_reset_dir
  from .pathlib import LOCK_TIMEOUT
  from .pathlib import make_numbered_dir
  from .pathlib import make_numbered_dir_with_cleanup
  from .pathlib import Path
  from _pytest.monkeypatch import MonkeyPatch
label_desc: Use image node_id 2 for calling a global function with example usage: pytest_configure(config) without return types