def METHOD_NAME(i: ImportModel, delimiter: str) -> str:
    if not i.version_modules:
        return ""
    buffer = []
    for n, (version, module_name, comment) in enumerate(i.version_modules):
        buffer.append(
            "{} sys.version_info >= {}:".format("if" if n == 0 else "elif", version)
        )
        buffer.append(
            f"    from {module_name} import {i.submodule_name}{f' as {i.alias}' if i.alias else ''}"
            f"{f' # {comment}' if comment else ''}"
        )
    buffer.append("else:")
    buffer.append(
        f"    from {i.module_name} import {i.submodule_name}{f' as {i.alias}' if i.alias else ''}"
        "  # type: ignore  # pylint: disable=ungrouped-imports"
    )
    return delimiter.join(buffer)