def _generate_docstring_for_func(self, namespace, arg_data_type,<EOL>result_data_type=None, error_data_type=None,<EOL>overview=None, extra_request_args=None,<EOL>extra_return_arg=None, footer=None):
fields = [] if is_void_type(arg_data_type) else arg_data_type.fields<EOL>if not fields and not overview:<EOL><INDENT>return<EOL><DEDENT>self.emit('<STR_LIT>')<EOL>if overview:<EOL><INDENT>self.emit_wrapped_text(overview)<EOL><DEDENT>if extra_request_args or fields:<EOL><INDENT>if overview:<EOL><INDENT>self.emit()<EOL><DEDENT>if extra_request_args:<EOL><INDENT>for name, data_type_name, doc in extra_request_args:<EOL><INDENT>if data_type_name:<EOL><INDENT>field_doc = '<STR_LIT>'.format(data_type_name,<EOL>name, doc)<EOL>self.emit_wrapped_text(field_doc,<EOL>subsequent_prefix='<STR_LIT:U+0020>')<EOL><DEDENT>else:<EOL><INDENT>self.emit_wrapped_text(<EOL>'<STR_LIT>'.format(name, doc),<EOL>subsequent_prefix='<STR_LIT:U+0020>')<EOL><DEDENT><DEDENT><DEDENT>if is_struct_type(arg_data_type):<EOL><INDENT>for field in fields:<EOL><INDENT>if field.doc:<EOL><INDENT>if is_user_defined_type(field.data_type):<EOL><INDENT>field_doc = '<STR_LIT>'.format(<EOL>field.name, self.process_doc(field.doc, self._docf))<EOL><DEDENT>else:<EOL><INDENT>field_doc = '<STR_LIT>'.format(<EOL>self._format_type_in_doc(namespace, field.data_type),<EOL>field.name,<EOL>self.process_doc(field.doc, self._docf),<EOL>)<EOL><DEDENT>self.emit_wrapped_text(<EOL>field_doc, subsequent_prefix='<STR_LIT:U+0020>')<EOL>if is_user_defined_type(field.data_type):<EOL><INDENT>self.emit('<STR_LIT>'.format(<EOL>field.name,<EOL>self._format_type_in_doc(namespace, field.data_type),<EOL>))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>field_doc = '<STR_LIT>'.format(<EOL>field.name,<EOL>self._format_type_in_doc(namespace, field.data_type),<EOL>)<EOL>self.emit_wrapped_text(field_doc)<EOL><DEDENT><DEDENT><DEDENT>elif is_union_type(arg_data_type):<EOL><INDENT>if arg_data_type.doc:<EOL><INDENT>self.emit_wrapped_text('<STR_LIT>'.format(<EOL>self.process_doc(arg_data_type.doc, self._docf)),<EOL>subsequent_prefix='<STR_LIT:U+0020>')<EOL><DEDENT>self.emit('<STR_LIT>'.format(<EOL>self._format_type_in_doc(namespace, arg_data_type)))<EOL><DEDENT><DEDENT>if overview and not (extra_request_args or fields):<EOL><INDENT>self.emit()<EOL><DEDENT>if extra_return_arg:<EOL><INDENT>args = []<EOL>if is_void_type(result_data_type):<EOL><INDENT>args.append('<STR_LIT:None>')<EOL><DEDENT>else:<EOL><INDENT>rtype = self._format_type_in_doc(namespace,<EOL>result_data_type)<EOL>args.append(rtype)<EOL><DEDENT>args.append(extra_return_arg)<EOL>self.generate_multiline_list(args, '<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>if is_void_type(result_data_type):<EOL><INDENT>self.emit('<STR_LIT>')<EOL><DEDENT>else:<EOL><INDENT>rtype = self._format_type_in_doc(namespace, result_data_type)<EOL>self.emit('<STR_LIT>'.format(rtype))<EOL><DEDENT><DEDENT>if not is_void_type(error_data_type) and error_data_type.fields:<EOL><INDENT>self.emit('<STR_LIT>'.format(self.args.error_class_path))<EOL>self.emit()<EOL>error_class_name = self.args.error_class_path.rsplit('<STR_LIT:.>', <NUM_LIT:1>)[-<NUM_LIT:1>]<EOL>self.emit('<STR_LIT>'.format(error_class_name))<EOL>with self.indent():<EOL><INDENT>self.emit(self._format_type_in_doc(namespace, error_data_type))<EOL><DEDENT><DEDENT>if footer:<EOL><INDENT>self.emit()<EOL>self.emit_wrapped_text(footer)<EOL><DEDENT>self.emit('<STR_LIT>')<EOL>
Generates a docstring for a function or method.

This function is versatile. It will create a docstring using all the
data that is provided.

:param arg_data_type: The data type describing the argument to the
    route. The data type should be a struct, and each field will be
    treated as an input parameter of the method.
:param result_data_type: The data type of the route result.
:param error_data_type: The data type of the route result in the case
    of an error.
:param str overview: A description of the route that will be located
    at the top of the docstring.
:param extra_request_args: [(field name, field type, field doc), ...]
    Describes any additional parameters for the method that aren't a
    field in arg_data_type.
:param str extra_return_arg: Name of an additional return type that. If
    this is specified, it is assumed that the return of the function
    will be a tuple of return_data_type and extra_return-arg.
:param str footer: Additional notes at the end of the docstring.