<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_filepath_findex_from_user(self, wildcard, message, style, filterindex=0):
 """Opens a file dialog and returns filepath and filterindex Parameters wildcard: String \tWildcard string for file dialog message: String \tMessage in the file dialog style: Integer \tDialog style, e. g. wx.OPEN | wx.CHANGE_DIR filterindex: Integer, defaults to 0 \tDefault filterindex that is selected when the dialog is displayed """


        dlg = wx.FileDialog(self.main_window, wildcard=wildcard,
                            message=message, style=style,
                            defaultDir=os.getcwd(), defaultFile="")

        # Set the initial filterindex
        dlg.SetFilterIndex(filterindex)

        filepath = None
        filter_index = None

        if dlg.ShowModal() == wx.ID_OK:
            filepath = dlg.GetPath()
            filter_index = dlg.GetFilterIndex()

        dlg.Destroy()

        return filepath, filter_index