def _is_line_from_candidate(line: str, import_str: str) -> bool:
    """
    Check if line has from import
    :param line: the line to check
    :param import_str: the import string
    :return: True if the line has from import to replace
    """
    if not (import_str in line and "from" in line):
        return False
    return True