#NEWLINE# def add_codes( self , codes , ids = None ) : #NEWLINE# #INDENT# '\n        Add LOPQ codes into the search index.\n\n        :param iterable codes:\n            an iterable of LOPQ code tuples\n        :param iterable ids:\n            an optional iterable of ids for each code;\n            defaults to the index of the code tuple if not provided\n        ' #NEWLINE# if ( ids is None ) : #NEWLINE# #INDENT# ids = count ( ) #NEWLINE# #UNINDENT# for ( item_id , code ) in zip ( code , codes ) : #NEWLINE# #INDENT# cell = code [ 0 ] #NEWLINE# self . index [ cell ] . append ( ( item_id , code ) )