from typing import Mapping


def make_dict(*args):
    """Combine all key/vals in *args into one dict with later values taking precedence

    Yanked from prom.utils on 6-7-2021

    https://docs.python.org/3/library/stdtypes.html#dict

    :params *args: dictionaries, or tuples (key, val) or lists of tuples to be
        combined into one dictionary
    :returns: dict
    """
    ret = {}

    for d in args:
        if isinstance(d, Mapping):
            ret.update(d)

        else:
            try:
                ret.update(dict(d))
            except ValueError:
                ret.update(dict([d]))

    return ret