Merge list of tuples into dict amap, and optionally load source as value

def merge(items, amap, load=False):

    """Merge list of tuples into dict amap, and optionally load source as value"""

    for target, source in items:
        if amap.get(target):
            logger.warn('overwriting {0}'.format(target))
        if load:
            amap[target] = open(source).read()
        else:
            amap[target] = source