'Restore the saved region. If bbox (instance of BboxBase, or
its extents) is given, only the region specified by the bbox
will be restored. *xy* (a tuple of two floasts) optionally
specifies the new position (the LLC of the original region,
not the LLC of the bbox) where the region will be restored.
>>> region = renderer.copy_from_bbox()
>>> x1, y1, x2, y2 = region.get_extents()
>>> renderer.restore_region(region, bbox=(x1+dx, y1, x2, y2),
...                         xy=(x1-dx, y1))'

def restore_region(self, region, bbox=None, xy=None):

    if ((bbox is not None) or (xy is not None)):
        if (bbox is None):
            (x1, y1, x2, y2) = region.get_extents()
        elif isinstance(bbox, BboxBase):
            (x1, y1, x2, y2) = bbox.extents
        else:
            (x1, y1, x2, y2) = bbox
        if (xy is None):
            (ox, oy) = (x1, y1)
        else:
            (ox, oy) = xy
        self._renderer.restore_region(region, int(x1), int(y1), int(x2), int(y2), int(ox), int(oy))
    else:
        self._renderer.restore_region(region)
