def get_names_from_path(fontpath):
    """Parse underscore(or hyphen)-separated font file names into ``family`` and ``style`` names."""
    _file = os.path.basename(fontpath)
    _file_name = os.path.splitext(_file)[0]
    try:
        family_name, style_name = _file_name.split('_')
    except __HOLE__:
        family_name, style_name = _file_name.split('-')
    style_name = get_parameters_from_style(style_name)
    style_name = ' '.join(style_name)
    return family_name, style_name
dataset/ETHPy150Open gferreira/hTools2/Lib/hTools2/modules/fileutils.py/get_names_from_path