def METHOD_NAME(
    token, count: int, prev_nfold: str | None, prev_axis: str | None, magnetic: bool = False
):
    pos = 0
    # improper
    improper = False
    if token[pos] == "-":
        pos += 1
        improper = True
    # nfold
    nfold = token[pos]
    pos += 1
    # change axis symbol for MHall
    if magnetic:
        prime_axis_symbol = "^"
    else:
        prime_axis_symbol = "'"
    # axis
    axis = ""
    if pos <= len(token) - 1:
        if token[pos] == prime_axis_symbol:
            axis = "p"
            pos += 1
        elif token[pos] in ['"', '=']:
            # "
            axis = "pp"
            pos += 1
    if pos <= len(token) - 1:
        if token[pos] in ["x", "y", "z", "*"]:
            axis = token[pos]
            pos += 1
    if (axis in ["p", "pp"]) and (prev_axis in ["x", "y", "z"]):
        # See Table A1.4.2.5
        axis = axis + prev_axis
    # No need to specify axis for nfold=1
    if nfold == "1":
        axis = "z"
    # Default axes. See A1.4.2.3.1
    if axis in ["", "p", "pp"]:
        if count == 0:
            # axis direction of c
            axis += "z"
        elif count == 1:
            if prev_nfold in ["2", "4"]:
                # axis direction of a
                axis += "x"
            elif prev_nfold in ["3", "6"]:
                # axis direction of a-b
                axis = "pz"
            else:
                raise ValueError("unreachable!")
        elif count == 2:
            if nfold == "3":
                # axis direction of a+b+c
                axis += "*"
            else:
                raise ValueError("unreachable!")
        else:
            raise ValueError("unreachable!")
    rotation = np.array(rotation_matrices[nfold + axis])
    if improper:
        rotation = -rotation
    # translation
    translation = np.zeros(3)
    while pos <= len(token) - 1:
        # translations are applied additively
        if token[pos] in "123456":
            # always along z-axis!
            translation = [0, 0, int(token[pos]) / abs(int(nfold))]
        elif token[pos] in "abcnuvwd":
            translation += translations[token[pos]]
        else:
            break
        pos += 1
    # For magnetic hall symbols
    time_reversal = False
    if magnetic and (pos < len(token)) and (token[pos] == "'"):
        pos += 1
        time_reversal = True
    assert pos == len(token)
    return rotation, translation, nfold, axis, time_reversal