<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def doctree_read_handler(app, doctree):
 """ Add 'orphan' to metadata for partials :type app: sphinx.application.Sphinx :type doctree: docutils.nodes.document """

    # noinspection PyProtectedMember
    docname = sys._getframe(2).f_locals['docname']
    if docname.startswith('_partial'):
        app.env.metadata[docname]['orphan'] = True