code: def get_BO(AC, UA, DU, valences, UA_pairs, use_graph=True):
      """ """
      BO = AC.copy()
      DU_save = []
  
      while DU_save != DU:
          for i, j in UA_pairs:
              BO[i, j] += 1
              BO[j, i] += 1
  
          BO_valence = list(BO.sum(axis=1))
          DU_save = copy.copy(DU)
          UA, DU = get_UA(valences, BO_valence)
          UA_pairs = get_UA_pairs(UA, AC, use_graph=use_graph)[0]
  
      return BO
  
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 7 for calling a global function with example usage: get_BO(AC, UA, DU, valences, UA_pairs, use_graph) and returns: BO