import tempfile for temporary directory creation.