<s> """<STR_LIT>""" <EOL> from docutils import nodes <EOL> from sphinx . util . nodes import clean_astext <EOL> def register_sections_as_label ( app , document ) : <EOL> labels = app . env . domaindata [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> anonlabels = app . env . domaindata [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> for node in document . traverse ( nodes . section ) : <EOL> name = nodes . fully_normalize_name ( node [ <NUM_LIT:0> ] . astext ( ) ) <EOL> labelid = node [ '<STR_LIT>' ] [ <NUM_LIT:0> ] <EOL> docname = app . env . docname <EOL> sectname = clean_astext ( node [ <NUM_LIT:0> ] ) <EOL> if name in labels : <EOL> app . env . warn_node ( '<STR_LIT>' % name + '<STR_LIT>' <EOL> '<STR_LIT>' + app . env . doc2path ( labels [ name ] [ <NUM_LIT:0> ] ) , node ) <EOL> anonlabels [ name ] = docname , labelid <EOL> labels [ name ] = docname , labelid , sectname <EOL> def setup ( app ) : <EOL> app . connect ( '<STR_LIT>' , register_sections_as_label ) </s>
