def apriori(transactions, **kwargs):
<EOL>min_support = kwargs.get('<STR_LIT>', <NUM_LIT:0.1>)<EOL>min_confidence = kwargs.get('<STR_LIT>', <NUM_LIT:0.0>)<EOL>min_lift = kwargs.get('<STR_LIT>', <NUM_LIT:0.0>)<EOL>max_length = kwargs.get('<STR_LIT:max_length>', None)<EOL>if min_support <= <NUM_LIT:0>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>_gen_support_records = kwargs.get(<EOL>'<STR_LIT>', gen_support_records)<EOL>_gen_ordered_statistics = kwargs.get(<EOL>'<STR_LIT>', gen_ordered_statistics)<EOL>_filter_ordered_statistics = kwargs.get(<EOL>'<STR_LIT>', filter_ordered_statistics)<EOL>transaction_manager = TransactionManager.create(transactions)<EOL>support_records = _gen_support_records(<EOL>transaction_manager, min_support, max_length=max_length)<EOL>for support_record in support_records:<EOL><INDENT>ordered_statistics = list(<EOL>_filter_ordered_statistics(<EOL>_gen_ordered_statistics(transaction_manager, support_record),<EOL>min_confidence=min_confidence,<EOL>min_lift=min_lift,<EOL>)<EOL>)<EOL>if not ordered_statistics:<EOL><INDENT>continue<EOL><DEDENT>yield RelationRecord(<EOL>support_record.items, support_record.support, ordered_statistics)<EOL><DEDENT>
Executes Apriori algorithm and returns a RelationRecord generator.

Arguments:
    transactions -- A transaction iterable object
                    (eg. [['A', 'B'], ['B', 'C']]).

Keyword arguments:
    min_support -- The minimum support of relations (float).
    min_confidence -- The minimum confidence of relations (float).
    min_lift -- The minimum lift of relations (float).
    max_length -- The maximum length of the relation (integer).