code: def test_study(db):
      # First pass updates the cache, second pass reads it out
      for base_dir in (data_dir, None):
          studies = dft.get_studies(base_dir)
          assert len(studies) == 1
          assert (
              studies[0].uid
              == "1.3.12.2.1107.5.2.32.35119.30000010011408520750000000022"
          )
          assert studies[0].date == "20100114"
          assert studies[0].time == "121314.000000"
          assert studies[0].comments == "dft study comments"
          assert studies[0].patient_name == "dft patient name"
          assert studies[0].patient_id == "1234"
          assert studies[0].patient_birth_date == "19800102"
          assert studies[0].patient_sex == "F"
  
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 4 for calling a global function with example usage: test_study(db) without return types