def alphadump(d, indent=2, depth=0):
    """Dump a dict to a str,
    with keys in alphabetical order.
    """
    sep = "\n" + " " * depth * indent
    return "".join(
        (
            "{}: {}{}".format(
                k,
                alphadump(d[k], depth=depth + 1)
                if isinstance(d[k], dict)
                else str(d[k]),
                sep,
            )
            for k in sorted(d.keys())
        )
    )