code: def get_session(ec=None, create=True):
      
      
      ec = ec or __default_engine__
      if isinstance(ec, (str, unicode)):
          session = engine_manager[ec].session(create=True)
      elif isinstance(ec, Session):
          session = ec
      else:
          raise Error("Connection %r should be existed engine name or Session object" % ec)
      return session
docs: ec - engine_name or connection