code: def gradio_temp_dir(monkeypatch, tmp_path):
      """tmp_path is unique to each test function.
      It will be cleared automatically according to pytest docs: https://docs.pytest.org/en/6.2.x/reference.html#tmp-path
      """
      monkeypatch.setenv("GRADIO_TEMP_DIR", str(tmp_path))
      return tmp_path
  
file_path: gradio/test/conftest.py
imports: import inspect
  import pathlib
  from contextlib import contextmanager
  import pytest
  from gradio_client import Client
  import gradio
label_desc: Use image node_id 5 for calling a global function with example usage: gradio_temp_dir(monkeypatch, tmp_path) and returns: tmp_path