

def recall(reference, test):
    '\n    Given a set of reference values and a set of test values, return\n    the fraction of reference values that appear in the test set.\n    In particular, return card(``reference`` intersection ``test``)/card(``reference``).\n    If ``reference`` is empty, then return None.\n\n    :type reference: set\n    :param reference: A set of reference values.\n    :type test: set\n    :param test: A set of values to compare against the reference set.\n    :rtype: float or None\n    '
    if ((not hasattr(reference, 'intersection')) or (not hasattr(reference, 'intersection'))):
        raise TypeError('reference and test should be sets')
    if (len(reference) == 0):
        return None
    else:
        return (len(reference.intersection(test)) / len(reference))

dataset/ETHPy150Open nltk/nltk/nltk/metrics/scores.py recall/VarMisuse@30/213 `test`->`reference`