code: def get_bonds(UA, AC):
      """ """
      bonds = []
  
      for k, i in enumerate(UA):
          for j in UA[k + 1 :]:
              if AC[i, j] == 1:
                  bonds.append(tuple(sorted([i, j])))
  
      return bonds
  
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 4 for calling a global function with example usage: get_bonds(UA, AC) and returns: bonds