The description is expected to be the command class' docstring.
161380
def get_description(cls) -> str:
        
        if cls.__doc__ is None:
            raise ValueError('No docstring found for {}'.format(cls.__name__))
        return cls.__doc__.strip()
537908
private static String buildShortDescription(String descriptionMarkup) {
    if (StringUtils.isBlank(descriptionMarkup)) {
      return null;
    }
    String text = Jsoup.parse(descriptionMarkup).text();
    if (StringUtils.isBlank(text)) {
      return null;
    }
    if (StringUtils.contains(text, ".")) {
      return StringUtils.substringBefore(text, ".") + ".";
    }
    else {
      return StringUtils.trim(text);
    }
  }
660045
function describe(ctx) {
  try {
    return ctx.operation.spec.method + ' ' +
      ctx.operation.resource.spec.path + ' ';
  } catch (err) {
    return '';
  }
}
1132278
private void createCommandDescription(Description descAnnotation) {
        setName(descAnnotation.name());
        setSummary(descAnnotation.summary());
        setMethods(descAnnotation.methods());
        setURI(descAnnotation.uri());
        setInputEntity(descAnnotation.inputEntity());
        setOutputEntity(descAnnotation.outputEntity());
        setPrivileged(descAnnotation.privileged());
        setVisibility(descAnnotation.visible());
    }
464232
def string(description: str, **kwargs) -> typing.Type:
    
    kwargs['description'] = description
    return type('String', (String,), kwargs)
104945
function DocAction(docStr) {
    return function (target, propertyKey, descriptor) {
        let m = exports.globalKCState.getOrInsertController(target.constructor).getOrInsertMethod(propertyKey);
        m.docString = docStr;
    };
}
1297429
function documentParam(param, paramDictionary, procedureOrService) {
    let typeString = getTypeStringFromCode(param.type, null, param);
    let name = getParamName(param);
    let options = {
        type: param.type,
        paramDictionary: paramDictionary,
        paramName: name
    };
    let description = getParamDescription(options);
    if (description !== '') {
        return ' * @param ' + typeString + ' ' + name + ' - ' + description;
    }
    return ' * @param ' + typeString + ' ' + name;
}
263683
def autocommand(func):
    
    name = func.__name__
    title, desc = command.parse_docstring(func)
    if not title:
        title = 'Auto command for: %s' % name
    if not desc:
        # Prevent Command from using docstring of AutoCommand
        desc = ' '
    return AutoCommand(title=title, desc=desc, name=name, func=func)
255522
function commandUsage(command, options, description) {
  return pkg.name + ' v' + pkg.version + ' - ' + description + 
  '\n\nUsage:\n  ' + pkg.name + ' ' + command + ' ' + options;
}
207595
def p_docstring_string(self, p):
        ''
        # Remove trailing whitespace on every line.
        p[0] = '\n'.join([line.rstrip() for line in p[1].split('\n')])
