human
Complete this python program:
def _get_comment_callback(comment_data, thread_id, parent_id):
assistant
#Here is the Python program you requested.

    """Get a callback function that will return a comment containing the given data
    plus necessary dummy data, overridden by the content of the POST/PUT
    request.
    """
    def callback(request, _uri, headers):
        u'\n                                Simulate    the    comment    creation    or    update    endpoint    as    described    above.\n                                '
        response_data = make_minimal_cs_comment(comment_data)
        response_data[u'thread_id'] = thread_id
        response_data[u'parent_id'] = parent_id
        for (key, val_list) in request.parsed_body.items():
            val = val_list[0]
            if (key in [u'anonymous', u'anonymous_to_peers', u'endorsed']):
                response_data[key] = (val == u'True')
            else:
                response_data[key] = val
        return (200, headers, json.dumps(response_data))
    return callback