r"""
    called from vim. Uses strings of filename and modnames to build docstr

    Args:
        modname (str): name of a python module
        funcname (str): name of a function in the module

    Returns:
        str: docstr

    CommandLine:
        python -m utool.util_autogen auto_docstr
        python -m utool --tf auto_docstr

    Example:
        >>> # DISABLE_DOCTEST
        >>> import utool as ut
        >>> from utool.util_autogen import *  # NOQA
        >>> ut.util_autogen.rrr(verbose=False)
        >>> #docstr = ut.auto_docstr('ibeis.algo.hots.smk.smk_index', 'compute_negentropy_names')
        >>> modname = ut.get_argval('--modname', default='utool.util_autogen')
        >>> funcname = ut.get_argval('--funcname', default='auto_docstr')
        >>> moddir = ut.get_argval('--moddir', type_=str, default=None)
        >>> docstr = ut.util_autogen.auto_docstr(modname, funcname)
        >>> print(docstr)

def auto_docstr(modname, funcname, verbose=True, moddir=None, modpath=None, **kwargs):
    r"""
    called from vim. Uses strings of filename and modnames to build docstr

    Args:
        modname (str): name of a python module
        funcname (str): name of a function in the module

    Returns:
        str: docstr

    CommandLine:
        python -m utool.util_autogen auto_docstr
        python -m utool --tf auto_docstr

    Example:
        >>> # DISABLE_DOCTEST
        >>> import utool as ut
        >>> from utool.util_autogen import *  # NOQA
        >>> ut.util_autogen.rrr(verbose=False)
        >>> #docstr = ut.auto_docstr('ibeis.algo.hots.smk.smk_index', 'compute_negentropy_names')
        >>> modname = ut.get_argval('--modname', default='utool.util_autogen')
        >>> funcname = ut.get_argval('--funcname', default='auto_docstr')
        >>> moddir = ut.get_argval('--moddir', type_=str, default=None)
        >>> docstr = ut.util_autogen.auto_docstr(modname, funcname)
        >>> print(docstr)
    """
    #import utool as ut
    func, module, error_str = load_func_from_module(
        modname, funcname, verbose=verbose, moddir=moddir, modpath=modpath)
    if error_str is None:
        try:
            docstr = make_default_docstr(func, **kwargs)
        except Exception as ex:
            import utool as ut
            error_str = ut.formatex(ex, 'Caught Error in parsing docstr', tb=True)
            #ut.printex(ex)
            error_str += (
                '\n\nReplicateCommand:\n    '
                'python -m utool --tf auto_docstr '
                '--modname={modname} --funcname={funcname} --moddir={moddir}').format(
                    modname=modname, funcname=funcname, moddir=moddir)
            error_str += '\n kwargs='  + ut.repr4(kwargs)
            return error_str
    else:
        docstr = error_str
    return docstr