def get_pint_to_fortran_safe_units_mapping(inverse=False):
replacements = {"<STR_LIT>": "<STR_LIT>", "<STR_LIT:/>": "<STR_LIT>", "<STR_LIT:U+0020>": "<STR_LIT>"}<EOL>if inverse:<EOL><INDENT>replacements = {v: k for k, v in replacements.items()}<EOL>replacements.pop("<STR_LIT>")<EOL><DEDENT>return replacements<EOL>
Get the mappings from Pint to Fortran safe units.

    Fortran can't handle special characters like "^" or "/" in names, but we need
    these in Pint. Conversely, Pint stores variables with spaces by default e.g. "Mt
    CO2 / yr" but we don't want these in the input files as Fortran is likely to think
    the whitespace is a delimiter.

    Parameters
    ----------
    inverse : bool
        If True, return the inverse mappings i.e. Fortran safe to Pint mappings

    Returns
    -------
    dict
        Dictionary of mappings