766516
def pack_command(command: str, **kwargs: Any) -> str:
    
    if not command:
        raise ValueError("Must provide a command")
    if not isinstance(command, str):
        raise ValueError("Command must be a string")
    command = command.upper()

    # ========================================================================
    # For each command, provide:
    #  1. a link to the definition in rfc2812
    #  2. the normalized grammar, which may not equate to the rfc grammar
    #     the normalized grammar will use the keys expected in kwargs,
    #     which usually do NOT line up with rfc2812.  They may also make
    #     optional fields which are required in rfc2812, by providing
    #     the most common or reasonable defaults.
    #  3. exhaustive examples, preferring normalized form of
    #     the rfc2812 examples
    # ========================================================================

    # ========================================================================
    # Normalized grammar:
    # : should not be provided; it denotes the beginning of the last
    #   field, which may contain spaces
    # [] indicates an optional field
    # <> denote the key that the field will be filled with
    # because fields are filled from a dict, required fields may follow
    #   optional fields - see USER command, where mode is optional
    #   (and defaults to 0)
    # "" indicates a literal value that is inserted if present
    # ========================================================================

    # PASS
    # https://tools.ietf.org/html/rfc2812#section-3.1.1
    # PASS <password>
    # ----------
    # PASS secretpasswordhere
    if command == "PASS":
        return "PASS " + f("password", kwargs)

    # NICK
    # https://tools.ietf.org/html/rfc2812#section-3.1.2
    # NICK <nick>
    # ----------
    # NICK Wiz
    elif command == "NICK":
        return "NICK " + f("nick", kwargs)

    # USER
    # https://tools.ietf.org/html/rfc2812#section-3.1.3
    # USER <user> [<mode>] :<realname>
    # ----------
    # USER guest 8 :Ronnie Reagan
    # USER guest :Ronnie Reagan
    elif command == "USER":
        return "USER {} {} * :{}".format(
            f("user", kwargs),
            f("mode", kwargs, 0),
            f("realname", kwargs))

    # OPER
    # https://tools.ietf.org/html/rfc2812#section-3.1.4
    # OPER <user> <password>
    # ----------
    # OPER AzureDiamond hunter2
    elif command == "OPER":
        return "OPER {} {}".format(f("user", kwargs), f("password", kwargs))

    # USERMODE (renamed from MODE)
    # https://tools.ietf.org/html/rfc2812#section-3.1.5
    # MODE <nick> [<modes>]
    # ----------
    # MODE WiZ -w
    # MODE Angel +i
    # MODE
    elif command == "USERMODE":
        return "MODE {} {}".format(f("nick", kwargs), f("modes", kwargs, ''))

    # SERVICE
    # https://tools.ietf.org/html/rfc2812#section-3.1.6
    # SERVICE <nick> <distribution> <type> :<info>
    # ----------
    # SERVICE dict *.fr 0 :French
    elif command == "SERVICE":
        return "SERVICE {} * {} {} 0 :{}".format(
            f("nick", kwargs),
            f("distribution", kwargs),
            f("type", kwargs),
            f("info", kwargs))

    # QUIT
    # https://tools.ietf.org/html/rfc2812#section-3.1.7
    # QUIT :[<message>]
    # ----------
    # QUIT :Gone to lunch
    # QUIT
    elif command == "QUIT":
        if "message" in kwargs:
            return "QUIT :" + f("message", kwargs)
        return "QUIT"

    # SQUIT
    # https://tools.ietf.org/html/rfc2812#section-3.1.8
    # SQUIT <server> [<message>]
    # ----------
    # SQUIT tolsun.oulu.fi :Bad Link
    # SQUIT tolsun.oulu.fi
    elif command == "SQUIT":
        base = "SQUIT " + f("server", kwargs)
        if "message" in kwargs:
            return base + " :" + f("message", kwargs)
        return base

    # JOIN
    # https://tools.ietf.org/html/rfc2812#section-3.2.1
    # JOIN <channel> [<key>]
    # ----------
    # JOIN #foo fookey
    # JOIN #foo
    # JOIN 0
    elif command == "JOIN":
        return "JOIN {} {}".format(pack("channel", kwargs),
                                   pack("key", kwargs, ''))

    # PART
    # https://tools.ietf.org/html/rfc2812#section-3.2.2
    # PART <channel> :[<message>]
    # ----------
    # PART #foo :I lost
    # PART #foo
    elif command == "PART":
        base = "PART " + pack("channel", kwargs)
        if "message" in kwargs:
            return base + " :" + f("message", kwargs)
        return base

    # CHANNELMODE (renamed from MODE)
    # https://tools.ietf.org/html/rfc2812#section-3.2.3
    # MODE <channel> <modes> [<params>]
    # ----------
    # MODE #Finnish +imI *!*@*.fi
    # MODE #en-ops +v WiZ
    # MODE #Fins -s
    elif command == "CHANNELMODE":
        return "MODE {} {} {}".format(f("channel", kwargs),
                                      f("modes", kwargs),
                                      f("params", kwargs, ''))

    # TOPIC
    # https://tools.ietf.org/html/rfc2812#section-3.2.4
    # TOPIC <channel> :[<message>]
    # ----------
    # TOPIC #test :New topic
    # TOPIC #test :
    # TOPIC #test
    elif command == "TOPIC":
        base = "TOPIC " + f("channel", kwargs)
        if "message" in kwargs:
            return base + " :" + f("message", kwargs)
        return base

    # NAMES
    # https://tools.ietf.org/html/rfc2812#section-3.2.5
    # NAMES [<channel>] [<target>]
    # ----------
    # NAMES #twilight_zone remote.*.edu
    # NAMES #twilight_zone
    # NAMES
    elif command == "NAMES":
        if "channel" in kwargs:
            return "NAMES {} {}".format(pack("channel", kwargs),
                                        f("target", kwargs, ''))
        return "NAMES"

    # LIST
    # https://tools.ietf.org/html/rfc2812#section-3.2.6
    # LIST [<channel>] [<target>]
    # ----------
    # LIST #twilight_zone remote.*.edu
    # LIST #twilight_zone
    # LIST
    elif command == "LIST":
        if "channel" in kwargs:
            return "LIST {} {}".format(pack("channel", kwargs),
                                       f("target", kwargs, ''))
        return "LIST"

    # INVITE
    # https://tools.ietf.org/html/rfc2812#section-3.2.7
    # INVITE <nick> <channel>
    # ----------
    # INVITE Wiz #Twilight_Zone
    elif command == "INVITE":
        return "INVITE {} {}".format(f("nick", kwargs),
                                     f("channel", kwargs))

    # KICK
    # https://tools.ietf.org/html/rfc2812#section-3.2.8
    # KICK <channel> <nick> :[<message>]
    # ----------
    # KICK #Finnish WiZ :Speaking English
    # KICK #Finnish WiZ,Wiz-Bot :Both speaking English
    # KICK #Finnish,#English WiZ,ZiW :Speaking wrong language
    elif command == "KICK":
        base = "KICK {} {}".format(pack("channel", kwargs),
                                   pack("nick", kwargs))
        if "message" in kwargs:
            return base + " :" + pack("message", kwargs)
        return base

    # PRIVMSG
    # https://tools.ietf.org/html/rfc2812#section-3.3.1
    # PRIVMSG <target> :<message>
    # ----------
    # PRIVMSG Angel :yes I'm receiving it !
    # PRIVMSG $*.fi :Server tolsun.oulu.fi rebooting.
    # PRIVMSG #Finnish :This message is in english
    elif command == "PRIVMSG":
        return "PRIVMSG {} :{}".format(f("target", kwargs),
                                       f("message", kwargs))

    # NOTICE
    # https://tools.ietf.org/html/rfc2812#section-3.3.2
    # NOTICE <target> :<message>
    # ----------
    # NOTICE Angel :yes I'm receiving it !
    # NOTICE $*.fi :Server tolsun.oulu.fi rebooting.
    # NOTICE #Finnish :This message is in english
    elif command == "NOTICE":
        return "NOTICE {} :{}".format(f("target", kwargs),
                                      f("message", kwargs))

    # MOTD
    # https://tools.ietf.org/html/rfc2812#section-3.4.1
    # MOTD [<target>]
    # ----------
    # MOTD remote.*.edu
    # MOTD
    elif command == "MOTD":
        return "MOTD " + f("target", kwargs, '')

    # LUSERS
    # https://tools.ietf.org/html/rfc2812#section-3.4.2
    # LUSERS [<mask>] [<target>]
    # ----------
    # LUSERS *.edu remote.*.edu
    # LUSERS *.edu
    # LUSERS
    elif command == "LUSERS":
        if "mask" in kwargs:
            return "LUSERS {} {}".format(f("mask", kwargs),
                                         f("target", kwargs, ''))
        return "LUSERS"

    # VERSION
    # https://tools.ietf.org/html/rfc2812#section-3.4.3
    # VERSION [<target>]
    # ----------
    # VERSION remote.*.edu
    # VERSION
    elif command == "VERSION":
        return "VERSION " + f("target", kwargs, '')

    # STATS
    # https://tools.ietf.org/html/rfc2812#section-3.4.4
    # STATS [<query>] [<target>]
    # ----------
    # STATS m remote.*.edu
    # STATS m
    # STATS
    elif command == "STATS":
        if "query" in kwargs:
            return "STATS {} {}".format(f("query", kwargs),
                                        f("target", kwargs, ''))
        return "STATS"

    # LINKS
    # https://tools.ietf.org/html/rfc2812#section-3.4.5
    # LINKS [<remote>] [<mask>]
    # ----------
    # LINKS *.edu *.bu.edu
    # LINKS *.au
    # LINKS
    elif command == "LINKS":
        if "remote" in kwargs:
            return "LINKS {} {}".format(f("remote", kwargs), f("mask", kwargs))
        elif "mask" in kwargs:
            return "LINKS " + f("mask", kwargs)
        return "LINKS"

    # TIME
    # https://tools.ietf.org/html/rfc2812#section-3.4.6
    # TIME [<target>]
    # ----------
    # TIME remote.*.edu
    # TIME
    elif command == "TIME":
        return "TIME " + f("target", kwargs, '')

    # CONNECT
    # https://tools.ietf.org/html/rfc2812#section-3.4.7
    # CONNECT <target> <port> [<remote>]
    # ----------
    # CONNECT tolsun.oulu.fi 6667 *.edu
    # CONNECT tolsun.oulu.fi 6667
    elif command == "CONNECT":
        return "CONNECT {} {} {}".format(f("target", kwargs),
                                         f("port", kwargs),
                                         f("remote", kwargs, ''))

    # TRACE
    # https://tools.ietf.org/html/rfc2812#section-3.4.8
    # TRACE [<target>]
    # ----------
    # TRACE
    elif command == "TRACE":
        return "TRACE " + f("target", kwargs, '')

    # ADMIN
    # https://tools.ietf.org/html/rfc2812#section-3.4.9
    # ADMIN [<target>]
    # ----------
    # ADMIN
    elif command == "ADMIN":
        return "ADMIN " + f("target", kwargs, '')

    # INFO
    # https://tools.ietf.org/html/rfc2812#section-3.4.10
    # INFO [<target>]
    # ----------
    # INFO
    elif command == "INFO":
        return "INFO " + f("target", kwargs, '')

    # SERVLIST
    # https://tools.ietf.org/html/rfc2812#section-3.5.1
    # SERVLIST [<mask>] [<type>]
    # ----------
    # SERVLIST *SERV 3
    # SERVLIST *SERV
    # SERVLIST
    elif command == "SERVLIST":
        return "SERVLIST {} {}".format(f("mask", kwargs, ''),
                                       f("type", kwargs, ''))

    # SQUERY
    # https://tools.ietf.org/html/rfc2812#section-3.5.2
    # SQUERY <target> :<message>
    # ----------
    # SQUERY irchelp :HELP privmsg
    elif command == "SQUERY":
        return "SQUERY {} :{}".format(f("target", kwargs),
                                      f("message", kwargs))

    # WHO
    # https://tools.ietf.org/html/rfc2812#section-3.6.1
    # WHO [<mask>] ["o"]
    # ----------
    # WHO jto* o
    # WHO *.fi
    # WHO
    elif command == "WHO":
        return "WHO {} {}".format(f("mask", kwargs, ''), b("o", kwargs))

    # WHOIS
    # https://tools.ietf.org/html/rfc2812#section-3.6.2
    # WHOIS <mask> [<target>]
    # ----------
    # WHOIS jto* o remote.*.edu
    # WHOIS jto* o
    # WHOIS *.fi
    elif command == "WHOIS":
        return "WHOIS {} {}".format(pack("mask", kwargs),
                                    f("target", kwargs, ''))

    # WHOWAS
    # https://tools.ietf.org/html/rfc2812#section-3.6.3
    # WHOWAS <nick> [<count>] [<target>]
    # ----------
    # WHOWAS Wiz 9 remote.*.edu
    # WHOWAS Wiz 9
    # WHOWAS Mermaid
    elif command == "WHOWAS":
        if "count" in kwargs:
            return "WHOWAS {} {} {}".format(pack("nick", kwargs),
                                            f("count", kwargs),
                                            f("target", kwargs, ''))
        return "WHOWAS " + pack("nick", kwargs)

    # KILL
    # https://tools.ietf.org/html/rfc2812#section-3.7.1
    # KILL <nick> :<message>
    # ----------
    # KILL WiZ :Spamming joins
    elif command == "KILL":
        return "KILL {} :{}".format(f("nick", kwargs), f("message", kwargs))

    # PING
    # https://tools.ietf.org/html/rfc2812#section-3.7.2
    # PING :[<message>]
    # ----------
    # PING :I'm still here
    # PING
    elif command == "PING":
        if "message" in kwargs:
            return "PING :{}".format(f("message", kwargs))
        else:
            return "PING"

    # PONG
    # https://tools.ietf.org/html/rfc2812#section-3.7.3
    # PONG :[<message>]
    # ----------
    # PONG :I'm still here
    # PONG
    elif command == "PONG":
        if "message" in kwargs:
            return "PONG :{}".format(f("message", kwargs))
        else:
            return "PONG"

    # AWAY
    # https://tools.ietf.org/html/rfc2812#section-4.1
    # AWAY :[<message>]
    # ----------
    # AWAY :Gone to lunch.
    # AWAY
    elif command == "AWAY":
        if "message" in kwargs:
            return "AWAY :" + f("message", kwargs)
        return "AWAY"

    # REHASH
    # https://tools.ietf.org/html/rfc2812#section-4.2
    # REHASH
    # ----------
    # REHASH
    elif command == "REHASH":
        return "REHASH"

    # DIE
    # https://tools.ietf.org/html/rfc2812#section-4.3
    # DIE
    # ----------
    # DIE
    elif command == "DIE":
        return "DIE"

    # RESTART
    # https://tools.ietf.org/html/rfc2812#section-4.4
    # RESTART
    # ----------
    # RESTART
    elif command == "RESTART":
        return "RESTART"

    # SUMMON
    # https://tools.ietf.org/html/rfc2812#section-4.5
    # SUMMON <nick> [<target>] [<channel>]
    # ----------
    # SUMMON Wiz remote.*.edu #Finnish
    # SUMMON Wiz remote.*.edu
    # SUMMON Wiz
    elif command == "SUMMON":
        if "target" in kwargs:
            return "SUMMON {} {} {}".format(f("nick", kwargs),
                                            f("target", kwargs),
                                            f("channel", kwargs, ''))
        return "SUMMON " + f("nick", kwargs)

    # USERS
    # https://tools.ietf.org/html/rfc2812#section-4.6
    # USERS [<target>]
    # ----------
    # USERS remote.*.edu
    # USERS
    elif command == "USERS":
        return "USERS " + f("target", kwargs, '')

    # WALLOPS
    # https://tools.ietf.org/html/rfc2812#section-4.7
    # WALLOPS :<message>
    # ----------
    # WALLOPS :Maintenance in 5 minutes
    elif command == "WALLOPS":
        return "WALLOPS :" + f("message", kwargs)

    # USERHOST
    # https://tools.ietf.org/html/rfc2812#section-4.8
    # USERHOST <nick>
    # ----------
    # USERHOST Wiz Michael syrk
    # USERHOST syrk
    elif command == "USERHOST":
        return "USERHOST " + pack("nick", kwargs, sep=" ")

    # ISON
    # https://tools.ietf.org/html/rfc2812#section-4.9
    # ISON <nick>
    # ----------
    # ISON Wiz Michael syrk
    # ISON syrk
    elif command == "ISON":
        return "ISON " + pack("nick", kwargs, sep=" ")

    else:
        raise ValueError("Unknown command '{}'".format(command))
