human
What is a the Python code you requested given the following:
Complete the below
def get_annotated_content_infos(course_id, thread, user, user_info):

    ''''Get metadata for a thread and its children'
    '''
assistant
#Here is the Python code you requested.
    infos = {}
    def annotate(content):
        infos[str(content['id'])] = get_annotated_content_info(course_id, content, user, user_info)
        for child in ((content.get('children', []) + content.get('endorsed_responses', [])) + content.get('non_endorsed_responses', [])):
            annotate(child)
    annotate(thread)
    return infos