def load_fault_selection_file(fault_selection_file):
    """
    Loads a fault selection file, returning a dictionary of fault:count pairs
    :param fault_selection_file: The relative or absolute path to the fault selection file
    :return: A dictionary of fault:count pairs for all faults found in the file
    """
    faults = {}
    with open(fault_selection_file) as fault_file:
        for lineno, line in enumerate(fault_file.readlines()):
            try:
                fault, count = line.split()
                if count.endswith("r"):
                    count = int(count[:-1])
                else:
                    count = int(count)
            except ValueError:
                raise ValueError(
                    "Error encountered on line {lineno} when loading fault selection file {fault_selection_file}. "
                    "Line content: {line}".format(
                        lineno=lineno,
                        fault_selection_file=fault_selection_file,
                        line=line,
                    )
                )
            if fault in faults.keys():
                raise ValueError(
                    "Fault {} has been found twice in the fault selection file, please check the file".format(
                        fault
                    )
                )
            faults.update({fault: count})

    return faults