code: def fit_transform(self, bundle: DataBundle) -> DataBundle:
      self.delimiter = self.config.delimiter
      self.has_header = self.config.has_header
      self.contain_labels = self.config.contain_labels
      self.auto_convert_labels = self.config.auto_convert_labels
      self.custom_dtypes = self.config.custom_dtypes or {}
      self.custom_mappings = self.config.custom_mappings or {}
      self.default_values = self.config.default_values or {}
      if not self._check_file(bundle.x_train):
          self.is_placeholder = True
          self._setup_none_file(bundle.x_train, bundle.y_train)  # type: ignore
          return bundle
      self.is_placeholder = False
      # sanity check
      if bundle.y_train is not None:
          raise ValueError(
              "`y_train` should not be provided for `FileParserBlock`"
          )
      if bundle.y_valid is not None:
          raise ValueError(
              "`y_valid` should not be provided for `FileParserBlock`"
          )
      # read raw train data
      _validate_file(bundle.x_train)
      all_header, data = self._read(bundle.x_train)  # type: ignore
      num_columns = len(data[0])
      # read raw valid data
      if bundle.x_valid is None:
          valid_data = None
      else:
          _validate_file(bundle.x_valid)
          all_valid_header, valid_data = self._read(bundle.x_valid)
          if self.config.has_header and all_header != all_valid_header:
              raise ValueError(
                  "train header does not match valid header:\n"  # type: ignore
                  f"> train header | {', '.join(all_header)}\n"  # type: ignore
                  f"> valid header | {', '.join(all_valid_header)}\n"  # type: ignore
              )
      # handle label columns & header
      if not self.config.contain_labels:
          msg = "`contain_labels` should be True in `FileParserBlock.fit_transform`"
          raise ValueError(msg)
      label_names = self.config.label_names
      label_indices = self.config.label_indices
      if not label_names and not label_indices:
          msg = "neither `label_names` nor `label_indices` is provided, `[-1]` will be used"
          print_warning(msg)
          label_indices = self.config.label_indices = [-1]
      if label_indices is not None:
          label_indices = [
              i if i >= 0 else num_columns + i for i in label_indices
          ]
      if all_header is not None:
          if label_names is not None:
              header = [e for e in all_header if e not in label_names]
              label_header = label_names
          else:
              header = [e for i, e in enumerate(all_header) if i not in label_indices]  # type: ignore
              label_header = [all_header[i] for i in label_indices]  # type: ignore
      else:
          if label_names:
              raise ValueError(
                  f"header is not found at `{bundle.x_train}` but `label_names` is provided. "
                  f"please either provide header in `{bundle.x_train}`, "
                  "or use `label_indices` instead."
              )
          header = []
          label_header = []
          all_header = []
          x_counter = y_counter = 0
          for i in range(num_columns):
              if i not in label_indices:  # type: ignore
                  header.append(get_x_column_name(x_counter))
                  all_header.append(header[-1])
                  x_counter += 1
              else:
                  label_header.append(get_y_column_name(y_counter))
                  all_header.append(label_header[-1])
                  y_counter += 1
      self.feature_header = header
      self.label_header = label_header
      self.all_header = all_header
      # recognize data types
      data_T = list(zip(*data))
      self.converters = {}
      for column_name, line in zip(all_header, data_T):
          is_label = column_name in label_header
          custom_dtype = self.custom_dtypes.get(column_name)
          custom_mapping = self.custom_mappings.get(column_name)
          default_value = self.default_values.get(column_name)
          args = (
              column_name,
              line,
              is_label,
              custom_dtype,
              custom_mapping,
              default_value,
          )
          converter = Converter.fit(*args)  # type: ignore
          self.converters[column_name] = converter
      # transform
      train_data_T = data_T
      valid_data_T = (
          None if valid_data is None else list(zip(*valid_data))
      )
      return self._transform(
          bundle, False, (train_data_T, valid_data_T)
      )
  
imports: import csv
  import numpy
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import Tuple
  from typing import Union
  from typing import Optional
  from pathlib import Path
  from collections import Counter
  from dataclasses import dataclass
  from cftool.misc import print_info
  from cftool.misc import print_warning
  from cftool.misc import shallow_copy_dict
  from cftool.misc import ISerializable
  from cftool.misc import PureFromInfoMixin
  from cftool.array import is_float
  from ....schema import DataTypes
  from ....schema import DataBundle
  from ....schema import TDataBundleItem
  from ....schema import INoInitDataBlock
label_desc: Use image node_id 4 for calling the FileParserBlock obj's underlying member method code with example usage: obj.fit_transform(bundle) and returns: self, bundle