code: def dfs_assemble(cur_mol, global_amap, fa_amap, cur_node, fa_node):
      fa_nid = fa_node.nid if fa_node is not None else -1
      prev_nodes = [fa_node] if fa_node is not None else []
  
      children = [
          nei for nei in cur_node.neighbors if nei.nid != fa_nid
      ]
      neighbors = [nei for nei in children if nei.mol.GetNumAtoms() > 1]
      neighbors = sorted(
          neighbors, key=lambda x: x.mol.GetNumAtoms(), reverse=True
      )
      singletons = [
          nei for nei in children if nei.mol.GetNumAtoms() == 1
      ]
      neighbors = singletons + neighbors
  
      cur_amap = [
          (fa_nid, a2, a1)
          for nid, a1, a2 in fa_amap
          if nid == cur_node.nid
      ]
      cands = enum_assemble(cur_node, neighbors, prev_nodes, cur_amap)
  
      cand_smiles, cand_amap = zip(*cands)
      label_idx = cand_smiles.index(cur_node.label)
      label_amap = cand_amap[label_idx]
  
      for nei_id, ctr_atom, nei_atom in label_amap:
          if nei_id == fa_nid:
              continue
          global_amap[nei_id][nei_atom] = global_amap[cur_node.nid][
              ctr_atom
          ]
  
      # father is already attached
      cur_mol = attach_mols(cur_mol, children, [], global_amap)
      for nei_node in children:
          if not nei_node.is_leaf:
              dfs_assemble(
                  cur_mol, global_amap, label_amap, nei_node, cur_node
              )
  
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 18 for calling a global function with example usage: dfs_assemble(cur_mol, global_amap, fa_amap, cur_node, fa_node) without return types