871611
def rpc_get_oneline_docstring(self, filename, source, offset):
        """"""
        line, column = pos_to_linecol(source, offset)
        definitions = run_with_debug(jedi, 'goto_definitions',
                                     source=source, line=line, column=column,
                                     path=filename, encoding='utf-8')
        assignments = run_with_debug(jedi, 'goto_assignments',
                                     source=source, line=line, column=column,
                                     path=filename, encoding='utf-8')
        if definitions:
            definition = definitions[0]
        else:
            definition = None
        if assignments:
            assignment = assignments[0]
        else:
            assignment = None
        if definition:
            # Get name
            if definition.type in ['function', 'class']:
                raw_name = definition.name
                name = '{}()'.format(raw_name)
                doc = definition.docstring().split('\n')
            elif definition.type in ['module']:
                raw_name = definition.name
                name = '{} {}'.format(raw_name, definition.type)
                doc = definition.docstring().split('\n')
            elif (definition.type in ['instance']
                  and hasattr(assignment, "name")):
                raw_name = assignment.name
                name = raw_name
                doc = assignment.docstring().split('\n')
            else:
                return None
            # Keep only the first paragraph that is not a function declaration
            lines = []
            call = "{}(".format(raw_name)
            # last line
            doc.append('')
            for i in range(len(doc)):
                if doc[i] == '' and len(lines) != 0:
                    paragraph = " ".join(lines)
                    lines = []
                    if call != paragraph[0:len(call)]:
                        break
                    paragraph = ""
                    continue
                lines.append(doc[i])
            # Keep only the first sentence
            onelinedoc = paragraph.split('. ', 1)
            if len(onelinedoc) == 2:
                onelinedoc = onelinedoc[0] + '.'
            else:
                onelinedoc = onelinedoc[0]
            if onelinedoc == '':
                onelinedoc = "No documentation"
            return {"name": name,
                    "doc": onelinedoc}
        return None
