#NEWLINE# def find_start( annotations ) : #NEWLINE# #INDENT# es_ids = [ a [ '_id' ] for a in annotations ] #NEWLINE# db_annotations = Annotation . query . filter ( Annotation . id . in_ ( es_ids ) ) #NEWLINE# db_ids = set ( [ a . id for a in db_annotations ] ) #NEWLINE# skipped = len ( db_ids ) #NEWLINE# to_import = [ a for a in annotations if ( a [ '_id' ] not in db_ids ) ] #NEWLINE# return ( annotations , to_import )