def docutilize(obj):
    "Convert Numpy or Google style docstring into reStructuredText format.\n\n    Args:\n        obj (str or object):\n            Takes an object and changes it's docstrings to a reStructuredText\n            format.\n    Returns:\n        str or object:\n            A converted string or an object with replaced docstring depending\n            on the type of the input.\n    "
    from inspect import cleandoc, getdoc
    from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring
    if isinstance(obj, str):
        doc = cleandoc(obj)
    else:
        doc = getdoc(obj)
    doc = str(NumpyDocstring(doc))
    doc = str(GoogleDocstring(doc))
    doc = doc.replace(':exc:', '')
    doc = doc.replace(':data:', '')
    doc = doc.replace(':keyword', ':param')
    doc = doc.replace(':kwtype', ':type')
    if isinstance(obj, str):
        return doc
    obj.__doc__ = doc
    return obj
Convert Numpy or Google style docstring into reStructuredText format.

Args:
    obj (str or object):
        Takes an object and changes it's docstrings to a reStructuredText
        format.
Returns:
    str or object:
        A converted string or an object with replaced docstring depending
        on the type of the input.
def docutilize(obj):
    "Convert Numpy or Google style docstring into reStructuredText format.\n\n    Args:\n        obj (str or object):\n            Takes an object and changes it's docstrings to a reStructuredText\n            format.\n    Returns:\n        str or object:\n            A converted string or an object with replaced docstring depending\n            on the type of the input.\n    "
    from inspect import cleandoc, getdoc
    from sphinx.ext.napoleon.docstring import GoogleDocstring, NumpyDocstring
    if isinstance(obj, str):
        doc = cleandoc(obj)
    else:
        doc = getdoc(obj)
    doc = str(NumpyDocstring(doc))
    doc = str(GoogleDocstring(doc))
    doc = doc.replace(':exc:', )
    doc = doc.replace(':data:', )
    doc = doc.replace(':keyword', ':param')
    doc = doc.replace(':kwtype', ':type')
    if isinstance(obj, str):
        return doc
    obj.__doc__ = doc
    return obj