def parse_sample_temperatures(arguments, samples):
    """Parse inverse temperatures for MCMC simulation
    with parallel-tempering.

    Parameters
    ----------
    arguments
        Parsed arguments containing the "mcmc_temperatures"
        argument and optionally the "sample_mcmc_temperatures"
        argument.
    samples : list
        List of samples.

    Returns
    -------
    sample_temperatures : dict
        Dict mapping each sample to a list of temperatures (floats).

    """
    assert hasattr(arguments, "mcmc_temperatures")
    # per sample mcmc temperatures
    sample_mcmc_temperatures = dict()
    if hasattr(arguments, "sample_mcmc_temperatures"):
        path = arguments.sample_mcmc_temperatures[0]
        if path:
            with open(path) as f:
                for line in f.readlines():
                    values = line.strip().split("\t")
                    sample = values[0]
                    temps = [float(v) for v in values[1:]]
                    temps.sort()
                    assert temps[0] > 0.0
                    assert temps[-1] <= 1.0
                    if temps[-1] != 1.0:
                        temps.append(1.0)
                    sample_mcmc_temperatures[sample] = temps

    # default mcmc temperatures
    temps = arguments.mcmc_temperatures
    temps.sort()
    assert temps[0] > 0.0
    assert temps[-1] <= 1.0
    if temps[-1] != 1.0:
        temps.append(1.0)
    for sample in samples:
        if sample in sample_mcmc_temperatures:
            pass
        else:
            sample_mcmc_temperatures[sample] = temps
    return sample_mcmc_temperatures