<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_files(path_dir, dos_spin=1):
 """ get a BoltztrapAnalyzer object from a set of files Args: path_dir: directory where the boltztrap files are dos_spin: in DOS mode, set to 1 for spin up and -1 for spin down Returns: a BoltztrapAnalyzer object """

        run_type, warning, efermi, gap, doping_levels = \
            BoltztrapAnalyzer.parse_outputtrans(path_dir)

        vol = BoltztrapAnalyzer.parse_struct(path_dir)

        intrans = BoltztrapAnalyzer.parse_intrans(path_dir)

        if run_type == "BOLTZ":
            dos, pdos = BoltztrapAnalyzer.parse_transdos(
                path_dir, efermi, dos_spin=dos_spin, trim_dos=False)

            mu_steps, cond, seebeck, kappa, hall, pn_doping_levels, mu_doping, \
            seebeck_doping, cond_doping, kappa_doping, hall_doping, \
            carrier_conc = BoltztrapAnalyzer. \
                parse_cond_and_hall(path_dir, doping_levels)

            return BoltztrapAnalyzer(
                gap, mu_steps, cond, seebeck, kappa, hall, pn_doping_levels,
                mu_doping, seebeck_doping, cond_doping, kappa_doping,
                hall_doping, intrans, dos, pdos, carrier_conc, vol, warning)

        elif run_type == "DOS":
            trim = True if intrans["dos_type"] == "HISTO" else False
            dos, pdos = BoltztrapAnalyzer.parse_transdos(
                path_dir, efermi, dos_spin=dos_spin, trim_dos=trim)

            return BoltztrapAnalyzer(gap=gap, dos=dos, dos_partial=pdos,
                                     warning=warning, vol=vol)

        elif run_type == "BANDS":
            bz_kpoints = np.loadtxt(
                os.path.join(path_dir, "boltztrap_band.dat"))[:, -3:]
            bz_bands = np.loadtxt(
                os.path.join(path_dir, "boltztrap_band.dat"))[:, 1:-6]
            return BoltztrapAnalyzer(bz_bands=bz_bands, bz_kpoints=bz_kpoints,
                                     warning=warning, vol=vol)

        elif run_type == "FERMI":
            """
            """

            if os.path.exists(os.path.join(path_dir, 'boltztrap_BZ.cube')):
                fs_data = read_cube_file(
                    os.path.join(path_dir, 'boltztrap_BZ.cube'))
            elif os.path.exists(os.path.join(path_dir, 'fort.30')):
                fs_data = read_cube_file(os.path.join(path_dir, 'fort.30'))
            else:
                raise BoltztrapError("No data file found for fermi surface")
            return BoltztrapAnalyzer(fermi_surface_data=fs_data)

        else:
            raise ValueError("Run type: {} not recognized!".format(run_type))