class_docstr: Titanic dataset.
class_docstr_tok: ["Titanic","dataset","."]
docstr: Generate features and target given the directory path.
  
  Args:
    file_path: path where the csv file is stored
  
  Yields:
    The features and the target
docstr_tok: ["Generate","features","and","target","given","the","directory","path",".","Args",":","file_path",":","path","where","the","csv","file","is","stored","Yields",":","The","features","and","the","target"]
code: def _generate_examples(self, file_path):
      """Generate features and target given the directory path.
  
      Args:
        file_path: path where the csv file is stored
  
      Yields:
        The features and the target
      """
      with epath.Path(file_path).open() as f:
          raw_data = csv.DictReader(f)
          if self.version >= "3.0.0":
              for i, row in enumerate(raw_data):
                  yield i, {
                      name: _feature_dict()[name][1](value)
                      for name, value in row.items()
                  }
          else:
              for i, row in enumerate(raw_data):
                  survive_val = row.pop("survived")
                  yield i, {
                      "survived": convert_to_label(
                          survive_val, _SURVIVED_DICT
                      ),
                      "features": {
                          name: _feature_dict()[name][1](value)
                          for name, value in row.items()
                      },
                  }
  
file_path: datasets/tensorflow_datasets/datasets/titanic/titanic_dataset_builder.py
imports: import collections
  import csv
  from etils import epath
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the Builder obj's underlying member method code with example usage: obj._generate_examples(file_path) without return types