Did I find the right examples for you? yes no

All Samples(2)  |  Call(2)  |  Derive(0)  |  Import(0)
Study differences between fields.

@param clues: Clues to analyze.
@type clues: C{list}

@return: Fields which were found to be different among the analyzed clues.
@rtype: C{list}

        def diff_fields(clues):
    """Study differences between fields.

    @param clues: Clues to analyze.
    @type clues: C{list}

    @return: Fields which were found to be different among the analyzed clues.
    @rtype: C{list}
    """
    def pairs(num):
        for i in xrange(num):
            for j in xrange(num):
                if i == j:
                    continue
                yield (i, j)

    import difflib

    different = []
    for i, j in pairs(len(clues)):
        one, other = clues[i].headers, clues[j].headers
        matcher = difflib.SequenceMatcher(None, one, other)

        for tag, alo, ahi, blo, bhi in matcher.get_opcodes():
            if tag == 'equal':
                continue
                
            for name, value in one[alo:ahi] + other[blo:bhi]:
                different.append(name)

    different.sort()
    different.reverse()

    return different
        


src/h/a/halberd-0.2.4/Halberd/reportlib.py   halberd(Download)
    # xxx This could be passed by the caller in order to avoid recomputation in
    # case the clues needed a re-analysis.
    diff_fields = analysis.diff_fields(clues)
 
    out.write('=' * 70 + '\n')

src/h/a/halberd-HEAD/Halberd/reportlib.py   halberd(Download)
    # xxx This could be passed by the caller in order to avoid recomputation in
    # case the clues needed a re-analysis.
    diff_fields = analysis.diff_fields(clues)
 
    out.write('=' * 70 + '\n')