code: def yaml_read_kpoints(filename, doc_tag="!Kpoints"):
      
      with YamlTokenizer(filename) as r:
          doc = r.next_doc_with_tag(doc_tag)
          d = yaml.safe_load(doc.text_notag)
  
          return np.array(d["reduced_coordinates_of_qpoints"])
docs: Read the K-points from file.