def getArgumentDescriptions(f):
<EOL>argspec = inspect.getargspec(f)<EOL>docstring = f.__doc__<EOL>descriptions = {}<EOL>if docstring:<EOL><INDENT>lines = docstring.split('<STR_LIT:\n>')<EOL>i = <NUM_LIT:0><EOL>while i < len(lines):<EOL><INDENT>stripped = lines[i].lstrip()<EOL>if not stripped:<EOL><INDENT>i += <NUM_LIT:1><EOL>continue<EOL><DEDENT>indentLevel = lines[i].index(stripped[<NUM_LIT:0>])<EOL>firstWord = stripped.split()[<NUM_LIT:0>]<EOL>if firstWord.endswith('<STR_LIT::>'):<EOL><INDENT>firstWord = firstWord[:-<NUM_LIT:1>]<EOL><DEDENT>if firstWord in argspec.args:<EOL><INDENT>argName = firstWord<EOL>restOfLine = stripped[len(firstWord)+<NUM_LIT:1>:].strip()<EOL>argLines = [restOfLine]<EOL>i += <NUM_LIT:1><EOL>while i < len(lines):<EOL><INDENT>stripped = lines[i].lstrip()<EOL>if not stripped:<EOL><INDENT>break<EOL><DEDENT>if lines[i].index(stripped[<NUM_LIT:0>]) <= indentLevel:<EOL><INDENT>break<EOL><DEDENT>argLines.append(lines[i].strip())<EOL>i += <NUM_LIT:1><EOL><DEDENT>descriptions[argName] = '<STR_LIT:U+0020>'.join(argLines)<EOL><DEDENT>else:<EOL><INDENT>i += <NUM_LIT:1><EOL><DEDENT><DEDENT><DEDENT>args = []<EOL>if argspec.defaults:<EOL><INDENT>defaultCount = len(argspec.defaults)<EOL><DEDENT>else:<EOL><INDENT>defaultCount = <NUM_LIT:0><EOL><DEDENT>nonDefaultArgCount = len(argspec.args) - defaultCount<EOL>for i, argName in enumerate(argspec.args):<EOL><INDENT>if i >= nonDefaultArgCount:<EOL><INDENT>defaultValue = argspec.defaults[i - nonDefaultArgCount]<EOL>args.append((argName, descriptions.get(argName, "<STR_LIT>"), defaultValue))<EOL><DEDENT>else:<EOL><INDENT>args.append((argName, descriptions.get(argName, "<STR_LIT>")))<EOL><DEDENT><DEDENT>return args<EOL>
Get the arguments, default values, and argument descriptions for a function.

Parses the argument descriptions out of the function docstring, using a
format something lke this:

::

  [junk]
  argument_name:     description...
    description...
    description...
  [junk]
  [more arguments]

It will find an argument as long as the exact argument name starts the line.
It will then strip a trailing colon, if present, then strip the rest of the
line and use it to start the description. It will then strip and append any
subsequent lines with a greater indent level than the original argument name.

:param f: (function) to inspect
:returns: (list of tuples) (``argName``, ``argDescription``, ``defaultValue``)
  If an argument has no default value, the tuple is only two elements long (as
  ``None`` cannot be used, since it could be a default value itself).