def merge_result(command, res):
    """
    Merge all items in `res` into a list.

    This command is used when sending a command to multiple nodes
    and they result from each node should be merged into a single list.
    """
    if not isinstance(res, dict):
        raise ValueError('Value should be of dict type')
    result = set([])
    for _, v in res.items():
        for value in v:
            result.add(value)
    return list(result)
