def validate_station(station):
 if (station is None):
  return
 station = station.replace('.shtml', '')
 if (not re.fullmatch('ID[A-Z]\\d\\d\\d\\d\\d\\.\\d\\d\\d\\d\\d', station)):
  raise vol.error.Invalid('Malformed station ID')
 return station

def validate_station ( station ) : if ( station is None ) : return station = station . replace ( '.shtml' , '' ) if ( not re . fullmatch ( 'ID[A-Z]\\d\\d\\d\\d\\d\\.\\d\\d\\d\\d\\d' , station ) ) : raise vol . error . Invalid ( 'Malformed station ID' ) return station
check that the station id is well-formed .