code: def create_session_engine(uri=None, cfg=None):
      
      if uri is not None:
          eng = sa.create_engine(uri)
      elif cfg is not None:
          eng = sa.create_engine(cfg.get('db', 'SA_ENGINE_URI'))
      else:
          raise IOError("unable to connect to SQL database")
      ses = orm.sessionmaker(bind=eng)()
      return ses, eng
docs: Create an sqlalchemy session and engine.
  
      :param str uri: The database URI to connect to
      :param cfg: The configuration object with database URI info.
      :return: The session and the engine as a list (in that order)