def diffstat(self):
        names = []
        insert = []
        delete = []
        delta = 0  # size change in bytes
        namelen = 0
        maxdiff = 0  # max number of changes for single file
        # (for histogram width calculation)
        for patch in self.items:
            i, d = 0, 0
            for hunk in patch.hunks:
                for line in hunk.text:
                    if line.startswith(b'+'):
                        i += 1
                        delta += len(line) - 1
                    elif line.startswith(b'-'):
                        d += 1
                        delta -= len(line) - 1
            names.append(patch.target)
            insert.append(i)
            delete.append(d)
            namelen = max(namelen, len(patch.target))
            maxdiff = max(maxdiff, i + d)
        output = ''
        statlen = len(str(maxdiff))  # stats column width
        for i, n in enumerate(names):
            # %-19s | %-4d %s
            format = " %-" + str(namelen) + "s | %" + str(statlen) + "s %s\n"

            hist = ''
            # -- calculating histogram --
            width = len(format % ('', '', ''))
            histwidth = max(2, 80 - width)
            if maxdiff < histwidth:
                hist = "+" * insert[i] + "-" * delete[i]
            else:
                iratio = (float(insert[i]) / maxdiff) * histwidth
                dratio = (float(delete[i]) / maxdiff) * histwidth

                # make sure every entry gets at least one + or -
                iwidth = 1 if 0 < iratio < 1 else int(iratio)
                dwidth = 1 if 0 < dratio < 1 else int(dratio)
                # print(iratio, dratio, iwidth, dwidth, histwidth)
                hist = "+" * int(iwidth) + "-" * int(dwidth)
            # -- /calculating +- histogram --
            output += (format % (tostr(names[i]), str(insert[i] + delete[i]), hist))

        output += (" %d files changed, %d insertions(+), %d deletions(-), %+d bytes"
                   % (len(names), sum(insert), sum(delete), delta))
        return output
A generator wrapper for the read() method. A call will block until
dataset/ETHPy150Open ensime/ensime-sublime/patch.py/PatchSet.diffstat--crossover with--dataset/ETHPy150Open CouchPotato/CouchPotatoServer/libs/requests/packages/urllib3/response.py/HTTPResponse.stream