def break_up_addresses(device, addrs, block_wordcount):

    parts = []
    block_bytecount = block_wordcount * 4

    for addr in addrs:

        if len(addr) == 1:
            # Single word.
            # Looks just like a tiny block, but we read it with peek()

            def fn(device = device,
                   ptr = addr[0]
                   ):
                return struct.pack('<I', device.peek(ptr))

            parts.append(( addr[0], fn ))

        elif len(addr) == 2:
            # Range. First, pad it out to word alignment.

            first, last = addr
            first &= ~3
            last = (last + 3) & ~3

            if last <= first:
                raise ValueError('Empty range ' + repr(addr))

            # The first read address will be randomized to include up to one
            # full block of padding before the range we care about. This will
            # randomize the alignment of packet boundaries with respect to the
            # regions we're scanning.

            block_offset = random.randint(0, block_wordcount) * 4
            ptr = first - block_offset

            while ptr < last:

                def fn(device = device,
                       count = block_wordcount,
                       ptr = ptr,
                       start = block_offset,
                       end = min(block_bytecount, last + 1 - ptr)
                       ):
                    return device.read_block(ptr, count)[start:end]

                parts.append(( ptr + block_offset, fn ))
                block_offset = 0
                ptr += block_bytecount

        else:
            raise ValueError('Unrecognized address format ' + repr(addr))

    random.shuffle(parts)
    return parts
Get the details for the specified Frame using the frame's name.
dataset/ETHPy150Open scanlime/coastermelt/backdoor/watch.py/break_up_addresses--crossover with--dataset/ETHPy150Open nltk/nltk/nltk/corpus/reader/framenet.py/FramenetCorpusReader.frame_by_name