#NEWLINE# def __init__( self , docstr , template_order = False ) : #NEWLINE# #INDENT# '\n        Parameters:\n            docstr (Docstring or str): some existing docstring\n            template_order (bool, optional): iff True, reorder the\n                sections to match the order they appear in the template\n        ' #NEWLINE# if isinstance ( docstr , Docstring ) : #NEWLINE# #INDENT# self . sections = docstr . sections #NEWLINE# self . trailing_newlines = docstr . trailing_newlines #NEWLINE# if ( not isinstance ( docstr , type ( self ) ) ) : #NEWLINE# #INDENT# make_new_sec = self . SECTION_STYLE . from_section #NEWLINE# for ( sec_name , sec ) in docstr . sections . items ( ) : #NEWLINE# #INDENT# docstr . sections [ sec_name ] = make_new_sec ( sec ) #NEWLINE# #UNINDENT# if ( 'Parameters' in docstr . sections ) : #NEWLINE# #INDENT# self . get_section ( 'Parameters' ) . heading = self . PREFERRED_PARAMS_ALIAS #NEWLINE# for arg in self . get_section ( 'Parameters' ) . args . values ( ) : #NEWLINE# #INDENT# arg . meta [ 'indent' ] = self . get_section ( 'Parameters' ) . indent #NEWLINE# #UNINDENT# #UNINDENT# if ( 'Returns' in docstr . sections ) : #NEWLINE# #INDENT# for arg in self . get_section ( 'Returns' ) . args . values ( ) : #NEWLINE# #INDENT# arg . meta [ 'indent' ] = self . get_section ( 'Returns' ) . indent #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( docstr , string_types ) : #NEWLINE# #INDENT# if template_order : #NEWLINE# #INDENT# self . sections = self . TEMPLATE . copy ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . sections = OrderedDict ( ) #NEWLINE# #UNINDENT# self . _parse ( docstr )