def merge_dicts(*dict_args):
    """
        Given any number of dicts, shallow copy and merge into a new dict,
        precedence goes to key value pairs in later dicts:
        z = merge_dicts(a, b, c, d, e, f, g)
        i.e. key value pairs in g will take precedence over dicts a to f,
        and so on.
    """

    result = {}
    for dictionary in dict_args:
        result.update(dictionary)

    return result