<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_translation(self, ims_width, ims_height):
 """Returns x and y for a bitmap translation"""


        # Get cell attributes
        cell_attributes = self.code_array.cell_attributes[self.key]
        justification = cell_attributes["justification"]
        vertical_align = cell_attributes["vertical_align"]
        angle = cell_attributes["angle"]

        scale_x, scale_y = self._get_scalexy(ims_width, ims_height)
        scale = min(scale_x, scale_y)

        if angle not in (90, 180, -90):
            # Standard direction
            x = -2  # Otherwise there is a white border
            y = -2  # Otherwise there is a white border

            if scale_x > scale_y:
                if justification == "center":
                    x += (self.rect[2] - ims_width * scale) / 2

                elif justification == "right":
                    x += self.rect[2] - ims_width * scale

            else:
                if vertical_align == "middle":
                    y += (self.rect[3] - ims_height * scale) / 2

                elif vertical_align == "bottom":
                    y += self.rect[3] - ims_height * scale

        if angle == 90:
            x = -ims_width * scale + 2
            y = -2

            if scale_y > scale_x:
                if justification == "center":
                    y += (self.rect[2] - ims_height * scale) / 2

                elif justification == "right":
                    y += self.rect[2] - ims_height * scale

            else:
                if vertical_align == "middle":
                    x -= (self.rect[3] - ims_width * scale) / 2

                elif vertical_align == "bottom":
                    x -= self.rect[3] - ims_width * scale

        elif angle == 180:
            x = -ims_width * scale + 2
            y = -ims_height * scale + 2

            if scale_x > scale_y:
                if justification == "center":
                    x -= (self.rect[2] - ims_width * scale) / 2

                elif justification == "right":
                    x -= self.rect[2] - ims_width * scale

            else:
                if vertical_align == "middle":
                    y -= (self.rect[3] - ims_height * scale) / 2

                elif vertical_align == "bottom":
                    y -= self.rect[3] - ims_height * scale

        elif angle == -90:
            x = -2
            y = -ims_height * scale + 2

            if scale_y > scale_x:
                if justification == "center":
                    y -= (self.rect[2] - ims_height * scale) / 2

                elif justification == "right":
                    y -= self.rect[2] - ims_height * scale

            else:
                if vertical_align == "middle":
                    x += (self.rect[3] - ims_width * scale) / 2

                elif vertical_align == "bottom":
                    x += self.rect[3] - ims_width * scale

        return x, y