from typing import Dict
from typing import List
from typing import Optional


def get_paratope_string(
    paratope_probs: Dict[str, List[tuple]],
    paratope_residue_threshold: Optional[float] = 0.67,
) -> str:

    """
    Returns paratope as a string for a given dictionary of CDRs.
    Non-paratope residues replaced with '-' and CDRs separated by spaces.
    """

    paratope_str = ""
    for cdr_name, cdr in paratope_probs.items():
        for res in cdr:
            if res[2] > paratope_residue_threshold:
                paratope_str += res[1]
            else:
                paratope_str += "-"
        paratope_str += " " * 4

    return paratope_str.rstrip()