parameters: (self)
docstring: Set document['title'] metadata title from the following
          sources, listed in order of priority:
  
          * Existing document['title'] attribute.
          * "title" setting.
          * Document title node (as promoted by promote_title).
docstring_summary: Set document['title'] metadata title from the following
          sources, listed in order of priority:
docstring_tokens: Set document [ title ] metadata title from the following sources listed in order of priority :
function: def set_metadata(self):
          """
          Set document['title'] metadata title from the following
          sources, listed in order of priority:
  
          * Existing document['title'] attribute.
          * "title" setting.
          * Document title node (as promoted by promote_title).
          """
          if not self.document.hasattr('title'):
              if self.document.settings.title is not None:
                  self.document['title'] = self.document.settings.title
              elif len(self.document) and isinstance(self.document[0], nodes.title):
                  self.document['title'] = self.document[0].astext()
function_tokens: def set_metadata ( self ) : if not self . document . hasattr ( 'title' ) : if self . document . settings . title is not None : self . document [ 'title' ] = self . document . settings . title elif len ( self . document ) and isinstance ( self . document [ 0 ] , nodes . title ) : self . document [ 'title' ] = self . document [ 0 ] . astext ( )