class_docstr: Invokes a :class:`.BakedQuery` against a :class:`.Session`.
  
  The :class:`_baked.Result` object is where the actual :class:`.query.Query`
  object gets created, or retrieved from the cache,
  against a target :class:`.Session`, and is then invoked for results.
class_docstr_tok: ["Invokes","a",":","class",":","`",".BakedQuery","`","against","a",":","class",":","`",".Session","`",".","The",":","class",":","`","_baked.Result","`","object","is","where","the","actual",":","class",":","`",".query.Query","`","object","gets","created",",","or","retrieved","from","the","cache",",","against","a","target",":","class",":","`",".Session","`",",","and","is","then","invoked","for","results","."]
docstr: Return the first element of the first result or None
  if no rows present.  If multiple rows are returned,
  raises MultipleResultsFound.
  
  Equivalent to :meth:`_query.Query.scalar`.
docstr_tok: ["Return","the","first","element","of","the","first","result","or","None","if","no","rows","present",".","If","multiple","rows","are","returned",",","raises","MultipleResultsFound",".","Equivalent","to",":","meth",":","`","_query.Query.scalar","`","."]
code: def scalar(self):
      """Return the first element of the first result or None
      if no rows present.  If multiple rows are returned,
      raises MultipleResultsFound.
  
      Equivalent to :meth:`_query.Query.scalar`.
  
      """
      try:
          ret = self.one()
          if not isinstance(ret, collections_abc.Sequence):
              return ret
          return ret[0]
      except orm_exc.NoResultFound:
          return None
  
imports: import collections.abc
  import logging
  from ..None import exc
  from ..None import util
  from ..orm import exc
  from ..orm.query import Query
  from ..orm.session import Session
  from ..sql import func
  from ..sql import literal_column
  from ..sql import util
label_desc: Use image node_id 10 for calling the Result obj's underlying member method code with example usage: obj.scalar() and returns: ret, ret, None