def check_api_doc(basename, verbose, only_documented, has_submodules):
    module_name = basename.replace('_', '.')
    try:
        module = __import__(module_name, globals(), {}, ['__all__'])
    except ImportError as e:
        print("Skipping %s (%s)" % (basename, e))
        return
    all = getattr(module, '__all__', None)
    if not all:
        print("Warning: %s doesn't define __all__, using exported symbols."
              % module_name)
        all = get_default_symbols(module, only_documented, has_submodules)
    no_apidoc = getattr(module, '__no_apidoc__', None)
    if no_apidoc:
        if isinstance(no_apidoc, basestring):
            no_apidoc = [s.strip() for s in no_apidoc.split()]
        all = list(set(all) - set(no_apidoc))
    symbols, keywords = get_sphinx_documented_symbols(basename + '.rst')
    for symbol in sorted(all):
        if symbol in symbols:
            if verbose:
                print(" - OK %14s :: %s"
                      % (keywords[symbols.index(symbol)], symbol))
        else:
            value = getattr(module, symbol)
            cls = getattr(value, '__class__', None)
            keyword = 'data'
            if cls.__name__ in ('function', 'instancemethod'):
                keyword = 'function'
            elif cls.__name__ == 'module':
                keyword = 'module'
            else:
                keyword = 'class'
            print(" * .. %14s :: %s" % ('auto' + keyword, symbol))
dataset/ETHPy150Open edgewall/trac/doc/utils/checkapidoc.py/check_api_doc/original