class_docstr: A set of excellent Records from a query.
class_docstr_tok: ["A","set","of","excellent","Records","from","a","query","."]
docstr: Returns a single record for the RecordCollection, or `default`. If
  `default` is an instance or subclass of Exception, then raise it
  instead of returning it.
docstr_tok: ["Returns","a","single","record","for","the","RecordCollection",",","or","`","default","`",".","If","`","default","`","is","an","instance","or","subclass","of","Exception",",","then","raise","it","instead","of","returning","it","."]
code: def first(self, default=None, as_dict=False, as_ordereddict=False):
      """Returns a single record for the RecordCollection, or `default`. If
      `default` is an instance or subclass of Exception, then raise it
      instead of returning it."""
  
      # Try to get a record, or return/raise default.
      try:
          record = self[0]
      except IndexError:
          if isexception(default):
              raise default
          return default
  
      # Cast and return.
      if as_dict:
          return record.as_dict()
      elif as_ordereddict:
          return record.as_dict(ordered=True)
      else:
          return record
  
imports: import os
  from sys import stdout
  from collections import OrderedDict
  from contextlib import contextmanager
  from inspect import isclass
  import tablib
  from docopt import docopt
  from sqlalchemy import create_engine, exc, inspect, text
label_desc: Use image node_id 12 for calling the RecordCollection obj's underlying member method code with example usage: obj.first(default, as_dict, as_ordereddict) and returns: record, default, record, record