def dot_appended_param(param_key, reverse=False):
    """Returns ``param_key`` string, ensuring that it ends with ``'.'``.
    Set ``reverse`` to ``True`` (default ``False``) to reverse this behavior,
    ensuring that ``param_key`` *does not* end with ``'.'``.
    """
    if not param_key.endswith("."):
        # Ensure this enumerated param ends in '.'
        param_key += "."
    if reverse:
        # Since param_key is guaranteed to end with '.' by this point,
        # if `reverse` flag was set, now we just get rid of it.
        param_key = param_key[:-1]
    return param_key