A MultiFS is a filesystem composed of a sequence of other filesystems. The directory structure of each filesystem in the sequence overlays the previous ones. This allows you to selectively override files or customize behavior by providing a 'higher priority' filesystem that masks files in 'lower priority' filesystems.
When multiple filesystems in the sequence contain the same path, the version from the filesystem added most recently (or the one appearing later in the sequence, depending on implementation details of the overlay) is what the user sees. In the provided example, the theme directory is used to override or extend the templates directory.
from fs.osfs import OSFS
from fs.multifs import MultiFS
theme_fs = MultiFS()
theme_fs.add_fs('templates', OSFS('templates'))
theme_fs.add_fs('theme', OSFS('theme'))