code: def enum_assemble(
      node,
      neighbors,
      prev_nodes=[],
      prev_amap=[],
      bayesian_optimization=False,
  ):
      all_attach_confs = []
      singletons = [
          nei_node.nid
          for nei_node in neighbors + prev_nodes
          if nei_node.mol.GetNumAtoms() == 1
      ]
  
      def search(cur_amap, depth):
          if len(all_attach_confs) > MAX_NCAND:
              return
          if depth == len(neighbors):
              all_attach_confs.append(cur_amap)
              return
  
          nei_node = neighbors[depth]
          cand_amap = enum_attach(
              node.mol, nei_node, cur_amap, singletons
          )
          cand_smiles = set()
          candidates = []
          for amap in cand_amap:
              cand_mol = local_attach(
                  node.mol, neighbors[: depth + 1], prev_nodes, amap
              )
              cand_mol = sanitize(cand_mol)
              if cand_mol is None:
                  continue
              smiles = get_smiles(cand_mol)
              if smiles in cand_smiles:
                  continue
              cand_smiles.add(smiles)
              candidates.append(amap)
  
          if len(candidates) == 0:
              return
  
          for new_amap in candidates:
              search(new_amap, depth + 1)
  
      search(prev_amap, 0)
      cand_smiles = set()
      candidates = []
      aroma_score = []
      for amap in all_attach_confs:
          cand_mol = local_attach(node.mol, neighbors, prev_nodes, amap)
          cand_mol = Chem.MolFromSmiles(Chem.MolToSmiles(cand_mol))
          smiles = Chem.MolToSmiles(cand_mol)
          if (
              smiles in cand_smiles
              or check_singleton(cand_mol, node, neighbors) == False
          ):
              continue
          cand_smiles.add(smiles)
          candidates.append((smiles, amap))
          aroma_score.append(check_aroma(cand_mol, node, neighbors))
  
      if not bayesian_optimization:
          return candidates, aroma_score
      else:
          return candidates
  
imports: import rdkit
  import rdkit.Chem
  from scipy.sparse import csr_matrix
  from scipy.sparse.csgraph import minimum_spanning_tree
  from collections import defaultdict
  from rdkit.Chem.EnumerateStereoisomers import EnumerateStereoisomers, StereoEnumerationOptions
  from .vocab import Vocab
label_desc: Use image node_id 15 for calling a global function with example usage: enum_assemble(node, neighbors, prev_nodes, prev_amap, bayesian_optimization) and returns: candidates,  aroma_score, candidates