Builds a CustomMetar object from a CustomMetar object (returns it), an ICAO code or a METAR string

        Args:
            metar: CustomMetar object, ICAO string or METAR string

        Returns: CustomMetar object

def get_metar(
            metar: typing.Union[str, 'CustomMetar']
    ) -> typing.Tuple[typing.Union[str, None], typing.Union['CustomMetar', None]]:
        """
        Builds a CustomMetar object from a CustomMetar object (returns it), an ICAO code or a METAR string

        Args:
            metar: CustomMetar object, ICAO string or METAR string

        Returns: CustomMetar object

        """
        error: typing.Optional[str] = None
        if isinstance(metar, CustomMetar):
            return None, metar

        if isinstance(metar, str):
            LOGGER.debug('building CustomMetar from: %s', metar)
            if len(metar) == 4:
                LOGGER.debug('retrieving METAR from ICAO')
                # NOAA has discontinued their hosting of raw METAR text files ...
                # error, metar = noaa.retrieve_metar(metar)
                # metar = avwx.AVWX.query_icao(metar).rawreport
                metar = AWC.query_icao(metar).raw_metar
        else:
            error = f'expected a string or or a CustomMetar object, got: {type(metar)}'

        if error:
            return error, None

        try:
            return None, CustomMetar(metar_code=metar)
        except ParserError:
            return f'Unable to parse METAR: {metar}', None