def get_sphinx_doc(<EOL>self,<EOL>name,<EOL>depth=None,<EOL>exclude=None,<EOL>width=<NUM_LIT>,<EOL>error=False,<EOL>raised=False,<EOL>no_comment=False,<EOL>):
<EOL>if depth and (<EOL>(not isinstance(depth, int)) or (isinstance(depth, int) and (depth < <NUM_LIT:0>))<EOL>):<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>if exclude and (<EOL>(not isinstance(exclude, list))<EOL>or (<EOL>isinstance(exclude, list)<EOL>and any([not isinstance(item, str) for item in exclude])<EOL>)<EOL>):<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>if (not isinstance(width, int)) or (<EOL>isinstance(width, int) and (width < _MINWIDTH)<EOL>):<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>if not isinstance(error, bool):<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>if not isinstance(raised, bool):<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>if not isinstance(no_comment, bool):<EOL><INDENT>raise RuntimeError("<STR_LIT>")<EOL><DEDENT>depth = self._depth if depth is None else depth<EOL>exclude = self._exclude if not exclude else exclude<EOL>callable_dict = {}<EOL>prop = False<EOL>instances = self._tobj.search_tree(name)<EOL>if instances:<EOL><INDENT>callable_dict[name] = {"<STR_LIT:type>": "<STR_LIT>", "<STR_LIT>": instances}<EOL><DEDENT>else:<EOL><INDENT>for action in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>prop_name = "<STR_LIT>".format(name=name, action=action)<EOL>instances = self._tobj.search_tree(prop_name)<EOL>if instances:<EOL><INDENT>callable_dict[prop_name] = {"<STR_LIT:type>": action, "<STR_LIT>": instances}<EOL>prop = True<EOL><DEDENT><DEDENT><DEDENT>if error and (not callable_dict):<EOL><INDENT>raise RuntimeError(<EOL>"<STR_LIT>".format(callable=name)<EOL>)<EOL><DEDENT>if not callable_dict:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>sep = self._tobj.node_separator<EOL>dkeys = []<EOL>for key, name_dict in callable_dict.items():<EOL><INDENT>exlist = []<EOL>for callable_root in name_dict["<STR_LIT>"]:<EOL><INDENT>rlevel = callable_root[: callable_root.index(name)].count(sep)<EOL>nodes = self._tobj.get_subtree(callable_root)<EOL>tnodes = [(node, sep.join(node.split(sep)[rlevel:])) for node in nodes]<EOL>for fnode, rnode in tnodes:<EOL><INDENT>data = self._tobj._get_data(fnode)<EOL>if (<EOL>data<EOL>and (<EOL>(depth is None)<EOL>or ((depth is not None) and (rnode.count(sep) <= depth))<EOL>)<EOL>and (<EOL>(not exclude)<EOL>or (not any([item in rnode for item in exclude]))<EOL>)<EOL>):<EOL><INDENT>for exc in data:<EOL><INDENT>msg = self._process_exlist(exc, raised)<EOL>if msg is not None:<EOL><INDENT>exlist.append(msg)<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>if exlist:<EOL><INDENT>name_dict["<STR_LIT>"] = list(set(exlist[:]))<EOL><DEDENT>else:<EOL><INDENT>dkeys.append(key)<EOL><DEDENT><DEDENT>for key in dkeys:<EOL><INDENT>del callable_dict[key]<EOL><DEDENT>if not callable_dict:<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>if no_comment:<EOL><INDENT>exoutput = ["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>template = "<STR_LIT>"<EOL>exoutput = [<EOL>_format_msg(template.format(callable=name), width, prefix="<STR_LIT>")<EOL>]<EOL>exoutput.extend(["<STR_LIT>"])<EOL><DEDENT>desc_dict = {"<STR_LIT>": "<STR_LIT>", "<STR_LIT>": "<STR_LIT>", "<STR_LIT>": "<STR_LIT>"}<EOL>if prop:<EOL><INDENT>if len(callable_dict) == <NUM_LIT:1>:<EOL><INDENT>callable_root = next(iter(callable_dict))<EOL>action = callable_dict[callable_root]["<STR_LIT:type>"]<EOL>desc = desc_dict[action]<EOL>exlist = set(callable_dict[callable_root]["<STR_LIT>"])<EOL>exlength = len(exlist)<EOL>indent = <NUM_LIT:1> if exlength == <NUM_LIT:1> else <NUM_LIT:3><EOL>template = "<STR_LIT>".format(action=desc)<EOL>prefix = (template.strip() + "<STR_LIT:U+0020>") if exlength == <NUM_LIT:1> else "<STR_LIT>"<EOL>fexlist = [<EOL>_format_msg(<EOL>"<STR_LIT>".format(prefix=prefix, name=name), width, indent<EOL>)<EOL>for name in sorted(list(exlist))<EOL>]<EOL>exoutput.extend(<EOL>[(template if exlength > <NUM_LIT:1> else "<STR_LIT>") + "<STR_LIT>".join(fexlist)]<EOL>)<EOL><DEDENT>else:<EOL><INDENT>exoutput.append("<STR_LIT>")<EOL>for action in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>desc = desc_dict[action]<EOL>for callable_root in callable_dict:<EOL><INDENT>if callable_dict[callable_root]["<STR_LIT:type>"] == action:<EOL><INDENT>exlist = set(callable_dict[callable_root]["<STR_LIT>"])<EOL>fexlist = [<EOL>_format_msg("<STR_LIT>".format(name=name), width, <NUM_LIT:5>)<EOL>for name in sorted(list(exlist))<EOL>]<EOL>exoutput.extend(<EOL>[<EOL>"<STR_LIT>".format(action=desc)<EOL>+ "<STR_LIT>".join(fexlist)<EOL>+ "<STR_LIT:\n>"<EOL>]<EOL>)<EOL><DEDENT><DEDENT><DEDENT><DEDENT><DEDENT>else:<EOL><INDENT>exlist = set(callable_dict[next(iter(callable_dict))]["<STR_LIT>"])<EOL>exlength = len(exlist)<EOL>indent = <NUM_LIT:1> if exlength == <NUM_LIT:1> else <NUM_LIT:3><EOL>prefix = "<STR_LIT>" if exlength == <NUM_LIT:1> else "<STR_LIT>"<EOL>fexlist = [<EOL>_format_msg(<EOL>"<STR_LIT>".format(prefix=prefix, name=name), width, indent<EOL>)<EOL>for name in sorted(list(exlist))<EOL>]<EOL>exoutput.extend(<EOL>[("<STR_LIT>" if exlength > <NUM_LIT:1> else "<STR_LIT>") + "<STR_LIT>".join(fexlist)]<EOL>)<EOL><DEDENT>exoutput[-<NUM_LIT:1>] = "<STR_LIT>".format(line=exoutput[-<NUM_LIT:1>].rstrip())<EOL>return ("<STR_LIT:\n>".join(exoutput)) if exoutput else "<STR_LIT>"<EOL>
r"""
        Return an exception list marked up in `reStructuredText`_.

        :param name: Name of the callable (method, function or class
                     property) to generate exceptions documentation for
        :type  name: string

        :param depth: Hierarchy levels to include in the exceptions
                      list (overrides default **depth** argument; see
                      :py:attr:`pexdoc.ExDoc.depth`). If None exceptions
                      at all depths are included
        :type  depth: non-negative integer or None

        :param exclude: List of (potentially partial) module and
                        callable names to exclude from exceptions list
                        (overrides default **exclude** argument; see
                        :py:attr:`pexdoc.ExDoc.exclude`). If None all
                        callables are included
        :type  exclude: list of strings or None

        :param width: Maximum width of the lines of text (minimum 40)
        :type  width: integer

        :param error: Flag that indicates whether an exception should
                      be raised if the callable is not found in the callables
                      exceptions database (True) or not (False)
        :type  error: boolean

        :param raised: Flag that indicates whether only exceptions that
                       were raised (and presumably caught) should be
                       documented (True) or all registered exceptions
                       should be documented (False)
        :type  raised: boolean

        :param no_comment: Flag that indicates whether a `reStructuredText`_
                           comment labeling the callable (method, function or
                           class property) should be printed (False) or not
                           (True) before the exceptions documentation
        :type  no_comment: boolean

        :raises:
         * RuntimeError (Argument \\`depth\\` is not valid)

         * RuntimeError (Argument \\`error\\` is not valid)

         * RuntimeError (Argument \\`exclude\\` is not valid)

         * RuntimeError (Argument \\`no_comment\\` is not valid)

         * RuntimeError (Argument \\`raised\\` is not valid)

         * RuntimeError (Argument \\`width\\` is not valid)

         * RuntimeError (Callable not found in exception list: *[name]*)