code: def gen_support_records(transaction_manager, min_support, **kwargs):
      """
      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).
      """
      # Parse arguments.
      max_length = kwargs.get("max_length")
  
      # For testing.
      _create_next_candidates = kwargs.get(
          "_create_next_candidates", create_next_candidates
      )
  
      # Process.
      candidates = transaction_manager.initial_candidates()
      length = 1
      while candidates:
          relations = set()
          for relation_candidate in candidates:
              support = transaction_manager.calc_support(
                  relation_candidate
              )
              if support < min_support:
                  continue
              candidate_set = frozenset(relation_candidate)
              relations.add(candidate_set)
              yield SupportRecord(candidate_set, support)
          length += 1
          if max_length and length > max_length:
              break
          candidates = _create_next_candidates(relations, length)
  
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 2 for calling a global function with example usage: gen_support_records(transaction_manager, min_support) without return types