<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def metar(data: MetarData, units: Units) -> str: """ Convert MetarData into a string for text-to-speech """

    speech = []
    if data.wind_direction and data.wind_speed:
        speech.append(wind(data.wind_direction, data.wind_speed,
                           data.wind_gust, data.wind_variable_direction,
                           units.wind_speed))
    if data.visibility:
        speech.append(visibility(data.visibility, units.visibility))
    if data.temperature:
        speech.append(temperature('Temperature', data.temperature, units.temperature))
    if data.dewpoint:
        speech.append(temperature('Dew point', data.dewpoint, units.temperature))
    if data.altimeter:
        speech.append(altimeter(data.altimeter, units.altimeter))
    if data.other:
        speech.append(other(data.other))
    speech.append(translate.clouds(data.clouds,
                                   units.altitude).replace(' - Reported AGL', ''))
    return ('. '.join([l for l in speech if l])).replace(',', '.')