def title_text(tag, parent_tag_name=None, p_parent_tag_name=None, direct_sibling_only=False):
title = None<EOL>title_tag = title_tag_inspected(tag, parent_tag_name, p_parent_tag_name, direct_sibling_only)<EOL>if title_tag:<EOL><INDENT>title = node_contents_str(title_tag)<EOL><DEDENT>return title<EOL>
Extract the text of a title tag and sometimes inspect its parents