def METHOD_NAME(dev):
    slots = {}
    version = 1
    max_slots = 8
    try:
        result = subprocess.check_output(["cryptsetup", "luksDump", dev], stderr=subprocess.PIPE)
    except subprocess.CalledProcessError:
        return {"version": version, "slots": [], "max_slots": max_slots}
    in_luks2_slot_section = False
    in_luks2_token_section = False
    for line in result.splitlines():
        if not (line.startswith(b" ") or line.startswith(b"\t")):
            in_luks2_slot_section = False
            in_luks2_token_section = False
        if line == b"Keyslots:":
            in_luks2_slot_section = True
            version = 2
            max_slots = 32
        elif line == b"Tokens:":
            in_luks2_token_section = True
        if in_luks2_slot_section:
            match = re.match(b"  ([0-9]+): luks2$", line)
        else:
            match = re.match(b"Key Slot ([0-9]+): ENABLED$", line)
        if match:
            slot = int(match.group(1))
            entry = {"Index": {"v": slot}}
            if version == 1:
                try:
                    luksmeta = subprocess.check_output(["luksmeta", "load", "-d", dev, "-s", str(slot),
                                                        "-u", "cb6e8904-81ff-40da-a84a-07ab9ab5715e"],
                                                       stderr=subprocess.PIPE)
                    entry["ClevisConfig"] = {
                        "v": json.dumps(get_clevis_config_from_jwe(luksmeta.decode("utf-8")))
                    }
                except (subprocess.CalledProcessError, FileNotFoundError):
                    pass
            if slot not in slots:
                slots[slot] = entry
        if in_luks2_token_section:
            match = re.match(b"  ([0-9]+): clevis$", line)
            if match:
                try:
                    token = subprocess.check_output(["cryptsetup", "token", "export", dev, "--token-id", match.group(1)],
                                                    stderr=subprocess.PIPE)
                    token_object = json.loads(token.decode("utf-8"))
                    if token_object.get("type") == "clevis":
                        config = json.dumps(get_clevis_config_from_protected_header(token_object["jwe"]["protected"]))
                        for slot_str in token_object.get("keyslots", []):
                            slot = int(slot_str)
                            slots[slot] = {"Index": {"v": slot},
                                           "ClevisConfig": {"v": config}}
                except subprocess.CalledProcessError:
                    pass
    return {"version": version, "slots": list(slots.values()), "max_slots": max_slots}