code: def _keep_analyses( analyses, keep_forms, target_forms ):
      ''' Filters the given list of *analyses* by morphological forms: 
          deletes analyses that are listed in *target_forms*, but not in 
          *keep_forms*. '''
      to_delete = []
      for aid, analysis in enumerate(analyses):
          delete = False
          for target in target_forms:
              if (target == analysis[FORM] and not analysis[FORM] in keep_forms):
                 delete = True
          if delete:
              to_delete.append( aid )
      if to_delete:
         to_delete.reverse()
         for aid in to_delete:
             del analyses[aidf _keep_analyses( analyses, keep_forms, target_forms ):
      ''' Filters the given list of *analyses* by morphological forms: 
          deletes analyses that are listed in *target_forms*, but not in 
          *keep_forms*. '''
      to_delete = []
      for aid, analysis in enumerate(analyses):
          delete = False
          for target in target_forms:
              if (target == analysis[FORM] and not analysis[FORM] in keep_forms):
                 delete = True
          if delete:
              to_delete.append( aid )
      if to_delete:
         to_delete.reverse()
         for aid in to_delete:
             del analyses[aid]
docs: Filters the given list of *analyses* by morphological forms: 
          deletes analyses that are listed in *target_forms*, but not in 
          *keep_forms*.