In this example, we create a temporary directory using the `TemporaryDirectory` method of the `calibre.ptempfile` module. The `with` statement automatically cleans up the directory once we are done with it. Example 2: Creating nested directories using TemporaryDirectory methodpython from calibre.ptempfile import TemporaryDirectory import os with TemporaryDirectory() as tmp_dir: print(tmp_dir) # prints the path of a temporary directory nested_dir = os.path.join(tmp_dir, 'nested') os.makedirs(nested_dir) print(f"Nested directory created at {nested_dir}") ``` In this example, we create a nested directory inside the temporary directory using the `makedirs` function from the `os` module. The `calibre.ptempfile` module is a part of the `calibre` package, which is a Python library for managing e-book collections.