<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def blit(self, source, x=0, y=0, width=None, height=None, srcX=0, srcY=0, fg_alpha=1.0, bg_alpha=1.0):
 """Blit another console or Window onto the current console. By default it blits the entire source to the topleft corner. Args: source (Union[tdl.Console, tdl.Window]):
 The blitting source. A console can blit to itself without any problems. x (int):
 x-coordinate of this console to blit on. y (int):
 y-coordinate of this console to blit on. width (Optional[int]):
 Width of the rectangle. Can be None to extend as far as possible to the bottom right corner of the blit area or can be a negative number to be sized reltive to the total size of the B{destination} console. height (Optional[int]):
 Height of the rectangle. srcX (int):
 x-coordinate of the source region to blit. srcY (int):
 y-coordinate of the source region to blit. fg_alpha (float):
 The foreground alpha. """

        assert isinstance(source, (Console, Window)), "source muse be a Window or Console instance"

        # handle negative indexes and rects
        # negative width and height will be set realtive to the destination
        # and will also be clamped to the smallest Console
        x, y, width, height = self._normalizeRect(x, y, width, height)
        srcX, srcY, width, height = source._normalizeRect(srcX, srcY, width, height)

        # translate source and self if any of them are Window instances
        srcX, srcY = source._translate(srcX, srcY)
        source = source.console
        x, y = self._translate(x, y)
        self = self.console

        if self == source:
            # if we are the same console then we need a third console to hold
            # onto the data, otherwise it tries to copy into itself and
            # starts destroying everything
            tmp = Console(width, height)
            _lib.TCOD_console_blit(source.console_c,
                                   srcX, srcY, width, height,
                                   tmp.console_c, 0, 0, fg_alpha, bg_alpha)
            _lib.TCOD_console_blit(tmp.console_c, 0, 0, width, height,
                                   self.console_c, x, y, fg_alpha, bg_alpha)
        else:
            _lib.TCOD_console_blit(source.console_c,
                                   srcX, srcY, width, height,
                                   self.console_c, x, y, fg_alpha, bg_alpha)