code: def first(self, default=None, as_dict=False, as_ordereddict=False):
          
  
          # 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
docs: 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.