code: def valences_not_too_large(BO, valences):
      """ """
      number_of_bonds_list = BO.sum(axis=1)
      for valence, number_of_bonds in zip(
          valences, number_of_bonds_list
      ):
          if number_of_bonds > valence:
              return False
  
      return True
  
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 8 for calling a global function with example usage: valences_not_too_large(BO, valences) and returns: True, False