def _truncate_bitmap(what):
    "Determine the index of greatest byte that isn't all zeros, and\n    return the bitmap that contains all the bytes less than that index.\n\n    @param what: a string of octets representing a bitmap.\n    @type what: string\n    @rtype: string\n    "
    for i in xrange((len(what) - 1), (- 1), (- 1)):
        if (what[i] != 0):
            return what[0:(i + 1)]
    return what[0:1]
Determine the index of greatest byte that isn't all zeros, and
return the bitmap that contains all the bytes less than that index.

@param what: a string of octets representing a bitmap.
@type what: string
@rtype: string
def _truncate_bitmap(what):
    "Determine the index of greatest byte that isn't all zeros, and\n    return the bitmap that contains all the bytes less than that index.\n\n    @param what: a string of octets representing a bitmap.\n    @type what: string\n    @rtype: string\n    "
    for i in xrange((len(what) - 1), (- 1), (- 1)):
        if (what[i] != 0):
            return what[0:(i + 1)]
    return what[0:1]