import difflib


def fuzzy_find_text_line(input_text_lines, keyword, cutoff=0.6):
    """Fuzzy matching of text lines and keyword. 
    Get line that contains word with the best matching score
    Args:
        input_text_lines [(str)]: lines of text to be fuzzy matched
        keyword (str): keyword for fuzzy matching
        cutoff (float): cutoff score for matching
    
    Returns:
        matched_text (str): a line of first-matched text
    """
    best_score = 0.0
    best_match_line = ""
    for line in input_text_lines:
        # tokenizing words
        words = line.strip().split()
        match = difflib.get_close_matches(keyword, words, 1, cutoff=cutoff)
        if match:
            # when match is found
            # we proceed to update best scoring token
            match = match[0]
            score = difflib.SequenceMatcher(lambda x: x == " ", match, keyword).ratio()
            if score > best_score:
                # update best matching and score
                best_match_line = line
                best_score = score
    return best_match_line