<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _draw_rectangle_path(self, context, width, height, only_get_extents=False):
 """Draws the rectangle path for the port The rectangle is correctly rotated. Height therefore refers to the border thickness and width to the length of the port. :param context: The context to draw on :param float width: The width of the rectangle :param float height: The height of the rectangle """

        c = context

        # Current position is the center of the rectangle
        c.save()
        if self.side is SnappedSide.LEFT or self.side is SnappedSide.RIGHT:
            c.rotate(deg2rad(90))
        c.rel_move_to(-width / 2., - height / 2.)
        c.rel_line_to(width, 0)
        c.rel_line_to(0, height)
        c.rel_line_to(-width, 0)
        c.close_path()
        c.restore()

        if only_get_extents:
            extents = c.path_extents()
            c.new_path()
            return extents