<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def OnDialectChoice(self, event):
 """Updates all param widgets confirming to the selcted dialect"""


        dialect_name = event.GetString()
        value = list(self.choices['dialects']).index(dialect_name)

        if dialect_name == 'sniffer':
            if self.csvfilepath is None:
                event.Skip()
                return None
            dialect, self.has_header = sniff(self.csvfilepath)
        elif dialect_name == 'user':
            event.Skip()
            return None
        else:
            dialect = csv.get_dialect(dialect_name)

        self._update_settings(dialect)

        self.choice_dialects.SetValue(value)