docs: def generate_doc(self, dir_name, vasprun_files):
          """
          Process aflow style runs, where each run is actually a combination of
          two vasp runs.
          """
          try:
              fullpath = os.path.abspath(dir_name)
              # Defensively copy the additional fields first.  This is a MUST.
              # Otherwise, parallel updates will see the same object and inserts
              # will be overridden!!
              d = {k: v for k, v in self.additional_fields.items()}
              d["dir_name"] = fullpath
              d["schema_version"] = VaspToDbTaskDrone.__version__
              d["calculations"] = [
                  self.process_vasprun(dir_name, taskname, filename)
                  for taskname, filename in vasprun_files.items()]
              d1 = d["calculations"][0]
              d2 = d["calculations"][-1]
  
              # Now map some useful info to the root level.
              for root_key in ["completed_at", "nsites", "unit_cell_formula",
                               "reduced_cell_formula", "pretty_formula",
                               "elements", "nelements", "cif", "density",
                               "is_hubbard", "hubbards", "run_type"]:
                  d[root_key] = d2[root_key]
              d["chemsys"] = "-".join(sorted(d2["elements"]))
  
              # store any overrides to the exchange correlation functional
              xc = d2["input"]["incar"].get("GGA")
              if xc:
                  xc = xc.upper()
              d["input"] = {"crystal": d1["input"]["crystal"],
                            "is_lasph": d2["input"]["incar"].get("LASPH", False),
                            "potcar_spec": d1["input"].get("potcar_spec"),
                            "xc_override": xc}
              vals = sorted(d2["reduced_cell_formula"].values())
              d["anonymous_formula"] = {string.ascii_uppercase[i]: float(vals[i])
                                        for i in range(len(vals))}
              d["output"] = {
                  "crystal": d2["output"]["crystal"],
                  "final_energy": d2["output"]["final_energy"],
                  "final_energy_per_atom": d2["output"]["final_energy_per_atom"]}
              d["name"] = "aflow"
              p = d2["input"]["potcar_type"][0].split("_")
              pot_type = p[0]
              functional = "lda" if len(pot_type) == 1 else "_".join(p[1:])
              d["pseudo_potential"] = {"functional": functional.lower(),
                                       "pot_type": pot_type.lower(),
                                       "labels": d2["input"]["potcar"]}
              if len(d["calculations"]) == len(self.runs) or \
                      list(vasprun_files.keys())[0] != "relax1":
                  d["state"] = "successful" if d2["has_vasp_completed"] \
                      else "unsuccessful"
              else:
                  d["state"] = "stopped"
              d["analysis"] = get_basic_analysis_and_error_checks(d)
  
              sg = SpacegroupAnalyzer(Structure.from_dict(d["output"]["crystal"]),
                                      0.1)
              d["spacegroup"] = {"symbol": sg.get_space_group_symbol(),
                                 "number": sg.get_space_group_number(),
                                 "point_group": sg.get_point_group_symbol(),
                                 "source": "spglib",
                                 "crystal_system": sg.get_crystal_system(),
                                 "hall": sg.get_hall()}
              d["oxide_type"] = d2["oxide_type"]
              d["last_updated"] = datetime.datetime.today()
              return d
          except Exception as ex:
              import traceback
              print(traceback.format_exc())
              logger.error("Error in " + os.path.abspath(dir_name) +
                           ".\n" + traceback.format_exc())
  
              return None