#NEWLINE# def tag( bucket , doc ) : #NEWLINE# #INDENT# def wrapped( inner , **options ) : #NEWLINE# #INDENT# options [ bucket ] = 1 #NEWLINE# if ( 'name' in options ) : #NEWLINE# #INDENT# inner . __name__ = inner . name = options . pop ( 'name' ) #NEWLINE# #UNINDENT# if ( 'doc' in options ) : #NEWLINE# #INDENT# inner . __doc__ = inner . doc = options . pop ( 'doc' ) #NEWLINE# #UNINDENT# for i in options . items ( ) : #NEWLINE# #INDENT# setattr ( inner , * i ) #NEWLINE# #UNINDENT# inner . __doc__ = inner . doc = ( '%s\n%s' % ( inner . __doc__ , '' . join ( [ ( 'This is a :ref:`%s tag<%s-tags>`. ' % ( tag , tag ) ) for tag in settings . TAG_TYPES if ( hasattr ( inner , tag ) and ( str ( inner . __doc__ ) . find ( ( 'This is a :ref:`%s' % tag ) ) == ( - 1 ) ) ) ] ) ) ) #NEWLINE# return inner #NEWLINE# #UNINDENT# wrapped . __doc__ = doc #NEWLINE# return wrapped