class_docstr: DatasetBuilder for penguins dataset.
class_docstr_tok: ["DatasetBuilder","for","penguins","dataset","."]
docstr: Applies field-level pre-processing, if needed.
docstr_tok: ["Applies","field-level","pre-processing",",","if","needed","."]
code: def _clean_up(self, field, value):
      """Applies field-level pre-processing, if needed."""
      if not self.builder_config.cleanup:
          return value
      if field not in self.builder_config.cleanup:
          return value
  
      feature_type = self.builder_config.features[field]
      if feature_type == np.float32:
          # Field is a float. If it won't parse, clean it up.
          try:
              return float(value)
          except ValueError:
              return self.builder_config.cleanup[field]
      elif isinstance(feature_type, tfds.features.ClassLabel):
          # Field is a class. If it's OOV, clean it up.
          if value not in feature_type.names:
              return self.builder_config.cleanup[field]
  
      return value
  
file_path: datasets/tensorflow_datasets/datasets/penguins/penguins_dataset_builder.py
imports: from __future__ import annotations
  import csv
  import dataclasses
  import textwrap
  import typing
  from typing import Any, Mapping, Optional, Union
  import numpy
  import tensorflow_datasets.core.utils
  import tensorflow_datasets.public_api
label_desc: Use image node_id 4 for calling the Builder obj's underlying member method code with example usage: obj._clean_up(field, value) and returns: value, value, value, float, self, self