<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_correct_module(mod):
 """returns imported module check if is ``leonardo_module_conf`` specified and then import them """


    module_location = getattr(
        mod, 'leonardo_module_conf',
        getattr(mod, "LEONARDO_MODULE_CONF", None))
    if module_location:
        mod = import_module(module_location)

    elif hasattr(mod, 'default_app_config'):
        # use django behavior
        mod_path, _, cls_name = mod.default_app_config.rpartition('.')
        _mod = import_module(mod_path)
        config_class = getattr(_mod, cls_name)
        # check if is leonardo config compliant
        if _is_leonardo_module(config_class):
            mod = config_class

    return mod