code: def tmpdir(tmp_path):
      """Return a temporary directory path object
      which is unique to each test function invocation,
      created as a sub directory of the base temporary
      directory.  The returned object is a `py.path.local`_
      path object.
  
      .. _`py.path.local`: https://py.readthedocs.io/en/latest/path.html
      """
      return py.path.local(tmp_path)
  
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 6 for calling a global function with example usage: tmpdir(tmp_path) and returns: py