code: def tempdir():
      
      directory_path = tempfile.mkdtemp()
  
      def clean_up():  # pylint: disable=missing-docstring
          shutil.rmtree(directory_path, onerror=on_error)
  
      with cd(directory_path, clean_up):
          yield directory_path
docs: Creates a temporary directory