def findModuleById(available_mods, module_id):
    """Find a module from list of modules (*available_mods*) by its *module_id* and return the module.

    Return None if the module is there is not a module with id *module_id* in *available_mods*.

    :param available_mods: list of all available modules
    :param module_id: id of the module to find
    """
    module_found = None
    for available_mod in available_mods:
        if available_mod.id == module_id:
            module_found = available_mod
            break
    return module_found