class_docstr: Use this context manager to automatically start and close a database session
  
  Examples:
      >>> with DBContextManager('ProjectFolder') as session:
      >>>     # Do stuff with session
class_docstr_tok: ["Use","this","context","manager","to","automatically","start","and","close","a","database","session","Examples",":",">",">",">","with","DBContextManager","(","'ProjectFolder","'",")","as","session",":",">",">",">","#","Do","stuff","with","session"]
code: def __enter__(self):
      if not os.path.exists(self.path):
          raise exceptions.UserError(
              "{} does not exist".format(self.path)
          )
      sqlite_url = "sqlite:///{}".format(self.path)
      engine = create_engine(sqlite_url)
  
      self.session = Session(bind=engine)
  
      return self.session
  
imports: from __future__ import absolute_import, print_function, division, unicode_literals
  import imp
  import sys
  import os
  import hashlib
  import json
  import numpy
  from sqlalchemy import create_engine
  from sqlalchemy.orm import Session
  from six import exec_, iteritems
  from sklearn import datasets
  from sklearn import model_selection
  from xcessiv import app, exceptions
label_desc: Use image node_id 2 for calling the DBContextManager obj's underlying member method code with example usage: obj.__enter__() and returns: self