<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def merged_args_dicts(global_args, subcommand_args):
    '''We deal with docopt args from the toplevel peru parse and the subcommand
    parse. We don't want False values for a flag in the subcommand to override
    True values if that flag was given at the top level. This function
    specifically handles that case.'''
    merged = global_args.copy()
    for key, val in subcommand_args.items():
        if key not in merged:
            merged[key] = val
        elif type(merged[key]) is type(val) is bool:
            merged[key] = merged[key] or val
        else:
            raise RuntimeError("Unmergable args.")
    return merged