nodes: 0, module; 1, function_definition; 2, function_name:duplicates; 3, parameters; 4, block; 5, identifier:base; 6, identifier:items; 7, expression_statement; 8, for_statement; 9, comment:"""Get an iterator of items similar but not equal to the base.
  
      @param base: base item to perform comparison against
      @param items: list of items to compare to the base
      @return: generator of items sorted by similarity to the base
  
      """; 10, identifier:item; 11, identifier:items; 12, block; 13, if_statement; 14, boolean_operator; 15, block; 16, call; 17, not_operator; 18, expression_statement; 19, attribute; 20, argument_list; 21, call; 22, yield; 23, identifier:item; 24, identifier:similarity; 25, identifier:base; 26, attribute; 27, argument_list; 28, identifier:item; 29, identifier:item; 30, identifier:equality; 31, identifier:base
code: def duplicates(base, items):
      """Get an iterator of items similar but not equal to the base.
  
      @param base: base item to perform comparison against
      @param items: list of items to compare to the base
      @return: generator of items sorted by similarity to the base
  
      """
      for item in items:
          if item.similarity(base) and not item.equality(base):
              yield item