def _is_line_from_candidate(line: str, from_imports: list, import_str: str) -> bool:
    """
    Check if line has from import
    :param line: the line to check
    :param from_imports: the from imports list
    :param import_str: the import string
    :return: True if the line has from import to replace
    """
    if import_str not in line:
        return False
    for from_import in from_imports:
        if line.strip().startswith(from_import):
            return True
    return False