def body_block_title_label_caption(tag_content, title_value, label_value,<EOL>caption_content, set_caption=True, prefer_title=False, prefer_label=False):
set_if_value(tag_content, "<STR_LIT:label>", rstrip_punctuation(label_value))<EOL>set_if_value(tag_content, "<STR_LIT:title>", title_value)<EOL>if set_caption is True and caption_content and len(caption_content) > <NUM_LIT:0>:<EOL><INDENT>tag_content["<STR_LIT>"] = caption_content<EOL><DEDENT>if prefer_title:<EOL><INDENT>if "<STR_LIT:title>" not in tag_content and label_value:<EOL><INDENT>set_if_value(tag_content, "<STR_LIT:title>", label_value)<EOL>del(tag_content["<STR_LIT:label>"])<EOL><DEDENT><DEDENT>if prefer_label:<EOL><INDENT>if "<STR_LIT:label>" not in tag_content and title_value:<EOL><INDENT>set_if_value(tag_content, "<STR_LIT:label>", rstrip_punctuation(title_value))<EOL>del(tag_content["<STR_LIT:title>"])<EOL><DEDENT><DEDENT>
set the title, label and caption values in a consistent way

    set_caption: insert a "caption" field
    prefer_title: when only one value is available, set title rather than label. If False, set label rather than title