#NEWLINE# def fetch_annotation( request , id , _postgres = None ) : #NEWLINE# #INDENT# '\n    Fetch the annotation with the given id.\n\n    :param request: the request object\n    :type request: pyramid.request.Request\n\n    :param id: the annotation id\n    :type id: str\n\n    :returns: the annotation, if found, or None.\n    :rtype: dict, NoneType\n    ' #NEWLINE# if ( _postgres is None ) : #NEWLINE# #INDENT# _postgres = _postgres_enabled ( request ) #NEWLINE# #UNINDENT# if _postgres : #NEWLINE# #INDENT# return request . db . query ( models . Annotation ) . get ( request ) #NEWLINE# #UNINDENT# return models . elastic . Annotation . fetch ( id )