class_docstr: Helps to populate things derived from BaseTable from maps, tuples, etc.
  
  A table of lifecycle callbacks may be provided to add logic beyond what is possible
  based on otData info for the target class. See BuildCallbacks.
class_docstr_tok: ["Helps","to","populate","things","derived","from","BaseTable","from","maps",",","tuples",",","etc",".","A","table","of","lifecycle","callbacks","may","be","provided","to","add","logic","beyond","what","is","possible","based","on","otData","info","for","the","target","class",".","See","BuildCallbacks","."]
code: def _convert(self, dest, field, converter, value):
      enumClass = getattr(converter, "enumClass", None)
  
      if enumClass:
          if isinstance(value, enumClass):
              pass
          elif isinstance(value, str):
              try:
                  value = getattr(enumClass, value.upper())
              except AttributeError:
                  raise ValueError(
                      f"{value} is not a valid {enumClass}"
                  )
          else:
              value = enumClass(value)
  
      elif isinstance(converter, IntValue):
          value = otRound(value)
      elif isinstance(converter, FloatValue):
          value = float(value)
  
      elif isinstance(converter, Struct):
          if converter.repeat:
              if _isNonStrSequence(value):
                  value = [
                      self.build(converter.tableClass, v) for v in value
                  ]
              else:
                  value = [self.build(converter.tableClass, value)]
              setattr(dest, converter.repeat, len(value))
          else:
              value = self.build(converter.tableClass, value)
      elif callable(converter):
          value = converter(value)
  
      setattr(dest, field, value)
  
file_path: catboost/contrib/python/fonttools/fontTools/colorLib/table_builder.py
imports: import collections
  import enum
  from fontTools.ttLib.tables.otBase import BaseTable, FormatSwitchingBaseTable, UInt8FormatSwitchingBaseTable
  from fontTools.ttLib.tables.otConverters import ComputedInt, SimpleValue, Struct, Short, UInt8, UShort, IntValue, FloatValue, OptionalValue
  from fontTools.misc.roundTools import otRound
label_desc: Use image node_id 2 for calling the TableBuilder obj's underlying member method code with example usage: obj._convert(dest, field, converter, value) without return types