'Searches for a particular player by name or
database id.
Args:
ostring (str or int): A key string or database id.
exact (bool, optional): Only valid for string matches. If
`True`, requires exact (non-case-sensitive) match,
otherwise also match also keys containing the `ostring`
(non-case-sensitive fuzzy match).
typeclass (str or Typeclass, optional): Limit the search only to
players of this typeclass.'

@returns_typeclass_list
def search_player(self, ostring, exact=True, typeclass=None):

    dbref = self.dbref(ostring)
    if (dbref or (dbref == 0)):
        matches = self.filter(id=dbref)
        if matches:
            return matches
    query = {('username__iexact' if exact else 'username__icontains'): ostring}
    if typeclass:
        if callable(typeclass):
            typeclass = (u'%s.%s' % (typeclass.__module__, typeclass.__name__))
        else:
            typeclass = (u'%s' % typeclass)
        query['db_typeclass_path'] = typeclass
    if exact:
        return self.filter(**query)
    else:
        return self.filter(**query)
