'Construct the instance docstring with string substitutions.'

def _construct_doc(self, docdict, shapes_vals=None):

    tempdict = docdict.copy()
    tempdict['name'] = (self.name or 'distname')
    tempdict['shapes'] = (self.shapes or '')
    if (shapes_vals is None):
        shapes_vals = ()
    vals = ',    '.join((('%.3g' % val) for val in shapes_vals))
    tempdict['vals'] = vals
    tempdict['shapes_'] = (self.shapes or '')
    if (self.shapes and (self.numargs == 1)):
        tempdict['shapes_'] += ','
    if self.shapes:
        tempdict['set_vals_stmt'] = ('>>>    %s    =    %s' % (self.shapes, vals))
    else:
        tempdict['set_vals_stmt'] = ''
    if (self.shapes is None):
        for item in ['default', 'before_notes']:
            tempdict[item] = tempdict[item].replace('\n%(shapes)s    :    array_like\n                shape    parameters', '')
    for i in range(2):
        if (self.shapes is None):
            self.__doc__ = self.__doc__.replace('%(shapes)s,    ', '')
        self.__doc__ = doccer.docformat(self.__doc__, tempdict)
    self.__doc__ = self.__doc__.replace('(,    ', '(').replace(',    )', ')')
