code: def _check_file_type(self, file_path):
      split_path = os.path.splitext(file_path)
  
      file_extension = split_path[1]
  
      # maps the suffix of the file-path to the name that Hugging Face's  load_dataset function uses
      ending_map = {".txt": "text", ".csv": "csv"}
      ending = ending_map[file_extension]
  
      if ending not in self._t_data_file_type:
          ValueError(f"Invalid file type for {file_path}.")
  
      return ending
  
imports: import logging
  import os
  import tempfile
  from typing import Union
  from datasets import Dataset, DatasetDict, load_dataset, load_from_disk
  import torch
  from transformers import AutoConfig, AutoModel, AutoTokenizer, Seq2SeqTrainer, Seq2SeqTrainingArguments, Trainer, TrainingArguments
  from happytransformer.args import EvalArgs, TrainArgs
  from happytransformer.fine_tuning_util import EvalResult, FistStep, ZERO_2_SETTINGS, ZERO_3_SETTINGS
label_desc: Use image node_id 17 for calling the HappyTransformer obj's underlying member method code with example usage: obj._check_file_type(file_path) and returns: ending