code: def mockfs(tmp_path_factory, mock_fsspec):
      local_fs_dir = tmp_path_factory.mktemp("mockfs")
      return MockFileSystem(
          local_root_dir=local_fs_dir, auto_mkdir=True
      )
  
imports: import posixpath
  import shutil
  from pathlib import Path
  from unittest.mock import patch
  import fsspec
  import pytest
  from fsspec.implementations.local import AbstractFileSystem, LocalFileSystem, stringify_path
label_desc: Use image node_id 2 for calling a global function with example usage: mockfs(tmp_path_factory, mock_fsspec) and returns: MockFileSystem