def as_dict(maybe_element, key):
    """helps to regularize input into a dict.

    if ``maybe_element`` is not a dict, will return a dict with single
    key as ``{key:maybe_element}``, else will return ``maybe_element``.

    Args:
        maybe_element: a dict or any object.
        key : the sole key.

    Returns:
        dict: ensures to be a dict.

    Example:

    >>> assert as_dict({"k": "v"}, "k") == {"k": "v"}
    >>> assert as_dict("v", "k") == {"k": "v"}
    """
    if isinstance(maybe_element, dict):
        mustbe_dict = maybe_element
    else:
        mustbe_dict = {key: maybe_element}
    return mustbe_dict