(
    data: List[Tuple[str, str]],
    min_obs: int,
)
return [text_lang for text_lang in data if text_lang[1] in valid_langs]
Args:
        data
        min_obs
Args:
        data
        min_obs
Args : data min_obs
def filter_data_by_lang_count(
    data: List[Tuple[str, str]],
    min_obs: int,
) -> List[Tuple[str, str]]:
    """
    Args:
        data
        min_obs
    """
    valid_langs = {
        lang
        for lang, count in collections.Counter(lang for _, lang in data).most_common()
        if count >= min_obs
    }
    return [text_lang for text_lang in data if text_lang[1] in valid_langs]
def filter_data_by_lang_count ( data : List [ Tuple [ str , str ] ] , min_obs : int , ) -> List [ Tuple [ str , str ] ] : valid_langs = { lang for lang , count in collections . Counter ( lang for _ , lang in data ) . most_common ( ) if count >= min_obs } return [ text_lang for text_lang in data if text_lang [ 1 ] in valid_langs ]