from typing import Dict
from typing import Any


def create_mesa_dir_name(comb: Dict[str, Any]) -> str:
    """
    Creates a MESA run dir name to use for the given combination of MESA
    parameter values. These prefixes should be unique for each MESA run.

    This also needs to be deterministic, reguardless of the fact that the dict
    passed in is unordered.

    >>> create_mesa_dir_name({"a": 2, "c": 3, "b": "hi"})
    'mesa_a_2__b_hi__c_3__'
    """
    dir_name = "mesa_"
    for key in sorted(comb.keys()):
        dir_name += key + "_" + str(comb[key]) + "__"

    return dir_name