def gen_support_records(transaction_manager, min_support, **kwargs):
<EOL>max_length = kwargs.get('<STR_LIT:max_length>')<EOL>_create_next_candidates = kwargs.get(<EOL>'<STR_LIT>', create_next_candidates)<EOL>candidates = transaction_manager.initial_candidates()<EOL>length = <NUM_LIT:1><EOL>while candidates:<EOL><INDENT>relations = set()<EOL>for relation_candidate in candidates:<EOL><INDENT>support = transaction_manager.calc_support(relation_candidate)<EOL>if support < min_support:<EOL><INDENT>continue<EOL><DEDENT>candidate_set = frozenset(relation_candidate)<EOL>relations.add(candidate_set)<EOL>yield SupportRecord(candidate_set, support)<EOL><DEDENT>length += <NUM_LIT:1><EOL>if max_length and length > max_length:<EOL><INDENT>break<EOL><DEDENT>candidates = _create_next_candidates(relations, length)<EOL><DEDENT>
Returns a generator of support records with given transactions.

Arguments:
    transaction_manager -- Transactions as a TransactionManager instance.
    min_support -- A minimum support (float).

Keyword arguments:
    max_length -- The maximum length of relations (integer).