def apl_singleton(ip: str) -> str:
    """
    Convert a single IP or net/mask to APL item form
    """
    try:
        ind = ip.find(":")  # IPv6?
    except Exception:
        ind = -1
    if ind >= 0:
        prefix = "2:"
    else:
        prefix = "1:"
    try:
        ind = ip.index("/")  # mask included?
    except Exception:
        ind = -1
        if prefix == "1:":
            ip += "/32"
        else:
            ip += "/128"
    return prefix + ip