<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def take_screen_shot_to_array(self, screen_id, width, height, bitmap_format):
 """Takes a guest screen shot of the requested size and format and returns it as an array of bytes. in screen_id of type int The guest monitor to take screenshot from. in width of type int Desired image width. in height of type int Desired image height. in bitmap_format of type :class:`BitmapFormat` The requested format. return screen_data of type str Array with resulting screen data. """

        if not isinstance(screen_id, baseinteger):
            raise TypeError("screen_id can only be an instance of type baseinteger")
        if not isinstance(width, baseinteger):
            raise TypeError("width can only be an instance of type baseinteger")
        if not isinstance(height, baseinteger):
            raise TypeError("height can only be an instance of type baseinteger")
        if not isinstance(bitmap_format, BitmapFormat):
            raise TypeError("bitmap_format can only be an instance of type BitmapFormat")
        screen_data = self._call("takeScreenShotToArray",
                     in_p=[screen_id, width, height, bitmap_format])
        return screen_data