import copy


def get_topic_with_children(prefix, children):
    """
    Reuse the three-nodes sequence form sample_children to create a topic node.
    Modify `node_id`s and `content_id`s to make sure nodes are different.
    """
    topic = {
        "title": "Topic " + prefix,
        "node_id": prefix,
        "content_id": prefix + "_cid",
        "description": "The description of the " + prefix + " topic",
        "language": "en",
        "children": [],
    }
    children_copy = copy.deepcopy(children)
    for child in children_copy:
        child['node_id'] = prefix + '_' + child['node_id']
        child['content_id'] = prefix + '_' + child['content_id']
        child['title'] = child['title'] + ' (' + prefix + ')'
    topic['children'] = children_copy
    return topic