code: def db(monkeypatch):
      """Build a dft database in memory to avoid cross-process races
      and not modify the host filesystem."""
      database = dft._DB(fname=":memory:")
      monkeypatch.setattr(dft, "DB", database)
      yield database
  
imports: import os
  import sqlite3
  from io import BytesIO
  from os.path import dirname
  from os.path import join
  from ..testing import suppress_warnings
  import unittest
  import pytest
  from ..None import nifti1
  from ..optpkg import optional_package
label_desc: Use image node_id 2 for calling a global function with example usage: db(monkeypatch) without return types