def METHOD_NAME(tree, delay):
    nodes = tree.findall(".//wavefunction/determinantset/slaterdeterminant")
    if len(nodes) == 0:
        print('slaterdeterminant not found')
        return
    for node in nodes:
      add_or_change_attribute(node, 'delay_rank', str(delay))