<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def OnInsertBitmap(self, event):
 """Insert bitmap event handler"""


        key = self.grid.actions.cursor
        # Get file name

        wildcard = _("Bitmap file") + " (*)|*"
        if rsvg is not None:
            wildcard += "|" + _("SVG file") + " (*.svg)|*.svg"

        message = _("Select image for current cell")
        style = wx.OPEN | wx.CHANGE_DIR
        filepath, index = \
            self.grid.interfaces.get_filepath_findex_from_user(wildcard,
                                                               message, style)
        if index == 0:
            # Bitmap loaded
            try:
                img = wx.EmptyImage(1, 1)
                img.LoadFile(filepath)
            except TypeError:
                return

            if img.GetSize() == (-1, -1):
                # Bitmap could not be read
                return

            code = self.grid.main_window.actions.img2code(key, img)

        elif index == 1 and rsvg is not None:
            # SVG loaded
            with open(filepath) as infile:
                try:
                    code = infile.read()
                except IOError:
                    return
                if is_svg(code):
                    code = 'u"""' + code + '"""'
                else:
                    # Does not seem to be an svg file
                    return

        else:
            code = None

        if code:
            self.grid.actions.set_code(key, code)