human
Complete the below
def cinder_import_module_only(logical_line):

    ''''Check for import module only.
    cinder HACKING guide recommends importing only modules:
    Do not import objects, only modules
    N302 import only modules
    N303 Invalid Import
    N304 Relative Import'
    '''
assistant
#Here is the Python program you requested.
    def importModuleCheck(mod, parent=None, added=False):
        "\n                                If    can't    find    module    on    first    try,    recursively    check    for    relative\n                                imports\n                                "
        current_path = os.path.dirname(pep8.current_file)
        try:
            with warnings.catch_warnings():
                warnings.simplefilter('ignore', DeprecationWarning)
                valid = True
                if parent:
                    if is_import_exception(parent):
                        return
                    parent_mod = __import__(parent, globals(), locals(), [mod], (-1))
                    valid = inspect.ismodule(getattr(parent_mod, mod))
                else:
                    __import__(mod, globals(), locals(), [], (-1))
                    valid = inspect.ismodule(sys.modules[mod])
                if (not valid):
                    if added:
                        sys.path.pop()
                        added = False
                        return (logical_line.find(mod), ("CINDER    N304:    No    relative        imports.    '%s'    is    a    relative    import" % logical_line))
                    return (logical_line.find(mod), ("CINDER    N302:    import    only    modules.    '%s'    does    not    import    a    module" % logical_line))
        except (ImportError, NameError) as exc:
            if (not added):
                added = True
                sys.path.append(current_path)
                return importModuleCheck(mod, parent, added)
            else:
                name = logical_line.split()[1]
                if (name not in _missingImport):
                    if VERBOSE_MISSING_IMPORT:
                        print >>sys.stderr, ("ERROR:    import    '%s'    failed:    %s" % (name, exc))
                    _missingImport.add(name)
                added = False
                sys.path.pop()
                return
        except AttributeError:
            return...