code: def yaml_read_irred_perts(filename, doc_tag="!IrredPerts"):
      
      with YamlTokenizer(filename) as r:
          doc = r.next_doc_with_tag(doc_tag)
          d = yaml.safe_load(doc.text_notag)
  
          return [AttrDict(**pert) for pert in d["irred_perts"]]
docs: Read the list of irreducible perturbations from file.