code: def gen_ordered_statistics(transaction_manager, record):
      """
      Returns a generator of ordered statistics as OrderedStatistic instances.
  
      Arguments:
          transaction_manager -- Transactions as a TransactionManager instance.
          record -- A support record as a SupportRecord instance.
      """
      items = record.items
      for combination_set in combinations(
          sorted(items), len(items) - 1
      ):
          items_base = frozenset(combination_set)
          items_add = frozenset(items.difference(items_base))
          confidence = (
              record.support
              / transaction_manager.calc_support(items_base)
          )
          lift = confidence / transaction_manager.calc_support(
              items_add
          )
          yield OrderedStatistic(
              frozenset(items_base),
              frozenset(items_add),
              confidence,
              lift,
          )
  
imports: import sys
  import csv
  import argparse
  import json
  import os
  from collections import namedtuple
  from itertools import combinations
  from itertools import chain
label_desc: Use image node_id 3 for calling a global function with example usage: gen_ordered_statistics(transaction_manager, record) without return types