code: def get_UA_pairs(UA, AC, use_graph=True):
      """ """
  
      bonds = get_bonds(UA, AC)
  
      if len(bonds) == 0:
          return [()]
  
      if use_graph:
          G = nx.Graph()
          G.add_edges_from(bonds)
          UA_pairs = [list(nx.max_weight_matching(G))]
          return UA_pairs
  
      max_atoms_in_combo = 0
      UA_pairs = [()]
      for combo in list(
          itertools.combinations(bonds, int(len(UA) / 2))
      ):
          flat_list = [item for sublist in combo for item in sublist]
          atoms_in_combo = len(set(flat_list))
          if atoms_in_combo > max_atoms_in_combo:
              max_atoms_in_combo = atoms_in_combo
              UA_pairs = [combo]
  
          elif atoms_in_combo == max_atoms_in_combo:
              UA_pairs.append(combo)
  
      return UA_pairs
  
imports: from rdkit import Chem
  import numpy
  import networkx
  import collections
  from collections import defaultdict
  import itertools
  import copy
  from scipy.spatial import distance_matrix
label_desc: Use image node_id 5 for calling a global function with example usage: get_UA_pairs(UA, AC, use_graph) and returns: UA_pairs, list, UA_pairs