<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_meter(self, meter):
 """Set the meter of this bar. Meters in mingus are represented by a single tuple. If the format of the meter is not recognised, a MeterFormatError will be raised. """

        # warning should raise exception
        if _meter.valid_beat_duration(meter[1]):
            self.meter = (meter[0], meter[1])
            self.length = meter[0] * (1.0 / meter[1])
        elif meter == (0, 0):
            self.meter = (0, 0)
            self.length = 0.0
        else:
            raise MeterFormatError("The meter argument '%s' is not an "
                    "understood representation of a meter. "
                    "Expecting a tuple." % meter)