def METHOD_NAME(modules):
    if not isinstance(modules, list):
        modules = [modules]
    dracut_modules = [DracutModule(name=i[0], module_path=i[1]) for i in modules]
    kernel_modules = [KernelModule(name=i[0], module_path=i[1]) for i in modules]
    return UpgradeInitramfsTasks(include_dracut_modules=dracut_modules, include_kernel_modules=kernel_modules)