<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def extend(*args):
 """shallow dictionary merge Args: a: dict to extend b: dict to apply to a Returns: new instance of the same type as _a_, with _a_ and _b_ merged. """

    if not args:
        return {}

    first = args[0]
    rest = args[1:]
    out = type(first)(first)
    for each in rest:
        out.update(each)
    return out