def match(sample, lookup, threshold):
    """returns list of matches for items in sample or None if num matches below threshold"""
    cnt = sample.count()
    bad_cnt, matches = 0, []
    for x in sample:
        if isinstance(x, str):
            x = x.strip().lower()
        match = lookup(x)
        matches.append(match)
        if not match:
            bad_cnt += 1
            if bad_cnt / cnt > 1 - threshold:
                return
    return matches
