def check_constraint_12pc(term_freq,top_terms,top_terms_test_freq):
    """
    Check the constraint >12% for the test set
    term_freq is the dictionnary of all term frequencies
    top_terms is the list of terms we care about (first 300?)
    top_terms_freq is an array of frequency of top terms in test set.
    RETURN
      True if constraint satisfied, False otherwise
    """
    for tidx,t in enumerate(top_terms):
        totalf = term_freq[t]
        testf = top_terms_test_freq[tidx]
        if testf < totalf * .12:
            return False
    return True