def parse_param(param):
    if not param:
        raise InvalidParameterException(_('Empty parameters are not allowed!'))

    if re.search('\s', param):
        raise InvalidParameterException(_('Sorry, no whitespace in parameters is allowed at this time.'))

    split = param.split('.')
    if len(split) > 2:
        raise InvalidParameterException(_('Parameters can have at most one period.'))
    if len(split) == 2:
        namespace, variable = split
    else:
        namespace = GLOBAL_NAMESPACE
        variable = split[0]

    if namespace not in VALID_NAMESPACES:
        raise InvalidParameterException(_('Namespace {} for variable {} is not valid! Must be one of {}.'.format(
            namespace, param, ', '.join(VALID_NAMESPACES)
        )))
    return ParsedParam(namespace, variable)
Test if the address is a loopback address.
dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/performance_sms/parser.py/parse_param--crossover with--dataset/ETHPy150Open anzev/hedwig/build/pip/pip/_vendor/ipaddress.py/IPv4Address.is_loopback