code: def files_to_pif(files, verbose=0, quality_report=True, inline=True):
      '''Given a directory that contains output from
      a DFT calculation, parse the data and return
      a pif object
      Input:
          files - [str] list of files from which the parser is allowed to read.
          verbose - int, How much status messages to print
      Output:
          pif - ChemicalSystem, Results and settings of
              the DFT calculation in pif format
      '''
      found_parser = False
      for possible_parser in [PwscfParser, VaspParser]:
          try:
              parser = possible_parser(files)
              found_parser = True
              break
          except InvalidIngesterException:
              pass
      if not found_parser:
          raise Exception('Directory is not in correct format for an existing parser')
      if verbose > 0:
          print("Found a {} directory".format(parser.get_name()))
      chem = ChemicalSystem()
      chem.chemical_formula = parser.get_composition()
      software = Software(name=parser.get_name(),
          version=parser.get_version_number())
      method = Method(name='Density Functional Theory',
          software=[software])
      conditions = []
      for name, func in parser.get_setting_functions().items():
          cond = getattr(parser, func)()
          if cond is None:
              continue
          if inline and cond.files is not None:
              continue
          cond.name = name
          conditions.append(cond)
      chem.properties = []
      for name, func in parser.get_result_functions().items():
          prop = getattr(parser, func)()
          if prop is None:
              continue
          if inline and prop.files is not None:
              continue
          prop.name = name
          prop.methods = [method,]
          prop.data_type='COMPUTATIONAL'
          if verbose > 0 and isinstance(prop, Value):
              print(name)
          if prop.conditions is None:
              prop.conditions = conditions
          else:
              if not isinstance(prop.conditions, list):
                  prop.conditions = [prop.conditions]
              prop.conditions.extend(conditions)
          chem.properties.append(prop)
      if quality_report and isinstance(parser, VaspParser):
          _add_quality_report(parser, chem)
      return chem