code: def readwrite_cursor(self):
      cursor = self.session.cursor()
      try:
          yield cursor
      except Exception:
          self.session.rollback()
          raise
      finally:
          cursor.close()
      self.session.commit()
  
imports: import contextlib
  import getpass
  import logging
  import os
  import sqlite3
  import tempfile
  import warnings
  from io import BytesIO
  from os.path import join
  import numpy
  from nibabel.optpkg import optional_package
  from .nifti1 import Nifti1Header
label_desc: Use image node_id 6 for calling the _DB obj's underlying member method code with example usage: obj.readwrite_cursor() without return types