349563
def parse_docstring(docstring, cls=None):
    
    def_arg_dict = lambda: {'description': None,
                            'type_name': None,
                            'required': False,
                            }
    description, fields_lines = split_docstring(docstring)
    arguments_dict = defaultdict(def_arg_dict)
    return_value_types = []
    #parse fields
    return_description = ''
    for docstring_line in fields_lines:
        if _ignored_field(docstring_line):
            continue
        #parse inherits
        if docstring_line.startswith('@inherits'):
            if not cls:
                raise MethodParsingException()
            inherit_tmp = docstring_line.split(None, 1)[1]
            inherit_str = inherit_tmp.split(':class:', 1)[1]
            result = _parse_inherit(cls, inherit_str)

            description = description or result['description']
            for arg_name, update_dict in result['arguments'].items():
                arguments_dict[arg_name].update(update_dict)
            return_value_types = result['return']['type_name']
            return_description = result['return']['description']
        #parse return value
        elif docstring_line.startswith(':rtype:'):
            class_name = __get_class_name(cls)
            types_str = docstring_line.split(None, 1)[1]
            return_value_types = types_str.replace('\n', '').strip(':').strip()
            if return_value_types.startswith('class:`.'):
                return_value_types = return_value_types.replace('class:`.', 'class:`'+class_name+'.')
        #parse return description
        elif docstring_line.startswith(':return:'):
            return_description = docstring_line.split(None, 1)[1].strip()
        #parse arguments
        else:
            arg_name, update_dict = _parse_docstring_field(cls, docstring_line)
            arguments_dict[arg_name].update(update_dict)
    #check fields
    _check_arguments_dict(arguments_dict)
    if not return_value_types:
        raise MethodParsingException('Can not get return types for method')
    return {'description': description,
            'arguments': arguments_dict,
            'return': {'description': return_description,
                       'type_name': return_value_types}}
