Repository: matplotlib/matplotlib
File: lib/matplotlib/offsetbox.py (Python)

Code before:
        """
        Set the bbox that the box is anchored to.

        *bbox* can be a Bbox instance, a list of [left, bottom, width,
        height], or a list of [left, bottom] where the width and
        height will be assumed to be zero. The bbox will be
        transformed to display coordinate by the given transform.
        """
        if bbox is None or isinstance(bbox, BboxBase):
            self._bbox_to_anchor = bbox
        else:
            try:
                l = len(bbox)
            except TypeError as err:
                raise ValueError(f"Invalid bbox: {bbox}") from err

            if l == 2:
                bbox = [bbox[0], bbox[1], 0, 0]

            self._bbox_to_anchor = Bbox.from_bounds(*bbox)

        self._bbox_to_anchor_transform = transform
        self.stale = True

    @_compat_get_offset

    def get_offset(self, bbox, renderer):
        fontsize_in_pixels = renderer.points_to_pixels(self.prop.get_size_in_points())
        try:
            borderpad_x, borderpad_y = self.borderpad
        except (TypeError, ValueError):
            borderpad_x = self.borderpad
            borderpad_y = self.borderpad
        pad_x_pixels = borderpad_x * fontsize_in_pixels
        pad_y_pixels = borderpad_y * fontsize_in_pixels
        bbox_to_anchor = self.get_bbox_to_anchor()
        padded_bbox_to_anchor = Bbox.from_extents(
            bbox_to_anchor.x0 + pad_x_pixels,
            bbox_to_anchor.y0 + pad_y_pixels,
            bbox_to_anchor.x1 - pad_x_pixels,
            bbox_to_anchor.y1 - pad_y_pixels
        )
        x0, y0 = _get_anchored_bbox(
            self.loc,
            Bbox.from_bounds(0, 0, bbox.width, bbox.height),
            padded_bbox_to_anchor,
            0
        )
        return x0 - bbox.x0, y0 - bbox.y0

    def update_frame(self, bbox, fontsize=None):

Review comment (suggestion):
```suggestion
```
Accidental added line I think.

Code after:
                return TransformedBbox(self._bbox_to_anchor, transform)

    def set_bbox_to_anchor(self, bbox, transform=None):
        """
        Set the bbox that the box is anchored to.

        *bbox* can be a Bbox instance, a list of [left, bottom, width,
        height], or a list of [left, bottom] where the width and
        height will be assumed to be zero. The bbox will be
        transformed to display coordinate by the given transform.
        """
        if bbox is None or isinstance(bbox, BboxBase):
            self._bbox_to_anchor = bbox
        else:
            try:
                l = len(bbox)
            except TypeError as err:
                raise ValueError(f"Invalid bbox: {bbox}") from err

            if l == 2:
                bbox = [bbox[0], bbox[1], 0, 0]

            self._bbox_to_anchor = Bbox.from_bounds(*bbox)

        self._bbox_to_anchor_transform = transform
        self.stale = True

    @_compat_get_offset
    def get_offset(self, bbox, renderer):
        # docstring inherited
        fontsize_in_pixels = renderer.points_to_pixels(self.prop.get_size_in_points())
        try:
            borderpad_x, borderpad_y = self.borderpad
        except TypeError:
            borderpad_x = self.borderpad
            borderpad_y = self.borderpad
        pad_x_pixels = borderpad_x * fontsize_in_pixels
        pad_y_pixels = borderpad_y * fontsize_in_pixels
        bbox_to_anchor = self.get_bbox_to_anchor()
        x0, y0 = _get_anchored_bbox(
            self.loc,
            Bbox.from_bounds(0, 0, bbox.width, bbox.height),
            bbox_to_anchor,
            pad_x_pixels,
            pad_y_pixels
        )
        return x0 - bbox.x0, y0 - bbox.y0

    def update_frame(self, bbox, fontsize=None):
        self.patch.set_bounds(bbox.bounds)
        if fontsize: