def get_session(args):
 engine_uri = args.engine_uri
 got_from = 'command line'
 if (engine_uri is None):
  (engine_uri, got_from) = defaults.get_default_db_uri_with_origin()
 session = pokedex.db.connect(engine_uri)
 if args.verbose:
  print(('Connected to database %(engine)s (from %(got_from)s)' % dict(engine=session.bind.url, got_from=got_from)))
 return session

def get_session ( args ) : engine_uri = args . engine_uri got_from = 'command line' if ( engine_uri is None ) : ( engine_uri , got_from ) = defaults . get_default_db_uri_with_origin ( ) session = pokedex . db . connect ( engine_uri ) if args . verbose : print ( ( 'Connected to database %(engine)s (from %(got_from)s)' % dict ( engine = session . bind . url , got_from = got_from ) ) ) return session
given a parsed options object .