464497
def is_docstring(self, node):
        """"""
        return isinstance(node, ast.Str) or (isinstance(node, ast.Expr) and
                                             isinstance(node.value, ast.Str))
1332676
def generate_docstring(operation_name):
        

        if operation_name in Operation._docstring_cache:
            return Operation._docstring_cache[operation_name]

        op = Operation.new_from_name(operation_name)
        if (op.get_flags() & _OPERATION_DEPRECATED) != 0:
            raise Error('No such operator.',
                        'operator "{0}" is deprecated'.format(operation_name))

        # we are only interested in non-deprecated args
        args = [[name, flags] for name, flags in op.get_args()
                if not flags & _DEPRECATED]

        # find the first required input image arg, if any ... that will be self
        member_x = None
        for name, flags in args:
            if ((flags & _INPUT) != 0 and
                    (flags & _REQUIRED) != 0 and
                    op.get_typeof(name) == GValue.image_type):
                member_x = name
                break

        required_input = [name for name, flags in args
                          if (flags & _INPUT) != 0 and
                          (flags & _REQUIRED) != 0 and
                          name != member_x]

        optional_input = [name for name, flags in args
                          if (flags & _INPUT) != 0 and
                             (flags & _REQUIRED) == 0]

        required_output = [name for name, flags in args
                           if ((flags & _OUTPUT) != 0 and
                               (flags & _REQUIRED) != 0) or
                              ((flags & _INPUT) != 0 and
                               (flags & _REQUIRED) != 0 and
                               (flags & _MODIFY) != 0)]

        optional_output = [name for name, flags in args
                           if (flags & _OUTPUT) != 0 and
                              (flags & _REQUIRED) == 0]

        description = op.get_description()
        result = description[0].upper() + description[1:] + ".\n\n"
        result += "Example:\n"

        result += "   " + ", ".join(required_output) + " = "
        if member_x is not None:
            result += member_x + "." + operation_name + "("
        else:
            result += "pyvips.Image." + operation_name + "("

        result += ", ".join(required_input)
        if len(optional_input) > 0 and len(required_input) > 0:
            result += ", "
        result += ", ".join([x + " = " +
                             GValue.gtype_to_python(op.get_typeof(x))
                             for x in optional_input])
        result += ")\n"

        def argstr(name):
            return (u'    {0} ({1}): {2}\n'.
                    format(name,
                           GValue.gtype_to_python(op.get_typeof(name)),
                           op.get_blurb(name)))

        result += "\nReturns:\n"
        for name in required_output:
            result += argstr(name)

        names = []
        if member_x is not None:
            names += [member_x]
        names += required_input

        result += "\nArgs:\n"
        for name in names:
            result += argstr(name)

        if len(optional_input) > 0:
            result += "\nKeyword args:\n"
            for name in optional_input:
                result += argstr(name)

        if len(optional_output) > 0:
            result += "\nOther Parameters:\n"
            for name in optional_output:
                result += argstr(name)

        result += "\nRaises:\n    :class:`.Error`\n"

        # add to cache to save building again
        Operation._docstring_cache[operation_name] = result

        return result
