def valid_nmap_range(target_spec):
    """
    :param target_spec: an nmap-style IP range target specification.

    :return: ``True`` if IP range target spec is valid, ``False`` otherwise.
    """
    try:
        _iter_next(_parse_nmap_target_spec(target_spec))
        return True
    except (TypeError, __HOLE__, AddrFormatError):
        pass
    return False
dataset/ETHPy150Open drkjam/netaddr/netaddr/ip/nmap.py/valid_nmap_range