from typing import Dict


def filter_reuses(reuses_dict: Dict):
    """
    Filter reuses and returns only those that contain some machine learning-y term in the description
    :param reuses_dict:
    :return:
    """
    list_ml_terms = ["deep learning", "apprentissage automatique", "machine learning", "classification",
                     "data science", "prédire"]
    ml_reuses = []
    for reuse in reuses_dict["data"]:
        if not reuse["featured"]:
            # reuse not featured, continue
            continue
        reuse_ml_terms = [term in reuse["description"].lower()
                          for term in list_ml_terms]
        if not any(reuse_ml_terms):
            # no ml terms, continue
            continue
        ml_reuses.append(reuse)

    return ml_reuses