975095
def _add_to_docstring(string):
    '''

    '''
    def wrapper(method):
        if method.__doc__ is not None:
            method.__doc__ += string
        else:
            method.__doc__ = string
        return method
    return wrapper
34045
public int commandToDocType(String strCommand)  // Standard file maint for this record (returns new record)
    {
        int iDocMode = ScreenConstants.MAINT_MODE;
        if ((MenuConstants.FORM.equalsIgnoreCase(strCommand))
            || (MenuConstants.FORMLINK.equalsIgnoreCase(strCommand)))
                iDocMode = ScreenConstants.MAINT_MODE;
        else if ((MenuConstants.LOOKUP.equalsIgnoreCase(strCommand))
            || (MenuConstants.LOOKUPCLONE.equalsIgnoreCase(strCommand)))
                iDocMode = ScreenConstants.DISPLAY_MODE;
        else if (MenuConstants.FORMDETAIL.equalsIgnoreCase(strCommand))
            iDocMode = ScreenConstants.DISPLAY_MODE | 64;
        else if (MenuConstants.POST.equalsIgnoreCase(strCommand))
            iDocMode = ScreenConstants.DISPLAY_MODE | 128;
        else if (MenuConstants.MENUREC.equalsIgnoreCase(strCommand))
            iDocMode = ScreenConstants.MENU_MODE;
        return iDocMode;
    }