def blocks_from_bbox(boxes, box):
    """Return all boxes that at least partially overlap box."""
    overlaps = lambda ll, lh, hl, hh : not ((hh < ll) or (hl > lh))
    return [blk for blk, bb in enumerate(boxes)
            if all(overlaps(*low, *high) for low, high in zip(bb, box))]