<commit_before>from .lamost_shared import lamost_default_dr, lamost_env
from .chips import wavelength_solution, continuum_normalize


def load_allstar_dr5():
    """
    Open LAMOST DR5 allstar

    :return: fits file opened by astropy
    :rtype: astropy.io.fits.hdu.hdulist.HDUList
    :History: 2018-Jun-17 - Written - <NAME> (University of Toronto)
    """
    import os
    from astropy.io import fits
    _lamost_dr5_allsta_path = os.path.join(lamost_env(), "DR5", "LAMO5_2MS_AP9_SD14_UC4_PS1_AW_Carlin_M.fits")
    return fits.open(_lamost_dr5_allsta_path)<commit_msg>raise error if LAMO5_2MS_AP9_SD14_UC4_PS1_AW_Carlin_M.fits not found [ci skip]<commit_after>from .lamost_shared import lamost_default_dr, lamost_env
from .chips import wavelength_solution, continuum_normalize


def load_allstar_dr5():
    """
    Open LAMOST DR5 allstar

    :return: fits file opened by astropy
    :rtype: astropy.io.fits.hdu.hdulist.HDUList
    :History: 2018-Jun-17 - Written - <NAME> (University of Toronto)
    """
    import os
    from astropy.io import fits
    _lamost_dr5_allsta_path = os.path.join(lamost_env(), "DR5", "LAMO5_2MS_AP9_SD14_UC4_PS1_AW_Carlin_M.fits")
    if not os.path.isfile(_lamost_dr5_allsta_path):
        raise FileNotFoundError('LAMO5_2MS_AP9_SD14_UC4_PS1_AW_Carlin_M.fits file not found')
    return fits.open(_lamost_dr5_allsta_path)
{'fraction_non_alphanumeric': 0.08743570903747244, 'fraction_numerical': 0.03747244673034533, 'mean_word_length': 4.581967213114754, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6406828', 'n_tokens_mistral': 565, 'n_tokens_neox': 519, 'n_words': 100}