code: def get_method_documentation(method):
      from inspect import getargspec
      result = {
          'name': method.__name__,
          'friendly_name': ' '.join([name.capitalize() for name in method.__name__.split('_')]),
      }
      arg_specs = getargspec(method)
      arguments = {}
      if not arg_specs.defaults:
          if len(arg_specs.args[1:]) > 0:
              arguments['required'] = list(arg_specs.args[1:])
      else:
          if len(arg_specs.args[1:-(len(arg_specs.defaults))]):
              arguments['required'] = list(arg_specs.args[1:-(len(arg_specs.defaults))])
          arguments['optional'] = {}
          for i in range(len(arg_specs.defaults)):
              arguments['optional'][arg_specs.args[-(len(arg_specs.defaults)) + i]] = arg_specs.defaults[i]
      if arguments != {}:
          result['parameters'] = arguments
      doc = method.__doc__.strip() if method.__doc__ else ''
      if ':' in method.__doc__:
          doc = {'summary': method.__doc__[0:doc.find('  :')].strip()}
          params = re.findall(r":param ([^\s]*): (.*)\n", method.__doc__)
          if len(params) > 0:
              doc['parameters'] = {}
              for param in params:
                  doc['parameters'][param[0]] = param[1].strip()
          regex = re.compile(r":returns:(.*)", re.MULTILINE | re.DOTALL)
          returns = regex.search(method.__doc__)
          if returns and returns.group(0):
              doc['return'] = returns.group(0).replace(':returns:', '').replace('\n        ', '\n').strip()
      if doc != '':
          result['help'] = doc
      return result