

def _ImportPythonModule(module_name):
    'Imports a Python module.\n\n  Args:\n    module_name: the name of the module.\n\n  Returns:\n    The Python module object (instance of module) or None\n    if the module cannot be imported.\n  '
    try:
        module_object = list(map(__import__, [module_name]))[0]
    except ImportError:
        return
    if ('.' in module_name):
        for submodule_name in module_name.split('.')[1:]:
            module_object = getattr(module_object, submodule_name, None)
    return module_object

dataset/ETHPy150Open log2timeline/dfvfs/dfvfs/dependencies.py _ImportPythonModule/original