(self)
return "\n".join(lines)
Generates a docstring.
Generates a docstring.
Generates a docstring .
def docstring(self):
    """Generates a docstring."""
    indent = codegen_util.Indenter()
    lines = textwrap.wrap(self.comment, width=80)
    if self.arguments:
      lines.append("\nArgs:")
      with indent:
        for a in self.arguments.values():
          s = "{a.name}: {a.arg}{const}".format(
              a=a, const=(" <const>" if a.is_const else ""))
          lines.append(indent(s))
    if self.return_value:
      lines.append("\nReturns:")
      with indent:
        lines.append(indent(self.return_value.arg))
    lines.append("")  # Force a newline at the end of the docstring.
    return "\n".join(lines)
def docstring ( self ) : indent = codegen_util . Indenter ( ) lines = textwrap . wrap ( self . comment , width = 80 ) if self . arguments : lines . append ( "\nArgs:" ) with indent : for a in self . arguments . values ( ) : s = "{a.name}: {a.arg}{const}" . format ( a = a , const = ( " <const>" if a . is_const else "" ) ) lines . append ( indent ( s ) ) if self . return_value : lines . append ( "\nReturns:" ) with indent : lines . append ( indent ( self . return_value . arg ) ) lines . append ( "" ) # Force a newline at the end of the docstring. return "\n" . join ( lines )